On Wed, Sep 05, 2007 at 08:35:41PM +1000, Darren Freeman wrote: > On Tue, 2007-09-04 at 18:44 -0400, Richard Heck wrote: > > On Linux. It links fine in src/ itself. > > Hi all, > > I just updated to the latest SVN, r20063, of the 1.5 branch and hit make > (Linux). Only change was to os_unix.cpp . It was clearly running the > config script again as it did a lot of checks before compiling. > > Unfortunately it failed on linking to the new font config stuff. So this > problem applies to branch as well. > > I just did a "make clean" and will try building again. If I get any > different I'll let you know, but assume otherwise.
Please, try the attached patch. -- 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) @@ -16,7 +16,7 @@ BOOST_LIBS = $(BOOST_REGEX) $(BOOST_FILE lyxclient_LDADD = \ $(top_builddir)/src/support/libsupport.la \ - $(BOOST_LIBS) $(INTLLIBS) @LIBS@ $(SOCKET_LIBS) + $(BOOST_LIBS) $(INTLLIBS) @LIBS@ $(SOCKET_LIBS) $(LIBFONTCONFIG) lyxclient_SOURCES = \ boost.cpp \ Index: src/tex2lyx/Makefile.am =================================================================== --- src/tex2lyx/Makefile.am (revision 20089) +++ src/tex2lyx/Makefile.am (working copy) @@ -53,7 +53,7 @@ tex2lyx_SOURCES = \ tex2lyx_LDADD = \ $(top_builddir)/src/support/libsupport.la \ - $(BOOST_LIBS) $(LIBICONV) @LIBS@ + $(BOOST_LIBS) $(LIBICONV) @LIBS@ $(LIBFONTCONFIG) $(LINKED_FILES) : @rm -f $@ ; \ 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 @@ -234,7 +244,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 utime.h sys/utime.h io.h process.h NewAPIs.h fontconfig/fontconfig.h) +AC_CHECK_HEADERS(sys/time.h sys/types.h sys/select.h strings.h locale.h utime.h sys/utime.h io.h process.h NewAPIs.h) # some standard structures AC_HEADER_STAT