]> git.saurik.com Git - apt.git/commitdiff
Made configure smarter about detecting the previous hp-...
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:55:34 +0000 (16:55 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:55:34 +0000 (16:55 +0000)
Author: doogie
Date: 1999-12-11 06:33:02 GMT
Made configure smarter about detecting the previous hp-ux fixes.

COMPILING
buildlib/config.h.in
buildlib/netdb.h.in [new file with mode: 0644]
configure.in

index e86b8c355d03bfae2d0f000dcdec01df8c21899b..ec02c3cd6eb57d5ca6f4df3a70a13fcd0f89300a 100644 (file)
--- a/COMPILING
+++ b/COMPILING
@@ -61,7 +61,8 @@ HP-UX
      1) snprintf exists but is not prototyped, ignore spurios warnings
      2) No socklen_t
      3) Requires -D_XOPEN_SOURCE_EXTENDED for h_errno
-    Items 2 and 3 have to be fixed by hand. Insert this into
+    configure attempts to detect items 2 and 3, and tries to fix them.  If
+    not, you can add the following into(patches welcome to configure.in)
     build/include/netdb.h:
     
     #define _XOPEN_SOURCE_EXTENDED
index 689549e6532aedd5956ecb6d9d7d7e4409b3c94c..7e738af52e12a3f2f47e4373eb1cc5629853daa4 100644 (file)
 /* Define if we have enabled pthread support */
 #undef HAVE_PTHREAD
 
+/* Define if h_errno is in netdb.h */
+#undef HAVE_NETDB_H
+
+/* Define if socklen_t is in sys/socket.h  This does not mean we
+   shouldn't include sys/socket.h tho!  */
+#undef HAVE_SYS_SOCKET_H
+
+/* If there is no socklen_t, define this(might want to update
+   configure.in.  */
+#undef NEED_SOCKLEN_T_DEFINE
+
+/* Define on HP-UX */
+#undef NEED_XOPEN_NETDB_H
+
 /* Define the architecture name string */
 #undef ARCHITECTURE
 
@@ -40,4 +54,3 @@
 
 /* The package name string */
 #undef PACKAGE
-
diff --git a/buildlib/netdb.h.in b/buildlib/netdb.h.in
new file mode 100644 (file)
index 0000000..1babd76
--- /dev/null
@@ -0,0 +1,5 @@
+/* Fix broken(?) unixen. */
+#ifdef NEED_SOCKLEN_T_DEFINE
+        #define socklen_t size_t
+#endif
+#include_next <netdb.h>
index 366d70375196375bcd7b9e4ac080056de8c20de0..2981a5a4c4bbabf495291415eb8b1b21dbfe41e5 100644 (file)
@@ -14,10 +14,10 @@ dnl configure.in correctly and can be run at any time
 
 AC_INIT(configure.in)
 AC_CONFIG_AUX_DIR(buildlib)
-AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in)
+AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/netdb.h:buildlib/netdb.h.in)
 
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.3.15")
+AC_DEFINE_UNQUOTED(VERSION,"0.3.15.1")
 AC_DEFINE_UNQUOTED(PACKAGE,"apt")
 
 dnl Check our C compiler
@@ -140,6 +140,30 @@ if test x"$c9x_ints" = x"no"; then
    AC_SUBST(HAVE_C9X)
 fi
 
+AC_MSG_CHECKING(for socklen_t)
+AC_EGREP_HEADER(socklen_t, sys/socket.h, [
+       AC_DEFINE(HAVE_SYS_SOCKET_H)
+       AC_MSG_RESULT(sys/socket.h)
+], [
+       AC_DEFINE(NEED_SOCKLEN_T_DEFINE)
+       AC_MSG_RESULT([socklen_t size_t])
+])
+
+AC_MSG_CHECKING(for h_errno)
+AC_EGREP_HEADER(h_errno, netdb.h, [AC_DEFINE(HAVE_NETDB_H)
+       AC_MSG_RESULT(found)
+], [AC_TRY_COMPILE(netdb.h, h_errno foo, [AC_MSG_RESULT(found)
+               AC_MSG_RESULT(found)
+       ], [ah_CFLAGS="$CFLAGS"
+               CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
+               AC_TRY_COMPILE([netdb.h], [h_errno foo], [AC_DEFINE(NEED_XOPEN_NETDB_H)
+                       AC_MSG_RESULT([found, needed -D_XOPEN_SOURCE_EXTENDED])
+               ], [CFLAGS="$ah_CFLAGS"
+                       AC_MSG_ERROR(["not found."])
+               ])
+       ])
+])
+
 dnl Check for debiandoc
 AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","")
 AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","")