apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@ebuilt.com>
Subject [PATCH] Detect basic libraries before first compile test
Date Wed, 01 Aug 2001 23:52:48 GMT
Any complaints?  This would move the check for libraries (except for dl
- should that be moved up here as well?) before we check for threading.

By checking the required libraries before we start the thread tests,
we can eliminate most of the LIBS in apr_hints.m4 because we properly
autodetect them.  Right now, we'll duplicate the libraries in LIBS.  

Previously on Solaris:
setting EXTRA_LIBS to "-lm -lsocket -lnsl -lsocket -lnsl -lpthread -ldl"

Now:
setting EXTRA_LIBS to "-lm -lsocket -lnsl  -lpthread -ldl"

I'm not sure where that extra space between -lnsl and -lpthread is
coming from though.  -- justin

Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.352
diff -u -r1.352 configure.in
--- configure.in	2001/08/01 22:57:32	1.352
+++ configure.in	2001/08/01 23:42:37
@@ -258,6 +258,15 @@
         ;;
 esac
 
+dnl #----------------------------- Checks for Any required Libraries
+AC_CHECK_LIB(nsl, gethostbyname)
+AC_SEARCH_LIBS(gethostname, nsl)
+AC_CHECK_LIB(socket, socket)
+AC_SEARCH_LIBS(crypt, crypt ufc)
+AC_CHECK_LIB(truerand, main)
+AC_CHECK_LIB(iconv, iconv)
+AC_CHECK_LIB(m, modf)
+
 dnl #----------------------------- Checking for Threads
 echo $ac_n "${nl}Checking for Threads...${nl}"
 
@@ -462,15 +471,6 @@
             ;;
     esac
 fi
-
-dnl #----------------------------- Checks for Any required Libraries
-AC_CHECK_LIB(nsl,gethostbyname)
-AC_SEARCH_LIBS(gethostname, nsl)
-AC_CHECK_LIB(socket,socket)
-AC_SEARCH_LIBS(crypt, crypt ufc)
-AC_CHECK_LIB(truerand,main)
-AC_CHECK_LIB(iconv,iconv)
-AC_CHECK_LIB(m,modf)
 
 dnl #----------------------------- Checks for Any required Functions
 dnl Checks for library functions. (N.B. poll is further down)
Index: build/apr_hints.m4
===================================================================
RCS file: /home/cvs/apr/build/apr_hints.m4,v
retrieving revision 1.16
diff -u -r1.16 apr_hints.m4
--- build/apr_hints.m4	2001/08/01 15:56:36	1.16
+++ build/apr_hints.m4	2001/08/01 23:42:37
@@ -29,11 +29,11 @@
   case "$host" in
     *mint)
 	APR_ADDTO(CPPFLAGS, [-DMINT])
-	APR_ADDTO(LIBS, [-lportlib -lsocket])
+	APR_ADDTO(LIBS, [-lportlib])
 	;;
     *MPE/iX*)
 	APR_ADDTO(CPPFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE])
-	APR_ADDTO(LIBS, [-lsocket -lsvipc -lcurses])
+	APR_ADDTO(LIBS, [-lsvipc -lcurses])
 	APR_ADDTO(LDFLAGS, [-Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\"])
 	;;
     *-apple-aux3*)
@@ -126,11 +126,10 @@
 	;;
     *-GNU*)
 	APR_ADDTO(CPPFLAGS, [-DHURD])
-	APR_ADDTO(LIBS, [-lcrypt])
 	;;
     *-lynx-lynxos)
 	APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS])
-	APR_ADDTO(LIBS, [-lbsd -lcrypt])
+	APR_ADDTO(LIBS, [-lbsd])
 	;;
     *486-*-bsdi*)
 	APR_ADDTO(CFLAGS, [-m486])
@@ -140,7 +139,6 @@
 	;;
     *-netbsd*)
 	APR_ADDTO(CPPFLAGS, [-DNETBSD])
-	APR_ADDTO(LIBS, [-lcrypt])
 	;;
     *-freebsd*)
 	case $host in
@@ -148,7 +146,6 @@
 		APR_ADDTO(CFLAGS, [-funsigned-char])
 		;;
 	esac
