[tex-live] makempx temp shell script packaged into texlive-metapost

Sanjoy Mahajan sanjoy at mrao.cam.ac.uk
Sat May 19 19:38:15 CEST 2007


I built the Ubuntu 7.10 (gutsy) texlive 2007 packages on my Ubuntu 7.04
system, in order to make backports publicly available.  Most tests
worked but metapost failed with:

  /usr/bin/ld: cannot open output file /usr/bin/.libs/12630-lt-makempx:
  No such file or directory

I think the fix is this one-line change (for metapost upstream, texlive
upstream, and the Debian and Ubuntu texlive-bin src package):

--- texlive-bin-2007/build/source/texk/web2c/mpware/Makefile.in	2006-11-28 08:24:53.000000000 -0500
+++ texlive-bin-2007/build/source/texk/web2c/mpware/Makefile.in	2007-05-19 11:24:46.000000000 -0400
@@ -49,7 +49,7 @@
 	$(INSTALL_PROGRAM) newer $(bindir)/newer
 	$(INSTALL_LIBTOOL_PROG) dmp $(bindir)
 	$(INSTALL_LIBTOOL_PROG) mpto $(bindir)
-	$(INSTALL_SCRIPT) makempx $(scriptdir)/makempx
+	$(INSTALL_LIBTOOL_PROG) makempx $(scriptdir)/makempx
 install-data:
 
 kpse_include ../make/tkpathsea.mk


Here is the longer story.  

The /usr/bin/makempx in my backport of texlive-metapost or in the Ubuntu
repo <http://packages.ubuntu.com/gutsy/tex/texlive-metapost> (version is
2007-7ubuntu1) was a temporary shell script.  It began with these lines
that indicate something bad has happened:

  #! /bin/sh

  # makempx - temporary wrapper script for .libs/makempx
  # Generated by ltmain.sh - GNU libtool 1.4.3 (1.922.2.111 2002/10/23 02:54:36)
  #
  # The makempx program cannot be directly executed until all the libtool
  # libraries that it depends on are installed.
  #
  # This wrapper script should never be moved out of the build directory.
  # If it is, it will not operate correctly.

That script should be run only during the build, and the makempx ELF
binary should be packaged instead.

Norbert's Debian packages don't expose this problem, nor (I think) does
a vanilla texlive install.  Since the Debian src package is almost
identical to the Ubuntu package, why does the Ubuntu texlive-bin src
package (version 2007-7ubuntu1) have the problem?  That question puzzled
me for a while.

So I built Norbert's packages (with the libpoppler patch from the Ubuntu
pkg).  The command lines to build makempx differ, because the libtool
scripts differ.  Here is the diff in the libtool scripts:

--- etch/texlive-bin-2007/build/source/Work/texk/libtool	2007-05-19 11:49:13.000000000 -0400
+++ fesity/texlive-bin-2007/build/source/Work/texk/libtool	2007-05-19 11:39:21.000000000 -0400
@@ -47 +47 @@
-build_libtool_libs=no
+build_libtool_libs=yes
@@ -53 +53 @@
-build_libtool_need_lc=yes
+build_libtool_need_lc=no
@@ -56 +56 @@
-fast_install=needless
+fast_install=yes


Here are the makempx build command in the Ubuntu build:

  /bin/sh ../../libtool --mode=link gcc -o makempx   makempx.o ../lib/lib.a ../../kpathsea/libkpathsea.la -lm  
  gcc -o .libs/makempx makempx.o  ../lib/lib.a ../../kpathsea/.libs/libkpathsea.so -lm -Wl,--rpath -Wl,/home/sanjoy/tmp/feisty-mod/texlive-bin-2007/build/source/inst/lib

So the makempx binary goes in .libs/makempx.  Which is fine as long it
gets packaged.  But the following Makefile.in line means that instead
./makempx (the temporary shell script) will get packaged:

	$(INSTALL_SCRIPT) makempx $(scriptdir)/makempx

But back to why the Debian pkgs end up with the correct makempx.  I
think it's due to a lucky combination of configure options.  

Here's the reasoning.  The libtool scripts differ between Debian and
Ubuntu builds because the configure settings differ.  Here is the
relevant hunk:

diff -r -u etch/texlive-bin-2007/debian/rules feisty/texlive-bin-2007/debian/rules
--- etch/texlive-bin-2007/debian/rules	2007-05-19 10:29:24.000000000 -0400
+++ feisty/texlive-bin-2007/debian/rules	2007-05-19 10:32:19.000000000 -0400
@@ -21,7 +21,7 @@
 	--with-system-ncurses --with-system-pnglib --with-system-zlib --with-system-gd \
 	--with-system-freetype --with-system-freetype2 \
 	--with-freetype2-include=/usr/include/freetype2 \
-	--without-install-extra
+	--without-install-extra --enable-shared
  
 unpack-stamp:
 	mkdir -p build


The --enable-shared in the Ubuntu pkg must set fast_install to yes.  In
the Debian build, perhaps because of fast_install=notneeded, the makempx
binary is put in the main directory rather than in .libs/:

  /bin/sh ../../libtool --mode=link gcc -o makempx   makempx.o ../lib/lib.a ../../kpathsea/libkpathsea.la -lm  
  gcc -o makempx makempx.o  ../lib/lib.a ../../kpathsea/.libs/libkpathsea.a -lm

The Makefile rule using $(INSTALL_SCRIPT) (which is just 'install')
installs the binary anyway and does no harm, in the Debian build.
However, if texlive or metapost or Debian turn on --enable-shared, then
this makempx trouble will arise.  So I think it should be fixed
upstream.

I checked through the other Makefile.in's in the texlive svn tree and
didn't see similar problems, but I may have missed an implicit use of
libtool that doesn't have a matching $(INSTALL_LIBTOOL_PROG).

-Sanjoy



More information about the tex-live mailing list