- fix configure scripts to detect !G_ATOMIC_LOCK_FREE correctly (use AC_TRY_LINK rather than AC_TRY_COMPILE to see if symbols are defined) - fix prototype mismatches in !G_ATOMIC_LOCK_FREE case (note no binary changes in G_ATOMIC_LOCK_FREE case) "please commit it" from agc@.
286 lines
8.1 KiB
Text
286 lines
8.1 KiB
Text
$NetBSD: patch-aa,v 1.55 2013/06/23 04:26:49 tsutsui Exp $
|
|
|
|
--- configure.orig 2013-06-09 22:53:42.000000000 +0000
|
|
+++ configure
|
|
@@ -724,6 +724,7 @@ GIO
|
|
GSPAWN
|
|
GLIB_DEBUG_FLAGS
|
|
G_MODULE_NEED_USCORE
|
|
+G_MODULE_BROKEN_DLOPEN_NULL
|
|
G_MODULE_BROKEN_RTLD_GLOBAL
|
|
G_MODULE_HAVE_DLERROR
|
|
G_MODULE_LDFLAGS
|
|
@@ -21108,6 +21109,8 @@ else
|
|
# ifdef _MSC_VER
|
|
# include <malloc.h>
|
|
# define alloca _alloca
|
|
+# elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
|
|
+# include <stdlib.h>
|
|
# else
|
|
# ifdef HAVE_ALLOCA_H
|
|
# include <alloca.h>
|
|
@@ -22153,8 +22156,8 @@ else
|
|
fi
|
|
|
|
|
|
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether using Sun Studio C compiler" >&5
|
|
-$as_echo_n "checking whether using Sun Studio C compiler... " >&6; }
|
|
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether using Sun Studio C compiler visibility" >&5
|
|
+$as_echo_n "checking whether using Sun Studio C compiler visibility... " >&6; }
|
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
/* end confdefs.h. */
|
|
#if defined(__SUNPRO_C) || (__SUNPRO_C >= 0x550)
|
|
@@ -23807,16 +23810,48 @@ fi
|
|
|
|
case $host in
|
|
*-*-solaris* )
|
|
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether using Sun Studio C compiler with C99" >&5
|
|
+$as_echo_n "checking whether using Sun Studio C compiler with C99... " >&6; }
|
|
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
+/* end confdefs.h. */
|
|
+#if defined(__STDC_VERSION__) || (__STDC_VERSION__ - 0 >= 199901L)
|
|
+#else
|
|
+# include "error: this is STD C99."
|
|
+#endif
|
|
+
|
|
+int
|
|
+main ()
|
|
+{
|
|
+
|
|
+ ;
|
|
+ return 0;
|
|
+}
|
|
+_ACEOF
|
|
+if ac_fn_c_try_compile "$LINENO"; then :
|
|
+ g_have_sunstudio_c99=yes
|
|
+else
|
|
+ g_have_sunstudio_c99=no
|
|
+fi
|
|
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
|
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $g_have_sunstudio_c99" >&5
|
|
+$as_echo "$g_have_sunstudio_c99" >&6; }
|
|
+ if test $g_have_sunstudio_c99 = yes; then
|
|
+
|
|
+$as_echo "#define _XOPEN_SOURCE 600" >>confdefs.h
|
|
+
|
|
+ else
|
|
|
|
$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h
|
|
|
|
|
|
$as_echo "#define _XOPEN_SOURCE 2" >>confdefs.h
|
|
|
|
+ fi
|
|
+
|
|
|
|
$as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
|
|
|
|
- ;;
|
|
+ ;;
|
|
esac
|
|
|
|
if test "$ac_cv_func_statfs" = yes; then :
|
|
@@ -24829,10 +24864,11 @@ if test x"$glib_native_win32" = xyes; th
|
|
G_MODULE_LDFLAGS=
|
|
else
|
|
export SED
|
|
- G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
|
|
+ G_MODULE_LDFLAGS=`(libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
|
|
fi
|
|
G_MODULE_NEED_USCORE=0
|
|
G_MODULE_BROKEN_RTLD_GLOBAL=0
|
|
+G_MODULE_BROKEN_DLOPEN_NULL=0
|
|
G_MODULE_HAVE_DLERROR=0
|
|
if test -z "$G_MODULE_IMPL"; then
|
|
case "$host" in
|
|
@@ -25050,13 +25086,13 @@ if test "$G_MODULE_IMPL" = "G_MODULE_IM
|
|
LIBS="$G_MODULE_LIBS $LIBS"
|
|
LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
|
|
echo "void glib_plugin_test(void) { }" > plugin.c
|
|
- ${SHELL} ./libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
|
|
+ ${SHELL} libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
|
|
${CPPFLAGS} -c -o plugin.lo plugin.c >/dev/null 2>&1
|
|
- ${SHELL} ./libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
|
|
+ ${SHELL} libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
|
|
${LDFLAGS} -module -o plugin.la -export-dynamic \
|
|
-shrext ".o" -avoid-version plugin.lo \
|
|
-rpath /dont/care >/dev/null 2>&1
|
|
- eval `./libtool --config | grep ^objdir`
|
|
+ eval `libtool --config | grep ^objdir`
|
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RTLD_GLOBAL brokenness" >&5
|
|
$as_echo_n "checking for RTLD_GLOBAL brokenness... " >&6; }
|
|
if ${glib_cv_rtldglobal_broken+:} false; then :
|
|
@@ -25166,6 +25202,56 @@ fi
|
|
LIBS="$LIBS_orig"
|
|
|
|
fi
|
|
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen(NULL, 0) brokenness" >&5
|
|
+$as_echo_n "checking for dlopen(NULL, 0) brokenness... " >&6; }
|
|
+if ${glib_cv_dlopennull_broken+:} false; then :
|
|
+ $as_echo_n "(cached) " >&6
|
|
+else
|
|
+
|
|
+ if test "$cross_compiling" = yes; then :
|
|
+ glib_cv_dlopennull_broken=no
|
|
+else
|
|
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
+/* end confdefs.h. */
|
|
+
|
|
+#include <stdio.h>
|
|
+#include <dlfcn.h>
|
|
+#ifndef RTLD_GLOBAL
|
|
+# define RTLD_GLOBAL 0
|
|
+#endif
|
|
+#ifndef RTLD_LAZY
|
|
+# define RTLD_LAZY 0
|
|
+#endif
|
|
+int gettext;
|
|
+int main () {
|
|
+ void *handle;
|
|
+ handle = dlopen ("libm.so", RTLD_GLOBAL | RTLD_LAZY);
|
|
+ if (!handle) return 0;
|
|
+ handle = dlopen (NULL, 0);
|
|
+ if (!handle) return 0;
|
|
+ handle = dlsym (handle, "sin");
|
|
+ return handle == NULL;
|
|
+}
|
|
+
|
|
+_ACEOF
|
|
+if ac_fn_c_try_run "$LINENO"; then :
|
|
+ glib_cv_dlopennull_broken=no
|
|
+else
|
|
+ glib_cv_dlopennull_broken=yes
|
|
+fi
|
|
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
|
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
|
|
+fi
|
|
+
|
|
+
|
|
+fi
|
|
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_dlopennull_broken" >&5
|
|
+$as_echo "$glib_cv_dlopennull_broken" >&6; }
|
|
+ if test "x$glib_cv_dlopennull_broken" = "xyes"; then
|
|
+ G_MODULE_BROKEN_DLOPEN_NULL=1
|
|
+ else
|
|
+ G_MODULE_BROKEN_DLOPEN_NULL=0
|
|
+ fi
|
|
if test -z "$G_MODULE_IMPL"; then
|
|
G_MODULE_IMPL=0
|
|
G_MODULE_SUPPORTED=false
|
|
@@ -25176,7 +25262,7 @@ fi
|
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the suffix of module shared libraries" >&5
|
|
$as_echo_n "checking for the suffix of module shared libraries... " >&6; }
|
|
export SED
|
|
-shrext_cmds=`./libtool --config | grep '^shrext_cmds='`
|
|
+shrext_cmds=`libtool --config | grep '^shrext_cmds='`
|
|
eval $shrext_cmds
|
|
module=yes eval std_shrext=$shrext_cmds
|
|
# chop the initial dot
|
|
@@ -25200,6 +25286,7 @@ fi
|
|
|
|
|
|
|
|
+
|
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gspawn implementation" >&5
|
|
$as_echo_n "checking for gspawn implementation... " >&6; }
|
|
case "$host" in
|
|
@@ -26177,62 +26264,8 @@ if test x"$have_threads" = xposix; then
|
|
G_THREAD_LIBS="-lpthread -lthread"
|
|
;;
|
|
*)
|
|
- for flag in pthread pthreads mt; do
|
|
- glib_save_CFLAGS="$CFLAGS"
|
|
- CFLAGS="$CFLAGS -$flag"
|
|
- if test "$cross_compiling" = yes; then :
|
|
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
-/* end confdefs.h. */
|
|
-
|
|
-#include <pthread.h>
|
|
-int check_me = 0;
|
|
-void* func(void* data) {check_me = 42; return &check_me;}
|
|
-int main()
|
|
- { pthread_t t;
|
|
- void *ret;
|
|
- pthread_create (&t, 0, func, 0);
|
|
- pthread_join (t, &ret);
|
|
- return (check_me != 42 || ret != &check_me);
|
|
-}
|
|
-_ACEOF
|
|
-if ac_fn_c_try_link "$LINENO"; then :
|
|
- glib_flag_works=yes
|
|
-else
|
|
- glib_flag_works=no
|
|
-fi
|
|
-rm -f core conftest.err conftest.$ac_objext \
|
|
- conftest$ac_exeext conftest.$ac_ext
|
|
-else
|
|
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
-/* end confdefs.h. */
|
|
-
|
|
-#include <pthread.h>
|
|
-int check_me = 0;
|
|
-void* func(void* data) {check_me = 42; return &check_me;}
|
|
-int main()
|
|
- { pthread_t t;
|
|
- void *ret;
|
|
- pthread_create (&t, 0, func, 0);
|
|
- pthread_join (t, &ret);
|
|
- return (check_me != 42 || ret != &check_me);
|
|
-}
|
|
-_ACEOF
|
|
-if ac_fn_c_try_run "$LINENO"; then :
|
|
- glib_flag_works=yes
|
|
-else
|
|
- glib_flag_works=no
|
|
-fi
|
|
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
|
- conftest.$ac_objext conftest.beam conftest.$ac_ext
|
|
-fi
|
|
-
|
|
- CFLAGS="$glib_save_CFLAGS"
|
|
- if test $glib_flag_works = yes ; then
|
|
- G_THREAD_CFLAGS=-$flag
|
|
- G_THREAD_LIBS=-$flag
|
|
- break;
|
|
- fi
|
|
- done
|
|
+ G_THREAD_LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}"
|
|
+ G_THREAD_CFLAGS="${PTHREAD_CFLAGS}"
|
|
;;
|
|
esac
|
|
|
|
@@ -26746,6 +26779,7 @@ case $host in
|
|
;;
|
|
*-*-openbsd*)
|
|
LDFLAGS="$LDFLAGS -pthread"
|
|
+ G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS"
|
|
;;
|
|
*)
|
|
G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS"
|
|
@@ -26844,7 +26878,7 @@ volatile int atomic = 2;\
|
|
return 0;
|
|
}
|
|
_ACEOF
|
|
-if ac_fn_c_try_compile "$LINENO"; then :
|
|
+if ac_fn_c_try_link "$LINENO"; then :
|
|
glib_cv_g_atomic_lock_free=yes
|
|
else
|
|
glib_cv_g_atomic_lock_free=no
|
|
@@ -26865,7 +26899,7 @@ volatile int atomic = 2;\
|
|
return 0;
|
|
}
|
|
_ACEOF
|
|
-if ac_fn_c_try_compile "$LINENO"; then :
|
|
+if ac_fn_c_try_link "$LINENO"; then :
|
|
as_fn_error $? "GLib must be build with -march=i486 or later." "$LINENO" 5
|
|
fi
|
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
|
@@ -26896,7 +26930,7 @@ __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;
|
|
return 0;
|
|
}
|
|
_ACEOF
|
|
-if ac_fn_c_try_compile "$LINENO"; then :
|
|
+if ac_fn_c_try_link "$LINENO"; then :
|
|
|
|
else
|
|
|