-	APR_ADDTO(LIBS, [-lcrypt])
 	APR_SETIFNULL(enable_threads, [no])
 	APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE])
 	;;
@@ -172,13 +169,13 @@
 	;;
     *-qnx)
 	APR_ADDTO(CPPFLAGS, [-DQNX])
-	APR_ADDTO(LIBS, [-N128k -lsocket -lunix])
+	APR_ADDTO(LIBS, [-N128k -lunix])
 	;;
     *-qnx32)
         APR_SETVAR(CC, [cc -F])
 	APR_ADDTO(CPPFLAGS, [-DQNX])
 	APR_ADDTO(CFLAGS, [-mf -3])
-	APR_ADDTO(LIBS, [-N128k -lsocket -lunix])
+	APR_ADDTO(LIBS, [-N128k -lunix])
 	;;
     *-isc4*)
 	APR_SETVAR(CC, [gcc])
@@ -189,20 +186,19 @@
     *-sco3*)
 	APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT])
 	APR_ADDTO(CFLAGS, [-Oacgiltz])
-	APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i])
+	APR_ADDTO(LIBS, [-lPW -lmalloc _i])
 	;;
     *-sco5*)
 	APR_ADDTO(CPPFLAGS, [-DSCO5 -D_REENTRANT])
-	APR_ADDTO(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx])
+	APR_ADDTO(LIBS, [-lmalloc -lprot -ltinfo -lx])
 	;;
     *-sco_sv*|*-SCO_SV*)
 	APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT])
-	APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i])
+	APR_ADDTO(LIBS, [-lPW -lmalloc _i])
 	;;
     *-solaris2*)
     	PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'`
 	APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT])
-	APR_ADDTO(LIBS, [-lsocket -lnsl])
 	APR_SETIFNULL(apr_iconv_inbuf_const, [1])
 	;;
     *-sunos4*)
@@ -210,31 +206,30 @@
 	;;
     *-unixware1)
 	APR_ADDTO(CPPFLAGS, [-DUW=100])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt])
 	;;
     *-unixware2)
 	APR_ADDTO(CPPFLAGS, [-DUW=200])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen])
+	APR_ADDTO(LIBS, [-lgen])
 	;;
     *-unixware211)
 	APR_ADDTO(CPPFLAGS, [-DUW=211])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen])
+	APR_ADDTO(LIBS, [-lgen])
 	;;
     *-unixware212)
 	APR_ADDTO(CPPFLAGS, [-DUW=212])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen])
+	APR_ADDTO(LIBS, [-lgen])
 	;;
     *-unixware7)
 	APR_ADDTO(CPPFLAGS, [-DUW=700])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lcrypt -lgen])
+	APR_ADDTO(LIBS, [-lgen])
 	;;
     maxion-*-sysv4*)
 	APR_ADDTO(CPPFLAGS, [-DSVR4])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lc -lgen])
+	APR_ADDTO(LIBS, [-lc -lgen])
 	;;
     *-*-powermax*)
 	APR_ADDTO(CPPFLAGS, [-DSVR4])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lgen])
+	APR_ADDTO(LIBS, [-lgen])
 	;;
     TPF)
        APR_SETVAR(CC, [c89])
@@ -246,27 +241,25 @@
 	;;
     *-siemens-sysv4*)
 	APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT
-DNEED_UNION_SEMUN])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lc])
+	APR_ADDTO(LIBS, [-lc])
 	;;
     pyramid-pyramid-svr4)
 	APR_ADDTO(CPPFLAGS, [-DSVR4 -DNO_LONG_DOUBLE])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lc])
+	APR_ADDTO(LIBS, [-lc])
 	;;
     DS/90\ 7000-*-sysv4*)
 	APR_ADDTO(CPPFLAGS, [-DUXPDS])
-	APR_ADDTO(LIBS, [-lsocket -lnsl])
 	;;
     *-tandem-sysv4*)
 	APR_ADDTO(CPPFLAGS, [-DSVR4])
-	APR_ADDTO(LIBS, [-lsocket -lnsl])
 	;;
     *-ncr-sysv4)
 	APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb])
+	APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb])
 	;;
     *-sysv4*)
 	APR_ADDTO(CPPFLAGS, [-DSVR4])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lc])
