automake-patches
[Top][All Lists]
Advanced

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

FYI: fix for PR/300


From: Alexandre Duret-Lutz
Subject: FYI: fix for PR/300
Date: 05 Mar 2002 22:23:28 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

I'm checking in this patch for PR/300.  It is similar to the fix
for nobase.test: i.e., when nobase_ is used, use install-sh
(because install_sh will create the missing directories
automatically).

(No NEWS entry because this is somehow part of "Fixed handling
of nobase_ targets.")

Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.1774
diff -u -r1.1774 ChangeLog
--- ChangeLog   2002/03/05 18:41:39     1.1774
+++ ChangeLog   2002/03/05 20:42:40
@@ -1,3 +1,23 @@
+2002-03-05  Alexandre Duret-Lutz  <address@hidden>
+
+       Fix for PR automake/300:
+       * tests/pr300-lib.test, tests/pr300-ltlib.test,
+       tests/pr300-prog.test: New files.
+       * tests/Makefile.am (TESTS): Add them.
+       * automake.in (handle_ltlibraries): Strip nobase_ prefix to
+       compute the directory.
+       * lib/am/header-vars.am (install_sh_PROGRAM): New variable.
+       * lib/am/libs.am (%DIR%LIBRARIES_INSTALL): New variable.
+       (install-%DIR%LIBRARIES): Use it.  Honor nobase_.
+       (uninstall-%DIR%LIBRARIES): Honor nobase_.
+       * lib/am/ltlibs.am (%DIR%LTLIBRARIES_INSTALL): New variable.
+       (install-%DIR%LTLIBRARIES): Use it.  Honor nobase_.
+       (uninstall-%DIR%LTLIBRARIES): Honor nobase_.
+       * lib/am/progs.am (%DIR%PROGRAMS_INSTALL): New variable.
+       (install-%DIR%PROGRAMS): Use it.  Honor nobase_.
+       (uninstall-%DIR%PROGRAMS): Honor nobase_.
+       See also the fix for nobase.test on 2001-11-09.
+
 2002-03-05  Pavel Roskin  <address@hidden>
 
        * tests/yacc8.test: Add a command between "test" and "cd" to
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1280
diff -u -r1.1280 automake.in
--- automake.in 2002/03/05 17:09:29     1.1280
+++ automake.in 2002/03/05 20:43:03
@@ -2867,6 +2867,7 @@
          }
 
        # Get the installation directory of each library.
+       (my $dir = $key) =~ s/^nobase_//;
        for (variable_value_as_list_recursive ($key . '_LTLIBRARIES', 'all'))
          {
            if ($instdirs{$_})
@@ -2875,7 +2876,7 @@
              }
            else
              {
-               $instdirs{$_} = $key;
+               $instdirs{$_} = $dir;
              }
          }
       }
Index: lib/am/header-vars.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/header-vars.am,v
retrieving revision 1.42
diff -u -r1.42 header-vars.am
--- header-vars.am      2001/11/09 16:25:03     1.42
+++ header-vars.am      2002/03/05 20:43:11
@@ -65,6 +65,7 @@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
 install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_HEADER = $(INSTALL_DATA)
 transform = @program_transform_name@
Index: lib/am/libs.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/libs.am,v
retrieving revision 1.21
diff -u -r1.21 libs.am
--- libs.am     2001/06/28 15:06:50     1.21
+++ libs.am     2002/03/05 20:43:11
@@ -33,6 +33,8 @@
 
 if %?INSTALL%
 _am_installdirs += $(DESTDIR)$(%NDIR%dir)
+?BASE?%DIR%LIBRARIES_INSTALL = $(INSTALL_DATA)
+?!BASE?%DIR%LIBRARIES_INSTALL = $(install_sh_DATA)
 ?EXEC?.PHONY install-exec-am: install-%DIR%LIBRARIES
 ?!EXEC?.PHONY install-data-am: install-%DIR%LIBRARIES
 install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES)
@@ -42,8 +44,13 @@
 ## a syntax error in sh.
        @list='$(%DIR%_LIBRARIES)'; for p in $$list; do \
          if test -f $$p; then \
-           echo " $(INSTALL_DATA) $$p $(DESTDIR)$(%NDIR%dir)/$$p"; \
-           $(INSTALL_DATA) $$p $(DESTDIR)$(%NDIR%dir)/$$p; \
+## Compute basename of source file.  Unless this is a nobase_ target, we
+## want to install 'python/foo.py' as '$(DESTDIR)$(%NDIR%dir)/foo.yo',
+## not '$(DESTDIR)$(%NDIR%dir)/python/foo.yo'.
+?BASE?     f="`echo $$p | sed -e 's|^.*/||'`"; \
+?!BASE?            f="$$p"; \
+           echo " $(%DIR%LIBRARIES_INSTALL) $$p $(DESTDIR)$(%NDIR%dir)/$$f"; \
+           $(%DIR%LIBRARIES_INSTALL) $$p $(DESTDIR)$(%NDIR%dir)/$$f; \
          else :; fi; \
        done
 ## We do two loops here so that $(POST_INSTALL) can be empty.  If we
@@ -54,6 +61,7 @@
        @$(POST_INSTALL)
        @list='$(%DIR%_LIBRARIES)'; for p in $$list; do \
          if test -f $$p; then \
+?BASE?     p="`echo $$p | sed -e 's|^.*/||'`"; \
 ## Must ranlib after installing because mod time changes.
            echo " $(RANLIB) $(DESTDIR)$(%NDIR%dir)/$$p"; \
            $(RANLIB) $(DESTDIR)$(%NDIR%dir)/$$p; \
@@ -71,6 +79,7 @@
 uninstall-%DIR%LIBRARIES:
        @$(NORMAL_UNINSTALL)
        @list='$(%DIR%_LIBRARIES)'; for p in $$list; do \
+?BASE?   p="`echo $$p | sed -e 's|^.*/||'`"; \
          echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$p"; \
          rm -f $(DESTDIR)$(%NDIR%dir)/$$p; \
        done
Index: lib/am/ltlib.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/ltlib.am,v
retrieving revision 1.21
diff -u -r1.21 ltlib.am
--- ltlib.am    2001/04/09 09:50:33     1.21
+++ ltlib.am    2002/03/05 20:43:11
@@ -23,6 +23,8 @@
 
 if %?INSTALL%
 _am_installdirs += $(DESTDIR)$(%NDIR%dir)
+?BASE?%DIR%LTLIBRARIES_INSTALL = $(INSTALL)
+?!BASE?%DIR%LTLIBRARIES_INSTALL = $(install_sh) -c
 ?EXEC?.PHONY install-exec-am: install-%DIR%LTLIBRARIES
 ?!EXEC?.PHONY install-data-am: install-%DIR%LTLIBRARIES
 install-%DIR%LTLIBRARIES: $(%DIR%_LTLIBRARIES)
@@ -32,14 +34,19 @@
 ## a syntax error in sh.
        @list='$(%DIR%_LTLIBRARIES)'; for p in $$list; do \
          if test -f $$p; then \
+## Compute basename of source file.  Unless this is a nobase_ target, we
+## want to install 'python/foo.py' as '$(DESTDIR)$(%NDIR%dir)/foo.yo',
+## not '$(DESTDIR)$(%NDIR%dir)/python/foo.yo'.
+?BASE?     f="`echo $$p | sed -e 's|^.*/||'`"; \
+?!BASE?            f="$$p"; \
 ## Note that we explicitly set the libtool mode.  This avoids any lossage
 ## if the program doesn't have a name that libtool expects.
 ## Use INSTALL and not INSTALL_DATA because libtool knows the right
 ## permissions to use.
-?LIBTOOL?          echo " $(LIBTOOL) --mode=install $(INSTALL) 
$(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(%NDIR%dir)/$$p"; \
-?LIBTOOL?          $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) 
$$p $(DESTDIR)$(%NDIR%dir)/$$p; \
-?!LIBTOOL?         echo " $(INSTALL) $(INSTALL_STRIP_FLAG) $$p 
$(DESTDIR)$(%NDIR%dir)/$$p"; \
-?!LIBTOOL?         $(INSTALL) $(INSTALL_STRIP_FLAG) $$p 
$(DESTDIR)$(%NDIR%dir)/$$p; \
+?LIBTOOL?          echo " $(LIBTOOL) --mode=install 
$(%DIR%LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p 
$(DESTDIR)$(%NDIR%dir)/$$f"; \
+?LIBTOOL?          $(LIBTOOL) --mode=install $(%DIR%LTLIBRARIES_INSTALL) 
$(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(%NDIR%dir)/$$f; \
+?!LIBTOOL?         echo " $(%DIR%LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) 
$$p $(DESTDIR)$(%NDIR%dir)/$$f"; \
+?!LIBTOOL?         $(%DIR%LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p 
$(DESTDIR)$(%NDIR%dir)/$$f; \
          else :; fi; \
        done
 endif %?INSTALL%
@@ -54,6 +61,7 @@
 uninstall-%DIR%LTLIBRARIES:
        @$(NORMAL_UNINSTALL)
        @list='$(%DIR%_LTLIBRARIES)'; for p in $$list; do \
+?BASE?     p="`echo $$p | sed -e 's|^.*/||'`"; \
 ?LIBTOOL?        echo " $(LIBTOOL) --mode=uninstall rm -f 
$(DESTDIR)$(%NDIR%dir)/$$p"; \
 ?LIBTOOL?        $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(%NDIR%dir)/$$p; 
\
 ?!LIBTOOL?       echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$p"; \
Index: lib/am/progs.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/progs.am,v
retrieving revision 1.32
diff -u -r1.32 progs.am
--- progs.am    2001/07/22 21:50:18     1.32
+++ progs.am    2002/03/05 20:43:11
@@ -24,6 +24,8 @@
 
 if %?INSTALL%
 _am_installdirs += $(DESTDIR)$(%NDIR%dir)
+?BASE?%DIR%PROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+?!BASE?%DIR%PROGRAMS_INSTALL = $(install_sh_PROGRAM)
 ?EXEC?.PHONY install-exec-am: install-%DIR%PROGRAMS
 ?!EXEC?.PHONY install-data-am: install-%DIR%PROGRAMS
 install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
@@ -38,14 +40,18 @@
          if test -f $$p \
 ?LIBTOOL?           || test -f $$p1 \
          ; then \
+## Compute basename of source file.  Unless this is a nobase_ target, we
+## want to install 'python/foo.py' as '$(DESTDIR)$(%NDIR%dir)/foo.yo',
+## not '$(DESTDIR)$(%NDIR%dir)/python/foo.yo'.
+?BASE?     p1=`echo "$$p1" | sed -e 's,^.*/,,'`; \
+           f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
 ## Note that we explicitly set the libtool mode.  This avoids any
 ## lossage if the install program doesn't have a name that libtool
 ## expects.
-           f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
-?LIBTOOL?         echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install 
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(%NDIR%dir)/$$f"; \
-?LIBTOOL?         $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install 
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(%NDIR%dir)/$$f; \
-?!LIBTOOL?        echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p 
$(DESTDIR)$(%NDIR%dir)/$$f"; \
-?!LIBTOOL?        $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p 
$(DESTDIR)$(%NDIR%dir)/$$f; \
+?LIBTOOL?         echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install 
$(%DIR%PROGRAMS_INSTALL) $$p $(DESTDIR)$(%NDIR%dir)/$$f"; \
+?LIBTOOL?         $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install 
$(%DIR%PROGRAMS_INSTALL) $$p $(DESTDIR)$(%NDIR%dir)/$$f; \
+?!LIBTOOL?        echo " $(INSTALL_PROGRAM_ENV) $(%DIR%PROGRAMS_INSTALL) $$p 
$(DESTDIR)$(%NDIR%dir)/$$f"; \
+?!LIBTOOL?        $(INSTALL_PROGRAM_ENV) $(%DIR%PROGRAMS_INSTALL) $$p 
$(DESTDIR)$(%NDIR%dir)/$$f; \
          else :; fi; \
        done
 endif %?INSTALL%
@@ -61,6 +67,7 @@
        @$(NORMAL_UNINSTALL)
        @list='$(%DIR%_PROGRAMS)'; for p in $$list; do \
          f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+?BASE?   f=`echo "$$f" | sed -e 's,^.*/,,'`; \
          echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$f"; \
          rm -f $(DESTDIR)$(%NDIR%dir)/$$f; \
        done
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.378
diff -u -r1.378 Makefile.am
--- Makefile.am 2002/03/05 17:09:31     1.378
+++ Makefile.am 2002/03/05 20:43:13
@@ -264,6 +264,9 @@
 pr279.test \
 pr279-2.test \
 pr287.test \
+pr300-lib.test \
+pr300-ltlib.test \
+pr300-prog.test \
 prefix.test \
 primary.test \
 primary2.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.490
diff -u -r1.490 Makefile.in
--- Makefile.in 2002/03/05 17:09:32     1.490
+++ Makefile.in 2002/03/05 20:43:13
@@ -48,6 +48,7 @@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
 install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_HEADER = $(INSTALL_DATA)
 transform = @program_transform_name@
@@ -339,6 +340,9 @@
 pr279.test \
 pr279-2.test \
 pr287.test \
+pr300-lib.test \
+pr300-ltlib.test \
+pr300-prog.test \
 prefix.test \
 primary.test \
 primary2.test \
Index: tests/pr300-lib.test
===================================================================
RCS file: pr300-lib.test
diff -N pr300-lib.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ pr300-lib.test      Tue Mar  5 12:43:13 2002
@@ -0,0 +1,53 @@
+#! /bin/sh
+
+# Make sure that installing subdirectory libraries works.
+# PR/300
+
+. $srcdir/defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_RANLIB
+AC_PROG_CC
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+lib_LIBRARIES = subdir/liba.a
+subdir_liba_a_SOURCES = a.c
+
+nobase_lib_LIBRARIES = subdir/libb.a
+subdir_libb_a_SOURCES = a.c
+END
+
+cat > a.c << 'END'
+int i = 3;
+END
+
+## A rule in the Makefile should create subdir
+# mkdir subdir
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --copy --add-missing
+./configure --prefix `pwd`/inst
+$MAKE
+
+test -f subdir/liba.a
+test -f subdir/libb.a
+
+$MAKE install
+
+test -f inst/lib/liba.a
+test -f inst/lib/subdir/libb.a
+
+$MAKE uninstall
+
+test -f inst/lib/liba.a && exit 1
+test -f inst/lib/subdir/libb.a && exit 1
+
+$MAKE install-strip
+
+test -f inst/lib/liba.a
+test -f inst/lib/subdir/libb.a
Index: tests/pr300-ltlib.test
===================================================================
RCS file: pr300-ltlib.test
diff -N pr300-ltlib.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ pr300-ltlib.test    Tue Mar  5 12:43:13 2002
@@ -0,0 +1,55 @@
+#! /bin/sh
+
+# Make sure that installing subdirectory libtool libraries works.
+# PR/300
+
+required=libtoolize
+. $srcdir/defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+lib_LTLIBRARIES = subdir/liba.la
+subdir_liba_la_SOURCES = a.c
+
+nobase_lib_LTLIBRARIES = subdir/libb.la
+subdir_libb_la_SOURCES = a.c
+END
+
+cat > a.c << 'END'
+int i = 3;
+END
+
+## A rule in the Makefile should create subdir
+# mkdir subdir
+
+libtoolize
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --copy --add-missing
+./configure --prefix `pwd`/inst
+$MAKE
+
+test -f subdir/liba.la
+test -f subdir/libb.la
+
+$MAKE install
+
+test -f inst/lib/liba.la
+test -f inst/lib/subdir/libb.la
+
+$MAKE uninstall
+
+test -f inst/lib/liba.la && exit 1
+test -f inst/lib/subdir/libb.la && exit 1
+
+$MAKE install-strip
+
+test -f inst/lib/liba.la
+test -f inst/lib/subdir/libb.la
Index: tests/pr300-prog.test
===================================================================
RCS file: pr300-prog.test
diff -N pr300-prog.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ pr300-prog.test     Tue Mar  5 12:43:13 2002
@@ -0,0 +1,57 @@
+#! /bin/sh
+
+# Make sure that installing subdirectory programs works.
+# PR/300
+
+. $srcdir/defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = subdir/wish
+subdir_wish_SOURCES = a.c
+
+nobase_bin_PROGRAMS = subdir/want
+subdir_want_SOURCES = a.c
+END
+
+cat > a.c << 'END'
+#include <stdio.h>
+int main ()
+{
+   printf ("hi liver!\n");
+   return 0;
+}
+END
+
+## A rule in the Makefile should create subdir
+# mkdir subdir
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --copy --add-missing
+./configure --prefix `pwd`/inst
+$MAKE
+
+test -f subdir/wish
+test -f subdir/want
+
+$MAKE install
+
+test -f inst/bin/wish
+test -f inst/bin/subdir/want
+
+$MAKE uninstall
+
+test -f inst/bin/wish && exit 1
+test -f inst/bin/subdir/want && exit 1
+
+$MAKE install-strip
+
+test -f inst/bin/wish
+test -f inst/bin/subdir/want
-- 
Alexandre Duret-Lutz




reply via email to

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