From: Stefano Lattarini Date: Sun, 20 May 2012 09:35:22 +0000 (+0200) Subject: [ng] cleanup: remove obsolete special-handling of default source for libs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67d4966d8c0d4fcedbcb0c80cdb6ed95be4a7b65;p=thirdparty%2Fautomake.git [ng] cleanup: remove obsolete special-handling of default source for libs 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 --- diff --git a/NG-NEWS b/NG-NEWS index 4eab9489c..8a9fb9a14 100644 --- 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. diff --git a/automake.in b/automake.in index 039b26995..d14132117 100644 --- a/automake.in +++ b/automake.in @@ -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 index 11e2a1d56..000000000 --- a/t/ltlibsrc.sh +++ /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 . - -# 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 - -: