[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: same library installed several times in same directory (PR/350)
From: |
Alexandre Duret-Lutz |
Subject: |
FYI: same library installed several times in same directory (PR/350) |
Date: |
24 Sep 2002 00:07:07 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
I'm installing this and closing the PR.
As explained in the comment, a more accurate fix for PR/350
would be to allow one library to be installed several times in
the same directory but only *in non-overlapping conditions*.
This didn't seem worth the pain.
2002-09-23 Alexandre Duret-Lutz <address@hidden>
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.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1361
diff -u -r1.1361 automake.in
--- automake.in 22 Sep 2002 19:02:44 -0000 1.1361
+++ automake.in 23 Sep 2002 22:05:42 -0000
@@ -3310,7 +3310,25 @@
(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{$_}'");
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.442
diff -u -r1.442 Makefile.am
--- tests/Makefile.am 19 Sep 2002 08:59:49 -0000 1.442
+++ tests/Makefile.am 23 Sep 2002 22:06:11 -0000
@@ -228,6 +228,8 @@
libtool2.test \
libtool3.test \
libtool4.test \
+libtool5.test \
+libtool6.test \
link_c_cxx.test \
link_dist.test \
link_f_c.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.573
diff -u -r1.573 Makefile.in
--- tests/Makefile.in 20 Sep 2002 11:29:12 -0000 1.573
+++ tests/Makefile.in 23 Sep 2002 22:06:11 -0000
@@ -319,6 +319,8 @@
libtool2.test \
libtool3.test \
libtool4.test \
+libtool5.test \
+libtool6.test \
link_c_cxx.test \
link_dist.test \
link_f_c.test \
Index: tests/libtool5.test
===================================================================
RCS file: tests/libtool5.test
diff -N tests/libtool5.test
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/libtool5.test 23 Sep 2002 22:06:11 -0000
@@ -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
Index: tests/libtool6.test
===================================================================
RCS file: tests/libtool6.test
diff -N tests/libtool6.test
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/libtool6.test 23 Sep 2002 22:06:11 -0000
@@ -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
--
Alexandre Duret-Lutz
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: same library installed several times in same directory (PR/350),
Alexandre Duret-Lutz <=