summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-05-03 12:10:48 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-05-03 12:10:48 (GMT)
commit95c419b20ae7953fee534584e0baf39c4d8f0c38 (patch)
tree34ef7d81d127d40ad6b3b97d09d5ddfbd26518f2
parentd3545ec5e3508479c48c2d5828b8c9e484222778 (diff)
downloadcpython-95c419b20ae7953fee534584e0baf39c4d8f0c38.zip
cpython-95c419b20ae7953fee534584e0baf39c4d8f0c38.tar.gz
cpython-95c419b20ae7953fee534584e0baf39c4d8f0c38.tar.bz2
Try linking hstrerror and inet_aton tests. Look for these functions in -lresolv.
-rwxr-xr-xconfigure153
-rw-r--r--configure.in14
-rw-r--r--pyconfig.h.in3
3 files changed, 153 insertions, 17 deletions
diff --git a/configure b/configure
index 205d3e9..1c678bc 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in Revision: 1.403 .
+# From configure.in Revision: 1.404 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53 for python 2.3.
#
@@ -12509,6 +12509,133 @@ echo "${ECHO_T}no" >&6
fi
rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5
+echo $ECHO_N "checking for inet_aton in -lc... $ECHO_C" >&6
+if test "${ac_cv_lib_c_inet_aton+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char inet_aton ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+inet_aton ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext 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='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
+ ac_cv_lib_c_inet_aton=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_c_inet_aton=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5
+echo "${ECHO_T}$ac_cv_lib_c_inet_aton" >&6
+if test $ac_cv_lib_c_inet_aton = yes; then
+ /bin/true
+else
+
+echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5
+echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6
+if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lresolv $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char inet_aton ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+inet_aton ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext 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='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
+ ac_cv_lib_resolv_inet_aton=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_resolv_inet_aton=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5
+echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6
+if test $ac_cv_lib_resolv_inet_aton = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRESOLV 1
+_ACEOF
+
+ LIBS="-lresolv $LIBS"
+
+fi
+
+
+fi
+
+
echo "$as_me:$LINENO: checking for hstrerror" >&5
echo $ECHO_N "checking for hstrerror... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
@@ -12527,18 +12654,18 @@ cat >conftest.$ac_ext <<_ACEOF
int
main ()
{
-void* p = hstrerror
+void* p = hstrerror; hstrerror(0)
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+rm -f conftest.$ac_objext 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='test -s conftest.$ac_objext'
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -12558,7 +12685,7 @@ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
echo "$as_me:$LINENO: checking for inet_aton" >&5
echo $ECHO_N "checking for inet_aton... $ECHO_C" >&6
@@ -12580,18 +12707,18 @@ cat >conftest.$ac_ext <<_ACEOF
int
main ()
{
-void* p = inet_aton
+void* p = inet_aton;inet_aton(0,0)
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+rm -f conftest.$ac_objext 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='test -s conftest.$ac_objext'
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -12611,7 +12738,7 @@ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
echo "$as_me:$LINENO: checking for inet_pton" >&5
echo $ECHO_N "checking for inet_pton... $ECHO_C" >&6
diff --git a/configure.in b/configure.in
index 6686f2b..9db7f43 100644
--- a/configure.in
+++ b/configure.in
@@ -1929,23 +1929,29 @@ AC_TRY_COMPILE([
AC_MSG_RESULT(no)
)
+dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv
+dnl On others, they are in the C library, so we to take no action
+AC_CHECK_LIB(c, inet_aton, [/bin/true],
+ AC_CHECK_LIB(resolv, inet_aton)
+)
+
AC_MSG_CHECKING(for hstrerror)
-AC_TRY_COMPILE([
+AC_TRY_LINK([
#include "confdefs.h"
#include <netdb.h>
-], void* p = hstrerror,
+], void* p = hstrerror; hstrerror(0),
AC_DEFINE(HAVE_HSTRERROR, 1, Define if you have the 'hstrerror' function.)
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for inet_aton)
-AC_TRY_COMPILE([
+AC_TRY_LINK([
#include "confdefs.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-], void* p = inet_aton,
+], void* p = inet_aton;inet_aton(0,0),
AC_DEFINE(HAVE_INET_ATON, 1, Define if you have the 'inet_aton' function.)
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
diff --git a/pyconfig.h.in b/pyconfig.h.in
index 705976d..a5adca1 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -252,6 +252,9 @@
/* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H
+/* Define to 1 if you have the `resolv' library (-lresolv). */
+#undef HAVE_LIBRESOLV
+
/* Define to 1 if you have the <libutil.h> header file. */
#undef HAVE_LIBUTIL_H