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.
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.
# 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'
# 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,
ansi.test \
ansi2.test \
ansi3.test \
+ansi3b.test \
ansi4.test \
ansi5.test \
ansi6.test \
ansi.test \
ansi2.test \
ansi3.test \
+ansi3b.test \
ansi4.test \
ansi5.test \
ansi6.test \
required=gcc
. ./defs || exit 1
+set -e
+
cat > configure.in << 'END'
AC_INIT(hello.c)
AM_INIT_AUTOMAKE(hello,0.23)
# 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
--- /dev/null
+#! /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