Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#9807) GTK2 client doesn't link due to missing -lsocket
Home

[Freeciv-Dev] (PR#9807) GTK2 client doesn't link due to missing -lsocket

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: brett.albertson@xxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#9807) GTK2 client doesn't link due to missing -lsocket -lnsl
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 4 Sep 2004 13:24:24 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9807 >

> [bretta - Wed Aug 25 13:25:35 2004]:
> 
> When I build the GTK2 client on Solaris, I get the following when
> linking the civclient binary:

See if this fixes things.

jason

? manual
Index: configure.ac
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.ac,v
retrieving revision 1.70
diff -u -r1.70 configure.ac
--- configure.ac        21 Aug 2004 16:20:25 -0000      1.70
+++ configure.ac        4 Sep 2004 20:24:11 -0000
@@ -422,16 +422,6 @@
 
 dnl Checks for additional server libraries:
 if test x$server = xtrue; then
-    dnl The use of AC_CHECK_FUNC is to avoid wrong libs on IRIX.
-    AC_CHECK_FUNC(gethostbyname)
-    if test $ac_cv_func_gethostbyname = no; then
-        AC_CHECK_LIB(nsl, gethostbyname, SERVER_LIBS="-lnsl $SERVER_LIBS")
-    fi
-    AC_CHECK_FUNC(connect)
-    if test $ac_cv_func_connect = no; then
-        AC_CHECK_LIB(socket, connect, SERVER_LIBS="-lsocket $SERVER_LIBS")
-    fi
-
     dnl Some systems (e.g., BeOS) need this lib
     AC_CHECK_LIB(bind, gethostbyaddr, SERVER_LIBS="-lbind $SERVER_LIBS")
 
@@ -483,12 +473,26 @@
 
 AC_CHECK_FUNCS([fileno ftime gethostname getpwuid inet_aton \
                select snooze strerror strcasecmp strncasecmp \
-               strlcat strlcpy strstr usleep vsnprintf uname flock])
+               strlcat strlcpy strstr usleep vsnprintf uname flock \
+               gethostbyname connect bind])
 
 AC_MSG_CHECKING(for working gettimeofday)
   FC_CHECK_GETTIMEOFDAY_RUNTIME(,AC_DEFINE(HAVE_GETTIMEOFDAY, 1,
        [Define if the gettimeofday function works and is sane.]),)
 
+dnl Check for extra socket libraries.
+dnl If the AC_CHECK_FUNCS check finds the function, we don't look any
+dnl further.  This is rumoured to prevent choosing the wrong libs on IRIX.
+if test $ac_cv_func_gethostbyname = no; then
+  AC_CHECK_LIB(nsl, gethostbyname, LIBS="-lnsl $LIBS")
+fi
+if test $ac_cv_func_connect = no; then
+  AC_CHECK_LIB(socket, connect, LIBS="-lsocket $LIBS")
+fi
+if test $ac_cv_func_bind = no; then
+  AC_CHECK_LIB(bind, gethostbyaddr, LIBS="-lbind $LIBS")
+fi
+
 dnl The use of both AC_FUNC_VSNPRINTF and AC_CHECK_FUNCS(vsnprintf) is
 dnl deliberate.
 
Index: configure.in
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.in,v
retrieving revision 1.247
diff -u -r1.247 configure.in
--- configure.in        4 Sep 2004 00:52:59 -0000       1.247
+++ configure.in        4 Sep 2004 20:24:11 -0000
@@ -415,18 +415,6 @@
 
 dnl Checks for additional server libraries:
 if test x$server = xtrue; then
-    dnl The use of AC_CHECK_FUNC is to avoid wrong libs on IRIX.
-    AC_CHECK_FUNC(gethostbyname)
-    if test $ac_cv_func_gethostbyname = no; then
-        AC_CHECK_LIB(nsl, gethostbyname, SERVER_LIBS="-lnsl $SERVER_LIBS")
-    fi
-    AC_CHECK_FUNC(connect)
-    if test $ac_cv_func_connect = no; then
-        AC_CHECK_LIB(socket, connect, SERVER_LIBS="-lsocket $SERVER_LIBS")
-    fi
-
-    dnl Some systems (e.g., BeOS) need this lib
-    AC_CHECK_LIB(bind, gethostbyaddr, SERVER_LIBS="-lbind $SERVER_LIBS")
 
     dnl Readline library and header files.
     FC_HAS_READLINE()
@@ -475,11 +463,26 @@
 
 AC_CHECK_FUNCS([fileno ftime gethostname getpwuid inet_aton \
                select snooze strerror strcasecmp strncasecmp \
-               strlcat strlcpy strstr usleep vsnprintf uname flock])
+               strlcat strlcpy strstr usleep vsnprintf uname flock \
+               gethostbyname connect bind])
 AC_CHECK_FUNC([fork], AC_DEFINE(HAVE_WORKING_FORK))
+
 AC_MSG_CHECKING(for working gettimeofday)
   FC_CHECK_GETTIMEOFDAY_RUNTIME(,AC_DEFINE(HAVE_GETTIMEOFDAY),)
 
+dnl Check for extra socket libraries.
+dnl If the AC_CHECK_FUNCS check finds the function, we don't look any
+dnl further.  This is rumoured to prevent choosing the wrong libs on IRIX.
+if test $ac_cv_func_gethostbyname = no; then
+  AC_CHECK_LIB(nsl, gethostbyname, LIBS="-lnsl $LIBS")
+fi
+if test $ac_cv_func_connect = no; then
+  AC_CHECK_LIB(socket, connect, LIBS="-lsocket $LIBS")
+fi
+if test $ac_cv_func_bind = no; then
+  AC_CHECK_LIB(bind, gethostbyaddr, LIBS="-lbind $LIBS")
+fi
+
 dnl The use of both AC_FUNC_VSNPRINTF and AC_CHECK_FUNCS(vsnprintf) is
 dnl deliberate.
 

[Prev in Thread] Current Thread [Next in Thread]