#!/bin/sh # Demonstrate the issue and check the fix. # Tested with GNU libtool 2.4.6 on Debian 5.10/GNU Linux x86_64. fix=draft960469.diff tmpdir=reproducer_temporary_directory set -C -e -f -u -v mkdir $tmpdir cd $tmpdir recreate_template() { find . -mindepth 1 -delete cat > hello.c < void hello (void) { printf ("If you are reading this, all probably went OK.\n"); } EOF cat > redirect.c < main.c < configure.ac < Makefile.am <> Makefile.am echo 'EXTRA_libredirect_la_DEPENDENCIES = libhello.so' >> Makefile.am autoreconf -i ./configure make LD_LIBRARY_PATH=. ./main # Recommended way (libhello.so). Currently fails. recreate_template echo 'libredirect_la_LIBADD = libhello.so' >> Makefile.am autoreconf -i ./configure ! make # Recommended way, with libtool patched. Should succeed. recreate_template echo 'libredirect_la_LIBADD = libhello.so' >> Makefile.am autoreconf -i ./configure patch -p2 libtool ../$fix make LD_LIBRARY_PATH=. ./main