automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automake,cygwin: 'make clean' with libtool wrappers...


From: Alexandre Duret-Lutz
Subject: Re: Automake,cygwin: 'make clean' with libtool wrappers...
Date: 08 May 2002 10:41:58 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>> "Charles" == Charles Wilson <address@hidden> writes:

[...]  
 Charles> You have to use Charles> 'lib_LTLIBRARIES" instead
[...]
 Charles> With that change(*), then this test fails without
 Charles> your-version-of-my-patch to progs.am, and passes with
 Charles> that patch to progs.am.

Thanks, I'm checking in the appended patch.

[...]

 Charles> I also tracked down the a.exe problem to libtool.m4
 Charles> (line 3150) within the g++ configuration block
 Charles> (20020502 CVS):

[...]

 Charles> # Clean up.
 Charles> rm -f a.out  <<<<<<< HERE
 Charles> else
 Charles> echo "libtool.m4: error: problem compiling C++ test program"
 Charles> fi

 Charles> $rm -f confest.$objext

 Charles> case " $_LT_AC_TAGVAR(postdeps, $1) " in
 Charles> *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
 Charles> -------------------------------------

 Charles> Scanning through configure, I see that in many places -- even after
 Charles> 'EXEEXT' has been found, both a.out and a.exe are explicitly removed:

 Charles> rm -f a.out a.exe conftest$ac_cv_exeext

 Charles> I also notice that there is an explicit test for "C
 Charles> compiler default output" -- but none for "C++ compiler
 Charles> default output".

 Charles> Is this an autoconf bug AND a libtool bug -- autoconf
 Charles> doesn't test for C++ "default output" variable, and
 Charles> libtool.m4 should use that variable (rm -f
 Charles> ${cxx_default_output))?

In my opinion this is a double Libtool bug:

  1. it doesn't delete a.exe in addition to a.out
  2. it run some C++ test although we don't use C++.

The last time I checked Libtool CVS, it would systematically run
tests for all languages it knows (C++, Java...) even when not
used.  So I assumed that CVS HEAD was not ready for public use.

-- 
Alexandre Duret-Lutz
Index: ChangeLog
--- ChangeLog
+++ ChangeLog
@@ -1,1 +1,9 @@
+2002-05-08  Charles Wilson  <address@hidden>
+            Alexandre Duret-Lutz  <address@hidden>
+
+       * 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.
+

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.170
diff -u -r1.170 THANKS
--- THANKS      25 Apr 2002 07:55:00 -0000      1.170
+++ THANKS      8 May 2002 08:42:31 -0000
@@ -28,6 +28,7 @@
 Brian Ford             address@hidden
 Brian Jones            address@hidden
 Bruno Haible           address@hidden
+Charles Wilson         address@hidden
 Chris Provenzano       address@hidden
 Christian Cornelssen   address@hidden
 danbp                  address@hidden
Index: lib/am/progs.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/progs.am,v
retrieving revision 1.33
diff -u -r1.33 progs.am
--- lib/am/progs.am     5 Mar 2002 21:34:14 -0000       1.33
+++ lib/am/progs.am     8 May 2002 08:42:31 -0000
@@ -80,4 +80,17 @@
 
 .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
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.395
diff -u -r1.395 Makefile.am
--- tests/Makefile.am   6 May 2002 19:10:42 -0000       1.395
+++ tests/Makefile.am   8 May 2002 08:42:31 -0000
@@ -201,6 +201,7 @@
 library.test \
 libtool.test \
 libtool2.test \
+libtool3.test \
 link_c_cxx.test        \
 link_dist.test \
 link_f_c.test \
Index: tests/libtool3.test
===================================================================
RCS file: tests/libtool3.test
diff -N tests/libtool3.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/libtool3.test 8 May 2002 08:42:31 -0000
@@ -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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]