Subject: libtool 2.4.2 fails to build due to macro_revision reversion

From: Bob Friesenhahn <[email-masked]>
Date: Sat, 27 Apr 2013 10:59:08 -0500 (CDT)

On an OpenIndiana (Solaris) system where I last formally installed 
libtool 2.4.2 on July 30, 2012, I am no longer able to build libtool 
2.4.2.

Regardless of if the build is done in the libtool source tree, or in 
another directory, the build fails with:

libtool: Version mismatch error.  This is libtool 2.4.2, revision 1.3337,
libtool: but the definition of this LT_INIT comes from revision 1.3135.
libtool: You should recreate aclocal.m4 with macros from revision 1.3337
libtool: of libtool 2.4.2 and run autoconf again.

% autoconf --version
autoconf (GNU Autoconf) 2.69

% automake --version
automake (GNU automake) 1.13

% libtool --version
libtool (GNU libtool) 2.4.2

% m4 --version
m4 (GNU M4) 1.4.12
[ yes, the above is old ]

% gcc --version
gcc (GCC) 4.8.0

% gmake --version
GNU Make 3.82

Quite bizarrely (not sure why), the first step of the build process 
regenerates libltdl/m4/ltversion.m4 in the source tree and ends up 
with a different serial number (1.3135) than what it had before 
(1.3337) even though the other libtool m4 files are the same.  A diff 
of the libltdl/m4 directory content only shows the serial number 
change.  The value must be computed by something (perhaps unreliably) 
since it does not appear in the original source files.

This is the result of 'gmake' (the wrong revision is immediately 
apparent in first line of output):

sed -e s,@MACRO_VERSION\@,2.4.2,g -e s,@MACRO_REVISION\@,1.3135,g -e s,@MACRO_SERIAL\@,3135,g -e s,@PACKAGE\@,libtool,g -e s,@PACKAGE_BUGREPORT\@,[email-masked],g -e s,@PACKAGE_URL\@,http://www.gnu.org/software/libtool/,g -e s,@PACKAGE_NAME\@,GNU Libtool,g -e s,@package_revision\@,1.3135,g -e s,@PACKAGE_STRING\@,GNU Libtool 2.4.2,g -e s,@PACKAGE_TARNAME\@,libtool,g -e s,@PACKAGE_VERSION\@,2.4.2,g -e s,@TIMESTAMP\@,,g -e s,@VERSION\@,2.4.2,g /home/bfriesen/src/gnu/libtool-2.4.2/libltdl/m4/ltversion.in > /home/bfriesen/src/gnu/libtool-2.4.2/libltdl/m4/ltversion.m4
CDPATH="${ZSH_VERSION+.}:" && cd /home/bfriesen/src/gnu/libtool-2.4.2 && /bin/sh /home/bfriesen/src/gnu/libtool-2.4.2/libltdl/config/missing --run aclocal-1.11 -I libltdl/m4
  cd /home/bfriesen/src/gnu/libtool-2.4.2 && /bin/sh /home/bfriesen/src/gnu/libtool-2.4.2/libltdl/config/missing --run automake-1.11 --gnu
CDPATH="${ZSH_VERSION+.}:" && cd /home/bfriesen/src/gnu/libtool-2.4.2 && /bin/sh /home/bfriesen/src/gnu/libtool-2.4.2/libltdl/config/missing --run autoconf
/bin/sh ./config.status --recheck
running CONFIG_SHELL=/bin/sh /bin/sh /home/bfriesen/src/gnu/libtool-2.4.2/configure --no-create --no-recursion
configure: loading site script /usr/local/share/config.site
Applying settings for 32-bit build ...
Using GCC 4.8.0 ...
CC       = "gcc-4.8.0"
CXX      = "c++-4.8.0"
F77      = "gfortran-4.8.0"
FC       = "gfortran-4.8.0"
CFLAGS   = "-O2"
CXXFLAGS = "-O"
CPPFLAGS = ""
LDFLAGS  = "-L/usr/local/lib -R/usr/local/lib"
## ------------------------- ##
## Configuring libtool 2.4.2 ##
## ------------------------- ##

