]> sourceware.org Git - automake.git/commitdiff
* automake.in (process_option_list): Record the location
authorAlexandre Duret-Lutz <adl@gnu.org>
Wed, 4 Jun 2003 20:18:36 +0000 (20:18 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Wed, 4 Jun 2003 20:18:36 +0000 (20:18 +0000)
of ansi2knr's definition.
(handle_compile): Use it.
* tests/ansi3.test: Make sure the location appears correctly.
Update to use set -e.
* tests/ansi3b.test: New file.
* tests/Makefile.am (TESTS): Add ansi3b.test.

ChangeLog
automake.in
tests/Makefile.am
tests/Makefile.in
tests/ansi3.test
tests/ansi3b.test [new file with mode: 0755]

index 401efd2068f2c85e4a36d119ac6755f148ff775f..c2fa9373f5d1d11773110821b8f3cc16f8fedf84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2003-06-04  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       * automake.in (process_option_list): Record the location
+       of ansi2knr's definition.
+       (handle_compile): Use it.
+       * tests/ansi3.test: Make sure the location appears correctly.
+       Update to use set -e.
+       * tests/ansi3b.test: New file.
+       * tests/Makefile.am (TESTS): Add ansi3b.test.
+
        * tests/alpha.test: Really run $MAKE.  Augment to test
        subdirectories, and check-news report.
        * tests/alpha2.test: New file.  Bug report from Akim Demaille.
index cfe589bb99ab11c60eca15b55dcc74200266f25b..177df8b574a25e16ec15e56ada4d92640ced8fea 100755 (executable)
@@ -1400,7 +1400,7 @@ sub process_option_list
          # An option like "../lib/ansi2knr" is allowed.  With no
          # path prefix, we assume the required programs are in this
          # directory.  We save the actual option for later.
-         $options{'ansi2knr'} = $_;
+         $options{'ansi2knr'} = [$_, $where];
        }
       elsif ($_ eq 'no-installman' || $_ eq 'no-installinfo'
             || $_ eq 'dist-shar' || $_ eq 'dist-zip'
@@ -2820,25 +2820,27 @@ sub handle_compile ()
     # Check for automatic de-ANSI-fication.
     if (defined $options{'ansi2knr'})
       {
-       require_variables_for_variable ('AUTOMAKE_OPTIONS',
-                                       "option `ansi2knr' is used",
-                                       "ANSI2KNR", "U");
+       my ($ansi2knr_filename, $ansi2knr_where) = @{$options{'ansi2knr'}};
+       my $ansi2knr_dir = '';
+
+       require_variables ($ansi2knr_where, "option `ansi2knr' is used",
+                          TRUE, "ANSI2KNR", "U");
 
        # topdir is where ansi2knr should be.
-       if ($options{'ansi2knr'} eq 'ansi2knr')
+       if ($ansi2knr_filename eq 'ansi2knr')
          {
            # Only require ansi2knr files if they should appear in
            # this directory.
-           require_file_with_macro (TRUE, 'AUTOMAKE_OPTIONS', FOREIGN,
-                                    'ansi2knr.c', 'ansi2knr.1');
+           require_file ($ansi2knr_where, FOREIGN,
+                         'ansi2knr.c', 'ansi2knr.1');
 
            # ansi2knr needs to be built before subdirs, so unshift it.
            unshift (@all, '$(ANSI2KNR)');
          }
-
-       my $ansi2knr_dir = '';
-       $ansi2knr_dir = dirname ($options{'ansi2knr'})
-         if $options{'ansi2knr'} ne 'ansi2knr';
+       else
+         {
+           $ansi2knr_dir = dirname ($ansi2knr_filename);
+         }
 
        $output_rules .= &file_contents ('ansi2knr',
                                         new Automake::Location,
index 030d8692c2b80bff9d5342d4c0279371e5e05a4a..c0da6c6a492e0eeb8d68399869dd934dcd4fb3e9 100644 (file)
@@ -26,6 +26,7 @@ ammissing.test \
 ansi.test \
 ansi2.test \
 ansi3.test \
+ansi3b.test \
 ansi4.test \
 ansi5.test \
 ansi6.test \
index f192399df5883aced33463d4d377f51b8434481d..dec5c1542cc90aef87d74bd430015fd686bf1485 100644 (file)
@@ -137,6 +137,7 @@ ammissing.test \
 ansi.test \
 ansi2.test \
 ansi3.test \
+ansi3b.test \
 ansi4.test \
 ansi5.test \
 ansi6.test \
index 2bc57042812887f0b2d63fb336e1b4e3805f5501..7823cc652cec7546a2ab987add89580a6756128e 100755 (executable)
@@ -24,6 +24,8 @@
 required=gcc
 . ./defs || exit 1
 
+set -e
+
 cat > configure.in << 'END'
 AC_INIT(hello.c)
 AM_INIT_AUTOMAKE(hello,0.23)
@@ -53,9 +55,11 @@ export CFLAGS
 
 # We use gcc and not gcc -traditional as the latter fails on some
 # Linux boxes (Red Hat 5.1 in particular).
-$ACLOCAL \
-   && $AUTOCONF \
-   && $AUTOMAKE -a \
-   && CC='gcc' ./configure \
-   && ANSI2KNR=./ansi2knr U=_ $MAKE -e \
-   && ./hello
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a 2>stderr
+cat stderr
+grep 'Makefile.am:1:.*ansi2knr\.c' stderr
+CC='gcc' ./configure
+ANSI2KNR=./ansi2knr U=_ $MAKE -e
+./hello
diff --git a/tests/ansi3b.test b/tests/ansi3b.test
new file mode 100755 (executable)
index 0000000..9bb18cb
--- /dev/null
@@ -0,0 +1,64 @@
+#! /bin/sh
+# Copyright (C) 1998, 1999, 2001, 2002, 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.
+
+# Actual test of ansi2knr functionality.  Relies on existence
+# of working gcc.  Same as ansi3.test, but with AUTOMAKE_OPTIONS
+# defined in configure.in.
+
+required=gcc
+. ./defs || exit 1
+
+set -e
+
+cat > configure.in << 'END'
+AC_INIT([hello], [0.24])
+AM_INIT_AUTOMAKE([ansi2knr no-dependencies])
+AC_PROG_CC
+AM_C_PROTOTYPES
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+echo 'bin_PROGRAMS = hello' > Makefile.am
+
+cat > hello.c << 'END'
+#include <stdio.h>
+int
+main (int argc, char *argv[])
+{
+   printf ("yeah, yeah\n");
+   return 0;
+}
+END
+
+# Ignore user CFLAGS.
+CFLAGS=
+export CFLAGS
+
+# We use gcc and not gcc -traditional as the latter fails on some
+# Linux boxes (Red Hat 5.1 in particular).
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a 2>stderr
+cat stderr
+grep 'configure.in:2:.*ansi2knr\.1' stderr
+CC='gcc' ./configure
+ANSI2KNR=./ansi2knr U=_ $MAKE -e
+./hello
This page took 0.065049 seconds and 5 git commands to generate.