>>>>> "Jean-Marc" == Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

Jean-Marc> The following patch fixes the compilation of lyxclient on
Jean-Marc> solaris, where the socket function need additional
Jean-Marc> libraries. It happens that LyX itself is not affected
Jean-Marc> because X window adds these libraries for its own use.

Jean-Marc> I am not really satisfied by this patch. An alternative
Jean-Marc> solution (or hack) would be to just add X_EXTRA_LIBS to
Jean-Marc> lyxclient's libraries. This would of course fail if
Jean-Marc> compiling without X (but OSX and windows do not need the
Jean-Marc> libs anyway).

So, it seems that nobody cares, so here is the updated patch I am
going to commit soon.

JMarc

Index: ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/ChangeLog,v
retrieving revision 1.1036
diff -u -p -r1.1036 ChangeLog
--- ChangeLog	7 Dec 2005 14:08:45 -0000	1.1036
+++ ChangeLog	7 Dec 2005 16:19:07 -0000
@@ -1,3 +1,8 @@
+2005-12-07  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* configure.ac: add to SOCKET_LIBS the libraries required by
+	socket code (useful for solaris).
+
 2005-12-06  Georg Baum  <[EMAIL PROTECTED]>
 
 	* configure.ac: remove dead gnome stuff
Index: configure.ac
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v
retrieving revision 1.67
diff -u -p -r1.67 configure.ac
--- configure.ac	7 Dec 2005 14:08:46 -0000	1.67
+++ configure.ac	7 Dec 2005 16:19:07 -0000
@@ -289,7 +289,17 @@ LYX_CHECK_SPELL_ENGINES
 
 lyx_client_subdir=true
 AC_LANG_PUSH(C)
-AC_CHECK_FUNCS(fcntl,, [lyx_client_subdir=false])
+dnl LIBS already contains some X extra libs that may interfere.
+save_LIBS="$LIBS"
+LIBS=
+AC_CHECK_FUNCS(fcntl,
+  [AC_SEARCH_LIBS([gethostbyname], [nsl])
+   AC_SEARCH_LIBS([socket], [socket], [], 
+     [AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
+                [], [-lnsl])])], 
+  [lyx_client_subdir=false])
+AC_SUBST(SOCKET_LIBS,$LIBS)
+LIBS="$save_LIBS"
 AM_CONDITIONAL(BUILD_CLIENT_SUBDIR, $lyx_client_subdir)
 AC_LANG_POP(C)
 
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2337
diff -u -p -r1.2337 ChangeLog
--- src/ChangeLog	7 Dec 2005 14:09:30 -0000	1.2337
+++ src/ChangeLog	7 Dec 2005 16:19:08 -0000
@@ -1,3 +1,8 @@
+2005-12-07  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* Makefile.am (OTHERLIBS): add SOCKET_LIBS in case we compile
+	without X support.
+
 2005-12-06  Georg Baum  <[EMAIL PROTECTED]>
 
 	* exporter.C (Export): Don't try to copy a file if it does not exist
Index: src/Makefile.am
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/Makefile.am,v
retrieving revision 1.227
diff -u -p -r1.227 Makefile.am
--- src/Makefile.am	12 Jul 2005 23:42:21 -0000	1.227
+++ src/Makefile.am	7 Dec 2005 16:19:08 -0000
@@ -27,7 +27,7 @@ LYX_POST_LIBS = frontends/controllers/li
 
 BOOST_LIBS = $(BOOST_REGEX) $(BOOST_SIGNALS) $(BOOST_FILESYSTEM)
 
-OTHERLIBS = $(BOOST_LIBS) $(INTLLIBS) $(AIKSAURUS_LIBS) @LIBS@
+OTHERLIBS = $(BOOST_LIBS) $(INTLLIBS) $(AIKSAURUS_LIBS) @LIBS@ $(SOCKET_LIBS)
 
 bin_PROGRAMS = lyx
 noinst_PROGRAMS = $(FRONTENDS_PROGS)
Index: src/client/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/client/ChangeLog,v
retrieving revision 1.17
diff -u -p -r1.17 ChangeLog
--- src/client/ChangeLog	18 Jul 2005 08:04:47 -0000	1.17
+++ src/client/ChangeLog	7 Dec 2005 16:19:08 -0000
@@ -1,3 +1,8 @@
+2005-12-07  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* Makefile.am (lyxclient_LDADD): link against SOCKET_LIBS (needed
+	for solaris).
+
 2005-07-17  Michael Schmitt  <[EMAIL PROTECTED]>
 
 	* debug.C: fix typo
Index: src/client/Makefile.am
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/client/Makefile.am,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile.am
--- src/client/Makefile.am	12 Jul 2005 23:42:21 -0000	1.11
+++ src/client/Makefile.am	7 Dec 2005 16:19:08 -0000
@@ -16,7 +16,7 @@ BOOST_LIBS = $(BOOST_REGEX) $(BOOST_FILE
 
 lyxclient_LDADD = \
 	$(top_builddir)/src/support/libsupport.la \
-	$(BOOST_LIBS) $(INTLLIBS)
+	$(BOOST_LIBS) $(INTLLIBS) $(SOCKET_LIBS)
 
 lyxclient_SOURCES = \
 	boost.C \

Reply via email to