From: Alexandre Duret-Lutz Date: Mon, 23 Sep 2002 22:08:31 +0000 (+0000) Subject: For PR automake/350: X-Git-Tag: Release-1-7~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a5358a7ce52b46ec9a557e9692ebf4aab9bd519;p=thirdparty%2Fautomake.git For PR automake/350: * automake.in (handle_ltlibraries): Allow a library to be installed many times in the same directory. * tests/libtool5.test, tests/libtool6.test: New files. * tests/Makefile.am (TESTS): Add libtool5.test and libtool6.test. --- diff --git a/ChangeLog b/ChangeLog index 337232778..2dd9e5917 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-09-23 Alexandre Duret-Lutz + + For PR automake/350: + * automake.in (handle_ltlibraries): Allow a library to be installed + many times in the same directory. + * tests/libtool5.test, tests/libtool6.test: New files. + * tests/Makefile.am (TESTS): Add libtool5.test and libtool6.test. + 2002-09-22 Alexandre Duret-Lutz * automake.in (handle_ltlibraries): Fill $libtool_clean_directories diff --git a/automake.in b/automake.in index 2916cc6fc..73339bcb3 100755 --- a/automake.in +++ b/automake.in @@ -3310,7 +3310,25 @@ sub handle_ltlibraries (my $dir = $key) =~ s/^nobase_//; for (variable_value_as_list_recursive ($key . '_LTLIBRARIES', 'all')) { - if ($instdirs{$_}) + # We reject libraries which are installed in several places, + # because we don't handle this in the rules (think `-rpath'). + # + # However, we allow the same library to be listed many times + # for the same directory. This is for users who need setups + # like + # if COND1 + # lib_LTLIBRARIES = libfoo.la + # endif + # if COND2 + # lib_LTLIBRARIES = libfoo.la + # endif + # + # Actually this will also allow + # lib_LTLIBRARIES = libfoo.la libfoo.la + # Diagnosing this case doesn't seem worth the plain (we'd + # have to fill $instdirs on a per-condition basis, check + # implied conditions, etc.) + if (defined $instdirs{$_} && $instdirs{$_} ne $dir) { err_am ("`$_' is already going to be installed in " . "`$instdirs{$_}'"); diff --git a/tests/Makefile.am b/tests/Makefile.am index 333ef33d3..fecf3ec01 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -228,6 +228,8 @@ libtool.test \ libtool2.test \ libtool3.test \ libtool4.test \ +libtool5.test \ +libtool6.test \ link_c_cxx.test \ link_dist.test \ link_f_c.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 34091a5c0..110ae8aea 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -319,6 +319,8 @@ libtool.test \ libtool2.test \ libtool3.test \ libtool4.test \ +libtool5.test \ +libtool6.test \ link_c_cxx.test \ link_dist.test \ link_f_c.test \ diff --git a/tests/libtool5.test b/tests/libtool5.test new file mode 100755 index 000000000..19f856820 --- /dev/null +++ b/tests/libtool5.test @@ -0,0 +1,49 @@ +#!/bin/sh +# Copyright (C) 2002 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Automake is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with autoconf; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Make sure it's ok to install a library under differents conditions +# in the same directory. +# Report from Harlan Stenn. + +required='libtoolize' +. ./defs || exit 1 + +set -e + +cat >>configure.in <<'END' +AM_CONDITIONAL([COND1], [true]) +AM_CONDITIONAL([COND2], [false]) +AC_PROG_CC +AC_PROG_LIBTOOL +AC_OUTPUT +END + +cat >Makefile.am <<'END' +if COND1 + lib_LTLIBRARIES = liba.la +endif +if COND2 + lib_LTLIBRARIES = liba.la +endif +END + +libtoolize +$ACLOCAL +$AUTOMAKE diff --git a/tests/libtool6.test b/tests/libtool6.test new file mode 100755 index 000000000..8424aee6e --- /dev/null +++ b/tests/libtool6.test @@ -0,0 +1,50 @@ +#!/bin/sh +# Copyright (C) 2002 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Automake is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with autoconf; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Make sure it's not ok to install a library under differents conditions +# in different directories. + +required='libtoolize' +. ./defs || exit 1 + +set -e + +cat >>configure.in <<'END' +AM_CONDITIONAL([COND1], [true]) +AM_CONDITIONAL([COND2], [false]) +AC_PROG_CC +AC_PROG_LIBTOOL +AC_OUTPUT +END + +cat >Makefile.am <<'END' +if COND1 + lib_LTLIBRARIES = liba.la +endif +if COND2 + pkglib_LTLIBRARIES = liba.la +endif +END + +libtoolize +$ACLOCAL +$AUTOMAKE 2>stderr && exit 1 +cat stderr +grep 'liba\.la.* installed .*lib' stderr