[tlbuild] xetex statically linked

Rodrigo Medina rodmedina at cantv.net
Thu Sep 11 02:16:14 CEST 2008


Hi,
Finally I succeeding in statically linking xetex.
For some reason that I have not clear, but that I suspect
it has to do with the following check of configure in texk/web2

checking for statically linking C++ runtime library... not supported

the building process tries to link to the dynamical libraries.

It links to the following non-standard dynamic libraries of the system
cygexpat-1.dll
cygfontconfig-1.dll
cygfreetype-6.dll

In order to do this it builds the import libraries from the .dll's
.libs/libimp-cygfontconfig-1.a
.libs/libimp-cygfreetype-6.a
.libs/libimp-cygexpat-1.a
instead of using the import libraries that are already in the system as
(libexpat.dll.a etc)
or the static libraries (libexpat.a  etc).

One strange thing is that TeXlive has its own freetype2 library that is
used once as a
static library ./../libs/freetype2/.libs/libfreetype.a in addition to
libimp-cygfreetype-6.a

Another strange thing is that there is a /libs/expat directory in libs, but
nothing is built there.

Look at the compilation command that had previously worked
g++ -o xetex.exe xetexini.o xetex0.o xetex1.o xetex2.o xetexextra.o trans.o
XeTeX_ext.o xetex_pool.o XeT
eXFontMgr_FC.o synctex-xe.o mfileio.o numbers.o pdfimage.o bmpimage.o
jpegimage.o pngimage.o XeTeX_pic.o
 XeTeXFontMgr.o XeTeXLayoutInterface.o XeTeXOTLayoutEngine.o
XeTeXFontInst.o cmaps.o FontTableCache.o Xe
TeXOTMath.o XeTeXFontInst_FT2.o  ../../libs/icu-xetex/lib/impicuuc.a
../../libs/icu-xetex/lib/impicule.a
 ../../libs/icu-xetex/lib/impicudata.a
../../libs/teckit/lib/.libs/libTECkit.a ../../libs/freetype2/.lib
s/libfreetype.a ../../libs/zlib/libz.a ../../libs/xpdf/xpdf/libxpdf.a
../../libs/xpdf/goo/libGoo.a ../..
/libs/xpdf/fofi/libfofi.a ../../libs/libpng/libpng.a
.libs/libimp-cygfontconfig-1.a .libs/libimp-cygfree
type-6.a -lz .libs/libimp-cygexpat-1.a lib/lib.a
../kpathsea/.libs/libkpathsea.a

impicuuc.a impicule.a and impicudata.a are my own dynamical import icu
libraries, that I
have built from the static lisicu*.a files.

As the static link works for other platforms I have assumed that the
problem was with the objects
of /texk/web2c/xetexdir. I noticed that while compiling the icu libraries
there was a flag
-DU_STATIC_IMPLEMENTATION that affects a couple of programs and headers,
and that the xetex
objects use the icu-xetex headers.

So I have made the following:
1-I changed the /texk/web2c/Makefile setting the ICUCFLAGS as
   ICUCFLAGS = -I$(ICUDIR)/common -I$(ICUSRCDIR)/common
-I$(ICUSRCDIR)/layout -DU_STATIC_IMPLEMENTATION
2- I have compiled again the files of /texk/web2c/xetexdir
3- I have run by hand the compilation command of xetex substituting the
dynamic libraries by the
   the static ones
4- I had to change the second reference to libfreetype.a at the en of the
command because a new undefined reference
   appeared.

The new command is:

$ g++ -o xetex.exe xetexini.o xetex0.o xetex1.o xetex2.o xetexextra.o
trans.o XeTeX_ext.o xetex_pool.o X
eTeXFontMgr_FC.o synctex-xe.o mfileio.o numbers.o pdfimage.o bmpimage.o
jpegimage.o pngimage.o XeTeX_pic
.o XeTeXFontMgr.o XeTeXLayoutInterface.o XeTeXOTLayoutEngine.o
XeTeXFontInst.o cmaps.o FontTableCache.o 
XeTeXOTMath.o XeTeXFontInst_FT2.o  ../../libs/icu-xetex/lib/libsicuuc.a
../../libs/icu-xetex/lib/libsicu
le.a ../../libs/icu-xetex/lib/libsicudata.a
../../libs/teckit/lib/.libs/libTECkit.a ../../libs/freetype2
/.libs/libfreetype.a ../../libs/zlib/libz.a ../../libs/xpdf/xpdf/libxpdf.a
../../libs/xpdf/goo/libGoo.a 
../../libs/xpdf/fofi/libfofi.a ../../libs/libpng/libpng.a
/usr/lib/libfontconfig.a  -lz /usr/lib/libexpa
t.a lib/lib.a ../kpathsea/.libs/libkpathsea.a
../../libs/freetype2/.libs/libfreetype.a 
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:
warning: auto-importing has been ac
tivated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing
symbols from auto-imported DLLs
.Info: resolving __timezone by linking to __imp___timezone (auto-import)

Finally it worked.

$ xetex
warning: kpathsea: configuration file texmf.cnf not found in these
directories: /home/rmedina/TeXlive-20
08/texlive-20080816-source/Work/texk/web2c:/home/rmedina/TeXlive-2008/texliv
e-20080816-source/Work/texk:
/home/rmedina/TeXlive-2008/texlive-20080816-source/Work:/home/rmedina/TeXliv
e-2008/texlive-20080816-sour
ce/Work/texk/web2c/share/texmf-local/web2c:/home/rmedina/TeXlive-2008/texliv
e-20080816-source/Work/texk/
share/texmf-local/web2c:/home/rmedina/TeXlive-2008/texlive-20080816-source/W
ork/share/texmf-local/web2c:
/home/rmedina/TeXlive-2008/texlive-20080816-source/Work/texk/web2c/texmf-loc
al/web2c:/home/rmedina/TeXli
ve-2008/texlive-20080816-source/Work/texk/texmf-local/web2c:/home/rmedina/Te
Xlive-2008/texlive-20080816-
source/Work/texmf-local/web2c:/home/rmedina/TeXlive-2008/texlive-20080816-so
urce/Work/texk/web2c/share/t
exmf/web2c:/home/rmedina/TeXlive-2008/texlive-20080816-source/Work/texk/shar
e/texmf/web2c:/home/rmedina/
TeXlive-2008/texlive-20080816-source/Work/share/texmf/web2c:/home/rmedina/Te
Xlive-2008/texlive-20080816-
source/Work/texk/web2c/texmf/web2c:/home/rmedina/TeXlive-2008/texlive-200808
16-source/Work/texk/texmf/we
b2c:/home/rmedina/TeXlive-2008/texlive-20080816-source/Work/texmf/web2c.
This is XeTeX, Version 3.1415926-2.2-0.999.6 (Web2C 7.5.7)
**
! End of file on the terminal... why?

My knowledge of Makefiles is so basic that I declare myself incompetent in
proposing
modifications for Makefile.in and/or configure.


Greetings
Rodrigo Medina

Angelo: finalmente siamo usciti dalla selva oscura dove eravamo smarriti 
...





More information about the tlbuild mailing list