$NetBSD: patch-aa,v 1.30 2006/10/08 11:56:18 joerg Exp $ --- configure.orig 2006-10-02 01:05:29.000000000 +0200 +++ configure @@ -465,7 +465,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot GLIB_MAJOR_VERSION GLIB_MINOR_VERSION GLIB_MICRO_VERSION GLIB_VERSION GLIB_INTERFACE_AGE GLIB_BINARY_AGE LT_RELEASE LT_CURRENT LT_REVISION LT_AGE LT_CURRENT_MINUS_AGE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os OS_WIN32_TRUE OS_WIN32_FALSE OS_UNIX_TRUE OS_UNIX_FALSE OS_LINUX_TRUE OS_LINUX_FALSE GLIB_DEF GMODULE_DEF GOBJECT_DEF GTHREAD_DEF TESTGMODULE_EXP WINDRES ac_ct_WINDRES NM ac_ct_NM RANLIB ac_ct_RANLIB ms_librarian MS_LIB_AVAILABLE_TRUE MS_LIB_AVAILABLE_FALSE LIBTOOL_EXPORT_OPTIONS DISABLE_MEM_POOLS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE HAVE_CXX_TRUE HAVE_CXX_FALSE PKG_CONFIG PERL INDENT REBUILD PERL_PATH CPP EGREP GLIBC21 USE_NLS MSGFMT GMSGFMT XGETTEXT CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLLIBS PO_IN_DATADIR_TRUE PO_IN_DATADIR_FALSE POFILES POSUB MKINSTALLDIRS GETTEXT_PACKAGE ICONV_LIBS LN_S ECHO AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ALLOCA HAVE_GNUC_VISIBILITY_TRUE HAVE_GNUC_VISIBILITY_FALSE HAVE_GOOD_PRINTF_TRUE HAVE_GOOD_PRINTF_FALSE G_MODULE_SUPPORTED G_MODULE_IMPL G_MODULE_LIBS G_MODULE_LIBS_EXTRA G_MODULE_PLUGIN_LIBS G_MODULE_LDFLAGS G_MODULE_HAVE_DLERROR G_MODULE_BROKEN_RTLD_GLOBAL G_MODULE_NEED_USCORE GLIB_DEBUG_FLAGS GSPAWN GIO PLATFORMDEP ENABLE_TIMELOOP_TRUE ENABLE_TIMELOOP_FALSE PLATFORM_WIN32_TRUE PLATFORM_WIN32_FALSE GTHREAD_COMPILE_IMPL_DEFINES G_THREAD_CFLAGS G_THREAD_LIBS G_THREAD_LIBS_FOR_GTHREAD G_THREAD_LIBS_EXTRA G_LIBS_EXTRA CROSS_COMPILING_TRUE CROSS_COMPILING_FALSE GLIB_GENMARSHAL HTML_DIR ENABLE_GTK_DOC_TRUE ENABLE_GTK_DOC_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_USE_LIBTOOL_FALSE XSLTPROC XML_CATALOG_FILE XMLCATALOG ENABLE_MAN_TRUE ENABLE_MAN_FALSE LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot GLIB_MAJOR_VERSION GLIB_MINOR_VERSION GLIB_MICRO_VERSION GLIB_VERSION GLIB_INTERFACE_AGE GLIB_BINARY_AGE LT_RELEASE LT_CURRENT LT_REVISION LT_AGE LT_CURRENT_MINUS_AGE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os OS_WIN32_TRUE OS_WIN32_FALSE OS_UNIX_TRUE OS_UNIX_FALSE OS_LINUX_TRUE OS_LINUX_FALSE GLIB_DEF GMODULE_DEF GOBJECT_DEF GTHREAD_DEF TESTGMODULE_EXP WINDRES ac_ct_WINDRES NM ac_ct_NM RANLIB ac_ct_RANLIB ms_librarian MS_LIB_AVAILABLE_TRUE MS_LIB_AVAILABLE_FALSE LIBTOOL_EXPORT_OPTIONS DISABLE_MEM_POOLS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE HAVE_CXX_TRUE HAVE_CXX_FALSE PKG_CONFIG PERL INDENT REBUILD PERL_PATH CPP EGREP GLIBC21 USE_NLS MSGFMT GMSGFMT XGETTEXT CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLLIBS PO_IN_DATADIR_TRUE PO_IN_DATADIR_FALSE POFILES POSUB MKINSTALLDIRS GETTEXT_PACKAGE ICONV_LIBS LN_S ECHO AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ALLOCA HAVE_GNUC_VISIBILITY_TRUE HAVE_GNUC_VISIBILITY_FALSE HAVE_GOOD_PRINTF_TRUE HAVE_GOOD_PRINTF_FALSE G_MODULE_SUPPORTED G_MODULE_IMPL G_MODULE_LIBS G_MODULE_LIBS_EXTRA G_MODULE_PLUGIN_LIBS G_MODULE_LDFLAGS G_MODULE_HAVE_DLERROR G_MODULE_BROKEN_RTLD_GLOBAL G_MODULE_BROKEN_DLOPEN_NULL G_MODULE_NEED_USCORE GLIB_DEBUG_FLAGS GSPAWN GIO PLATFORMDEP ENABLE_TIMELOOP_TRUE ENABLE_TIMELOOP_FALSE PLATFORM_WIN32_TRUE PLATFORM_WIN32_FALSE GTHREAD_COMPILE_IMPL_DEFINES G_THREAD_CFLAGS G_THREAD_LIBS G_THREAD_LIBS_FOR_GTHREAD G_THREAD_LIBS_EXTRA G_LIBS_EXTRA CROSS_COMPILING_TRUE CROSS_COMPILING_FALSE GLIB_GENMARSHAL HTML_DIR ENABLE_GTK_DOC_TRUE ENABLE_GTK_DOC_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_USE_LIBTOOL_FALSE XSLTPROC XML_CATALOG_FILE XMLCATALOG ENABLE_MAN_TRUE ENABLE_MAN_FALSE LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -32564,6 +32564,7 @@ else 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 @@ -33217,6 +33218,72 @@ echo "${ECHO_T}$glib_cv_rtldglobal_broke else G_MODULE_BROKEN_RTLD_GLOBAL=0 fi + echo "$as_me:$LINENO: checking for dlopen(NULL, 0) brokenness" >&5 +echo $ECHO_N "checking for dlopen(NULL, 0) brokenness... $ECHO_C" >&6 +if test "${glib_cv_dlopennull_broken+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "$cross_compiling" = yes; then + glib_cv_dlopennull_broken=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#ifndef RTLD_GLOBAL +# define RTLD_GLOBAL 0 +#endif +#ifndef RTLD_LAZY +# define RTLD_LAZY 0 +#endif +int gettext; +int main () { + void *handle; + handle = dlopen ("libintl.so", RTLD_GLOBAL | RTLD_LAZY); + if (!handle) return 0; + handle = dlopen (NULL, 0); + if (!handle) return 0; + handle = dlsym (handle, "gettext"); + return handle == NULL; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + glib_cv_dlopennull_broken=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +glib_cv_dlopennull_broken=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + rm -f plugin.c plugin.o plugin.lo + +fi +echo "$as_me:$LINENO: result: $glib_cv_dlopennull_broken" >&5 +echo "${ECHO_T}$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 echo "$as_me:$LINENO: checking for preceeding underscore in symbols" >&5 echo $ECHO_N "checking for preceeding underscore in symbols... $ECHO_C" >&6 if test "${glib_cv_uscore+set}" = set; then @@ -33779,102 +33846,8 @@ if test x"$have_threads" != xno; then # skip cygwin and darwin -pthread or -pthreads test ;; *) - for flag in pthread pthreads mt; do - glib_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -$flag" - if test "$cross_compiling" = yes; then - cat >conftest.$ac_ext <<_ACEOF - -#include -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 -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - glib_flag_works=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -glib_flag_works=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -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 -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - glib_flag_works=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -glib_flag_works=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext 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 fi @@ -35880,6 +35853,10 @@ case $host in *) G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS" ;; + *-*-netbsd*) + # On NetBSD, pkgsrc's libtool does the right thing. + G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS" + ;; esac @@ -40154,6 +40131,7 @@ s,@G_MODULE_PLUGIN_LIBS@,$G_MODULE_PLUGI s,@G_MODULE_LDFLAGS@,$G_MODULE_LDFLAGS,;t t s,@G_MODULE_HAVE_DLERROR@,$G_MODULE_HAVE_DLERROR,;t t s,@G_MODULE_BROKEN_RTLD_GLOBAL@,$G_MODULE_BROKEN_RTLD_GLOBAL,;t t +s,@G_MODULE_BROKEN_DLOPEN_NULL@,$G_MODULE_BROKEN_DLOPEN_NULL,;t t s,@G_MODULE_NEED_USCORE@,$G_MODULE_NEED_USCORE,;t t s,@GLIB_DEBUG_FLAGS@,$GLIB_DEBUG_FLAGS,;t t s,@GSPAWN@,$GSPAWN,;t t