]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] cleanup: remove obsolete special-handling of default source for libs
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 20 May 2012 09:35:22 +0000 (11:35 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 21 May 2012 07:25:44 +0000 (09:25 +0200)
Since we are already breaking backward-compatibility in small ways in
Automake-NG, we can snatch the occasion to do some cleanup of obsolescent
behaviours and backward-compatibility hacks.  This is the first of such
cleanups.

* automake.in (handle_source_transform): The default source for libfoo.la
is libfoo.c, but for backward compatibility we used look for libfoo_la.c
first.  Don't do that anymore now.
* t/ltlibsrc.sh: Remove as obsolete.
* NG-NEWS: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
NG-NEWS
automake.in
t/ltlibsrc.sh [deleted file]

diff --git a/NG-NEWS b/NG-NEWS
index 4eab9489c051f9e808023b316360d0e66d58d8d8..8a9fb9a14f331559e0a7d27100dcd28b7764b47b 100644 (file)
--- a/NG-NEWS
+++ b/NG-NEWS
@@ -192,6 +192,14 @@ Miscellaneous
 
   Do not use any of these variables in your Makefiles!
 
+* If the sources for a target library like 'libfoo.a' or 'libbar.la' are
+  not explicitly specified, mainline Automake looks also (respectively)
+  for the files 'libfoo_a.c' or 'libbar_la.c' as possible default sources.
+  Such a behaviour is deprecated though, and is present only for the sake
+  of backward-compatibility.  Automake-NG has thus dropped the behaviour,
+  and will only look for (respectively) 'libfoo.c' and 'libbar.c' as
+  possible default sources.
+
 -----
 
 Copyright (C) 2012 Free Software Foundation, Inc.
index 039b2699565d7f035470fe1f7d2a758299b9940d..d141321170301fc3d7f1dadf7a2c1c32eb913c88 100644 (file)
@@ -2023,30 +2023,11 @@ sub handle_source_transform ($$$$%)
     my @keys = sort keys %used_pfx;
     if (scalar @keys == 0)
     {
-       # The default source for libfoo.la is libfoo.c, but for
-       # backward compatibility we first look at libfoo_la.c,
-       # if no default source suffix is given.
-       my $old_default_source = "$one_file.c";
        my $ext_var = var ('AM_DEFAULT_SOURCE_EXT');
        my $default_source_ext = $ext_var ? variable_value ($ext_var) : '.c';
        msg_var ('unsupported', $ext_var, $ext_var->name . " can assume at most one value")
          if $default_source_ext =~ /[\t ]/;
        (my $default_source = $unxformed) =~ s,(\.[^./\\]*)?$,$default_source_ext,;
-       if ($old_default_source ne $default_source
-           && !$ext_var
-           && (rule $old_default_source
-               || rule '$(srcdir)/' . $old_default_source
-               || rule '${srcdir}/' . $old_default_source
-               || -f $old_default_source))
-         {
-           my $loc = $where->clone;
-           $loc->pop_context;
-           msg ('obsolete', $loc,
-                "the default source for '$unxformed' has been changed "
-                . "to '$default_source'.\n(Using '$old_default_source' for "
-                . "backward compatibility.)");
-           $default_source = $old_default_source;
-         }
        &define_variable ($one_file . "_SOURCES", $default_source, $where);
        push (@sources, $default_source);
        push (@dist_sources, $default_source);
diff --git a/t/ltlibsrc.sh b/t/ltlibsrc.sh
deleted file mode 100755 (executable)
index 11e2a1d..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
-#
-# This program 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.
-#
-# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Test to make sure a sensible default source for libraries is used.
-
-required='cc libtool'
-. ./defs || Exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CC
-AM_PROG_AR
-AC_PROG_LIBTOOL
-AC_OUTPUT
-END
-
-mkdir zoo.d
-
-cat > Makefile.am << 'END'
-AM_LDFLAGS = -module
-pkglib_LTLIBRARIES = zoo.d/bar.la old.la
-noinst_LTLIBRARIES = foo.la zoo.d/old2.la
-
-$(srcdir)/zoo_d_old2_la.c: $(srcdir)/old_la.c
-       cp $(srcdir)/old_la.c $@
-END
-
-cat > foo.c << 'END'
-int foo (void)
-{
-  return 0;
-}
-END
-
-cp foo.c zoo.d/bar.c
-cp foo.c old_la.c
-
-libtoolize
-$ACLOCAL
-$AUTOCONF
-AUTOMAKE_fails -a
-grep '^Makefile\.am:2:.*old_la\.c' stderr
-grep '^Makefile\.am:2:.*old\.c' stderr
-grep '^Makefile\.am:3:.*zoo_d_old2_la\.c' stderr
-grep '^Makefile\.am:3:.*zoo\.d/old2\.c' stderr
-
-$AUTOMAKE -Wno-obsolete
-
-mkdir sub
-cd sub
-
-../configure
-$MAKE
-
-test -f foo.la
-test -f zoo.d/bar.la
-test -f old.la
-test -f zoo.d/old2.la
-
-$MAKE distcheck
-
-: