3 --- configure.ac.orig 2011-10-14 04:12:40.000000000 +0000
5 @@ -882,7 +882,7 @@ int main (int argc, char **argv)
6 AC_MSG_RESULT($g_have_gnuc_visibility)
7 AM_CONDITIONAL(HAVE_GNUC_VISIBILITY, [test x$g_have_gnuc_visibility = xyes])
9 -AC_MSG_CHECKING([whether using Sun Studio C compiler])
10 +AC_MSG_CHECKING([whether using Sun Studio C compiler visibilily])
11 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if defined(__SUNPRO_C) || (__SUNPRO_C >= 0x550)
13 # include "error: this is not Sun Studio."
14 @@ -1114,8 +1114,20 @@ AC_SUBST(NETWORK_LIBS)
18 + AC_MSG_CHECKING([whether using Sun Studio C compiler with C99])
19 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if defined(__STDC_VERSION__) || (__STDC_VERSION__ - 0 >= 199901L)
21 +# include "error: this is STD C99."
23 + ]], [[]])], [ g_have_sunstudio_c99=yes ], [ g_have_sunstudio_c99=no ])
24 + AC_MSG_RESULT($g_have_sunstudio_c99)
25 + if test $g_have_sunstudio_c99 = yes; then
26 + AC_DEFINE(_XOPEN_SOURCE, 600, Needed to get declarations for msg_control and msg_controllen on Solaris)
28 AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
29 AC_DEFINE(_XOPEN_SOURCE, 2, Needed to get declarations for msg_control and msg_controllen on Solaris)
32 AC_DEFINE(__EXTENSIONS__, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
35 @@ -1509,11 +1521,12 @@ if test x"$glib_native_win32" = xyes; th
39 - G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
40 + G_MODULE_LDFLAGS=`(libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
42 dnl G_MODULE_IMPL= don't reset, so cmd-line can override
43 G_MODULE_NEED_USCORE=0
44 G_MODULE_BROKEN_RTLD_GLOBAL=0
45 +G_MODULE_BROKEN_DLOPEN_NULL=0
46 G_MODULE_HAVE_DLERROR=0
47 dnl *** force native WIN32 shared lib loader
48 if test -z "$G_MODULE_IMPL"; then
49 @@ -1574,7 +1587,7 @@ if test "$G_MODULE_IMPL" = "G_MODULE_IMP
50 LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
51 dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness
52 echo "void glib_plugin_test(void) { }" > plugin.c
53 - ${SHELL} ./libtool --mode=compile ${CC} -shared \
54 + ${SHELL} libtool --mode=compile ${CC} -shared \
55 -export-dynamic -o plugin.o plugin.c 2>&1 >/dev/null
56 AC_CACHE_CHECK([for RTLD_GLOBAL brokenness],
57 glib_cv_rtldglobal_broken,[
58 @@ -1638,6 +1651,38 @@ dnl *** check for having dlerror()
59 [G_MODULE_HAVE_DLERROR=0])
62 +dnl *** check for dlopen(NULL, 0) brokenness
63 + AC_CACHE_CHECK([for dlopen(NULL, 0) brokenness],
64 + glib_cv_dlopennull_broken,[
69 +# define RTLD_GLOBAL 0
77 + handle = dlopen ("libm.so", RTLD_GLOBAL | RTLD_LAZY);
78 + if (!handle) return 0;
79 + handle = dlopen (NULL, 0);
80 + if (!handle) return 0;
81 + handle = dlsym (handle, "sin");
82 + return handle == NULL;
85 + [glib_cv_dlopennull_broken=no],
86 + [glib_cv_dlopennull_broken=yes],
87 + [glib_cv_dlopennull_broken=no])
89 + if test "x$glib_cv_dlopennull_broken" = "xyes"; then
90 + G_MODULE_BROKEN_DLOPEN_NULL=1
92 + G_MODULE_BROKEN_DLOPEN_NULL=0
94 dnl *** done, have we got an implementation?
95 if test -z "$G_MODULE_IMPL"; then
97 @@ -1648,7 +1693,7 @@ fi
99 AC_MSG_CHECKING(for the suffix of module shared libraries)
101 -shrext_cmds=`./libtool --config | grep '^shrext_cmds='`
102 +shrext_cmds=`libtool --config | grep '^shrext_cmds='`
104 module=yes eval std_shrext=$shrext_cmds
105 # chop the initial dot
106 @@ -1667,6 +1712,8 @@ AC_SUBST(G_MODULE_PLUGIN_LIBS)
107 AC_SUBST(G_MODULE_LDFLAGS)
108 AC_SUBST(G_MODULE_HAVE_DLERROR)
109 AC_SUBST(G_MODULE_BROKEN_RTLD_GLOBAL)
110 +AC_SUBST(G_MODULE_BROKEN_DLOPEN_NULL)
112 AC_SUBST(G_MODULE_NEED_USCORE)
113 AC_SUBST(GLIB_DEBUG_FLAGS)
115 @@ -2055,22 +2102,8 @@ if test x"$have_threads" != xno; then
116 G_THREAD_LIBS="-lpthread -lthread"
119 - for flag in pthread pthreads mt; do
120 - glib_save_CFLAGS="$CFLAGS"
121 - CFLAGS="$CFLAGS -$flag"
122 - AC_TRY_RUN(glib_thread_test(0),
123 - glib_flag_works=yes,
124 - glib_flag_works=no,
125 - [AC_LINK_IFELSE([AC_LANG_SOURCE(glib_thread_test(0))],
126 - glib_flag_works=yes,
127 - glib_flag_works=no)])
128 - CFLAGS="$glib_save_CFLAGS"
129 - if test $glib_flag_works = yes ; then
130 - G_THREAD_CFLAGS=-$flag
131 - G_THREAD_LIBS=-$flag
135 + G_THREAD_LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}"
136 + G_THREAD_CFLAGS="${PTHREAD_CFLAGS}"
140 @@ -3771,7 +3804,7 @@ AC_ARG_ENABLE(Bsymbolic,
142 LDFLAGS="${SAVED_LDFLAGS}"])
144 -if test "x${enable_Bsymbolic}" == "xyes"; then
145 +if test "x${enable_Bsymbolic}" = "xyes"; then
146 GLIB_LINK_FLAGS=-Wl,-Bsymbolic-functions