[m-dev.] diff: autoconf test for -lnsl

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 5 07:09:33 AEDT 1999


Estimated hours taken: 0.75

configure.in:
	Check for -lnsl, since on i386-pc-solaris2.7 that is needed
	for the socket stuff.

scripts/ml.in:
	Link with -lnsl if necessary.

Workspace: /mount/munkora/mercury4/fjh/mercury-compiler-rotd-1999-11-04
Index: configure.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/configure.in,v
retrieving revision 1.187
diff -u -d -r1.187 configure.in
--- configure.in	1999/11/03 04:14:33	1.187
+++ configure.in	1999/11/04 20:00:54
@@ -2083,10 +2083,15 @@
 AC_CHECK_LIB(socket, socket, SOCKET_LIBRARY=-lsocket, SOCKET_LIBRARY="")
 
 #
+# check whether we need -lnsl
+#
+AC_CHECK_LIB(nsl, inet_addr, NSL_LIBRARY=-lnsl, NSL_LIBRARY="")
+
+#
 # temporarily add -lsocket to LIBS, for use by TRY_LINK
 #
 save_LIBS="$LIBS"
-LIBS="$LIBS $SOCKET_LIBRARY"
+LIBS="$LIBS $SOCKET_LIBRARY $NSL_LIBRARY"
 
 #
 # use TRY_LINK to see whether we can use sockets
@@ -2290,9 +2295,11 @@
 
 	# don't link with the socket library if we're not going to use it
 	SOCKET_LIBRARY=
+	NSL_LIBRARY=
 fi
 
 AC_SUBST(SOCKET_LIBRARY)
+AC_SUBST(NSL_LIBRARY)
 #-----------------------------------------------------------------------------#
 MERCURY_CHECK_READLINE
 #-----------------------------------------------------------------------------#
Index: scripts/ml.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/scripts/ml.in,v
retrieving revision 1.69
diff -u -d -r1.69 ml.in
--- ml.in	1999/10/29 05:09:38	1.69
+++ ml.in	1999/11/04 20:02:47
@@ -125,6 +125,7 @@
 # use sockets. The name of the needed libraries is determined by autoconf
 # and passed through this variable.
 SOCKET_LIBRARY="@SOCKET_LIBRARY@"
+NSL_LIBRARY="@NSL_LIBRARY@"
 
 # Likewise for -ldl (libdl.so), which is often needed for dlopen() etc.
 DL_LIBRARY="@DL_LIBRARY@"
@@ -428,7 +429,7 @@
 
 case $trace in
 	true)	TRACE_LIBS="-l$TRACE_LIB_NAME -l$BROWSER_LIB_NAME"
-		TRACE_LIBS_SYSTEM="$SOCKET_LIBRARY $DL_LIBRARY \
+		TRACE_LIBS_SYSTEM="$SOCKET_LIBRARY $NSL_LIBRARY $DL_LIBRARY \
 			$READLINE_LIBRARIES"
 		TRACE_STATIC_LIBS="\
 			$LIBDIR/$GRADE/$FULLARCH/lib$TRACE_LIB_NAME.a \

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list