From: Alexandre Duret-Lutz Date: Tue, 5 Mar 2002 21:34:15 +0000 (+0000) Subject: Fix for PR automake/300: X-Git-Tag: v1.10.2~1425 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1487d51256b32da24c24ea80bd5581001bcea280;p=platform%2Fupstream%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index e29afce..d7227d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2002-03-05 Alexandre Duret-Lutz + + 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 Tom Tromey * lib/config.sub, lib/config.guess, lib/texinfo.tex: Updated. diff --git a/Makefile.in b/Makefile.in index b2c5906..1eea3ab 100644 --- a/Makefile.in +++ b/Makefile.in @@ -48,6 +48,7 @@ INSTALL = @INSTALL@ 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@ diff --git a/automake.in b/automake.in index 20eadd5..c7fe80d 100755 --- a/automake.in +++ b/automake.in @@ -2867,6 +2867,7 @@ sub handle_ltlibraries } # 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 @@ sub handle_ltlibraries } else { - $instdirs{$_} = $key; + $instdirs{$_} = $dir; } } } diff --git a/configure b/configure index f15fb43..113c58d 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.52i for GNU Automake 1.5e. +# Generated by GNU Autoconf 2.52j for GNU Automake 1.5e. # # Report bugs to . # @@ -611,7 +611,7 @@ do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done @@ -623,18 +623,19 @@ do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. +# FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias -# FIXME: should be removed in autoconf 3.0. +# FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe @@ -834,7 +835,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF GNU Automake configure 1.5e -generated by GNU Autoconf 2.52i +generated by GNU Autoconf 2.52j Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. @@ -849,7 +850,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GNU Automake $as_me 1.5e, which was -generated by GNU Autoconf 2.52i. Invocation command line was +generated by GNU Autoconf 2.52j. Invocation command line was $ $0 $@ @@ -1167,8 +1168,8 @@ am__api_version="1.5e" # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD compatible install" >&5 -echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1960,7 +1961,7 @@ _ASBOX cat >&5 <<_CSEOF This file was extended by GNU Automake $as_me 1.5e, which was -generated by GNU Autoconf 2.52i. Invocation command line was +generated by GNU Autoconf 2.52j. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -2014,7 +2015,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ GNU Automake config.status 1.5e -configured by $0, generated by GNU Autoconf 2.52i, +configured by $0, generated by GNU Autoconf 2.52j, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am index aea1311..b389d36 100644 --- a/lib/am/header-vars.am +++ b/lib/am/header-vars.am @@ -65,6 +65,7 @@ INSTALL = @INSTALL@ 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@ diff --git a/lib/am/libs.am b/lib/am/libs.am index b7e9db8..906d5e5 100644 --- a/lib/am/libs.am +++ b/lib/am/libs.am @@ -33,6 +33,8 @@ endif %?FIRST% 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 @@ install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES) ## 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 @@ install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES) @$(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 @@ if %?INSTALL% 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 diff --git a/lib/am/ltlib.am b/lib/am/ltlib.am index ebf0059..29a1473 100644 --- a/lib/am/ltlib.am +++ b/lib/am/ltlib.am @@ -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 @@ install-%DIR%LTLIBRARIES: $(%DIR%_LTLIBRARIES) ## 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 @@ if %?INSTALL% 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"; \ diff --git a/lib/am/progs.am b/lib/am/progs.am index 191c52b..2e7ad83 100644 --- a/lib/am/progs.am +++ b/lib/am/progs.am @@ -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 @@ install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS) 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 @@ uninstall-%DIR%PROGRAMS: @$(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 diff --git a/tests/Makefile.am b/tests/Makefile.am index a1418b2..2a4597c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -264,6 +264,9 @@ pr266.test \ pr279.test \ pr279-2.test \ pr287.test \ +pr300-lib.test \ +pr300-ltlib.test \ +pr300-prog.test \ prefix.test \ primary.test \ primary2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index d72759e..a92fd54 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -48,6 +48,7 @@ INSTALL = @INSTALL@ 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 @@ pr266.test \ pr279.test \ pr279-2.test \ pr287.test \ +pr300-lib.test \ +pr300-ltlib.test \ +pr300-prog.test \ prefix.test \ primary.test \ primary2.test \ diff --git a/tests/pr300-lib.test b/tests/pr300-lib.test new file mode 100755 index 0000000..60161e3 --- /dev/null +++ b/tests/pr300-lib.test @@ -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 diff --git a/tests/pr300-ltlib.test b/tests/pr300-ltlib.test new file mode 100755 index 0000000..531aeb4 --- /dev/null +++ b/tests/pr300-ltlib.test @@ -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 diff --git a/tests/pr300-prog.test b/tests/pr300-prog.test new file mode 100755 index 0000000..cc455cc --- /dev/null +++ b/tests/pr300-prog.test @@ -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 +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