From 02764f3ec68ffe3a6c038505474d577c93c8c520 Mon Sep 17 00:00:00 2001 From: Adam Fedor Date: Mon, 28 Jan 2008 19:45:23 +0000 Subject: [PATCH] * configure.ac: Add option to disable bfd. Add check for Solaris libs socket and nsl. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26009 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 ++ configure | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 20 +++++-- 3 files changed, 169 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 99deac02e..431671677 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-28 Adam Fedor + + * configure.ac: Add option to disable bfd. Add check for + Solaris libs socket and nsl. + 2008-01-27 Richard Frith-Macdonald * Source/NSXMLParser.m: Implement reporting of namespace diff --git a/configure b/configure index 0fdc83ef4..7aed01ea8 100755 --- a/configure +++ b/configure @@ -1348,6 +1348,7 @@ Optional Features: --disable-importing-config-file Disable importing of an existing GNUstep config file and use inbuilt defaults instead. + --disable-bfd Don't use bfd functions (stack traces, etc) --enable-procfs Use /proc filesystem (default) --enable-procfs-psinfo Use /proc/%pid% to get info --enable-pass-arguments Force user main call to NSProcessInfo initialize @@ -11113,6 +11114,16 @@ done #-------------------------------------------------------------------- # These headers/functions needed for stacktrace in NSException.m #-------------------------------------------------------------------- +PASS_ARG=yes +# Check whether --enable-bfd was given. +if test "${enable_bfd+set}" = set; then + enableval=$enable_bfd; +else + enable_bfd=$PASS_ARG +fi + + +if test $enable_bfd = yes; then for ac_header in bfd.h do @@ -11395,6 +11406,7 @@ _ACEOF fi +fi #-------------------------------------------------------------------- # These headers/functions needed by NSLog.m @@ -13671,6 +13683,141 @@ fi +#-------------------------------------------------------------------- +# Solaris needs this for internet functions. It's already in +# gnustep-make, which should be deprecated. +#-------------------------------------------------------------------- + +{ echo "$as_me:$LINENO: checking for main in -lnsl" >&5 +echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6; } +if test "${ac_cv_lib_nsl_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_nsl_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_nsl_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6; } +if test $ac_cv_lib_nsl_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNSL 1 +_ACEOF + + LIBS="-lnsl $LIBS" + +fi + + +{ echo "$as_me:$LINENO: checking for main in -lsocket" >&5 +echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; } +if test "${ac_cv_lib_socket_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_socket_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_socket_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; } +if test $ac_cv_lib_socket_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + + #-------------------------------------------------------------------- # These used by GSFileHandle.m and distributed objects #-------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index fb3c4717f..1960f582a 100644 --- a/configure.ac +++ b/configure.ac @@ -1370,9 +1370,16 @@ dnl AC_REPLACE_FUNCS(recvfrom) #-------------------------------------------------------------------- # These headers/functions needed for stacktrace in NSException.m #-------------------------------------------------------------------- -AC_CHECK_HEADERS(bfd.h) -AC_CHECK_LIB(iberty, dyn_string_append) -AC_CHECK_LIB(bfd, bfd_openr) +PASS_ARG=yes +AC_ARG_ENABLE(bfd, + [ --disable-bfd Don't use bfd functions (stack traces, etc)],, + enable_bfd=$PASS_ARG) + +if test $enable_bfd = yes; then + AC_CHECK_HEADERS(bfd.h) + AC_CHECK_LIB(iberty, dyn_string_append) + AC_CHECK_LIB(bfd, bfd_openr) +fi #-------------------------------------------------------------------- # These headers/functions needed by NSLog.m @@ -1544,6 +1551,13 @@ AC_SUBST(DEFINE_UINT64_T) AC_SUBST(DEFINE_INTPTR_T) AC_SUBST(DEFINE_UINTPTR_T) +#-------------------------------------------------------------------- +# Solaris needs this for internet functions. It's already in +# gnustep-make, which should be deprecated. +#-------------------------------------------------------------------- +AC_CHECK_LIB(nsl, main) +AC_CHECK_LIB(socket, main) + #-------------------------------------------------------------------- # These used by GSFileHandle.m and distributed objects #--------------------------------------------------------------------