+	APR_ADDTO(LIBS, [-lc])
 	;;
     88k-encore-sysv4)
 	APR_ADDTO(CPPFLAGS, [-DSVR4 -DENCORE])
@@ -277,11 +270,10 @@
 	case $PLATOSVERS in
 	    2*) APR_ADDTO(CPPFLAGS, [-DUTS21 -DUSEBCOPY])
 	        APR_ADDTO(CFLAGS, [-Xa -eft])
-	        APR_ADDTO(LIBS, [-lsocket -lbsd -la])
+	        APR_ADDTO(LIBS, [-lbsd -la])
 	        ;;
 	    *)  APR_ADDTO(CPPFLAGS, [-DSVR4])
 	        APR_ADDTO(CFLAGS, [-Xa])
-	        APR_ADDTO(LIBS, [-lsocket -lnsl])
 	        ;;
 	esac
 	;;
@@ -307,32 +299,32 @@
     *-sequent-ptx2.*.*)
 	APR_ADDTO(CPPFLAGS, [-DSEQUENT=20])
 	APR_ADDTO(CFLAGS, [-Wc,-pw])
-	APR_ADDTO(LIBS, [-lsocket -linet -lnsl -lc -lseq])
+	APR_ADDTO(LIBS, [-linet -lc -lseq])
 	;;
     *-sequent-ptx4.0.*)
 	APR_ADDTO(CPPFLAGS, [-DSEQUENT=40])
 	APR_ADDTO(CFLAGS, [-Wc,-pw])
-	APR_ADDTO(LIBS, [-lsocket -linet -lnsl -lc])
+	APR_ADDTO(LIBS, [-linet -lc])
 	;;
     *-sequent-ptx4.[123].*)
 	APR_ADDTO(CPPFLAGS, [-DSEQUENT=41])
 	APR_ADDTO(CFLAGS, [-Wc,-pw])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lc])
+	APR_ADDTO(LIBS, [-lc])
 	;;
     *-sequent-ptx4.4.*)
 	APR_ADDTO(CPPFLAGS, [-DSEQUENT=44])
 	APR_ADDTO(CFLAGS, [-Wc,-pw])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lc])
+	APR_ADDTO(LIBS, [-lc])
 	;;
     *-sequent-ptx4.5.*)
 	APR_ADDTO(CPPFLAGS, [-DSEQUENT=45])
 	APR_ADDTO(CFLAGS, [-Wc,-pw])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lc])
+	APR_ADDTO(LIBS, [-lc])
 	;;
     *-sequent-ptx5.0.*)
 	APR_ADDTO(CPPFLAGS, [-DSEQUENT=50])
 	APR_ADDTO(CFLAGS, [-Wc,-pw])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lc])
+	APR_ADDTO(LIBS, [-lc])
 	;;
     *NEWS-OS*)
 	APR_ADDTO(CPPFLAGS, [-DNEWSOS])
@@ -350,23 +342,23 @@
         case $PLATOSVERS in
             5.0.4)
                 APR_ADDTO(LDFLAGS, [-L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind
-lsocket])
-                APR_ADDTO(LIBS, [-lbind -lsocket -lbe -lroot])
+                APR_ADDTO(LIBS, [-lbind -lbe -lroot])
                 APR_ADDTO(CPPFLAGS,[-DBONE7])
                 ;;
             5.1)
                 APR_ADDTO(LDFLAGS, [-L/boot/develop/lib/x86 -L/boot/beos/system/lib -lbind
-lsocket])
-                APR_ADDTO(LIBS, [-lbind -lsocket -lbe -lroot])
+                APR_ADDTO(LIBS, [-lbind -lbe -lroot])
                 ;;
 	esac
 	APR_ADDTO(CPPFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK -DAP_AUTH_DBM_USE_APR])
         ;;
     4850-*.*)
 	APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb])
+	APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb])
 	;;
     drs6000*)
 	APR_ADDTO(CPPFLAGS, [-DSVR4])
-	APR_ADDTO(LIBS, [-lsocket -lnsl -lc -L/usr/ucblib -lucb])
+	APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb])
 	;;
     m88k-*-CX/SX|CYBER)
 	APR_ADDTO(CPPFLAGS, [-D_CX_SX])


Mime
View raw message