[tlbuild] yet another progress report from Utah: OpenBSD (mostly a success)

Peter Breitenlohner peb at mppmu.mpg.de
Sat May 5 13:17:42 CEST 2012


On Fri, 4 May 2012, Nelson H. F. Beebe wrote:

> It isn't an OpenBSD thing: it happens on ALL of the platforms that
> I've built on.  I personally suspect that it is a bug in the
> source/Work/texk/kpathsea/Makefile, which has
>
> 	libkpathsea.la: $(libkpathsea_la_OBJECTS) $(libkpathsea_la_DEPENDENCIES) $(EXTRA_libkpathsea_la_DEPENDENCIES)
> 		$(libkpathsea_la_LINK) -rpath $(libdir) $(libkpathsea_la_OBJECTS) $(libkpathsea_la_LIBADD) $(LIBS)
>
> Notice that $(LIBS) appears at the end of that command.

That is the way Automake+Libtool work.  LIBS is intended for things detected
by configure such as '-lm'.

> 	LIBS='/usr/local/lib/libfontconfig.a /usr/lib/libexpat.a /usr/local/lib/libfreetype.a /usr/local/lib/libbz2.a /usr/local/lib/libz.a -lm'

You are forcing these libraries onto every binary - Libtool treats
executables and (static and/or shared) libtool-libraries on similar footing.

Since your setting of LIBS works, I assume there are no shared libfontconfig
etc in your library search path.

A proper way to do things would be this:

(1) add to the library search path, e.g., LDFLAGS=-L<some_dir>.

(2) put libfontconfig.la plus libfontconfig.a into <some_dir>, and do
     the same for libexpat, libfreetype, libbz2, libz.

     The .la files could be those where your .a files come from, suitably
     modified for the absence of shared libraries and for <some_dir>,
     or you could just manufacture them by hand.

     The attached file can serve as template.

     Of course, all that could equally be achieved when you freshly build
     and install libz, libbz2, etc with
       '--disable-shared --libdir=<some_dir> LDFLAGS=-L<some_dir>'

The dependency_libs listed in libfontconfig.la make sure that when Libtool
is linking a program against libfontconfig.a the other ones will be
automatically included explicitly.

You may have to configure with '--disable-libtool-hack' in order to avoid
the hack that otherwise would prevent exactly this mechanism (for shared
libraries).

Regards
Peter
-------------- next part --------------
# libfontconfig.la - a libtool library file
# Generated by libtool (GNU libtool) 2.4 Debian-2.4-2ubuntu1
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# The name that we can dlopen(3).
dlname=''

# Names of this library.
library_names=''

# The name of the static archive.
old_library='libfontconfig.a'

# Linker flags that can not go in dependency_libs.
inherited_linker_flags=''

# Libraries that this one depends upon.
dependency_libs=' <some_dir>/libfreetype.la <some_dir>/libexpat.la <some_dir>/libbz2.la <some_dir>/libz.la'

# Names of additional weak libraries provided by this library
weak_library_names=''

# Version information for libfontconfig.
current=6
age=5
revision=0

# Is this an already installed library?
installed=yes

# Should we warn about portability when linking against -modules?
shouldnotlink=no

# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''

# Directory that this library needs to be installed in:
libdir='<some_dir>'


More information about the tlbuild mailing list