+2002-09-23 Alexandre Duret-Lutz <duret_g@epita.fr>
+
+ 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 <duret_g@epita.fr>
* automake.in (handle_ltlibraries): Fill $libtool_clean_directories
(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{$_}'");
libtool2.test \
libtool3.test \
libtool4.test \
+libtool5.test \
+libtool6.test \
link_c_cxx.test \
link_dist.test \
link_f_c.test \
libtool2.test \
libtool3.test \
libtool4.test \
+libtool5.test \
+libtool6.test \
link_c_cxx.test \
link_dist.test \
link_f_c.test \
--- /dev/null
+#!/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
--- /dev/null
+#!/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