Fix testsuite build on Solaris
authorJeremy Harris <jgh146exb@wizmail.org>
Wed, 20 Nov 2013 14:19:37 +0000 (14:19 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Wed, 20 Nov 2013 14:36:19 +0000 (14:36 +0000)
As of s11, Solaris & derivatives need libsocket and libnsl.  Ensure they are searched for
by autoconfig.  This seems to be successfully ignored on Linux.
Credit to Dave Edmondson (dme@dme.org) for the fix.

test/Makefile.in
test/configure.ac

index fda4d5f..8c2ee96 100644 (file)
@@ -10,6 +10,7 @@ CLIENT_SSL=@CLIENT_SSL@
 CLIENT_GNUTLS=@CLIENT_GNUTLS@
 LOADED=@LOADED@
 LOADED_OPT=@LOADED_OPT@
 CLIENT_GNUTLS=@CLIENT_GNUTLS@
 LOADED=@LOADED@
 LOADED_OPT=@LOADED_OPT@
+LIBS=@LIBS@
 
 ##############################################################################
 
 
 ##############################################################################
 
@@ -44,17 +45,17 @@ bin/cf:         src/cf.c Makefile
                @echo " "
 
 bin/client:     src/client.c Makefile
                @echo " "
 
 bin/client:     src/client.c Makefile
-               $(CC) $(CFLAGS) $(LDFLAGS) -o bin/client src/client.c
+               $(CC) $(CFLAGS) $(LDFLAGS) -o bin/client src/client.c $(LIBS)
                @echo ">>> bin/client command built"
                @echo " "
 
 bin/client-gnutls: src/client.c Makefile
                @echo ">>> bin/client command built"
                @echo " "
 
 bin/client-gnutls: src/client.c Makefile
-               $(CC) $(CFLAGS) -DHAVE_GNUTLS $(LDFLAGS) -o bin/client-gnutls src/client.c -lgnutls -lgcrypt
+               $(CC) $(CFLAGS) -DHAVE_GNUTLS $(LDFLAGS) -o bin/client-gnutls src/client.c -lgnutls -lgcrypt $(LIBS)
                @echo ">>> bin/client-gnutls command built"
                @echo " "
 
 bin/client-ssl: src/client.c Makefile
                @echo ">>> bin/client-gnutls command built"
                @echo " "
 
 bin/client-ssl: src/client.c Makefile
-               $(CC) $(CFLAGS) -DHAVE_OPENSSL $(LDFLAGS) -o bin/client-ssl src/client.c -lssl -lcrypto
+               $(CC) $(CFLAGS) -DHAVE_OPENSSL $(LDFLAGS) -o bin/client-ssl src/client.c -lssl -lcrypto $(LIBS)
                @echo ">>> bin/client-ssl command built"
                @echo " "
 
                @echo ">>> bin/client-ssl command built"
                @echo " "
 
@@ -89,7 +90,7 @@ bin/mtpscript:  src/mtpscript.c Makefile
                @echo " "
 
 bin/server:     src/server.c Makefile
                @echo " "
 
 bin/server:     src/server.c Makefile
-               $(CC) $(CFLAGS) $(LDFLAGS) -o bin/server src/server.c
+               $(CC) $(CFLAGS) $(LDFLAGS) -o bin/server src/server.c $(LIBS)
                @echo ">>> bin/server command built"
                @echo " "
 
                @echo ">>> bin/server command built"
                @echo " "
 
index 83f1aa0..a38b5b0 100644 (file)
@@ -48,6 +48,11 @@ case $host_os in
     ;;
 esac
 
     ;;
 esac
 
+dnl Solaris requires additional libraries for networking functions.
+
+AC_SEARCH_LIBS([inet_addr], [nsl])
+AC_SEARCH_LIBS([connect], [socket])
+
 dnl "Export" these variables
 
 AC_SUBST(BIND_8_COMPAT)
 dnl "Export" these variables
 
 AC_SUBST(BIND_8_COMPAT)
@@ -55,6 +60,7 @@ AC_SUBST(CLIENT_SSL)
 AC_SUBST(CLIENT_GNUTLS)
 AC_SUBST(LOADED)
 AC_SUBST(LOADED_OPT)
 AC_SUBST(CLIENT_GNUTLS)
 AC_SUBST(LOADED)
 AC_SUBST(LOADED_OPT)
+AC_SUBST(LIBS)
 
 dnl This must be last; it determines what files are written
 
 
 dnl This must be last; it determines what files are written