[tlbuild] Unable to compile dvisvgm (linux x86_64, system libs)

Ken Moffat zarniwhoop at ntlworld.com
Sat Mar 10 02:19:23 CET 2018


On Thu, Mar 08, 2018 at 12:51:44AM +0000, Ken Moffat wrote:
> On Wed, Mar 07, 2018 at 11:42:08PM +0000, Karl Berry wrote:
> >     So the current source decides to use -ldl instead of -lgs.  Clearly
> >     I do have libgs.so, but it is not found when using this approach.
> > 
> > With --enable-native-texlive-build, I explicitly disable linking against
> > libgs at build time, because the result is unlikely to run on other
> > versions of the same system; libgs has its own set of painful
> > dependencies, all of which then get pulled into the binary. Thus libgs
> > is always dlloaded for native TL.
> > 
> 
> Yes, I saw that.  I'm using --disable-native-texlive-build.
> 
> > If you're not using --enable-native-texlive-build, then probably
> > something in the way I implemented the above is causing the failure to
> > find libgs.  Please take a look at dvisvgm/configure.ac, search for "TL:".
> > 
> 
> Will do, but maybe not for a while.  I'll also mention that I had
> tried --without-libgs but that seemed to not make any difference.
> 
> > As for the load problem,
> >     libdvisvgm.a(Ghostscript.o): In function `Ghostscript::~Ghostscript()':
> >     Ghostscript.cpp:(.text+0xd0): undefined reference to `gsapi_exit'
> > I just don't know. Sorry.
> > 
> > You might find it easier to work with the upstream dvisvgm and disable
> > it as part of TL. (Depending on how you handle kpathsea in LFS, I guess.)
> > 
> > Sorry I don't have any real answers ... please let me know if you
> > discover changes I should insert. --thanks, karl.
> 
For dvisvgm, as with everything else in the TeX world, we (LFS)
regard texlive as our upstream, so we prefer to just work with
whatever you release, and fix it when necessary (e.g. we are now
using current poppler, so we need to use the -newpoppler versions of
a couple of files in pdftexdir.  Anyway, I've hacked on the dvisvgm
configure.ac.

The problem was that HAVE_LIBGS got set to 0 for a native texlive
build, but never otherwise set, so that the test for it being equal
to 0 or unset always passed.  I have assumed that the semantics of
HAVE_LIBGS should be the same as for have_libgs, i.e. only true if a
sufficiently new version of ghostscript is found, so I set it in the
non texlive-native-build after running the alternative tests.

After fixing that, I got

checking ghostscript/iapi.h usability... yes
checking ghostscript/iapi.h presence... yes
checking for ghostscript/iapi.h... yes
checking for gsapi_revision in -lgs... yes
checking Ghostscript version... "922"
../../../texk/dvisvgm/configure: line 22051: 922: command not found

which I assume will cause the dvisvgm test for a too-early version
to fail, so I changed that to insert a missing 'test'.

My build now completes, using -lgs in dvisvgm :

libtool: link: g++ -Wimplicit -Wreturn-type -Wnon-virtual-dtor -I../../../../../texk/dvisvgm/dvisvgm-src/libs/clipper -I../../../../../texk/dvisvgm/dvisvgm-src/libs/variant/include -I../../../../../texk/dvisvgm/dvisvgm-src/libs/xxHash -I../../../../../texk/dvisvgm/dvisvgm-src/libs/brotli/include -I../../../../../texk/dvisvgm/dvisvgm-src/libs/woff2/include -I/scratch/working/texlive-2018r46857-source/texlive-build/texk -I/scratch/working/texlive-2018r46857-source/texk -I/scratch/working/texlive-2018r46857-source/texlive-build/libs/potrace/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -O2 -march=native -o .libs/dvisvgm dvisvgm.o  libdvisvgm.a ../libs/clipper/libclipper.a ../libs/xxHash/libxxhash.a ../libs/ff-woff/libfontforge.a ../libs/woff2/libwoff2.a ../libs/brotli/libbrotli.a /scratch/working/texlive-2018r46857-source/texlive-build/texk/kpathsea/.libs/libkpathsea.so /scratch/working/texlive-2018r46857-source/texlive-build/libs/potrace/libpotrace.a -lfreetype -lz -lgs

Checking a texlive-native-build, that too completed, and still linked
to -ldl :

libtool: link: g++ -Wimplicit -Wreturn-type -Wnon-virtual-dtor -I../../../../../texk/dvisvgm/dvisvgm-src/libs/clipper -I../../../../../texk/dvisvgm/dvisvgm-src/libs/variant/include -I../../../../../texk/dvisvgm/dvisvgm-src/libs/xxHash -I../../../../../texk/dvisvgm/dvisvgm-src/libs/brotli/include -I../../../../../texk/dvisvgm/dvisvgm-src/libs/woff2/include -I/scratch/working/texlive-2018r46857-source/texlive-build/texk -I/scratch/working/texlive-2018r46857-source/texk -I/scratch/working/texlive-2018r46857-source/texlive-build/libs/potrace/include -I/scratch/working/texlive-2018r46857-source/texlive-build/libs/freetype2/freetype2 -I/scratch/working/texlive-2018r46857-source/texlive-build/libs/zlib/include -O2 -march=native -o dvisvgm dvisvgm.o  libdvisvgm.a ../libs/clipper/libclipper.a ../libs/xxHash/libxxhash.a ../libs/ff-woff/libfontforge.a ../libs/woff2/libwoff2.a ../libs/brotli/libbrotli.a /scratch/working/texlive-2018r46857-source/texlive-build/texk/kpathsea/.libs/libkpathsea.a /scratch/working/texlive-2018r46857-source/texlive-build/libs/potrace/libpotrace.a /scratch/working/texlive-2018r46857-source/texlive-build/libs/freetype2/libfreetype.a /scratch/working/texlive-2018r46857-source/texlive-build/libs/zlib/libz.a -ldl

ĸen
-- 
Truth, in front of her huge walk-in wardrobe, selected black leather
boots with stiletto heels for such a barefaced truth.
                                     - Unseen Academicals
-------------- next part --------------
--- texk/dvisvgm/configure.ac.orig	2018-03-09 21:48:03.806119651 +0000
+++ texk/dvisvgm/configure.ac	2018-03-09 22:52:54.100381253 +0000
@@ -63,6 +63,9 @@
 AC_CHECK_HEADER([ghostscript/iapi.h],
 	[AC_CHECK_LIB(gs, gsapi_revision,, [have_libgs=no])],
 	[have_libgs=no])
+if test "x$have_libgs" = xyes; then
+  HAVE_LIBGS=1
+fi
 AS_IF([test "x$have_libgs" = "xno"],
 	# Ghostscript not found, check for dlopen
 	[AC_CHECK_LIB(dl, dlopen,,
@@ -106,7 +109,7 @@
 		[gsversion=`cat gsversion`], [gsversion=], [gsversion=unknown])
 	AC_MSG_RESULT("$gsversion")
 	rm -f gsversion
-	if test -z "$gsversion" || "$gsversion" -lt 831; then
+	if test -z "$gsversion" || test "$gsversion" -lt 831; then
 		# current Ghostscript API was introduced in version 8.31
 		# older versions are not supported
 		AC_DEFINE(DISABLE_GS, 1, [Set to 1 if PostScript support should be disabled])


More information about the tlbuild mailing list