checking for a BSD-compatible install... /usr/local/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /home/bfriesen/src/gnu/libtool-2.4.2/libltdl/config/install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... i386-pc-solaris2.11
checking host system type... i386-pc-solaris2.11
configure: autobuild project... GNU Libtool
configure: autobuild revision... 2.4.2 ()
configure: autobuild hostname... weerd
configure: autobuild mode... default
configure: autobuild timestamp... 20130427T150136Z
checking for gcc... gcc-4.8.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-4.8.0 accepts -g... yes
checking for gcc-4.8.0 option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc-4.8.0... gcc3
checking whether gcc-4.8.0 and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc-4.8.0 -E
checking how to print strings... print -r
checking for a sed that does not truncate output... /usr/bin/gsed
checking for grep that handles long lines and -e... /usr/sfw/bin/ggrep
checking for egrep... /usr/sfw/bin/ggrep -E
checking for fgrep... /usr/sfw/bin/ggrep -F
checking for ld used by gcc-4.8.0... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/ccs/bin/nm -p
checking the name lister (/usr/ccs/bin/nm -p) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786240
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i386-pc-solaris2.11 file names to i386-pc-solaris2.11 format... func_convert_file_noop
checking how to convert i386-pc-solaris2.11 file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... print -r --
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/ccs/bin/nm -p output from gcc-4.8.0 object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc-4.8.0 supports -fno-rtti -fno-exceptions... no
checking for gcc-4.8.0 option to produce PIC... -fPIC -DPIC
checking if gcc-4.8.0 PIC flag -fPIC -DPIC works... yes
checking if gcc-4.8.0 static flag -static works... no
checking if gcc-4.8.0 supports -c -o file.o... yes
checking if gcc-4.8.0 supports -c -o file.o... (cached) yes
checking whether the gcc-4.8.0 linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... solaris2.11 ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking whether stripping libraries is possible... no
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking which extension is used for runtime loadable modules... .so
checking which variable specifies run-time module search path... LD_LIBRARY_PATH
checking for the default library search path... /lib /usr/lib
checking for library containing dlopen... none required
checking for dlerror... yes
checking for shl_load... (cached) no
checking for shl_load in -ldld... (cached) no
checking for dld_link in -ldld... no
checking for _ prefix in compiled symbols... no
checking whether deplibs are loaded by dlopen... yes
checking for argz.h... no
checking for error_t... no
checking for argz_add... no
checking for argz_append... no
checking for argz_count... no
checking for argz_create_sep... no
checking for argz_insert... no
checking for argz_next... no
checking for argz_stringify... no
checking whether libtool supports -dlopen/-dlpreopen... yes
checking for unistd.h... (cached) yes
checking for dl.h... no
checking for sys/dl.h... yes
checking for dld.h... no
checking for mach-o/dyld.h... no
checking for dirent.h... yes
checking for closedir... yes
checking for opendir... yes
checking for readdir... yes
checking for strlcat... yes
checking for strlcpy... yes
checking whether we are using the GNU C++ compiler... yes
checking whether c++-4.8.0 accepts -g... yes
checking dependency style of c++-4.8.0... gcc3
checking how to run the C++ preprocessor... c++-4.8.0 -E
checking for ld used by c++-4.8.0... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking whether the c++-4.8.0 linker (/usr/bin/ld) supports shared libraries... yes
checking for c++-4.8.0 option to produce PIC... -fPIC -DPIC
checking if c++-4.8.0 PIC flag -fPIC -DPIC works... yes
checking if c++-4.8.0 static flag -static works... no
checking if c++-4.8.0 supports -c -o file.o... yes
checking if c++-4.8.0 supports -c -o file.o... (cached) yes
checking whether the c++-4.8.0 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... solaris2.11 ld.so
checking how to hardcode library paths into programs... immediate
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran-4.8.0 accepts -g... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gfortran-4.8.0 option to produce PIC... -fPIC
checking if gfortran-4.8.0 PIC flag -fPIC works... yes
checking if gfortran-4.8.0 static flag -static works... no
checking if gfortran-4.8.0 supports -c -o file.o... yes
checking if gfortran-4.8.0 supports -c -o file.o... (cached) yes
checking whether the gfortran-4.8.0 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... solaris2.11 ld.so
checking how to hardcode library paths into programs... immediate
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran-4.8.0 accepts -g... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gfortran-4.8.0 option to produce PIC... -fPIC
checking if gfortran-4.8.0 PIC flag -fPIC works... yes
checking if gfortran-4.8.0 static flag -static works... no
checking if gfortran-4.8.0 supports -c -o file.o... yes
checking if gfortran-4.8.0 supports -c -o file.o... (cached) yes
checking whether the gfortran-4.8.0 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... solaris2.11 ld.so
checking how to hardcode library paths into programs... immediate
checking for gccgo... no
checking for gcj... gcj
checking if gcj supports -fno-rtti -fno-exceptions... (cached) no
checking for gcj option to produce PIC... -fPIC
checking if gcj PIC flag -fPIC works... yes
checking if gcj static flag -static works... no
checking if gcj supports -c -o file.o... yes
checking if gcj supports -c -o file.o... (cached) yes
checking whether the gcj linker (/usr/bin/ld) supports shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking for windres... no
checking whether make supports order-only prerequisites... no
configure: creating ./config.status
  /bin/sh ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing tests/atconfig commands
