1 $NetBSD: patch-aa,v 1.49 2010/05/31 17:30:36 drochner Exp $
3 --- configure.orig 2010-05-03 00:59:28.000000000 +0000
5 @@ -807,6 +807,7 @@ GIO
9 +G_MODULE_BROKEN_DLOPEN_NULL
10 G_MODULE_BROKEN_RTLD_GLOBAL
13 @@ -22220,8 +22221,8 @@ else
17 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether using Sun Studio C compiler" >&5
18 -$as_echo_n "checking whether using Sun Studio C compiler... " >&6; }
19 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether using Sun Studio C compiler visibilily" >&5
20 +$as_echo_n "checking whether using Sun Studio C compiler visibilily... " >&6; }
21 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23 #if defined(__SUNPRO_C) || (__SUNPRO_C >= 0x550)
24 @@ -23455,16 +23456,48 @@ fi
28 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether using Sun Studio C compiler with C99" >&5
29 +$as_echo_n "checking whether using Sun Studio C compiler with C99... " >&6; }
30 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31 +/* end confdefs.h. */
32 +#if defined(__STDC_VERSION__) || (__STDC_VERSION__ - 0 >= 199901L)
34 +# include "error: this is STD C99."
45 +if ac_fn_c_try_compile "$LINENO"; then :
46 + g_have_sunstudio_c99=yes
48 + g_have_sunstudio_c99=no
50 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $g_have_sunstudio_c99" >&5
52 +$as_echo "$g_have_sunstudio_c99" >&6; }
53 + if test $g_have_sunstudio_c99 = yes; then
55 +$as_echo "#define _XOPEN_SOURCE 600" >>confdefs.h
59 $as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h
62 $as_echo "#define _XOPEN_SOURCE 2" >>confdefs.h
67 $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
73 if test "$ac_cv_func_statfs" = yes ; then
74 @@ -24470,10 +24503,11 @@ if test x"$glib_native_win32" = xyes; th
78 - G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
79 + G_MODULE_LDFLAGS=`(libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
81 G_MODULE_NEED_USCORE=0
82 G_MODULE_BROKEN_RTLD_GLOBAL=0
83 +G_MODULE_BROKEN_DLOPEN_NULL=0
84 G_MODULE_HAVE_DLERROR=0
85 if test -z "$G_MODULE_IMPL"; then
87 @@ -24680,7 +24714,7 @@ if test "$G_MODULE_IMPL" = "G_MODULE_IMP
88 LIBS="$G_MODULE_LIBS $LIBS"
89 LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
90 echo "void glib_plugin_test(void) { }" > plugin.c
91 - ${SHELL} ./libtool --mode=compile ${CC} -shared \
92 + ${SHELL} libtool --mode=compile ${CC} -shared \
93 -export-dynamic -o plugin.o plugin.c 2>&1 >/dev/null
94 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RTLD_GLOBAL brokenness" >&5
95 $as_echo_n "checking for RTLD_GLOBAL brokenness... " >&6; }
96 @@ -24790,6 +24824,56 @@ fi
100 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen(NULL, 0) brokenness" >&5
101 +$as_echo_n "checking for dlopen(NULL, 0) brokenness... " >&6; }
102 +if test "${glib_cv_dlopennull_broken+set}" = set; then :
103 + $as_echo_n "(cached) " >&6
106 + if test "$cross_compiling" = yes; then :
107 + glib_cv_dlopennull_broken=no
109 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
110 +/* end confdefs.h. */
115 +# define RTLD_GLOBAL 0
118 +# define RTLD_LAZY 0
123 + handle = dlopen ("libm.so", RTLD_GLOBAL | RTLD_LAZY);
124 + if (!handle) return 0;
125 + handle = dlopen (NULL, 0);
126 + if (!handle) return 0;
127 + handle = dlsym (handle, "sin");
128 + return handle == NULL;
132 +if ac_fn_c_try_run "$LINENO"; then :
133 + glib_cv_dlopennull_broken=no
135 + glib_cv_dlopennull_broken=yes
137 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
138 + conftest.$ac_objext conftest.beam conftest.$ac_ext
143 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_dlopennull_broken" >&5
144 +$as_echo "$glib_cv_dlopennull_broken" >&6; }
145 + if test "x$glib_cv_dlopennull_broken" = "xyes"; then
146 + G_MODULE_BROKEN_DLOPEN_NULL=1
148 + G_MODULE_BROKEN_DLOPEN_NULL=0
150 if test -z "$G_MODULE_IMPL"; then
152 G_MODULE_SUPPORTED=false
153 @@ -24800,7 +24884,7 @@ fi
154 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the suffix of module shared libraries" >&5
155 $as_echo_n "checking for the suffix of module shared libraries... " >&6; }
157 -shrext_cmds=`./libtool --config | grep '^shrext_cmds='`
158 +shrext_cmds=`libtool --config | grep '^shrext_cmds='`
160 module=yes eval std_shrext=$shrext_cmds
161 # chop the initial dot
162 @@ -24824,6 +24908,8 @@ fi
168 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gspawn implementation" >&5
169 $as_echo_n "checking for gspawn implementation... " >&6; }
171 @@ -25572,62 +25658,8 @@ if test x"$have_threads" != xno; then
172 G_THREAD_LIBS="-lpthread -lthread"
175 - for flag in pthread pthreads mt; do
176 - glib_save_CFLAGS="$CFLAGS"
177 - CFLAGS="$CFLAGS -$flag"
178 - if test "$cross_compiling" = yes; then :
179 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
180 -/* end confdefs.h. */
182 -#include <pthread.h>
184 -void* func(void* data) {check_me = 42; return &check_me;}
188 - pthread_create (&t, 0, func, 0);
189 - pthread_join (t, &ret);
190 - return (check_me != 42 || ret != &check_me);
193 -if ac_fn_c_try_link "$LINENO"; then :
194 - glib_flag_works=yes
198 -rm -f core conftest.err conftest.$ac_objext \
199 - conftest$ac_exeext conftest.$ac_ext
201 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext
202 -/* end confdefs.h. */
204 -#include <pthread.h>
206 -void* func(void* data) {check_me = 42; return &check_me;}
210 - pthread_create (&t, 0, func, 0);
211 - pthread_join (t, &ret);
212 - return (check_me != 42 || ret != &check_me);
215 -if ac_fn_c_try_run "$LINENO"; then :
216 - glib_flag_works=yes
220 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
221 - conftest.$ac_objext conftest.beam conftest.$ac_ext
224 - CFLAGS="$glib_save_CFLAGS"
225 - if test $glib_flag_works = yes ; then
226 - G_THREAD_CFLAGS=-$flag
227 - G_THREAD_LIBS=-$flag
231 + G_THREAD_LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}"
232 + G_THREAD_CFLAGS="${PTHREAD_CFLAGS}"