[gnutls-help] Compiling gnutls on solaris

Nikos Mavrogiannopoulos nmav at gnutls.org
Tue Sep 30 21:25:07 CEST 2014


On Tue, 2014-09-30 at 21:15 +0200, Nikos Mavrogiannopoulos wrote:
> On Tue, 2014-09-30 at 14:04 -0400, dev wrote:
> 
> > > > OKay, this looks familiar and I remember running into this last time
> > > > I
> > > > tried a build of gnutls and I think I recall the solution was we
> > > > need
> > > > -lsocket -lnsl on Solaris because the socket funcs inet_ntop,
> > > > inet_ntoa
> > [...]
> > I have made no progress on that yet. There is someplace in that Makefile
> > within the ./lib directory that needs -lnsl and -lsocket but I can not
> > seem to find where. Any hints ?
> 
> gnulib may have done some discovery of them. Do any of the variables in
> config.log contains -lsocket -lnsl? If yes we could reuse it. I'd have
> expected LIBSOCKET to contain that.

Otherwise let me know whether that patch works. (it would require
running autoreconf after applying).

regards,
Nikos

-------------- next part --------------
diff --git a/configure.ac b/configure.ac
index 5620b8f..177d64b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -190,6 +190,11 @@ AC_LIB_HAVE_LINKFLAGS(rt,, [#include <time.h>
 #include <signal.h>
 ], [timer_create (0,0,0);])
 
+AC_LIB_HAVE_LINKFLAGS(nsl,, [#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+], [inet_aton (0,0);])
+
 if test "$have_win" != "yes";then
   AC_CHECK_FUNCS([pthread_mutex_lock],,)
   if test "$ac_cv_func_pthread_mutex_lock" != "yes";then
diff --git a/lib/Makefile.am b/lib/Makefile.am
index fccc8d4..1cad11e 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -129,7 +129,7 @@ libgnutls_la_LIBADD = ../gl/libgnu.la x509/libgnutls_x509.la \
 	ext/libgnutls_ext.la \
 	auth/libgnutls_auth.la algorithms/libgnutls_alg.la \
 	extras/libgnutls_extras.la
-thirdparty_libadd = $(LTLIBZ) $(LTLIBINTL) $(LIBSOCKET) \
+thirdparty_libadd = $(LTLIBZ) $(LTLIBINTL) $(LIBSOCKET) $(LIBNSL) \
 	$(LTLIBICONV) $(P11_KIT_LIBS) $(LIB_SELECT) $(TSS_LIBS)
 
 if HAVE_LIBIDN


More information about the Gnutls-help mailing list