diff options
author | Yang Tse <yangsita@gmail.com> | 2009-04-30 18:35:36 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2009-04-30 18:35:36 +0000 |
commit | c76e5382313c1d965d03a2cce07c97c5fba9c432 (patch) | |
tree | ac80a8791a86e5fc4109a944f445d91b133f85e7 | |
parent | 96ea49870c7fb1c3c967166814a1903bee92fef3 (diff) |
Check if X/Open network library is required
-rw-r--r-- | ares/configure.ac | 22 | ||||
-rw-r--r-- | configure.ac | 22 |
2 files changed, 44 insertions, 0 deletions
diff --git a/ares/configure.ac b/ares/configure.ac index 8482f1a3a..4111dc848 100644 --- a/ares/configure.ac +++ b/ares/configure.ac @@ -191,6 +191,28 @@ dnl ********************************************************************** dnl Checks for libraries. dnl ********************************************************************** +tst_lib_xnet_required="no" +AC_MSG_CHECKING([if X/Open network library is required]) +CURL_CHECK_DEF([__hpux], [], [silent]) +CURL_CHECK_DEF([_XOPEN_SOURCE_EXTENDED], [], [silent]) +if test "$curl_cv_have_def__XOPEN_SOURCE_EXTENDED" = "yes" && + test "$curl_cv_have_def___hpux" = "yes"; then + my_ac_save_LIBS=$LIBS + LIBS="-lxnet $LIBS" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + ]],[[ + if(0 != getpeername(0, 0, 0)) + return 1; + ]]) + ],[ + tst_lib_xnet_required="yes" + ],[ + LIBS=$my_ac_save_LIBS + ]) +fi +AC_MSG_RESULT([$tst_lib_xnet_required]) + dnl gethostbyname without lib or in the nsl lib? AC_CHECK_FUNC(gethostbyname, [HAVE_GETHOSTBYNAME="1" diff --git a/configure.ac b/configure.ac index 48c36a325..33561375b 100644 --- a/configure.ac +++ b/configure.ac @@ -498,6 +498,28 @@ dnl ********************************************************************** dnl Checks for libraries. dnl ********************************************************************** +tst_lib_xnet_required="no" +AC_MSG_CHECKING([if X/Open network library is required]) +CURL_CHECK_DEF([__hpux], [], [silent]) +CURL_CHECK_DEF([_XOPEN_SOURCE_EXTENDED], [], [silent]) +if test "$curl_cv_have_def__XOPEN_SOURCE_EXTENDED" = "yes" && + test "$curl_cv_have_def___hpux" = "yes"; then + my_ac_save_LIBS=$LIBS + LIBS="-lxnet $LIBS" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + ]],[[ + if(0 != getpeername(0, 0, 0)) + return 1; + ]]) + ],[ + tst_lib_xnet_required="yes" + ],[ + LIBS=$my_ac_save_LIBS + ]) +fi +AC_MSG_RESULT([$tst_lib_xnet_required]) + dnl gethostbyname without lib or in the nsl lib? AC_CHECK_FUNC(gethostbyname, [HAVE_GETHOSTBYNAME="1" |