On Wed, Sep 05, 2007 at 11:20:59AM +0100, José Matos wrote:

> On Wednesday 05 September 2007 02:55:46 Enrico Forestieri wrote:
> > You are missing -lfontconfig, apparently. Please, see whether the attach
> > patch helps. If yes, please apply it yourself as I will be away for one
> > or two days.
> 
>   It does not work, it fails with the same error.

Are you sure that it was not failing later on tex2lyx?

>   If I add fontconfig to the compile options by hand then it works.

Anyway, I was getting the same failure on solaris and the attached
patch solves the problem for me.

-- 
Enrico
Index: src/support/os_unix.cpp
===================================================================
--- src/support/os_unix.cpp     (revision 20089)
+++ src/support/os_unix.cpp     (working copy)
@@ -18,7 +18,7 @@
 #ifdef __APPLE__
 #include <Carbon/Carbon.h>
 #include <ApplicationServices/ApplicationServices.h>
-#elif defined(HAVE_FONTCONFIG_FONTCONFIG_H)
+#elif defined(HAVE_LIBFONTCONFIG)
 #include "support/filetools.h"
 #include "support/Package.h"
 #include <fontconfig/fontconfig.h>
@@ -229,7 +229,7 @@ void addFontResources()
                               kFMLocalActivationContext);
        if (err)
                lyxerr << "FMActivateFonts err = " << err << endl;
-#elif defined(HAVE_FONTCONFIG_FONTCONFIG_H)
+#elif defined(HAVE_LIBFONTCONFIG)
        // Register BaKoMa truetype fonts with fontconfig
        string const fonts_dir =
                addPath(package().system_support().absFilename(), "fonts");
@@ -241,7 +241,7 @@ void addFontResources()
 
 void restoreFontResources()
 {
-#if defined(HAVE_FONTCONFIG_FONTCONFIG_H) && !defined(__APPLE__)
+#if defined(HAVE_LIBFONTCONFIG) && !defined(__APPLE__)
        FcConfigAppFontClear(0);
 #endif
 }
Index: src/client/Makefile.am
===================================================================
--- src/client/Makefile.am      (revision 20089)
+++ src/client/Makefile.am      (working copy)
@@ -15,7 +15,7 @@ lyxclient.1:
 
 lyxclient_LDADD = \
        $(top_builddir)/src/support/liblyxsupport.la \
-       $(BOOST_LIBS) $(INTLLIBS) @LIBS@ $(SOCKET_LIBS) 
+       $(BOOST_LIBS) $(INTLLIBS) @LIBS@ $(SOCKET_LIBS) $(LIBFONTCONFIG)
 
 # everything below the line containing the single backslashs
 # an ugly hack and needed because of the
Index: src/tex2lyx/Makefile.am
===================================================================
--- src/tex2lyx/Makefile.am     (revision 20089)
+++ src/tex2lyx/Makefile.am     (working copy)
@@ -64,7 +64,7 @@ tex2lyx_SOURCES = \
 tex2lyx_LDADD = \
        $(top_builddir)/src/support/liblyxsupport.la \
        $(top_builddir)/boost/liblyxboost.la \
-       $(LIBICONV) @LIBS@
+       $(LIBICONV) @LIBS@ $(LIBFONTCONFIG)
 
 tex2lyx.1:
        cp -p $(srcdir)/tex2lyx.man tex2lyx.1
Index: configure.ac
===================================================================
--- configure.ac        (revision 20089)
+++ configure.ac        (working copy)
@@ -142,6 +142,16 @@ AC_DEFINE_UNQUOTED(AIKSAURUS_H_LOCATION,
 fi
 AC_SUBST(AIKSAURUS_LIBS)
 
+lyx_have_fontconfig=false
+AC_CHECK_HEADER(fontconfig/fontconfig.h,[lyx_have_fontconfig=true])
+if $lyx_have_fontconfig ; then
+    AC_CHECK_LIB(fontconfig, FcInit,
+       [AC_DEFINE(HAVE_LIBFONTCONFIG,1,[Define to 1 if you have the fontconfig 
library])
+        LIBFONTCONFIG="-lfontconfig"
+       ])
+fi
+AC_SUBST(LIBFONTCONFIG)
+
 LYX_USE_INCLUDED_BOOST
 
 # Needed for our char_type
@@ -236,7 +246,7 @@ AC_LANG_POP(C)
 # some standard header files
 AC_HEADER_DIRENT
 AC_HEADER_MAJOR
-AC_CHECK_HEADERS(sys/time.h sys/types.h sys/select.h strings.h locale.h io.h 
process.h NewAPIs.h utime.h sys/utime.h fontconfig/fontconfig.h)
+AC_CHECK_HEADERS(sys/time.h sys/types.h sys/select.h strings.h locale.h io.h 
process.h NewAPIs.h utime.h sys/utime.h)
 
 # some standard structures
 AC_HEADER_STAT

Reply via email to