automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: grep AM_LDFLAGS for -module (Was: Re: Some confusion regarding LIBA


From: Alexandre Duret-Lutz
Subject: FYI: grep AM_LDFLAGS for -module (Was: Re: Some confusion regarding LIBADD/LDFLAGS/etc.)
Date: Mon, 06 Oct 2003 23:46:54 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

>>> "Kevin" == Kevin P Fleming <address@hidden> writes:

[...]

 Kevin> If I move the "-module -avoid-version" stuff into AM_LDFLAGS, the
 Kevin> build works normally, but automake complains that the library names
 Kevin> are non-standard. I could live with this, but I'd rather the check for
 Kevin> "-module" look into AM_LDFLAGS if module_..._LDFLAGS has not been
 Kevin> specified.

[...]

I'm installing this on HEAD and branch-1-7.  The two fixes are
different (HEAD had an additional bug: LDFLAGS would not be looked
at if foo_LDFLAGS existed), so I'm enclosing both patches.

This is for HEAD

2003-10-06  Alexandre Duret-Lutz  <address@hidden>

        * automake.in (handle_ltlibraries): Also grep AM_LDFLAGS for `-module'.
        * tests/stdlib2.test: New file.
        * tests/Makefile.am (TESTS): Add stdlib2.test.
        Report from Kevin P. Fleming.

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.221
diff -u -r1.221 THANKS
--- THANKS      26 Sep 2003 17:28:50 -0000      1.221
+++ THANKS      6 Oct 2003 21:41:22 -0000
@@ -111,6 +111,7 @@
 Karl Berry             address@hidden
 Karl Heuer             address@hidden
 Kevin Dalley           address@hidden
+Kevin P. Fleming.      address@hidden
 Kevin Ryde             address@hidden
 Kevin Street           address@hidden
 Klaus Reichl           address@hidden
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1507
diff -u -r1.1507 automake.in
--- automake.in 30 Sep 2003 19:05:53 -0000      1.1507
+++ automake.in 6 Oct 2003 21:41:26 -0000
@@ -2360,8 +2360,11 @@
 
       # Check that the library fits the standard naming convention.
       my $libname_rx = "^lib.*\.la";
-      my $ldvar = var ("${xlib}_LDFLAGS") || var ('LDFLAGS');
-      if ($ldvar && grep (/-module/, $ldvar->value_as_list_recursive ('all')))
+      my $ldvar = var ("${xlib}_LDFLAGS") || var ('AM_LDFLAGS');
+      my $ldvar2 = var ('LDFLAGS');
+      if (($ldvar && grep (/-module/, $ldvar->value_as_list_recursive ('all')))
+         || ($ldvar2
+             && grep (/-module/, $ldvar2->value_as_list_recursive ('all'))))
        {
          # Relax name checking for libtool modules.
          $libname_rx = "\.la";
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.519
diff -u -r1.519 Makefile.am
--- tests/Makefile.am   30 Sep 2003 19:05:54 -0000      1.519
+++ tests/Makefile.am   6 Oct 2003 21:41:28 -0000
@@ -409,6 +409,7 @@
 spelling.test \
 stamph2.test \
 stdlib.test \
+stdlib2.test \
 strip.test \
 subdir.test \
 subdir2.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.667
diff -u -r1.667 Makefile.in
--- tests/Makefile.in   30 Sep 2003 19:05:54 -0000      1.667
+++ tests/Makefile.in   6 Oct 2003 21:41:28 -0000
@@ -519,6 +519,7 @@
 spelling.test \
 stamph2.test \
 stdlib.test \
+stdlib2.test \
 strip.test \
 subdir.test \
 subdir2.test \
Index: tests/stdlib2.test
===================================================================
RCS file: tests/stdlib2.test
diff -N tests/stdlib2.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/stdlib2.test  6 Oct 2003 21:41:28 -0000
@@ -0,0 +1,80 @@
+#! /bin/sh
+# Copyright (C) 2003  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.
+
+# Check for AM_LDFLAGS = -module
+# Report from Kevin P. Fleming.
+required=libtool
+. ./defs || exit 1
+
+set -e
+
+: > README
+: > NEWS
+: > AUTHORS
+: > ChangeLog
+: > ltconfig
+: > ltmain.sh
+: > config.guess
+: > config.sub
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+: > Makefile.inc
+
+cat > Makefile.am << 'END'
+include Makefile.inc
+lib_LTLIBRARIES = nonstandard.la
+nonstandard_la_SOURCES = foo.c
+FOO = -module
+END
+
+$ACLOCAL
+AUTOMAKE_fails --add-missing --gnu
+grep 'nonstandard.la.*not a standard libtool library name' stderr
+
+# We will use -Wno-gnu to disable the warning about setting LDFLAGS.
+# Make sure nonstandard names are diagnosed anyway.
+AUTOMAKE_fails --add-missing --gnu -Wno-gnu
+grep 'nonstandard.la.*not a standard libtool library name' stderr
+
+# Make sure nonstandard_la_LDFLAGS is read even if LDFLAGS is used.
+cat >Makefile.inc <<'EOF'
+LDFLAGS = -lfoo
+nonstandard_la_LDFLAGS = $(FOO)
+EOF
+$AUTOMAKE -Wno-gnu
+
+# Make sure LDFLAGS is read even if nonstandard_la_LDFLAGS is used.
+cat >Makefile.inc <<'EOF'
+LDFLAGS = $(FOO)
+nonstandard_la_LDFLAGS = -lfoo
+EOF
+$AUTOMAKE -Wno-gnu
+
+# Make sure AM_LDFLAGS is not read if foo_LDFLAGS is used.
+cat >Makefile.inc <<'EOF'
+nonstandard_la_LDFLAGS = -lfoo
+AM_LDFLAGS = -module
+EOF
+AUTOMAKE_fails


This is for branch-1-7

2003-10-06  Alexandre Duret-Lutz  <address@hidden>

        * automake.in (handle_ltlibraries): Also grep AM_LDFLAGS for `-module'.
        * tests/stdlib2.test: New file.
        * tests/Makefile.am (TESTS): Add stdlib2.test.
        Report from Kevin P. Fleming.

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.186.2.33
diff -u -r1.186.2.33 THANKS
--- THANKS      24 Aug 2003 22:37:40 -0000      1.186.2.33
+++ THANKS      6 Oct 2003 21:41:56 -0000
@@ -110,6 +110,7 @@
 Karl Berry             address@hidden
 Karl Heuer             address@hidden
 Kevin Dalley           address@hidden
+Kevin P. Fleming.      address@hidden
 Kevin Ryde             address@hidden
 Kevin Street           address@hidden
 Klaus Reichl           address@hidden
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1365.2.56
diff -u -r1.1365.2.56 automake.in
--- automake.in 26 Sep 2003 16:08:30 -0000      1.1365.2.56
+++ automake.in 6 Oct 2003 21:42:01 -0000
@@ -3472,10 +3472,12 @@
 
       # Check that the library fits the standard naming convention.
       my $libname_rx = "^lib.*\.la";
-      if ((variable_defined ($xlib . '_LDFLAGS')
+      my $ldflags = $xlib . '_LDFLAGS';
+      $ldflags = 'AM_LDFLAGS'
+       unless variable_defined ($ldflags);
+      if ((variable_defined ($ldflags)
           && grep (/-module/,
-                   &variable_value_as_list_recursive ($xlib . '_LDFLAGS',
-                                                      'all')))
+                   &variable_value_as_list_recursive ($ldflags, 'all')))
          || (variable_defined ('LDFLAGS')
              && grep (/-module/,
                       &variable_value_as_list_recursive ('LDFLAGS', 'all'))))
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.443.2.39
diff -u -r1.443.2.39 Makefile.am
--- tests/Makefile.am   24 Aug 2003 22:37:42 -0000      1.443.2.39
+++ tests/Makefile.am   6 Oct 2003 21:42:02 -0000
@@ -376,6 +376,7 @@
 spelling.test \
 stamph2.test \
 stdlib.test \
+stdlib2.test \
 strip.test \
 subdir.test \
 subdir2.test \
Index: tests/stdlib2.test
===================================================================
RCS file: tests/stdlib2.test
diff -N tests/stdlib2.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/stdlib2.test  6 Oct 2003 21:42:02 -0000
@@ -0,0 +1,83 @@
+#! /bin/sh
+# Copyright (C) 2003  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.
+
+# Check for AM_LDFLAGS = -module
+# Report from Kevin P. Fleming.
+required=libtool
+. ./defs || exit 1
+
+set -e
+
+: > README
+: > NEWS
+: > AUTHORS
+: > ChangeLog
+: > ltconfig
+: > ltmain.sh
+: > config.guess
+: > config.sub
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+: > Makefile.inc
+
+cat > Makefile.am << 'END'
+include Makefile.inc
+lib_LTLIBRARIES = nonstandard.la
+nonstandard_la_SOURCES = foo.c
+FOO = -module
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing --gnu 2>stderr && exit 1
+cat stderr
+grep 'nonstandard.la.*not a standard libtool library name' stderr
+
+# We will use -Wno-gnu to disable the warning about setting LDFLAGS.
+# Make sure nonstandard names are diagnosed anyway.
+$AUTOMAKE --add-missing --gnu -Wno-gnu 2>stderr && exit 1
+cat stderr
+grep 'nonstandard.la.*not a standard libtool library name' stderr
+
+# Make sure nonstandard_la_LDFLAGS is read even if LDFLAGS is used.
+cat >Makefile.inc <<'EOF'
+LDFLAGS = -lfoo
+nonstandard_la_LDFLAGS = $(FOO)
+EOF
+$AUTOMAKE -Wno-gnu
+
+# Make sure LDFLAGS is read even if nonstandard_la_LDFLAGS is used.
+cat >Makefile.inc <<'EOF'
+LDFLAGS = $(FOO)
+nonstandard_la_LDFLAGS = -lfoo
+EOF
+$AUTOMAKE -Wno-gnu
+
+# Make sure AM_LDFLAGS is not read if foo_LDFLAGS is used.
+cat >Makefile.inc <<'EOF'
+nonstandard_la_LDFLAGS = -lfoo
+AM_LDFLAGS = -module
+EOF
+$AUTOMAKE && exit 1
+:

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]