summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rwxr-xr-xautomake.in27
-rw-r--r--lib/am/library.am4
-rw-r--r--library.am4
-rw-r--r--tests/ChangeLog4
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/Makefile.in2
-rwxr-xr-xtests/canon4.test19
8 files changed, 57 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index adc0ab22a..2016d84d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Aug 9 09:18:46 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * automake.in (handle_libraries): Canonicalize library name. Test
+ canon4.test.
+ * library.am (lib@LIBRARY@.a): Use @XLIBRARY@ where appropriate.
+
Thu Aug 8 10:57:21 1996 Tom Tromey <tromey@creche.cygnus.com>
* automake.in (handle_scripts): Correctly compute
diff --git a/automake.in b/automake.in
index 6571a2c9b..237db7de6 100755
--- a/automake.in
+++ b/automake.in
@@ -832,23 +832,40 @@ sub handle_libraries
local ($obj) = &get_object_extension;
local ($munge);
+ local ($xlib);
foreach $onelib (@liblist)
{
- if (&variable_defined ($onelib . '_LIBADD'))
+ # Canonicalize names.
+ ($xlib = $onelib) =~ tr/A-Za-z0-9_/_/c;
+ if ($xlib ne $one_file)
+ {
+ local ($xt);
+ foreach $xt ('_LIBADD', '_SOURCES', '_OBJECTS', '_DEPENDENCIES')
+ {
+ &am_line_error ($one_file . $xt,
+ "invalid variable \`" . $onelib . $xt
+ . "'; should be \`" . $xlib . $xt . "'")
+ if &variable_defined ($onelib . $xt);
+ }
+ }
+
+ if (&variable_defined ($xlib . '_LIBADD'))
{
- &handle_lib_objects ($onelib . '_LIBADD');
+ &handle_lib_objects ($xlib . '_LIBADD');
}
else
{
# Generate support for conditional object inclusion in
# libraries.
- $output_vars .= $onelib . "_LIBADD =\n";
+ $output_vars .= $xlib . "_LIBADD =\n";
}
- &handle_source_transform ($onelib, $onelib, $obj);
+ &handle_source_transform ($xlib, $onelib, $obj);
$output_rules .=
- &file_contents_with_transform ('s/\@LIBRARY\@/' . $onelib . '/go',
+ &file_contents_with_transform ('s/\@LIBRARY\@/' . $onelib . '/go;'
+ . 's/\@XLIBRARY\@/'
+ . $xlib . '/go;',
'library');
}
diff --git a/lib/am/library.am b/lib/am/library.am
index a8126b073..41993982f 100644
--- a/lib/am/library.am
+++ b/lib/am/library.am
@@ -15,7 +15,7 @@
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA.
-lib@LIBRARY@.a: $(@LIBRARY@_OBJECTS) $(@LIBRARY@_LIBADD)
+lib@LIBRARY@.a: $(@XLIBRARY@_OBJECTS) $(@XLIBRARY@_LIBADD)
rm -f lib@LIBRARY@.a
- $(AR) cru lib@LIBRARY@.a $(@LIBRARY@_OBJECTS) $(@LIBRARY@_LIBADD)
+ $(AR) cru lib@LIBRARY@.a $(@XLIBRARY@_OBJECTS) $(@XLIBRARY@_LIBADD)
$(RANLIB) lib@LIBRARY@.a
diff --git a/library.am b/library.am
index a8126b073..41993982f 100644
--- a/library.am
+++ b/library.am
@@ -15,7 +15,7 @@
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA.
-lib@LIBRARY@.a: $(@LIBRARY@_OBJECTS) $(@LIBRARY@_LIBADD)
+lib@LIBRARY@.a: $(@XLIBRARY@_OBJECTS) $(@XLIBRARY@_LIBADD)
rm -f lib@LIBRARY@.a
- $(AR) cru lib@LIBRARY@.a $(@LIBRARY@_OBJECTS) $(@LIBRARY@_LIBADD)
+ $(AR) cru lib@LIBRARY@.a $(@XLIBRARY@_OBJECTS) $(@XLIBRARY@_LIBADD)
$(RANLIB) lib@LIBRARY@.a
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 2a8ed8bd9..fa6bd1e5a 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+Fri Aug 9 09:18:07 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * canon4.test: New file.
+
Thu Aug 8 10:47:45 1996 Tom Tromey <tromey@creche.cygnus.com>
* exsource.test: New file.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index fae6f9956..cccbc9d52 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -12,6 +12,6 @@ insh2.test outdir.test fpinstall.test fpinst2.test texinfo.test dejagnu.test \
yacc.test mkinstall2.test texinfo2.test ansi.test depacl.test depacl2.test \
error.test colon.test vtexi2.test tags.test comment.test libfiles.test \
man.test info.test obsolete.test lex.test scripts.test subdir2.test \
-exsource.test
+exsource.test canon4.test
EXTRA_DIST = defs $(TESTS)
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 79f219968..9db317bfc 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -50,7 +50,7 @@ insh2.test outdir.test fpinstall.test fpinst2.test texinfo.test dejagnu.test \
yacc.test mkinstall2.test texinfo2.test ansi.test depacl.test depacl2.test \
error.test colon.test vtexi2.test tags.test comment.test libfiles.test \
man.test info.test obsolete.test lex.test scripts.test subdir2.test \
-exsource.test
+exsource.test canon4.test
EXTRA_DIST = defs $(TESTS)
mkinstalldirs = $(top_srcdir)/mkinstalldirs
diff --git a/tests/canon4.test b/tests/canon4.test
new file mode 100755
index 000000000..11e83bfe8
--- /dev/null
+++ b/tests/canon4.test
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+# Test to make sure name canonicalization happens for libraries.
+
+. $srcdir/defs || exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_RANLIB
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = x-y
+x_y_SOURCES = xy.c
+END
+
+$AUTOMAKE || exit 1
+
+grep '^x-y' Makefile.in && exit 1
+exit 0