summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-05-03 17:35:44 +0000
committerYang Tse <yangsita@gmail.com>2009-05-03 17:35:44 +0000
commit9b4253fe67f076b0ed085f4df99d1bb571c5910c (patch)
tree13c12c33dedf5d0029b46b3fd1ae95959a9a974e
parentb5c599c80c18866dcb78599e99162bcf8ed4205d (diff)
downloadcurl-9b4253fe67f076b0ed085f4df99d1bb571c5910c.tar.gz
HP-UX's X/Open network library requirement check follow-up
-rw-r--r--acinclude.m428
-rw-r--r--ares/acinclude.m428
-rw-r--r--ares/configure.ac22
-rw-r--r--configure.ac22
4 files changed, 58 insertions, 42 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 2fe93c7fe..25c584d77 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -156,6 +156,34 @@ int main (void)
])
+dnl CURL_CHECK_LIB_XNET
+dnl -------------------------------------------------
+dnl Verify if X/Open network library is required.
+
+AC_DEFUN([CURL_CHECK_LIB_XNET], [
+ AC_MSG_CHECKING([if X/Open network library is required])
+ tst_lib_xnet_required="no"
+ AC_COMPILE_IFELSE([
+ AC_LANG_SOURCE([[
+int main (void)
+{
+#if defined(__hpux) && defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE >= 600)
+ return 0;
+#if defined(__hpux) && defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)
+ return 0;
+#else
+ force compilation error
+#endif
+}
+ ]])
+ ],[
+ tst_lib_xnet_required="yes"
+ LIBS="$LIBS -lxnet"
+ ])
+ AC_MSG_RESULT([$tst_lib_xnet_required])
+])
+
+
dnl CURL_CHECK_AIX_ALL_SOURCE
dnl -------------------------------------------------
dnl Provides a replacement of traditional AC_AIX with
diff --git a/ares/acinclude.m4 b/ares/acinclude.m4
index cf6383a33..7495faff8 100644
--- a/ares/acinclude.m4
+++ b/ares/acinclude.m4
@@ -134,6 +134,34 @@ int main (void)
])
+dnl CARES_CHECK_LIB_XNET
+dnl -------------------------------------------------
+dnl Verify if X/Open network library is required.
+
+AC_DEFUN([CARES_CHECK_LIB_XNET], [
+ AC_MSG_CHECKING([if X/Open network library is required])
+ tst_lib_xnet_required="no"
+ AC_COMPILE_IFELSE([
+ AC_LANG_SOURCE([[
+int main (void)
+{
+#if defined(__hpux) && defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE >= 600)
+ return 0;
+#if defined(__hpux) && defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)
+ return 0;
+#else
+ force compilation error
+#endif
+}
+ ]])
+ ],[
+ tst_lib_xnet_required="yes"
+ LIBS="$LIBS -lxnet"
+ ])
+ AC_MSG_RESULT([$tst_lib_xnet_required])
+])
+
+
dnl CARES_CHECK_AIX_ALL_SOURCE
dnl -------------------------------------------------
dnl Provides a replacement of traditional AC_AIX with
diff --git a/ares/configure.ac b/ares/configure.ac
index 78dde8973..5655e5382 100644
--- a/ares/configure.ac
+++ b/ares/configure.ac
@@ -191,27 +191,7 @@ 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_CC([_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])
+CARES_CHECK_LIB_XNET
dnl gethostbyname without lib or in the nsl lib?
AC_CHECK_FUNC(gethostbyname,
diff --git a/configure.ac b/configure.ac
index 35958a8a3..f1261838f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -498,27 +498,7 @@ 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_CC([_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])
+CURL_CHECK_LIB_XNET
dnl gethostbyname without lib or in the nsl lib?
AC_CHECK_FUNC(gethostbyname,