[gtk-osx] Patch ORBit2 to build with Glib-2.38
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-osx] Patch ORBit2 to build with Glib-2.38
- Date: Wed, 2 Oct 2013 05:21:27 +0000 (UTC)
commit b12cc59f704e5b3b8cd50592b79bbae9d32114c7
Author: John Ralls <jralls ceridwen us>
Date: Tue Oct 1 17:46:09 2013 -0700
Patch ORBit2 to build with Glib-2.38
modulesets-stable/gtk-osx-random.modules | 6 +-
...-Orbit-2.14.19-to-master-for-current-GLib.patch | 1963 ++++++++++++++++++++
2 files changed, 1967 insertions(+), 2 deletions(-)
---
diff --git a/modulesets-stable/gtk-osx-random.modules b/modulesets-stable/gtk-osx-random.modules
index 4a61c96..d9f31ab 100644
--- a/modulesets-stable/gtk-osx-random.modules
+++ b/modulesets-stable/gtk-osx-random.modules
@@ -193,9 +193,11 @@ Libglade itself is deprecated. This is the last release. -->
</after>
</autotools>
- <autotools id="ORBit2" autogen-sh="configure">
+ <autotools id="ORBit2" autogen-sh="autoreconf">
<branch module="ORBit2/2.14/ORBit2-2.14.19.tar.bz2" version="2.14.19"
- hash="sha256:55c900a905482992730f575f3eef34d50bda717c197c97c08fa5a6eafd857550"/>
+ hash="sha256:55c900a905482992730f575f3eef34d50bda717c197c97c08fa5a6eafd857550">
+ <patch
file="http://git.gnome.org/browse/gtk-osx/plain/patches/0001-Patch-Orbit-2.14.19-to-master-for-current-GLib.patch"
strip="1"/>
+ </branch>
<after>
<dep package="meta-gtk-osx-bootstrap"/>
</after>
diff --git a/patches/0001-Patch-Orbit-2.14.19-to-master-for-current-GLib.patch
b/patches/0001-Patch-Orbit-2.14.19-to-master-for-current-GLib.patch
new file mode 100644
index 0000000..12ddbc7
--- /dev/null
+++ b/patches/0001-Patch-Orbit-2.14.19-to-master-for-current-GLib.patch
@@ -0,0 +1,1963 @@
+From 8b6f17f1bf1a253b5d39bfd30c764c63b65001ef Mon Sep 17 00:00:00 2001
+From: John Ralls <jralls ceridwen us>
+Date: Tue, 1 Oct 2013 16:37:01 -0700
+Subject: [PATCH] Patch Orbit-2.14.19 to master for current GLib
+
+---
+ NEWS | 7 +
+ configure.ac | 424 ++++++++++++++++++++++++++++++++
+ configure.in | 413 -------------------------------
+ include/orbit/GIOP/giop-types.h | 5 +
+ include/orbit/GIOP/giop.h | 1 +
+ include/orbit/orb-core/corba-orb-type.h | 3 +
+ include/orbit/orb-core/corba-orb.h | 2 +
+ include/orbit/poa/orbit-adaptor.h | 3 +
+ include/orbit/util/basic_types.h | 8 -
+ linc2/src/Makefile.am | 6 +-
+ linc2/src/linc-connection.c | 17 +-
+ linc2/src/linc-private.h | 3 +
+ linc2/src/linc-protocols.c | 1 +
+ linc2/src/linc.c | 40 ++-
+ linc2/test/Makefile.am | 2 +-
+ src/idl-compiler/Makefile.am | 2 +-
+ src/orb/GIOP/Makefile.am | 2 +-
+ src/orb/GIOP/giop-recv-buffer.c | 14 +-
+ src/orb/GIOP/giop-send-buffer.c | 9 +-
+ src/orb/GIOP/giop.c | 38 ++-
+ src/orb/Makefile.am | 2 +-
+ src/orb/dynamic/Makefile.am | 2 +-
+ src/orb/orb-core/Makefile.am | 2 +-
+ src/orb/orb-core/corba-object.c | 8 +
+ src/orb/orb-core/corba-orb.c | 24 +-
+ src/orb/poa/Makefile.am | 2 +-
+ src/orb/poa/poa.c | 25 +-
+ src/orb/util/Makefile.am | 2 +-
+ src/orb/util/genrand.c | 13 +-
+ src/services/imodule/Makefile.am | 2 +-
+ src/services/name/Makefile.am | 2 +-
+ test/Makefile.am | 2 +-
+ test/everything/Makefile.am | 4 +-
+ test/everything/client.c | 14 +-
+ test/everything/server.c | 3 +-
+ test/inhibit/Makefile.am | 2 +-
+ test/poa/Makefile.am | 2 +-
+ test/poa/poatest-basic-shell.c | 3 +-
+ test/test-corbaloc.c | 4 +-
+ test/test-dynany.c | 5 +-
+ test/test-giop.c | 4 +-
+ test/test-mem.c | 8 +-
+ test/test-performance.c | 2 +
+ test/timeout-client.c | 2 +
+ test/timeout-server.c | 3 +-
+ 45 files changed, 662 insertions(+), 480 deletions(-)
+ create mode 100644 configure.ac
+ delete mode 100644 configure.in
+
+diff --git a/NEWS b/NEWS
+index bddfdff..7734385 100644
+--- a/NEWS
++++ b/NEWS
+@@ -1,3 +1,10 @@
++ORBit2-2.14.20
++
++ - build fixes
++ + Stop using -DG_DISABLE_DEPRECATED since it doesn't build
++ + Use AM_CPPFLAGS instead of INCLUDES
++ + Move configure.in to configure.ac
++
+ ORBit2-2.14.19
+
+ - bug fixes
+diff --git a/configure.ac b/configure.ac
+new file mode 100644
+index 0000000..61aa74c
+--- /dev/null
++++ b/configure.ac
+@@ -0,0 +1,424 @@
++m4_define([orbit_major_version],[2])
++m4_define([orbit_minor_version],[14])
++m4_define([orbit_micro_version],[20])
++m4_define([orbit_version],[orbit_major_version.orbit_minor_version.orbit_micro_version])
++
++dnl Process this file with autoconf to produce a configure script.
++AC_INIT([ORBit2],[orbit_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=ORBit2],[ORBit2])
++
++# Process this file with autoconf to produce a configure script.
++# require autoconf 2.60
++AC_PREREQ(2.60)
++
++# Before making a release, the LT_VERSION string should be modified.
++# The string is of the form C:R:A.
++# - If interfaces have been changed or added, but binary compatibility has
++# been preserved, change to C+1:0:A+1
++# - If binary compatibility has been broken (eg removed or changed interfaces)
++# change to C+1:0:0
++# - If the interface is the same as the previous version, change to C:R+1:A
++
++LT_VERSION=1:0:1
++AC_SUBST(LT_VERSION)
++
++ORBIT_MAJOR_VERSION=orbit_major_version
++ORBIT_MINOR_VERSION=orbit_minor_version
++ORBIT_MICRO_VERSION=orbit_micro_version
++ORBIT_VERSION=orbit_version
++AC_SUBST(ORBIT_MAJOR_VERSION)
++AC_SUBST(ORBIT_MINOR_VERSION)
++AC_SUBST(ORBIT_MICRO_VERSION)
++AC_SUBST(ORBIT_VERSION)
++
++# Increment this every time a feature is added in the .idl compiler
++# that needs help from the main libraries.
++ORBIT_SERIAL=20
++AC_SUBST(ORBIT_SERIAL)
++
++# For automake.
++
++AC_CONFIG_HEADERS([config.h])
++
++dnl Initialize automake stuff
++AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2 no-define])
++
++dnl Required by autoconf 2.60
++AC_SUBST(datarootdir)
++
++AC_CANONICAL_HOST
++AC_MSG_CHECKING([for Win32])
++case "$host" in
++ *-*-mingw*)
++ os_win32=yes
++ LIBM=
++ MINGW_LDFLAGS="-Wl,--enable-runtime-pseudo-reloc"
++ ;;
++ *)
++ os_win32=no
++ LIBM=-lm
++ MINGW_LDFLAGS=
++ ;;
++esac
++AC_MSG_RESULT([$os_win32])
++
++AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"])
++
++AC_SUBST(LIBM)
++AC_SUBST(MINGW_LDFLAGS)
++LDFLAGS="$MINGW_LDFLAGS $LDFLAGS"
++
++if test "$os_win32" = "yes"; then
++ if test x$enable_static = xyes -o x$enable_static = x; then
++ AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.])
++ enable_static=no
++ fi
++ if test x$enable_shared = xno; then
++ AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.])
++ fi
++ enable_shared=yes
++fi
++
++dnl Checks for programs.
++AC_PROG_CC
++AC_PROG_INSTALL
++
++AC_LIBTOOL_DLOPEN
++AC_LIBTOOL_WIN32_DLL
++AM_PROG_LIBTOOL
++AM_MAINTAINER_MODE([enable])
++
++dnl Useful for automating stuff
++AC_CACHE_CHECK([for aclocal flags], ac_cv_orbit_aclocal_flags,[
++ ac_cv_orbit_aclocal_flags="$ACLOCAL_FLAGS"
++])
++ACLOCAL="$ACLOCAL $ac_cv_orbit_aclocal_flags"
++
++AC_ARG_ENABLE(http, [--enable-http enables http connections],, enable_http=no)
++AM_CONDITIONAL(ENABLE_HTTP, test x"$enable_http" = xyes)
++if test x"$enable_http" = xyes ; then
++ AC_DEFINE(ENABLE_HTTP, 1, [Define if HTTP connections are available])
++fi
++dnl --enable-compile-warnings
++AC_ARG_ENABLE(compile-warnings, [ --enable-compile-warnings=[no/yes] Turn on compiler warnings.],
[enable_compile_warnings="$enableval"],[enable_compile_warnings="yes"])
++
++dnl --enable-debug=(yes|minimum|no)
++AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging [default=no]],,enable_debug=minimum)
++if test "x$enable_debug" = "xyes"; then
++ ORBIT_DEBUG_CFLAGS="-ggdb -O0 -DG_ENABLE_DEBUG"
++else
++ if test "x$enable_debug" = "xno"; then
++ ORBIT_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
++ else
++ ORBIT_DEBUG_CFLAGS=""
++ fi
++fi
++
++AC_ARG_ENABLE(purify, [ --enable-purify be clean for memory debuggers], enable_purify=yes,
enable_purify=no)
++if test z$enable_purify = zyes; then
++ AC_DEFINE(ORBIT_PURIFY, 1, [defined if purify is enabled])
++fi
++
++AC_MSG_CHECKING(which idl compiler to use)
++IDL_COMPILER="\$(top_builddir)/src/idl-compiler/orbit-idl-2\$(EXEEXT)"
++AC_ARG_WITH(idl-compiler,
++ [ --with-idl-compiler use specific idl compiler (useful when crosscompiling)],
++ if test "x$withval" != x; then
++ if test -f "$withval"; then
++ IDL_COMPILER=$withval
++ fi
++ fi
++)
++if test x$IDL_COMPILER == x"\$(top_builddir)/src/idl-compiler/orbit-idl-2\$(EXEEXT)"; then
++ AC_MSG_RESULT(internal)
++else
++ AC_MSG_RESULT(external ($IDL_COMPILER))
++fi
++AC_SUBST(IDL_COMPILER)
++
++AC_PROG_AWK
++
++GLIB_REQUIRED=2.8.0
++LIBIDL_REQUIRED=0.8.2
++AC_SUBST(GLIB_REQUIRED)
++AC_SUBST(LIBIDL_REQUIRED)
++
++dnl Check for pkg-config version; want >= 0.14.0 because of -pthread bug
++PKG_PROG_PKG_CONFIG([0.18])
++
++LOCAL_LINC_LIBS='$(top_builddir)/linc2/src/liblinc.la'
++LOCAL_LINC_CFLAGS='-I$(top_srcdir)/linc2/include -I$(top_builddir)/linc2/include'
++AC_SUBST(LOCAL_LINC_LIBS)
++AC_SUBST(LOCAL_LINC_CFLAGS)
++
++dnl Checks for libraries.
++PKG_CHECK_MODULES(ORBIT, \
++ glib-2.0 >= $GLIB_REQUIRED \
++ gobject-2.0 >= $GLIB_REQUIRED \
++ gthread-2.0 >= $GLIB_REQUIRED \
++ gmodule-2.0 >= $GLIB_REQUIRED)
++AC_SUBST(ORBIT_LIBS)
++AC_SUBST(ORBIT_CFLAGS)
++
++PKG_CHECK_MODULES(ORBIT_IDL, \
++ libIDL-2.0 >= $LIBIDL_REQUIRED \
++ glib-2.0 >= $GLIB_REQUIRED \
++ gobject-2.0 >= $GLIB_REQUIRED \
++ gmodule-2.0 >= $GLIB_REQUIRED)
++AC_SUBST(ORBIT_IDL_LIBS)
++AC_SUBST(ORBIT_IDL_CFLAGS)
++
++PKG_CHECK_MODULES(ORBIT_NAME,
++ glib-2.0 >= $GLIB_REQUIRED \
++ gobject-2.0 >= $GLIB_REQUIRED \
++ gthread-2.0 >= $GLIB_REQUIRED \
++ gmodule-2.0 >= $GLIB_REQUIRED)
++AC_SUBST(ORBIT_NAME_LIBS)
++AC_SUBST(ORBIT_NAME_CFLAGS)
++
++dnl Checks for header files.
++AC_HEADER_STDC
++AC_CHECK_HEADERS(fcntl.h unistd.h sys/endian.h endian.h machine/endian.h)
++AC_CHECK_HEADERS(sys/machine.h sys/isa_defs.h sys/poll.h sys/select.h)
++AC_CHECK_HEADERS(sys/time.h netinet/in.h sys/socket.h arpa/inet.h)
++AC_CHECK_HEADERS(stddef.h wchar.h wcstr.h wctype.h machine/types.h)
++AC_CHECK_HEADERS(sys/un.h sys/uio.h syslog.h)
++AC_CHECK_HEADERS(sys/wait.h netdb.h)
++AC_CHECK_HEADERS(utime.h sys/utime.h)
++AC_CHECK_HEADERS([linux/socket.h])
++AC_CHECK_HEADERS(sys/sockio.h)
++
++if test "$os_win32" = "yes"; then
++ AC_CHECK_HEADERS(winsock2.h)
++ if test $ac_cv_header_winsock2_h = yes; then
++ dnl If we have <winsock2.h>, assume we find the functions
++ dnl in -lws2_32.
++ LIBS="-lws2_32 $LIBS"
++ fi
++fi
++
++dnl Checks for typedefs, structures, and compiler characteristics.
++AC_C_CONST
++AC_C_INLINE
++AC_TYPE_SIZE_T
++
++dnl Checks for library functions.
++AC_FUNC_VPRINTF
++
++AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
++AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
++AC_CHECK_FUNC(sigaction)
++AC_CHECK_FUNC(syslog)
++
++dnl This generates warnings from autoconf...
++AC_C_BIGENDIAN
++
++
++dnl
++dnl So many people with broken linking setups asked about this
++dnl it turned out to be necessary to check for this.
++dnl
++dofus_save_libs="$LIBS"
++LIBS="$ORBIT_LIBS $LIBS"
++AC_TRY_RUN([ #include <stdio.h>
++ main ()
++ {
++ return 0;
++ } ],,
++ AC_MSG_ERROR([
++Linking is badly borked on your system. Please ensure your library path is correct
++Check config.log for details - check near the end of the log above 'failed program was'
++Alternatively ensure that your /etc/ld.so.conf (and/or LD_LIBRARY_PATH) includes the
++prefix you're compiling on: '${prefix}' ]),
++AC_MSG_WARN([Could not check for borked linking while cross-compiling]))
++LIBS="$dofus_save_libs"
++
++orig_CPPFLAGS=$CPPFLAGS
++CPPFLAGS="$CPPFLAGS $ORBIT_CFLAGS"
++AC_CHECK_ALIGNOF(CORBA_octet)
++AC_CHECK_ALIGNOF(CORBA_boolean)
++AC_CHECK_ALIGNOF(CORBA_char)
++AC_CHECK_ALIGNOF(CORBA_wchar)
++AC_CHECK_ALIGNOF(CORBA_short)
++AC_CHECK_ALIGNOF(CORBA_long)
++AC_CHECK_ALIGNOF(CORBA_long_long)
++AC_CHECK_ALIGNOF(CORBA_float)
++AC_CHECK_ALIGNOF(CORBA_double)
++AC_CHECK_ALIGNOF(CORBA_long_double)
++AC_CHECK_ALIGNOF(CORBA_struct)
++AC_CHECK_ALIGNOF(CORBA_pointer)
++CPPFLAGS=$orig_CPPFLAGS
++
++if test "x$GCC" = "xyes" -a "x$enable_compile_warnings" != "xno"; then
++ WARN_CFLAGS="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations"
++else
++ WARN_CFLAGS=
++fi
++
++AC_MSG_CHECKING(what warning flags to pass to the C compiler)
++AC_MSG_RESULT($WARN_CFLAGS)
++AC_SUBST(WARN_CFLAGS)
++
++AC_SUBST(pkglibdir)
++
++if test "$enable_maintainer_mode" = "yes"; then
++ DISABLE_DEPRECATED_CFLAGS=" \
++ -DG_DISABLE_SINGLE_INCLUDES"
++ AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
++fi
++
++dnl
++dnl --------- start linc bits ---------
++dnl
++
++dnl Checks for libraries.
++PKG_CHECK_MODULES(LINC, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED gthread-2.0 >=
$GLIB_REQUIRED)
++AC_SUBST(LINC_LIBS)
++AC_SUBST(LINC_CFLAGS)
++PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.36 gthread-2.0 gobject-2.0 gmodule-2.0,
++[
++ AC_DEFINE([HAVE_GLIB_2_36], [1], [Configure g_type_init deprecation])
++ AC_DEFINE([HAVE_GLIB_2_32], [1], [Configure gthread deprecations])
++],
++ [PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.32 gthread-2.0 gobject-2.0 gmodule-2.0,
++ [
++ AC_DEFINE([HAVE_GLIB_2_32], [1], [Configure gthread deprecations])
++ ])
++])
++
++dnl Checks for header files.
++AC_HEADER_STDC
++AC_HEADER_RESOLV
++AC_CHECK_HEADERS(fcntl.h unistd.h sys/endian.h endian.h machine/endian.h sys/machine.h sys/isa_defs.h
sys/poll.h)
++AC_CHECK_HEADERS(stddef.h wchar.h wcstr.h wctype.h machine/types.h)
++AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h sys/un.h)
++AC_CHECK_HEADERS(arpa/nameser.h)
++dnl AC_CHECK_HEADERS(linux/irda.h)
++
++dnl Checks for library functions.
++AC_CHECK_FUNCS(poll basename)
++AC_CHECK_FUNC(res_init,,[AC_CHECK_LIB(resolv,res_init)])
++AC_CHECK_LIB(resolv,res_9_init)
++AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
++AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
++AC_CHECK_FUNC(getaddrinfo,,[AC_CHECK_LIB(nsl,getaddrinfo)])
++if test x"$ac_cv_func_getaddrinfo" = "xyes" ; then
++ AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo() is available])
++fi
++AC_CHECK_FUNC(getnameinfo,,[AC_CHECK_LIB(nsl,getnameinfo)])
++if test x"$ac_cv_func_getnameinfo" = "xyes" ; then
++ AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define if getnameinfo() is available])
++fi
++have_inet_pton=no
++AC_CHECK_FUNC(inet_pton,,)
++if test x"$ac_cv_func_inet_pton" = "xyes" ; then
++ have_inet_pton=yes
++ AC_DEFINE(HAVE_INET_PTON, 1, [Define if inet_pton() is available])
++fi
++
++# AC_CHECK_TYPE doesn't work here.
++AC_MSG_CHECKING([for socklen_t])
++AC_TRY_COMPILE(
++ [#ifdef _WIN32
++#include <ws2tcpip.h>
++#else
++#include <sys/types.h>
++#include <sys/socket.h>
++#endif],
++ [socklen_t len;],
++ [AC_MSG_RESULT(yes)],
++ [AC_DEFINE(socklen_t, size_t, [Define socklen_t to be of type size_t])
++ AC_MSG_RESULT(no)])
++
++# Blatantly stolen from configure.in in the sample code from
++# "UNIX Network Programming, Volume 1" by W. Richard Stevens
++AC_CACHE_CHECK(if sockaddr has sa_len member,
++ac_cv_sockaddr_has_sa_len,
++ AC_TRY_COMPILE([
++# include <sys/types.h>
++# include <sys/socket.h>],
++ [unsigned int i = sizeof(((struct sockaddr *)0)->sa_len)],
++ ac_cv_sockaddr_has_sa_len=yes,
++ ac_cv_sockaddr_has_sa_len=no))
++if test x"$ac_cv_sockaddr_has_sa_len" = "xyes" ; then
++ AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member])
++fi
++
++dnl
++dnl --------- end linc bits ---------
++dnl
++
++dnl
++dnl --------- set additional gcc flags to catch errors ---------
++dnl
++AX_CFLAGS_GCC_OPTION(-Werror-implicit-function-declaration)
++CFLAGS="$CFLAGS $ORBIT_DEBUG_CFLAGS"
++AC_SUBST(CFLAGS)
++
++
++dnl ----- gtk-doc ------
++GTK_DOC_CHECK([1.0])
++
++
++AC_CONFIG_FILES([
++Makefile
++orbit2-config
++ORBit-2.0.pc
++ORBit-2.0-uninstalled.pc
++ORBit-CosNaming-2.0.pc
++ORBit-CosNaming-2.0-uninstalled.pc
++ORBit-imodule-2.0.pc
++ORBit-imodule-2.0-uninstalled.pc
++ORBit.spec
++orbit2-zip
++src/Makefile
++src/idl-compiler/Makefile
++src/idl-compiler/ORBit-idl-2.0.pc
++src/idl/Makefile
++src/idl/CORBA/Makefile
++src/idl/CORBA_PIDL/Makefile
++src/idl/interop/Makefile
++src/idl/misc/Makefile
++src/orb/Makefile
++src/orb/include/Makefile
++src/orb/util/Makefile
++src/orb/GIOP/Makefile
++src/orb/orb-core/Makefile
++src/orb/dynamic/Makefile
++src/orb/poa/Makefile
++src/services/Makefile
++src/services/name/Makefile
++src/services/imodule/Makefile
++include/Makefile
++include/orbit/Makefile
++include/orbit/orbit-config.h
++include/orbit/GIOP/Makefile
++include/orbit/util/Makefile
++include/orbit/orb-core/Makefile
++include/orbit/poa/Makefile
++include/orbit/dynamic/Makefile
++test/Makefile
++test/everything/Makefile
++test/inhibit/Makefile
++test/poa/Makefile
++docs/Makefile
++docs/devel/Makefile
++docs/internals/Makefile
++docs/api/Makefile
++
++linc2/Makefile
++linc2/src/Makefile
++linc2/test/Makefile
++linc2/include/Makefile
++linc2/include/linc/Makefile
++linc2/include/linc/linc-config.h
++])
++
++AC_OUTPUT
++
++echo "ORBit configuration:
++
++ Source code location: ${srcdir}
++ Compiler: ${CC}
++
++ Purify cleanliness: ${enable_purify}
++"
+diff --git a/configure.in b/configure.in
+deleted file mode 100644
+index 04d4b2a..0000000
+--- a/configure.in
++++ /dev/null
+@@ -1,413 +0,0 @@
+-m4_define([orbit_major_version],[2])
+-m4_define([orbit_minor_version],[14])
+-m4_define([orbit_micro_version],[19])
+-m4_define([orbit_version],[orbit_major_version.orbit_minor_version.orbit_micro_version])
+-
+-dnl Process this file with autoconf to produce a configure script.
+-AC_INIT([ORBit2],[orbit_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=ORBit2],[ORBit2])
+-
+-# Process this file with autoconf to produce a configure script.
+-# require autoconf 2.54
+-AC_PREREQ(2.54)
+-
+-# Before making a release, the LT_VERSION string should be modified.
+-# The string is of the form C:R:A.
+-# - If interfaces have been changed or added, but binary compatibility has
+-# been preserved, change to C+1:0:A+1
+-# - If binary compatibility has been broken (eg removed or changed interfaces)
+-# change to C+1:0:0
+-# - If the interface is the same as the previous version, change to C:R+1:A
+-
+-LT_VERSION=1:0:1
+-AC_SUBST(LT_VERSION)
+-
+-ORBIT_MAJOR_VERSION=orbit_major_version
+-ORBIT_MINOR_VERSION=orbit_minor_version
+-ORBIT_MICRO_VERSION=orbit_micro_version
+-ORBIT_VERSION=orbit_version
+-AC_SUBST(ORBIT_MAJOR_VERSION)
+-AC_SUBST(ORBIT_MINOR_VERSION)
+-AC_SUBST(ORBIT_MICRO_VERSION)
+-AC_SUBST(ORBIT_VERSION)
+-
+-# Increment this every time a feature is added in the .idl compiler
+-# that needs help from the main libraries.
+-ORBIT_SERIAL=20
+-AC_SUBST(ORBIT_SERIAL)
+-
+-# For automake.
+-
+-AC_CONFIG_HEADERS([config.h])
+-
+-dnl Initialize automake stuff
+-AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2 no-define])
+-
+-dnl Required by autoconf 2.60
+-AC_SUBST(datarootdir)
+-
+-AC_CANONICAL_HOST
+-AC_MSG_CHECKING([for Win32])
+-case "$host" in
+- *-*-mingw*)
+- os_win32=yes
+- LIBM=
+- MINGW_LDFLAGS="-Wl,--enable-runtime-pseudo-reloc"
+- ;;
+- *)
+- os_win32=no
+- LIBM=-lm
+- MINGW_LDFLAGS=
+- ;;
+-esac
+-AC_MSG_RESULT([$os_win32])
+-
+-AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"])
+-
+-AC_SUBST(LIBM)
+-AC_SUBST(MINGW_LDFLAGS)
+-LDFLAGS="$MINGW_LDFLAGS $LDFLAGS"
+-
+-if test "$os_win32" = "yes"; then
+- if test x$enable_static = xyes -o x$enable_static = x; then
+- AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.])
+- enable_static=no
+- fi
+- if test x$enable_shared = xno; then
+- AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.])
+- fi
+- enable_shared=yes
+-fi
+-
+-dnl Checks for programs.
+-AC_PROG_CC
+-AC_PROG_INSTALL
+-
+-AC_LIBTOOL_DLOPEN
+-AC_LIBTOOL_WIN32_DLL
+-AM_PROG_LIBTOOL
+-AM_MAINTAINER_MODE
+-
+-dnl Useful for automating stuff
+-AC_CACHE_CHECK([for aclocal flags], ac_cv_orbit_aclocal_flags,[
+- ac_cv_orbit_aclocal_flags="$ACLOCAL_FLAGS"
+-])
+-ACLOCAL="$ACLOCAL $ac_cv_orbit_aclocal_flags"
+-
+-AC_ARG_ENABLE(http, [--enable-http enables http connections],, enable_http=no)
+-AM_CONDITIONAL(ENABLE_HTTP, test x"$enable_http" = xyes)
+-if test x"$enable_http" = xyes ; then
+- AC_DEFINE(ENABLE_HTTP, 1, [Define if HTTP connections are available])
+-fi
+-dnl --enable-compile-warnings
+-AC_ARG_ENABLE(compile-warnings, [ --enable-compile-warnings=[no/yes] Turn on compiler warnings.],
[enable_compile_warnings="$enableval"],[enable_compile_warnings="yes"])
+-
+-dnl --enable-debug=(yes|minimum|no)
+-AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging [default=no]],,enable_debug=minimum)
+-if test "x$enable_debug" = "xyes"; then
+- ORBIT_DEBUG_CFLAGS="-ggdb -O0 -DG_ENABLE_DEBUG"
+-else
+- if test "x$enable_debug" = "xno"; then
+- ORBIT_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
+- else
+- ORBIT_DEBUG_CFLAGS=""
+- fi
+-fi
+-
+-AC_ARG_ENABLE(purify, [ --enable-purify be clean for memory debuggers], enable_purify=yes,
enable_purify=no)
+-if test z$enable_purify = zyes; then
+- AC_DEFINE(ORBIT_PURIFY, 1, [defined if purify is enabled])
+-fi
+-
+-AC_MSG_CHECKING(which idl compiler to use)
+-IDL_COMPILER="\$(top_builddir)/src/idl-compiler/orbit-idl-2\$(EXEEXT)"
+-AC_ARG_WITH(idl-compiler,
+- [ --with-idl-compiler use specific idl compiler (useful when crosscompiling)],
+- if test "x$withval" != x; then
+- if test -f "$withval"; then
+- IDL_COMPILER=$withval
+- fi
+- fi
+-)
+-if test x$IDL_COMPILER == x"\$(top_builddir)/src/idl-compiler/orbit-idl-2\$(EXEEXT)"; then
+- AC_MSG_RESULT(internal)
+-else
+- AC_MSG_RESULT(external ($IDL_COMPILER))
+-fi
+-AC_SUBST(IDL_COMPILER)
+-
+-AC_PROG_AWK
+-
+-GLIB_REQUIRED=2.8.0
+-LIBIDL_REQUIRED=0.8.2
+-AC_SUBST(GLIB_REQUIRED)
+-AC_SUBST(LIBIDL_REQUIRED)
+-
+-dnl Check for pkg-config version; want >= 0.14.0 because of -pthread bug
+-PKG_PROG_PKG_CONFIG([0.18])
+-
+-LOCAL_LINC_LIBS='$(top_builddir)/linc2/src/liblinc.la'
+-LOCAL_LINC_CFLAGS='-I$(top_srcdir)/linc2/include -I$(top_builddir)/linc2/include'
+-AC_SUBST(LOCAL_LINC_LIBS)
+-AC_SUBST(LOCAL_LINC_CFLAGS)
+-
+-dnl Checks for libraries.
+-PKG_CHECK_MODULES(ORBIT, \
+- glib-2.0 >= $GLIB_REQUIRED \
+- gobject-2.0 >= $GLIB_REQUIRED \
+- gthread-2.0 >= $GLIB_REQUIRED \
+- gmodule-2.0 >= $GLIB_REQUIRED)
+-AC_SUBST(ORBIT_LIBS)
+-AC_SUBST(ORBIT_CFLAGS)
+-
+-PKG_CHECK_MODULES(ORBIT_IDL, \
+- libIDL-2.0 >= $LIBIDL_REQUIRED \
+- glib-2.0 >= $GLIB_REQUIRED \
+- gobject-2.0 >= $GLIB_REQUIRED \
+- gmodule-2.0 >= $GLIB_REQUIRED)
+-AC_SUBST(ORBIT_IDL_LIBS)
+-AC_SUBST(ORBIT_IDL_CFLAGS)
+-
+-PKG_CHECK_MODULES(ORBIT_NAME,
+- glib-2.0 >= $GLIB_REQUIRED \
+- gobject-2.0 >= $GLIB_REQUIRED \
+- gthread-2.0 >= $GLIB_REQUIRED \
+- gmodule-2.0 >= $GLIB_REQUIRED)
+-AC_SUBST(ORBIT_NAME_LIBS)
+-AC_SUBST(ORBIT_NAME_CFLAGS)
+-
+-dnl Checks for header files.
+-AC_HEADER_STDC
+-AC_CHECK_HEADERS(fcntl.h unistd.h sys/endian.h endian.h machine/endian.h)
+-AC_CHECK_HEADERS(sys/machine.h sys/isa_defs.h sys/poll.h sys/select.h)
+-AC_CHECK_HEADERS(sys/time.h netinet/in.h sys/socket.h arpa/inet.h)
+-AC_CHECK_HEADERS(stddef.h wchar.h wcstr.h wctype.h machine/types.h)
+-AC_CHECK_HEADERS(sys/un.h sys/uio.h syslog.h)
+-AC_CHECK_HEADERS(sys/wait.h netdb.h)
+-AC_CHECK_HEADERS(utime.h sys/utime.h)
+-AC_CHECK_HEADERS([linux/socket.h])
+-AC_CHECK_HEADERS(sys/sockio.h)
+-
+-if test "$os_win32" = "yes"; then
+- AC_CHECK_HEADERS(winsock2.h)
+- if test $ac_cv_header_winsock2_h = yes; then
+- dnl If we have <winsock2.h>, assume we find the functions
+- dnl in -lws2_32.
+- LIBS="-lws2_32 $LIBS"
+- fi
+-fi
+-
+-dnl Checks for typedefs, structures, and compiler characteristics.
+-AC_C_CONST
+-AC_C_INLINE
+-AC_TYPE_SIZE_T
+-
+-dnl Checks for library functions.
+-AC_FUNC_VPRINTF
+-
+-AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
+-AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
+-AC_CHECK_FUNC(sigaction)
+-AC_CHECK_FUNC(syslog)
+-
+-dnl This generates warnings from autoconf...
+-AC_C_BIGENDIAN
+-
+-
+-dnl
+-dnl So many people with broken linking setups asked about this
+-dnl it turned out to be necessary to check for this.
+-dnl
+-dofus_save_libs="$LIBS"
+-LIBS="$ORBIT_LIBS $LIBS"
+-AC_TRY_RUN([ #include <stdio.h>
+- main ()
+- {
+- return 0;
+- } ],,
+- AC_MSG_ERROR([
+-Linking is badly borked on your system. Please ensure your library path is correct
+-Check config.log for details - check near the end of the log above 'failed program was'
+-Alternatively ensure that your /etc/ld.so.conf (and/or LD_LIBRARY_PATH) includes the
+-prefix you're compiling on: '${prefix}' ]),
+-AC_MSG_WARN([Could not check for borked linking while cross-compiling]))
+-LIBS="$dofus_save_libs"
+-
+-orig_CPPFLAGS=$CPPFLAGS
+-CPPFLAGS="$CPPFLAGS $ORBIT_CFLAGS"
+-AC_CHECK_ALIGNOF(CORBA_octet)
+-AC_CHECK_ALIGNOF(CORBA_boolean)
+-AC_CHECK_ALIGNOF(CORBA_char)
+-AC_CHECK_ALIGNOF(CORBA_wchar)
+-AC_CHECK_ALIGNOF(CORBA_short)
+-AC_CHECK_ALIGNOF(CORBA_long)
+-AC_CHECK_ALIGNOF(CORBA_long_long)
+-AC_CHECK_ALIGNOF(CORBA_float)
+-AC_CHECK_ALIGNOF(CORBA_double)
+-AC_CHECK_ALIGNOF(CORBA_long_double)
+-AC_CHECK_ALIGNOF(CORBA_struct)
+-AC_CHECK_ALIGNOF(CORBA_pointer)
+-CPPFLAGS=$orig_CPPFLAGS
+-
+-if test "x$GCC" = "xyes" -a "x$enable_compile_warnings" != "xno"; then
+- WARN_CFLAGS="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations"
+-else
+- WARN_CFLAGS=
+-fi
+-
+-AC_MSG_CHECKING(what warning flags to pass to the C compiler)
+-AC_MSG_RESULT($WARN_CFLAGS)
+-AC_SUBST(WARN_CFLAGS)
+-
+-AC_SUBST(pkglibdir)
+-
+-if test "$enable_maintainer_mode" = "yes"; then
+- DISABLE_DEPRECATED_CFLAGS=" \
+- -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES"
+- AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
+-fi
+-
+-dnl
+-dnl --------- start linc bits ---------
+-dnl
+-
+-dnl Checks for libraries.
+-PKG_CHECK_MODULES(LINC, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED gthread-2.0 >=
$GLIB_REQUIRED)
+-AC_SUBST(LINC_LIBS)
+-AC_SUBST(LINC_CFLAGS)
+-
+-dnl Checks for header files.
+-AC_HEADER_STDC
+-AC_CHECK_HEADERS(fcntl.h unistd.h sys/endian.h endian.h machine/endian.h sys/machine.h sys/isa_defs.h
sys/poll.h)
+-AC_CHECK_HEADERS(stddef.h wchar.h wcstr.h wctype.h machine/types.h)
+-AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h sys/un.h)
+-AC_CHECK_HEADERS(arpa/nameser.h resolv.h)
+-dnl AC_CHECK_HEADERS(linux/irda.h)
+-
+-dnl Checks for library functions.
+-AC_CHECK_FUNCS(poll basename)
+-AC_CHECK_FUNC(res_init,,[AC_CHECK_LIB(resolv,res_init)])
+-AC_CHECK_LIB(resolv,res_9_init)
+-AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
+-AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
+-AC_CHECK_FUNC(getaddrinfo,,[AC_CHECK_LIB(nsl,getaddrinfo)])
+-if test x"$ac_cv_func_getaddrinfo" = "xyes" ; then
+- AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo() is available])
+-fi
+-AC_CHECK_FUNC(getnameinfo,,[AC_CHECK_LIB(nsl,getnameinfo)])
+-if test x"$ac_cv_func_getnameinfo" = "xyes" ; then
+- AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define if getnameinfo() is available])
+-fi
+-have_inet_pton=no
+-AC_CHECK_FUNC(inet_pton,,)
+-if test x"$ac_cv_func_inet_pton" = "xyes" ; then
+- have_inet_pton=yes
+- AC_DEFINE(HAVE_INET_PTON, 1, [Define if inet_pton() is available])
+-fi
+-
+-# AC_CHECK_TYPE doesn't work here.
+-AC_MSG_CHECKING([for socklen_t])
+-AC_TRY_COMPILE(
+- [#ifdef _WIN32
+-#include <ws2tcpip.h>
+-#else
+-#include <sys/types.h>
+-#include <sys/socket.h>
+-#endif],
+- [socklen_t len;],
+- [AC_MSG_RESULT(yes)],
+- [AC_DEFINE(socklen_t, size_t, [Define socklen_t to be of type size_t])
+- AC_MSG_RESULT(no)])
+-
+-# Blatantly stolen from configure.in in the sample code from
+-# "UNIX Network Programming, Volume 1" by W. Richard Stevens
+-AC_CACHE_CHECK(if sockaddr has sa_len member,
+-ac_cv_sockaddr_has_sa_len,
+- AC_TRY_COMPILE([
+-# include <sys/types.h>
+-# include <sys/socket.h>],
+- [unsigned int i = sizeof(((struct sockaddr *)0)->sa_len)],
+- ac_cv_sockaddr_has_sa_len=yes,
+- ac_cv_sockaddr_has_sa_len=no))
+-if test x"$ac_cv_sockaddr_has_sa_len" = "xyes" ; then
+- AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member])
+-fi
+-
+-dnl
+-dnl --------- end linc bits ---------
+-dnl
+-
+-dnl
+-dnl --------- set additional gcc flags to catch errors ---------
+-dnl
+-AX_CFLAGS_GCC_OPTION(-Werror-implicit-function-declaration)
+-CFLAGS="$CFLAGS $ORBIT_DEBUG_CFLAGS"
+-AC_SUBST(CFLAGS)
+-
+-
+-dnl ----- gtk-doc ------
+-GTK_DOC_CHECK([1.0])
+-
+-
+-AC_CONFIG_FILES([
+-Makefile
+-orbit2-config
+-ORBit-2.0.pc
+-ORBit-2.0-uninstalled.pc
+-ORBit-CosNaming-2.0.pc
+-ORBit-CosNaming-2.0-uninstalled.pc
+-ORBit-imodule-2.0.pc
+-ORBit-imodule-2.0-uninstalled.pc
+-ORBit.spec
+-orbit2-zip
+-src/Makefile
+-src/idl-compiler/Makefile
+-src/idl-compiler/ORBit-idl-2.0.pc
+-src/idl/Makefile
+-src/idl/CORBA/Makefile
+-src/idl/CORBA_PIDL/Makefile
+-src/idl/interop/Makefile
+-src/idl/misc/Makefile
+-src/orb/Makefile
+-src/orb/include/Makefile
+-src/orb/util/Makefile
+-src/orb/GIOP/Makefile
+-src/orb/orb-core/Makefile
+-src/orb/dynamic/Makefile
+-src/orb/poa/Makefile
+-src/services/Makefile
+-src/services/name/Makefile
+-src/services/imodule/Makefile
+-include/Makefile
+-include/orbit/Makefile
+-include/orbit/orbit-config.h
+-include/orbit/GIOP/Makefile
+-include/orbit/util/Makefile
+-include/orbit/orb-core/Makefile
+-include/orbit/poa/Makefile
+-include/orbit/dynamic/Makefile
+-test/Makefile
+-test/everything/Makefile
+-test/inhibit/Makefile
+-test/poa/Makefile
+-docs/Makefile
+-docs/devel/Makefile
+-docs/internals/Makefile
+-docs/api/Makefile
+-
+-linc2/Makefile
+-linc2/src/Makefile
+-linc2/test/Makefile
+-linc2/include/Makefile
+-linc2/include/linc/Makefile
+-linc2/include/linc/linc-config.h
+-])
+-
+-AC_OUTPUT
+-
+-echo "ORBit configuration:
+-
+- Source code location: ${srcdir}
+- Compiler: ${CC}
+-
+- Purify cleanliness: ${enable_purify}
+-"
+diff --git a/include/orbit/GIOP/giop-types.h b/include/orbit/GIOP/giop-types.h
+index ddf7f14..d852e1e 100644
+--- a/include/orbit/GIOP/giop-types.h
++++ b/include/orbit/GIOP/giop-types.h
+@@ -33,6 +33,11 @@ struct _GIOPThread {
+ void (*request_handler) (gpointer poa_object,
+ gpointer recv_buffer,
+ gpointer dummy);
++#ifdef HAVE_GLIB_2_32
++ GMutex lock_body;
++ GCond incoming_body;
++#endif
++
+ };
+
+ #define GIOP_INITIAL_MSG_SIZE_LIMIT (256*1024)
+diff --git a/include/orbit/GIOP/giop.h b/include/orbit/GIOP/giop.h
+index 20a3a32..8d1dd7a 100644
+--- a/include/orbit/GIOP/giop.h
++++ b/include/orbit/GIOP/giop.h
+@@ -14,6 +14,7 @@ G_BEGIN_DECLS
+
+ #ifdef ORBIT2_INTERNAL_API
+
++void giop_set_main_context (GMainContext *context);
+ void giop_init (gboolean thread_safe,
+ gboolean blank_wire_data);
+ void giop_main_run (void);
+diff --git a/include/orbit/orb-core/corba-orb-type.h b/include/orbit/orb-core/corba-orb-type.h
+index 3dbac38..1f3ce0f 100644
+--- a/include/orbit/orb-core/corba-orb-type.h
++++ b/include/orbit/orb-core/corba-orb-type.h
+@@ -78,6 +78,9 @@ struct CORBA_ORB_type {
+ * been externalised and refs that we have received.
+ */
+ GHashTable *objrefs;
++#ifdef HAVE_GLIB_2_32
++ GMutex lock_body;
++#endif
+ };
+
+ #endif /* ORBIT2_INTERNAL_API */
+diff --git a/include/orbit/orb-core/corba-orb.h b/include/orbit/orb-core/corba-orb.h
+index 2fc409b..3cc5087 100644
+--- a/include/orbit/orb-core/corba-orb.h
++++ b/include/orbit/orb-core/corba-orb.h
+@@ -32,6 +32,8 @@ gboolean ORBit_proto_use (const char *name);
+ */
+ glong ORBit_get_giop_recv_limit (void);
+
++void ORBit_set_giop_main_context (GMainContext *context);
++
+ #ifdef ORBIT2_INTERNAL_API
+
+ void ORBit_ORB_forw_bind (CORBA_ORB orb,
+diff --git a/include/orbit/poa/orbit-adaptor.h b/include/orbit/poa/orbit-adaptor.h
+index 8756e2e..e4ab7ff 100644
+--- a/include/orbit/poa/orbit-adaptor.h
++++ b/include/orbit/poa/orbit-adaptor.h
+@@ -124,6 +124,9 @@ struct ORBit_ObjectAdaptor_type {
+ ORBitThreadHint thread_hint;
+
+ GMainContext *context;
++#ifdef HAVE_GLIB_2_32
++ GMutex lock_body;
++#endif
+ };
+
+ int ORBit_adaptor_setup (ORBit_ObjectAdaptor adaptor, CORBA_ORB orb);
+diff --git a/include/orbit/util/basic_types.h b/include/orbit/util/basic_types.h
+index 8702276..c8562ca 100644
+--- a/include/orbit/util/basic_types.h
++++ b/include/orbit/util/basic_types.h
+@@ -34,7 +34,6 @@ typedef CORBA_wchar *CORBA_wstring;
+ typedef struct CORBA_Object_type *CORBA_Object;
+ #endif
+
+-#ifdef G_HAVE_GINT64
+ #define HAVE_CORBA_LONG_LONG
+
+ /*
+@@ -44,13 +43,6 @@ typedef struct CORBA_Object_type *CORBA_Object;
+ typedef gint64 CORBA_long_long;
+ typedef guint64 CORBA_unsigned_long_long;
+
+-#else
+-#error ""
+-#error "You don't G_HAVE_GINT64 defined in glib."
+-#error "Please make sure you don't have an old glibconfig.h lying around."
+-#error ""
+-#endif
+-
+ G_END_DECLS
+
+ #endif
+diff --git a/linc2/src/Makefile.am b/linc2/src/Makefile.am
+index 357a2dd..17024b5 100644
+--- a/linc2/src/Makefile.am
++++ b/linc2/src/Makefile.am
+@@ -8,16 +8,16 @@ endif
+
+ # -I$(top_builddir)/include
+ # -I$(top_srcdir)/include
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I$(top_builddir)/linc2/include \
+ -I$(top_srcdir)/linc2/include \
+ $(LINC_CFLAGS) \
+ $(WARN_CFLAGS) \
+- -DG_DISABLE_DEPRECATED
++ $(DISABLE_DEPRECATED_CFLAGS)
+
+ if OS_WIN32
+ else
+-INCLUDES += -D_GNU_SOURCE
++AM_CPPFLAGS += -D_GNU_SOURCE
+ endif
+
+ liblinc_la_SOURCES = \
+diff --git a/linc2/src/linc-connection.c b/linc2/src/linc-connection.c
+index 77bab0f..d78c033 100644
+--- a/linc2/src/linc-connection.c
++++ b/linc2/src/linc-connection.c
+@@ -651,8 +651,12 @@ link_connection_do_initiate (LinkConnection *cnx,
+ fix_permissions (service);
+ }
+ #endif
+-
++retry:
+ LINK_TEMP_FAILURE_RETRY_SOCKET (connect (fd, saddr, saddr_len), rv);
++ if (rv == -1L && errno == EAGAIN) {
++ g_usleep (10000);
++ goto retry;
++ }
+ #ifdef HAVE_WINSOCK2_H
+ if (rv == SOCKET_ERROR) {
+ if ((options & LINK_CONNECTION_NONBLOCKING) &&
+@@ -1333,9 +1337,12 @@ link_connection_finalize (GObject *obj)
+ g_free (cnx->remote_serv_info);
+
+ g_free (cnx->priv);
+-
+ if (cnx->timeout_mutex)
++#ifndef HAVE_GLIB_2_32
+ g_mutex_free (cnx->timeout_mutex);
++#else
++ g_mutex_clear (cnx->timeout_mutex);
++#endif
+ if (cnx->timeout_source_id)
+ link_io_thread_remove_timeout (cnx->timeout_source_id);
+
+@@ -1350,8 +1357,12 @@ link_connection_init (LinkConnection *cnx)
+ cnx->priv = g_new0 (LinkConnectionPrivate, 1);
+ cnx->priv->fd = -1;
+ cnx->priv->was_disconnected = FALSE;
+-
++#ifdef HAVE_GLIB_2_32
++ cnx->timeout_mutex = &(cnx->priv->timeout_mutex);
++ g_mutex_init (cnx->timeout_mutex);
++#else
+ cnx->timeout_mutex = NULL;
++#endif
+ cnx->timeout_msec = 0;
+ cnx->timeout_source_id = 0;
+ cnx->timeout_status = LINK_TIMEOUT_UNKNOWN;
+diff --git a/linc2/src/linc-private.h b/linc2/src/linc-private.h
+index 03c77e9..e1c7d48 100644
+--- a/linc2/src/linc-private.h
++++ b/linc2/src/linc-private.h
+@@ -96,6 +96,9 @@ struct _LinkConnectionPrivate {
+ guint64 total_read_bytes;
+ guint64 total_written_bytes;
+ #endif
++#ifdef HAVE_GLIB_2_32
++ GMutex timeout_mutex;
++#endif
+ };
+
+ typedef struct {
+diff --git a/linc2/src/linc-protocols.c b/linc2/src/linc-protocols.c
+index e6895f4..22a77aa 100644
+--- a/linc2/src/linc-protocols.c
++++ b/linc2/src/linc-protocols.c
+@@ -383,6 +383,7 @@ link_protocol_is_local_ipv46 (const LinkProtocolInfo *proto,
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_CANONNAME;
++ hints.ai_family = proto->family;
+
+ if (getaddrinfo(link_get_local_hostname(), NULL, &hints, &local_addr) != 0) {
+ if (!warned++)
+diff --git a/linc2/src/linc.c b/linc2/src/linc.c
+index 917e036..f231d3a 100644
+--- a/linc2/src/linc.c
++++ b/linc2/src/linc.c
+@@ -41,6 +41,12 @@ static GCond *link_main_cond;
+ static GMutex *link_cmd_queue_lock = NULL;
+ static GCond *link_cmd_queue_cond = NULL;
+ static GList *link_cmd_queue = NULL;
++#ifdef HAVE_GLIB_2_32
++static GMutex link_main_lock_body;
++static GCond link_main_cond_body;
++static GMutex link_cmd_queue_lock_body;
++static GCond link_cmd_queue_cond_body;
++#endif
+
+ static int link_wakeup_fds[2] = { -1, -1 };
+ #define LINK_WAKEUP_POLL link_wakeup_fds [0]
+@@ -195,14 +201,14 @@ link_init (gboolean thread_safe)
+ d_printf ("stderr redirected here\n");
+ }
+ #endif
+-
++#ifndef HAVE_GLIB_2_32
+ if (thread_safe && !g_thread_supported ())
+ g_thread_init (NULL);
+-
++#endif
+ link_is_thread_safe = (thread_safe && g_thread_supported());
+-
++#ifndef HAVE_GLIB_2_36
+ g_type_init ();
+-
++#endif
+ #ifdef SIGPIPE
+ /*
+ * Link's raison d'etre is for ORBit2 and Bonobo
+@@ -255,13 +261,26 @@ link_init (gboolean thread_safe)
+ link_ssl_method = SSLv23_method ();
+ link_ssl_ctx = SSL_CTX_new (link_ssl_method);
+ #endif
+-
++#ifndef HAVE_GLIB_2_32
+ link_main_lock = link_mutex_new ();
+ link_cmd_queue_lock = link_mutex_new ();
++
+ if (link_is_thread_safe) {
+ link_main_cond = g_cond_new ();
+ link_cmd_queue_cond = g_cond_new ();
+ }
++#else
++ g_mutex_init (&link_main_lock_body);
++ g_mutex_init (&link_cmd_queue_lock_body);
++ link_main_lock = &link_main_lock_body;
++ link_cmd_queue_lock = &link_cmd_queue_lock_body;
++ if (link_is_thread_safe) {
++ g_cond_init (&link_main_cond_body);
++ g_cond_init (&link_cmd_queue_cond_body);
++ link_main_cond = &link_main_cond_body;
++ link_cmd_queue_cond = &link_cmd_queue_cond_body;
++ }
++#endif
+
+ #ifdef HAVE_WINSOCK2_H
+ {
+@@ -309,7 +328,7 @@ link_main_loop_run (void)
+ {
+ g_main_loop_run (link_loop);
+ }
+-
++#ifndef HAVE_GLIB_2_32
+ /**
+ * link_mutex_new:
+ *
+@@ -317,7 +336,7 @@ link_main_loop_run (void)
+ *
+ * Return value: a new GMutex, or NULL if one is not required.
+ **/
+-GMutex *
++
+ link_mutex_new (void)
+ {
+ if (link_is_thread_safe)
+@@ -325,6 +344,7 @@ link_mutex_new (void)
+ else
+ return NULL;
+ }
++#endif
+
+ gboolean
+ link_in_io_thread (void)
+@@ -458,11 +478,13 @@ link_exec_set_io_thread (gpointer data, gboolean immediate)
+ (link_thread_context, LINK_WAKEUP_POLL,
+ NULL, (G_IO_IN | G_IO_PRI),
+ link_mainloop_handle_input, NULL);
+-
++#ifndef HAVE_GLIB_2_32
+ link_io_thread = g_thread_create_full
+ (link_io_thread_fn, NULL, 256 * 1024, TRUE, FALSE,
+ G_THREAD_PRIORITY_NORMAL, &error);
+-
++#else
++ link_io_thread = g_thread_new ("link-thread", link_io_thread_fn, NULL);
++#endif
+ if (!link_io_thread || error)
+ g_error ("Failed to create linc worker thread");
+
+diff --git a/linc2/test/Makefile.am b/linc2/test/Makefile.am
+index 1979b9a..c6532fe 100644
+--- a/linc2/test/Makefile.am
++++ b/linc2/test/Makefile.am
+@@ -2,7 +2,7 @@ noinst_PROGRAMS = test-linc
+
+ # -I$(top_srcdir)/include
+ # -I$(top_builddir)/include
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I$(top_srcdir)/linc2/include \
+ -I$(top_builddir)/linc2/include \
+ -I$(top_srcdir)/linc2/src \
+diff --git a/src/idl-compiler/Makefile.am b/src/idl-compiler/Makefile.am
+index b45cae2..44b600b 100644
+--- a/src/idl-compiler/Makefile.am
++++ b/src/idl-compiler/Makefile.am
+@@ -2,7 +2,7 @@ bin_PROGRAMS = orbit-idl-2
+
+ orbit_backends_dir = $(libdir)/orbit-2.0/idl-backends
+
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I$(top_builddir) \
+ -I$(top_builddir)/include \
+ -I$(top_srcdir) \
+diff --git a/src/orb/GIOP/Makefile.am b/src/orb/GIOP/Makefile.am
+index 189f9f8..08b3be3 100644
+--- a/src/orb/GIOP/Makefile.am
++++ b/src/orb/GIOP/Makefile.am
+@@ -1,4 +1,4 @@
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
+ -DORBIT2_INTERNAL_API \
+diff --git a/src/orb/GIOP/giop-recv-buffer.c b/src/orb/GIOP/giop-recv-buffer.c
+index 15b6ab6..cbe50a5 100644
+--- a/src/orb/GIOP/giop-recv-buffer.c
++++ b/src/orb/GIOP/giop-recv-buffer.c
+@@ -31,7 +31,9 @@ void (*giop_debug_hook_incoming_mangler) (GIOPRecvBuffer *buf) = NULL;
+ /* A list of GIOPMessageQueueEntrys */
+ static GList *giop_queued_messages = NULL;
+ static GMutex *giop_queued_messages_lock = NULL;
+-
++#ifdef HAVE_GLIB_2_32
++static GMutex giop_qm_lock_body;
++#endif
+ /* Don't do this genericaly, union's suck genericaly */
+ static gboolean
+ giop_GIOP_TargetAddress_demarshal (GIOPRecvBuffer *buf,
+@@ -813,7 +815,12 @@ giop_recv_buffer_get_opname (GIOPRecvBuffer *buf)
+ void
+ giop_recv_buffer_init (void)
+ {
++#ifdef HAVE_GLIB_2_32
++ giop_queued_messages_lock = &giop_qm_lock_body;
++ g_mutex_init (giop_queued_messages_lock);
++#else
+ giop_queued_messages_lock = link_mutex_new ();
++#endif
+ }
+
+ static void
+@@ -1413,10 +1420,11 @@ giop_timeout_add (GIOPConnection *cnx)
+ goto out;
+
+ giop_connection_ref (cnx); // to be unref'ed by the one who removes the timeout source
+-
+ if (!lcnx->timeout_mutex)
++#ifndef HAVE_GLIB_2_32
+ lcnx->timeout_mutex = g_mutex_new ();
+-
++ //Otherwise handled by the LinkConnection constructor.
++#endif
+ g_mutex_lock (lcnx->timeout_mutex);
+ lcnx->timeout_status = LINK_TIMEOUT_UNKNOWN;
+ g_mutex_unlock (lcnx->timeout_mutex);
+diff --git a/src/orb/GIOP/giop-send-buffer.c b/src/orb/GIOP/giop-send-buffer.c
+index 64876f8..9ef76a5 100644
+--- a/src/orb/GIOP/giop-send-buffer.c
++++ b/src/orb/GIOP/giop-send-buffer.c
+@@ -14,7 +14,9 @@
+ static gboolean giop_blank_wire_data = FALSE;
+ static GSList *send_buffer_list = NULL;
+ static GMutex *send_buffer_list_lock = NULL;
+-
++#ifdef HAVE_GLIB_2_32
++static GMutex send_bl_lock_body;
++#endif
+ static const char giop_zero_buf [GIOP_CHUNK_ALIGN * 10] = {0};
+
+ void
+@@ -25,7 +27,12 @@ giop_send_buffer_init (gboolean wipe)
+ #else
+ giop_blank_wire_data = wipe;
+ #endif
++#ifdef HAVE_GLIB_2_32
++ send_buffer_list_lock = &send_bl_lock_body;
++ g_mutex_init (send_buffer_list_lock);
++#else
+ send_buffer_list_lock = link_mutex_new ();
++#endif
+ }
+
+ /* Marshal it at compile time so we don't have to do it over and over. This just stores codeset info to say
that
+diff --git a/src/orb/GIOP/giop.c b/src/orb/GIOP/giop.c
+index f287733..ac54c92 100644
+--- a/src/orb/GIOP/giop.c
++++ b/src/orb/GIOP/giop.c
+@@ -21,12 +21,16 @@
+ static int corba_wakeup_fds[2];
+ #define WAKEUP_POLL corba_wakeup_fds [0]
+ #define WAKEUP_WRITE corba_wakeup_fds [1]
++static GMainContext *giop_main_context = NULL;
+ static GSource *giop_main_source = NULL;
+ static GIOPThread *giop_main_thread = NULL;
+
+ /* Incoming dispatch thread pool */
+ static GThreadPool *giop_thread_pool = NULL;
+ static GMutex *giop_pool_hash_lock = NULL;
++#ifdef HAVE_GLIB_2_32
++static GMutex giop_pool_hash_lock_body;
++#endif
+ static GHashTable *giop_pool_hash = NULL;
+
+ const char giop_version_ids [GIOP_NUM_VERSIONS][2] = {
+@@ -302,8 +306,15 @@ giop_thread_new (GMainContext *context)
+ {
+ GIOPThread *tdata = g_new0 (GIOPThread, 1);
+
++#ifndef HAVE_GLIB_2_32
+ tdata->lock = g_mutex_new ();
+ tdata->incoming = g_cond_new ();
++#else
++ tdata->lock = &(tdata->lock_body);
++ tdata->incoming = &(tdata->incoming_body);
++ g_mutex_init (tdata->lock);
++ g_cond_init (tdata->incoming);
++#endif
+ tdata->wake_context = context;
+ tdata->keys = NULL;
+ tdata->async_ents = NULL;
+@@ -351,10 +362,17 @@ giop_thread_free (GIOPThread *tdata)
+
+ g_list_free (tdata->keys);
+ tdata->keys = NULL;
+-
++#ifndef HAVE_GLIB_2_32
+ g_mutex_free (tdata->lock);
++#else
++ g_mutex_clear (tdata->lock);
++#endif
+ tdata->lock = NULL;
++#ifndef HAVE_GLIB_2_32
+ g_cond_free (tdata->incoming);
++#else
++ g_cond_clear (tdata->incoming);
++#endif
+ tdata->incoming = NULL;
+
+ #ifdef G_ENABLE_DEBUG
+@@ -530,19 +548,26 @@ ORBit_get_safe_tmp (void)
+ }
+
+ void
++giop_set_main_context (GMainContext *context)
++{
++ giop_main_context = context;
++}
++
++void
+ giop_init (gboolean thread_safe, gboolean blank_wire_data)
+ {
+ link_init (thread_safe);
+
+ if (giop_thread_safe ()) {
+ GIOPThread *tdata;
++ if (!giop_main_context)
++ giop_main_context = g_main_context_default();
+
+ /* We need a destructor to clean up if giopthreads are used
+ * outside of ORBit controlled threads */
+ giop_tdata_private = g_private_new ((GDestroyNotify)giop_thread_free);
+
+- giop_main_thread = tdata = giop_thread_new (
+- g_main_context_default ()); /* main thread */
++ giop_main_thread = tdata = giop_thread_new (giop_main_context); /* main thread */
+
+ if (link_pipe (corba_wakeup_fds) < 0) /* cf. g_main_context_init_pipe */
+ g_error ("Can't create CORBA main-thread wakeup pipe");
+@@ -556,7 +581,7 @@ giop_init (gboolean thread_safe, gboolean blank_wire_data)
+ fcntl (WAKEUP_WRITE, F_SETFL, O_NONBLOCK);
+ #endif
+ giop_main_source = link_source_create_watch (
+- g_main_context_default (), WAKEUP_POLL,
++ giop_main_context, WAKEUP_POLL,
+ NULL, (G_IO_IN | G_IO_PRI),
+ giop_mainloop_handle_input, NULL);
+
+@@ -565,7 +590,12 @@ giop_init (gboolean thread_safe, gboolean blank_wire_data)
+ /* Setup thread pool for incoming requests */
+ giop_thread_pool = g_thread_pool_new
+ (giop_request_handler_thread, NULL, -1, FALSE, NULL);
++#ifdef HAVE_GLIB_2_32
++ giop_pool_hash_lock = &giop_pool_hash_lock_body;
++ g_mutex_init (giop_pool_hash_lock);
++#else
+ giop_pool_hash_lock = link_mutex_new ();
++#endif
+ giop_pool_hash = g_hash_table_new (NULL, NULL);
+ }
+
+diff --git a/src/orb/Makefile.am b/src/orb/Makefile.am
+index 2b443ba..f82227e 100644
+--- a/src/orb/Makefile.am
++++ b/src/orb/Makefile.am
+@@ -2,7 +2,7 @@ SUBDIRS=include orb-core util GIOP poa dynamic
+
+ lib_LTLIBRARIES=libORBit-2.la
+
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I. \
+ -I$(srcdir) \
+ -I$(top_srcdir)/include \
+diff --git a/src/orb/dynamic/Makefile.am b/src/orb/dynamic/Makefile.am
+index 330bf53..11e5785 100644
+--- a/src/orb/dynamic/Makefile.am
++++ b/src/orb/dynamic/Makefile.am
+@@ -5,7 +5,7 @@ liborb_dynamic_la_SOURCES= \
+ $(DYNAMIC_IDLOUT) \
+ dynany.c
+
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/orb \
+ -I$(top_builddir)/include \
+diff --git a/src/orb/orb-core/Makefile.am b/src/orb/orb-core/Makefile.am
+index 7cbed96..43b54ac 100644
+--- a/src/orb/orb-core/Makefile.am
++++ b/src/orb/orb-core/Makefile.am
+@@ -2,7 +2,7 @@ noinst_LTLIBRARIES=liborb-core.la
+
+ TYPELIB_DIR=$(libdir)/orbit-2.0
+
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I. \
+ -I$(srcdir) \
+ -I$(top_builddir)/include \
+diff --git a/src/orb/orb-core/corba-object.c b/src/orb/orb-core/corba-object.c
+index 28900e1..7c23684 100644
+--- a/src/orb/orb-core/corba-object.c
++++ b/src/orb/orb-core/corba-object.c
+@@ -9,6 +9,9 @@
+ #include "../util/orbit-purify.h"
+
+ static GMutex *object_lock = NULL;
++#ifdef HAVE_GLIB_2_32
++static GMutex object_lock_body;
++#endif
+
+ #define OBJECT_LOCK(obj) LINK_MUTEX_LOCK (object_lock)
+ #define OBJECT_UNLOCK(obj) LINK_MUTEX_UNLOCK (object_lock)
+@@ -998,5 +1001,10 @@ CORBA_Object__iinterface = {
+ void
+ _ORBit_object_init (void)
+ {
++#ifdef HAVE_GLIB_2_32
++ object_lock = &object_lock_body;
++ g_mutex_init (object_lock);
++#else
+ object_lock = link_mutex_new();
++#endif
+ }
+diff --git a/src/orb/orb-core/corba-orb.c b/src/orb/orb-core/corba-orb.c
+index 908535d..34c21b5 100644
+--- a/src/orb/orb-core/corba-orb.c
++++ b/src/orb/orb-core/corba-orb.c
+@@ -236,11 +236,18 @@ CORBA_ORB_release_fn (ORBit_RootObject robj)
+ }
+
+ GMutex *ORBit_RootObject_lifecycle_lock = NULL;
+-
++#ifdef HAVE_GLIB_2_32
++static GMutex ORBit_RO_lifecycle_lock_body;
++#endif
+ static void
+ ORBit_locks_initialize (void)
+ {
++#ifdef HAVE_GLIB_2_32
++ ORBit_RootObject_lifecycle_lock = &ORBit_RO_lifecycle_lock_body;
++ g_mutex_init (ORBit_RootObject_lifecycle_lock);
++#else
+ ORBit_RootObject_lifecycle_lock = link_mutex_new ();
++#endif
+ }
+
+ #ifdef G_ENABLE_DEBUG
+@@ -438,7 +445,12 @@ CORBA_ORB_init (int *argc, char **argv,
+ ORBit_RootObject_init (&retval->root_object, &orb_if);
+ /* released by CORBA_ORB_destroy */
+ _ORBit_orb = ORBit_RootObject_duplicate (retval);
++#ifdef HAVE_GLIB_2_32
++ _ORBit_orb->lock = &(_ORBit_orb->lock_body);
++ g_mutex_init (_ORBit_orb->lock);
++#else
+ _ORBit_orb->lock = link_mutex_new ();
++#endif
+ #ifndef G_OS_WIN32
+ /* atexit(), which g_atexit() is just a #define for on Win32,
+ * often causes breakage when invoked from DLLs. It causes the
+@@ -1328,7 +1340,11 @@ CORBA_ORB_destroy (CORBA_ORB orb,
+ orb->life_flags |= ORBit_LifeF_Destroyed;
+
+ if (orb->lock) {
++#ifndef HAVE_GLIB_2_32
+ g_mutex_free (orb->lock);
++#else
++ g_mutex_clear (orb->lock);
++#endif
+ orb->lock = NULL;
+ }
+
+@@ -1442,6 +1458,12 @@ ORBit_get_giop_recv_limit (void)
+ return giop_recv_get_limit ();
+ }
+
++void
++ORBit_set_giop_main_context (GMainContext *context)
++{
++ giop_set_main_context (context);
++}
++
+ const ORBit_option orbit_supported_options[] = {
+ { "ORBid", ORBIT_OPTION_STRING, NULL }, /* FIXME: unimplemented */
+ { "ORBImplRepoIOR", ORBIT_OPTION_STRING, NULL }, /* FIXME: unimplemented */
+diff --git a/src/orb/poa/Makefile.am b/src/orb/poa/Makefile.am
+index c42ae31..f47069c 100644
+--- a/src/orb/poa/Makefile.am
++++ b/src/orb/poa/Makefile.am
+@@ -2,7 +2,7 @@ noinst_LTLIBRARIES=liborb-poa.la
+
+ IDL = $(top_builddir)/src/idl-compiler/orbit-idl-2
+
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
+ -I$(top_builddir)/src/orb/orb-core \
+diff --git a/src/orb/poa/poa.c b/src/orb/poa/poa.c
+index 6cec95f..0668c36 100644
+--- a/src/orb/poa/poa.c
++++ b/src/orb/poa/poa.c
+@@ -20,6 +20,9 @@
+ #include "poa-macros.h"
+ #include "poa-private.h"
+ #include "orbit-poa.h"
++#ifdef HAVE_GLIB_2_32
++static GMutex _ORBit_poa_manager_lock_body;
++#endif
+
+ #ifdef DEBUG_LOCKS
+ # define LOCK_DEBUG(a) g_printerr("%p: %6s file %s: line %d (%s)\n", \
+@@ -41,7 +44,9 @@
+ static GMutex *ORBit_class_assignment_lock = NULL;
+ static GHashTable *ORBit_class_assignments = NULL;
+ static guint ORBit_class_assignment_counter = 0;
+-
++#ifdef HAVE_GLIB_2_32
++static GMutex ORBit_class_assignment_lock_body;
++#endif
+ static PortableServer_Servant ORBit_POA_ServantManager_use_servant(
+ PortableServer_POA poa,
+ ORBit_POAObject pobj,
+@@ -651,8 +656,11 @@ ORBit_POA_free_fn (ORBit_RootObject obj)
+ g_free (poa->name);
+
+ if (poa->base.lock)
++#ifndef HAVE_GLIB_2_32
+ g_mutex_free (poa->base.lock);
+-
++#else
++ g_mutex_clear (poa->base.lock);
++#endif
+ ORBit_RootObject_release_T (poa->orb);
+ ORBit_RootObject_release_T (poa->poa_manager);
+
+@@ -823,8 +831,12 @@ ORBit_POA_new (CORBA_ORB orb,
+ (GHashFunc) ORBit_sequence_CORBA_octet_hash,
+ (GEqualFunc) ORBit_sequence_CORBA_octet_equal);
+
++#ifdef HAVE_GLIB_2_32
++ poa->base.lock = &(poa->base.lock_body);
++ g_mutex_init (poa->base.lock);
++#else
+ poa->base.lock = link_mutex_new ();
+-
++#endif
+ ORBit_POAManager_register_poa (manager, poa);
+
+ return ORBit_RootObject_duplicate (poa);
+@@ -2491,8 +2503,15 @@ PortableServer_POA_id_to_reference (PortableServer_POA poa,
+ void
+ ORBit_poa_init (void)
+ {
++#ifdef HAVE_GLIB_2_32
++ ORBit_class_assignment_lock = &ORBit_class_assignment_lock_body;
++ g_mutex_init (ORBit_class_assignment_lock);
++ _ORBit_poa_manager_lock = &_ORBit_poa_manager_lock_body;
++ g_mutex_init (_ORBit_poa_manager_lock);
++#else
+ ORBit_class_assignment_lock = link_mutex_new ();
+ _ORBit_poa_manager_lock = link_mutex_new ();
++#endif
+ giop_thread_set_main_handler (ORBit_POAObject_invoke_incoming_request);
+ }
+
+diff --git a/src/orb/util/Makefile.am b/src/orb/util/Makefile.am
+index b391cd7..412be1f 100644
+--- a/src/orb/util/Makefile.am
++++ b/src/orb/util/Makefile.am
+@@ -1,6 +1,6 @@
+ noinst_LTLIBRARIES=liborb-util.la
+
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
+ -DORBIT_SYSTEM_RCFILE=\"$(sysconfdir)/orbitrc\" \
+diff --git a/src/orb/util/genrand.c b/src/orb/util/genrand.c
+index 7fd1bec..9c25edf 100644
+--- a/src/orb/util/genrand.c
++++ b/src/orb/util/genrand.c
+@@ -41,6 +41,9 @@ static int genuid_uid = 0;
+
+ /* This is quite possibly a complete waste of cycles */
+ static GMutex *inc_lock = NULL;
++#ifdef HAVE_GLIB_2_32
++static GMutex inc_lock_body;
++#endif
+ #define INC_LOCK() LINK_MUTEX_LOCK (inc_lock)
+ #define INC_UNLOCK() LINK_MUTEX_UNLOCK (inc_lock)
+
+@@ -62,8 +65,12 @@ ORBit_genuid_init (ORBitGenUidType type)
+ #ifndef G_OS_WIN32
+ genuid_uid = getuid ();
+ #endif
++#ifdef HAVE_GLIB_2_32
++ inc_lock = &inc_lock_body;
++ g_mutex_init (inc_lock);
++#else
+ inc_lock = link_mutex_new();
+-
++#endif
+ glib_prng = g_rand_new ();
+ g_get_current_time (&time);
+ g_rand_set_seed (glib_prng, (time.tv_sec << 20) ^ time.tv_usec);
+@@ -118,7 +125,11 @@ ORBit_genuid_fini (void)
+ }
+
+ if (inc_lock) {
++#ifndef HAVE_GLIB_2_32
+ g_mutex_free (inc_lock);
++#else
++ g_mutex_clear (inc_lock);
++#endif
+ inc_lock = NULL;
+ }
+ }
+diff --git a/src/services/imodule/Makefile.am b/src/services/imodule/Makefile.am
+index e0731a4..f63c920 100644
+--- a/src/services/imodule/Makefile.am
++++ b/src/services/imodule/Makefile.am
+@@ -2,7 +2,7 @@ NULL =
+
+ lib_LTLIBRARIES = libORBit-imodule-2.la
+
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
+ -DORBIT2_INTERNAL_API \
+diff --git a/src/services/name/Makefile.am b/src/services/name/Makefile.am
+index 7212557..deda1ed 100644
+--- a/src/services/name/Makefile.am
++++ b/src/services/name/Makefile.am
+@@ -26,7 +26,7 @@ libORBitCosNaming_2_la_LDFLAGS = \
+ $(ORBIT_NAME_LIBS) \
+ $(top_builddir)/src/orb/libORBit-2.la
+
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I. \
+ -I$(top_builddir)/include \
+ -I$(top_srcdir)/include \
+diff --git a/test/Makefile.am b/test/Makefile.am
+index a48d38e..87f35af 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -1,6 +1,6 @@
+ SUBDIRS = everything inhibit poa
+
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/orb \
+ -I$(top_builddir)/include \
+diff --git a/test/everything/Makefile.am b/test/everything/Makefile.am
+index 32beb36..cb4b1d6 100644
+--- a/test/everything/Makefile.am
++++ b/test/everything/Makefile.am
+@@ -10,7 +10,7 @@ EVERYTHING_IDLOUT = \
+ $(EVERYTHING_BUILT) \
+ everything-imodule.c
+
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
+ -I$(top_builddir)/src \
+@@ -78,7 +78,7 @@ include $(top_srcdir)/Makefile.shared
+ BUILT_SOURCES = ${EVERYTHING_BUILT} everything-imodule.c
+ CLEANFILES = ${BUILT_SOURCES} iorfile
+
+-TESTS = $(srcdir)/test.sh
++TESTS = $(top_builddir)/test/everything/test.sh
+
+ EXTRA_DIST = $(IDL_FILES) test.sh $(included_src)
+
+diff --git a/test/everything/client.c b/test/everything/client.c
+index afa6a9b..b5c5597 100644
+--- a/test/everything/client.c
++++ b/test/everything/client.c
+@@ -2502,13 +2502,19 @@ run_threaded_tests (test_TestFactory factory,
+ fprintf (stderr, "Testing with %d threads\n", NUM_THREADS);
+
+ threads = g_new0 (GThread *, NUM_THREADS);
+-
++#ifndef HAVE_GLIB_2_32
+ for (i = 0; i < NUM_THREADS; i++) {
+ threads [i] = g_thread_create
+ ( test_thread, factory, TRUE, &error);
+ g_assert (!error);
+ }
+-
++#else
++ for (i = 0; i < NUM_THREADS; i++) {
++ gchar *thread_name = g_strdup_printf ("thread_%d", i);
++ threads [i] = g_thread_new ( thread_name, test_thread, NULL);
++ g_free (thread_name);
++ }
++#endif
+ for (i = 0; i < NUM_THREADS; i++) {
+ if (!(g_thread_join (threads [i]) == factory))
+ g_error ("Wierd thread join problem '%d'", i);
+@@ -2555,9 +2561,9 @@ main (int argc, char *argv [])
+ gboolean gen_imodule = FALSE;
+ char *orb_name;
+ int i;
+-
++#ifndef HAVE_GLIB_2_32
+ g_thread_init (NULL);
+-
++#endif
+ CORBA_exception_init (ev);
+
+ /* FIXME - make this work nicely sometime.
+diff --git a/test/everything/server.c b/test/everything/server.c
+index 5219f54..0f2940c 100644
+--- a/test/everything/server.c
++++ b/test/everything/server.c
+@@ -528,8 +528,9 @@ init_iinterfaces (ORBit_IInterfaces *interfaces,
+
+ free (malloc (8)); /* -lefence */
+
++#ifndef HAVE_GLIB_2_32
+ g_thread_init (NULL);
+-
++#endif
+ CORBA_exception_init(&real_ev);
+
+ for (i = 0; i < argc; i++) {
+diff --git a/test/inhibit/Makefile.am b/test/inhibit/Makefile.am
+index 3974d0d..ef26a21 100644
+--- a/test/inhibit/Makefile.am
++++ b/test/inhibit/Makefile.am
+@@ -1,7 +1,7 @@
+ noinst_PROGRAMS= \
+ test-inhibit
+
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
+ $(WARN_CFLAGS) \
+diff --git a/test/poa/Makefile.am b/test/poa/Makefile.am
+index becfcfa..6cf9c38 100644
+--- a/test/poa/Makefile.am
++++ b/test/poa/Makefile.am
+@@ -1,4 +1,4 @@
+-INCLUDES = \
++AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
+ $(WARN_CFLAGS) \
+diff --git a/test/poa/poatest-basic-shell.c b/test/poa/poatest-basic-shell.c
+index a229fdb..8ec98c8 100644
+--- a/test/poa/poatest-basic-shell.c
++++ b/test/poa/poatest-basic-shell.c
+@@ -36,8 +36,9 @@ main (int argc, char **argv)
+ PortableServer_POAManager poa_mgr;
+ poatest poatest_obj;
+
++#ifndef HAVE_GLIB_2_32
+ g_thread_init (NULL);
+-
++#endif
+ CORBA_exception_init (&ev);
+
+ orb = CORBA_ORB_init (&argc, argv, "", &ev);
+diff --git a/test/test-corbaloc.c b/test/test-corbaloc.c
+index 3cb2c18..95d92a2 100644
+--- a/test/test-corbaloc.c
++++ b/test/test-corbaloc.c
+@@ -186,9 +186,9 @@ int main (int argc, char *argv[]) {
+
+ CORBA_Environment ev;
+ CORBA_ORB orb;
+-
++#ifndef HAVE_GLIB_2_32
+ g_thread_init (NULL);
+-
++#endif
+ CORBA_exception_init(&ev);
+ orb = CORBA_ORB_init(&argc, argv, "orbit-local-orb", &ev);
+
+diff --git a/test/test-dynany.c b/test/test-dynany.c
+index 2e47bcb..b535765 100644
+--- a/test/test-dynany.c
++++ b/test/test-dynany.c
+@@ -571,11 +571,12 @@ main (int argc, char *argv[])
+
+ free (malloc (8));
+
++#ifndef HAVE_GLIB_2_32
+ g_thread_init (NULL);
+-
++#endif
+ CORBA_exception_init (&ev);
+ orb = CORBA_ORB_init (NULL, NULL, "orbit-local-orb", &ev);
+-
++
+ /*
+ * Since the API is entirely macro generated
+ * we only need to test a few cases.
+diff --git a/test/test-giop.c b/test/test-giop.c
+index 84ac07b..f558c2a 100644
+--- a/test/test-giop.c
++++ b/test/test-giop.c
+@@ -330,9 +330,9 @@ main (int argc, char *argv[])
+ {
+ CORBA_ORB orb;
+ CORBA_Environment ev;
+-
++#ifndef HAVE_GLIB_2_32
+ g_thread_init (NULL);
+-
++#endif
+ CORBA_exception_init (&ev);
+
+ orb = CORBA_ORB_init (&argc, argv, "orbit-local-orb", &ev);
+diff --git a/test/test-mem.c b/test/test-mem.c
+index 94d82f4..f7e21da 100644
+--- a/test/test-mem.c
++++ b/test/test-mem.c
+@@ -236,9 +236,9 @@ main_func(int argc, char *argv[]) {
+ PortableServer_POAManager_activate(poa_manager, ev);
+ g_assert (!ORBIT_EX (ev));
+
+- LEAK_DETECT_WITH_TOLERANCE (1000, test_ORBit_alloc (), 50);
+- LEAK_DETECT_WITH_TOLERANCE (1000, test_ORBit_sequence (), 50);
+- LEAK_DETECT_WITH_TOLERANCE (1000, test_activate_deactivate (poa, ev), 50);
++ LEAK_DETECT_WITH_TOLERANCE (1000, test_ORBit_alloc (), 200);
++ LEAK_DETECT_WITH_TOLERANCE (1000, test_ORBit_sequence (), 200);
++ LEAK_DETECT_WITH_TOLERANCE (1000, test_activate_deactivate (poa, ev), 200);
+
+ /* tear down the ORB */
+ CORBA_Object_release ((CORBA_Object) poa_manager, ev);
+@@ -258,7 +258,9 @@ int
+ main(int argc, char *argv[]) {
+ /* ORBit2-2.7.6 leaks on shutdown with about 700KB */
+ /* LEAK_DETECT_WITH_TOLERANCE (1, main_func (argc,argv), 20); */
++#ifndef HAVE_GLIB_2_32
+ g_thread_init (NULL);
++#endif
+ main_func (argc, argv);
+ exit (0);
+ }
+diff --git a/test/test-performance.c b/test/test-performance.c
+index d4c446f..e94058f 100644
+--- a/test/test-performance.c
++++ b/test/test-performance.c
+@@ -175,7 +175,9 @@ main (int argc, char *argv[])
+
+ free (malloc (8));
+
++#ifndef HAVE_GLIB_2_32
+ g_thread_init (NULL);
++#endif
+
+ CORBA_exception_init (&ev);
+
+diff --git a/test/timeout-client.c b/test/timeout-client.c
+index 910f57c..0e73a4e 100644
+--- a/test/timeout-client.c
++++ b/test/timeout-client.c
+@@ -154,7 +154,9 @@ main (int argc, char *argv[])
+ CORBA_ORB orb;
+ int retv = EXIT_FAILURE;
+
++#ifndef HAVE_GLIB_2_32
+ g_thread_init (NULL);
++#endif
+
+ CORBA_exception_init (&ev);
+
+diff --git a/test/timeout-server.c b/test/timeout-server.c
+index d6386da..e2f10a6 100644
+--- a/test/timeout-server.c
++++ b/test/timeout-server.c
+@@ -92,8 +92,9 @@ main (int argc, char *argv[])
+ signal(SIGINT, exit);
+ signal(SIGTERM, exit);
+
++#ifndef HAVE_GLIB_2_32
+ g_thread_init (NULL);
+-
++#endif
+ CORBA_exception_init (&ev);
+
+ /* create IPv4 orb */
+--
+1.8.3.rc0
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]