]> sourceware.org Git - automake.git/commitdiff
Canoncalize library names
authorTom Tromey <tromey@redhat.com>
Fri, 9 Aug 1996 15:45:13 +0000 (15:45 +0000)
committerTom Tromey <tromey@redhat.com>
Fri, 9 Aug 1996 15:45:13 +0000 (15:45 +0000)
ChangeLog
automake.in
lib/am/library.am
library.am
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/canon4.test [new file with mode: 0755]

index adc0ab22a14a4f99bafbafc4bc8bcad09048718c..2016d84d647d223b25250263618787572dd5f4c6 100644 (file)
--- 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
index 6571a2c9bdd7db6abf3ea6de2d4182ce94c4f544..237db7de67b4201acfc16b4abcf70810822d782d 100755 (executable)
@@ -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');
     }
 
index a8126b073aa59f2261a4e67cb2003cffcd2d3b2e..41993982f8b0008d0891af8f27aee81eab05afb0 100644 (file)
@@ -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
index a8126b073aa59f2261a4e67cb2003cffcd2d3b2e..41993982f8b0008d0891af8f27aee81eab05afb0 100644 (file)
@@ -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
index 2a8ed8bd93a863036ece12dd133506e137b38381..fa6bd1e5abd6abcb5c3ce98d51e2779b10119065 100644 (file)
@@ -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.
index fae6f9956efe121da32a5e10f2f35e11149418ac..cccbc9d5213ab15432f36d2d8986dbede8c3b5d1 100644 (file)
@@ -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)
index 79f219968a46893916633b44b9d8f3b7b02f6e9b..9db317bfcc63230f2822c9ab3ef1cf331cde2239 100644 (file)
@@ -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 (executable)
index 0000000..11e83bf
--- /dev/null
@@ -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
This page took 0.04874 seconds and 5 git commands to generate.