config.status: executing depfiles commands
config.status: executing libtool commands
rm -f libtoolize.tmp libtoolize
sed -e 's,@aclocal_DATA\@,m4/argz.m4 m4/libtool.m4 m4/ltdl.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4,g' -e 's,@aclocaldir\@,/usr/local/share/aclocal,g' -e 's,@datadir\@,/usr/local/share,g' -e 's,@EGREP\@,/usr/sfw/bin/ggrep -E,g' -e 's,@FGREP\@,/usr/sfw/bin/ggrep -F,g' -e 's,@GREP\@,/usr/sfw/bin/ggrep,g' -e 's,@host_triplet\@,i386-pc-solaris2.11,g' -e 's,@LN_S\@,ln -s,g' -e "s,@pkgconfig_files\@,config/compile config/config.guess config/config.sub config/depcomp config/install-sh config/missing config/ltmain.sh,g" -e 's,@pkgdatadir\@,/usr/local/share/libtool,g' -e "s,@pkgltdl_files\@,libltdl/COPYING.LIB libltdl/README libltdl/Makefile.inc libltdl/Makefile.am libltdl/configure.ac libltdl/aclocal.m4 libltdl/Makefile.in libltdl/config-h.in libltdl/configure libltdl/argz_.h libltdl/argz.c libltdl/loaders/dld_link.c libltdl/loaders/dlopen.c libltdl/loaders/dyld.c libltdl/loaders/load_add_on.c libltdl/loaders/loadlibrary.c libltdl/loaders/shl_load.c libltdl!
 /lt__dirent.c libltdl/lt__strl.c libltdl/libltdl/lt__alloc.h libltdl/libltdl/lt__dirent.h libltdl/libltdl/lt__glibc.h libltdl/libltdl/lt__private.h libltdl/libltdl/lt__strl.h libltdl/libltdl/lt_dlloader.h libltdl/libltdl/lt_error.h libltdl/libltdl/lt_system.h libltdl/libltdl/slist.h libltdl/loaders/preopen.c libltdl/lt__alloc.c libltdl/lt_dlloader.c libltdl/lt_error.c libltdl/ltdl.c libltdl/ltdl.h libltdl/slist.c,g" -e 's,@prefix\@,/usr/local,g' -e 's,@SED\@,/usr/bin/gsed,g' \
 	/home/bfriesen/src/gnu/libtool-2.4.2/libtoolize.in > libtoolize.tmp
chmod a+x libtoolize.tmp
chmod a-w libtoolize.tmp
mv -f libtoolize.tmp libtoolize
/bin/sh /home/bfriesen/src/gnu/libtool-2.4.2/libltdl/config/install-sh -d . libltdl/
cp /home/bfriesen/src/gnu/libtool-2.4.2/libltdl/argz_.h libltdl/argz.h-t
mv libltdl/argz.h-t libltdl/argz.h
(CDPATH="${ZSH_VERSION+.}:" && cd /home/bfriesen/src/gnu/libtool-2.4.2 && /bin/sh /home/bfriesen/src/gnu/libtool-2.4.2/libltdl/config/missing --run autoheader)
rm -f stamp-h1
touch /home/bfriesen/src/gnu/libtool-2.4.2/config-h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
gmake  all-recursive
gmake[1]: Entering directory `/scratch/bfriesen/build/libtool-2.4.2'
gmake[2]: Entering directory `/scratch/bfriesen/build/libtool-2.4.2'
test -f doc/.dirstamp || gmake  doc/.dirstamp
gmake[3]: Entering directory `/scratch/bfriesen/build/libtool-2.4.2'
gmake[3]: Leaving directory `/scratch/bfriesen/build/libtool-2.4.2'
/bin/sh ./libtool  --tag=CC   --mode=compile gcc-4.8.0 -DHAVE_CONFIG_H -I. -I/home/bfriesen/src/gnu/libtool-2.4.2  -DLTDLOPEN=libltdl -DLT_CONFIG_H='<config.h>' -DLTDL -I. -I/home/bfriesen/src/gnu/libtool-2.4.2 -Ilibltdl -I/home/bfriesen/src/gnu/libtool-2.4.2/libltdl -I/home/bfriesen/src/gnu/libtool-2.4.2/libltdl/libltdl   -O2 -MT libltdl/loaders/libltdl_libltdl_la-preopen.lo -MD -MP -MF libltdl/loaders/.deps/libltdl_libltdl_la-preopen.Tpo -c -o libltdl/loaders/libltdl_libltdl_la-preopen.lo `test -f 'libltdl/loaders/preopen.c' || echo '/home/bfriesen/src/gnu/libtool-2.4.2/'`libltdl/loaders/preopen.c
libtool: Version mismatch error.  This is libtool 2.4.2, revision 1.3337,
libtool: but the definition of this LT_INIT comes from revision 1.3135.
libtool: You should recreate aclocal.m4 with macros from revision 1.3337
libtool: of libtool 2.4.2 and run autoconf again.
gmake[2]: *** [libltdl/loaders/libltdl_libltdl_la-preopen.lo] Error 63
gmake[2]: Leaving directory `/scratch/bfriesen/build/libtool-2.4.2'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/scratch/bfriesen/build/libtool-2.4.2'
gmake: *** [all] Error 2

-- 
Bob Friesenhahn
[email-masked], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/