From 88cd4e4c3fec7fca33701954456c98fa1f2133b2 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 8 May 2002 08:56:41 +0000 Subject: [PATCH] 2002-05-08 Charles Wilson Alexandre Duret-Lutz * lib/am/progs.am (clean-%DIR%PROGRAMS): If Libtool is used, clean both `program$(EXEEXT)' and `program'; needed under Cygwin. * tests/libtool3.test: New file. * tests/Makefile.am (TESTS): Add libtool3.test. --- ChangeLog | 8 +++++++ THANKS | 1 + lib/am/progs.am | 15 ++++++++++++- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/libtool3.test | 55 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 80 insertions(+), 1 deletion(-) create mode 100755 tests/libtool3.test diff --git a/ChangeLog b/ChangeLog index bd0b184e..ddf3aee6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-05-08 Charles Wilson + Alexandre Duret-Lutz + + * lib/am/progs.am (clean-%DIR%PROGRAMS): If Libtool is used, clean + both `program$(EXEEXT)' and `program'; needed under Cygwin. + * tests/libtool3.test: New file. + * tests/Makefile.am (TESTS): Add libtool3.test. + 2002-05-07 Alexandre Duret-Lutz * TODO: Undust. diff --git a/THANKS b/THANKS index 7c067ab3..7fc11afa 100644 --- a/THANKS +++ b/THANKS @@ -28,6 +28,7 @@ Brendan O'Dea bod@compusol.com.au Brian Ford ford@vss.fsi.com Brian Jones cbj@nortel.net Bruno Haible haible@ilog.fr +Charles Wilson cwilson@ece.gatech.edu Chris Provenzano proven@io.proven.org Christian Cornelssen ccorn@cs.tu-berlin.de danbp danpb@nospam.postmaster.co.uk diff --git a/lib/am/progs.am b/lib/am/progs.am index 2e7ad839..c1ccfbba 100644 --- a/lib/am/progs.am +++ b/lib/am/progs.am @@ -80,4 +80,17 @@ endif %?INSTALL% .PHONY clean-am: clean-%DIR%PROGRAMS clean-%DIR%PROGRAMS: - -test -z "$(%DIR%_PROGRAMS)" || rm -f $(%DIR%_PROGRAMS) +?!LIBTOOL? -test -z "$(%DIR%_PROGRAMS)" || rm -f $(%DIR%_PROGRAMS) +## Under Cygwin, we build `program$(EXEEXT)'. However, if this +## program uses a Libtool library, Libtool will move it in +## `_libs/program$(EXEEXT)' and create a `program' wrapper (without +## `$(EXEEXT)'). Therefore, if Libtool is used, we must try to erase +## both `program$(EXEEXT)' and `program'. +## Cleaning the `_libs/' or `.libs/' directory is done from clean-libtool. +## FIXME: In the future (i.e., when it works) it would be nice to delegate +## this task to `libtool --mode=clean'. +?LIBTOOL? @list='$(%DIR%_PROGRAMS)'; for p in $$list; do \ +?LIBTOOL? f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ +?LIBTOOL? echo " rm -f $$p $$f"; \ +?LIBTOOL? rm -f $$p $$f ; \ +?LIBTOOL? done diff --git a/tests/Makefile.am b/tests/Makefile.am index 14613f96..4798be8a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -201,6 +201,7 @@ libobj11.test \ library.test \ libtool.test \ libtool2.test \ +libtool3.test \ link_c_cxx.test \ link_dist.test \ link_f_c.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index a814f82d..1fbe417e 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -285,6 +285,7 @@ libobj11.test \ library.test \ libtool.test \ libtool2.test \ +libtool3.test \ link_c_cxx.test \ link_dist.test \ link_f_c.test \ diff --git a/tests/libtool3.test b/tests/libtool3.test new file mode 100755 index 00000000..8f0a07cf --- /dev/null +++ b/tests/libtool3.test @@ -0,0 +1,55 @@ +#! /bin/sh + +# Try to build and package a program linked to a Libtool library. + +required='libtoolize gcc' +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AM_PROG_LIBTOOL +AC_OUTPUT +END + +cat > Makefile.am << 'END' +lib_LTLIBRARIES = lib0.la +lib0_la_SOURCES = 0.c + +bin_PROGRAMS = 1 +1_SOURCES = 1.c +1_LDADD = lib0.la +END + +cat > 0.c << 'END' +int +zero (void) +{ + return 0; +} +END + +cat > 1.c << 'END' +int zero (); + +int +main () +{ + return zero (); +} +END + +set -e + +# Use --copy to workaround a bug in Cygwin's `cp -p' during distcheck. +# (This bug is already exhibited by subobj9.test.) In brief: Cygwin's +# `cp -p' tries to preserve group and owner of the source and fails +# to do so under normal accounts. With --copy we ensure we own all files. + +libtoolize --force --copy +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing --copy + +./configure +$MAKE +$MAKE distcheck -- 2.43.5