automake-patches
[Top][All Lists]
Advanced

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

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


From: Charles Wilson
Subject: Automake,cygwin: 'make clean' with libtool wrappers...
Date: Fri, 03 May 2002 00:59:00 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2

On cygwin, by the time you reach the 'clean-binPROGRAMS:' target, bin_PROGRAMS has been transmogrified to have .exe endings. But, when building dynamically linked executables on cygwin, you end up with:

<workdir>/myprogram  << wrapper script
<workdir>/.libs/myprogram.exe

In any case, it takes more than just 'rm -f ${bin_PROGRAMS)' to completely clean up this mess. So, the following patch to lib/am/progs.am.

When ?LIBTOOL?, loop thru bin_PROGRAMS, and hunt for and delete each of the following:

  myprogram.exe   << static linked .exe's go here (cygwin, DOS?)
  myprogram       << wrappers for dynamically linked .exe's (cygwin),
                     and statically linked unix executables
  .libs/myprogram.exe  << dynamically linked exe's (cygwin)
  .libs/myprogram      << dynamically linked unix executables
  _libs/myprogram.exe  << dynamically linked exe's (DOS?)
  _libs/myprogram      << ??? didn't want to leave anything out...

That covers all the possible "droppings" that libtool could create, on windows-ish platforms, dos-ish platforms (_libs) and unixoid ones.

(This patch also helps fix massive testsuite failures in the libtool package, when gets really confused by the random presence of old wrapper scripts -- when the current testbuild is static only ...)

--Chuck

2002-05-03  Charles Wilson  <address@hidden>

        * lib/am/progs.am: make sure to clean up all the
        libtool droppings when doing 'make clean'



diff -urN -x .build -x .inst -x .sinst automake-1.6.1-orig/lib/am/progs.am 
automake-1.6.1/lib/am/progs.am
--- automake-1.6.1-orig/lib/am/progs.am Tue Mar  5 16:34:14 2002
+++ automake-1.6.1/lib/am/progs.am      Thu May  2 20:34:07 2002
@@ -80,4 +80,31 @@
 
 .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)
+?LIBTOOL?      @list='$(%DIR%_PROGRAMS)'; for p in $$list; do \
+?LIBTOOL?        f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+?LIBTOOL?        if test -f $$p ; then \
+?LIBTOOL?          echo " rm -f $$p" && \
+?LIBTOOL?          rm -f $$p ; \
+?LIBTOOL?        fi ;\
+?LIBTOOL?        if test -f $$f ; then \
+?LIBTOOL?          echo " rm -f $$f" && \
+?LIBTOOL?          rm -f $$f ; \
+?LIBTOOL?        fi ;\
+?LIBTOOL?        if test -f .libs/$$p ; then \
+?LIBTOOL?          echo " rm -f .libs/$$p" && \
+?LIBTOOL?          rm -f .libs/$$p ; \
+?LIBTOOL?        fi ;\
+?LIBTOOL?        if test -f .libs/$$f ; then \
+?LIBTOOL?          echo " rm -f .libs/$$f" && \
+?LIBTOOL?          rm -f .libs/$$f ; \
+?LIBTOOL?        fi ;\
+?LIBTOOL?        if test -f _libs/$$p ; then \
+?LIBTOOL?          echo " rm -f _libs/$$p" && \
+?LIBTOOL?          rm -f _libs/$$p ; \
+?LIBTOOL?        fi ;\
+?LIBTOOL?        if test -f _libs/$$f ; then \
+?LIBTOOL?          echo " rm -f _libs/$$f" && \
+?LIBTOOL?          rm -f _libs/$$f ; \
+?LIBTOOL?        fi ;\
+?LIBTOOL?      done

reply via email to

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