* automake.in (define_configure_variable): Define a user macro,
authorTom Tromey <tromey@redhat.com>
Mon, 31 Dec 2001 02:44:37 +0000 (02:44 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 31 Dec 2001 02:44:37 +0000 (02:44 +0000)
not an automake macro.
* tests/Makefile.am (TESTS): Added ar.test.
* tests/ar.test: New file.

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

index 133f338..0a3fc91 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2001-12-30  Tom Tromey  <tromey@redhat.com>
 
+       * automake.in (define_configure_variable): Define a user macro,
+       not an automake macro.
+       * tests/Makefile.am (TESTS): Added ar.test.
+       * tests/ar.test: New file.
+
        For PR automake/211:
        * automake.in (object_compilation_map): New global.
        (initialize_per_input): Initialize it.
index 725e871..2ece128 100755 (executable)
@@ -6624,7 +6624,13 @@ sub define_variable ($$)
 sub define_configure_variable ($)
 {
     my ($var) = @_;
-    define_variable ($var, subst $var);
+    if (! variable_defined ($var, 'TRUE'))
+    {
+       # A macro defined via configure is a `user' macro -- we should not
+       # override it.
+       macro_define ($var, 0, '', 'TRUE', subst $var, undef);
+       variable_pretty_output ($var, 'TRUE');
+    }
 }
 
 
index 6472ffe..4263cf1 100644 (file)
@@ -24,6 +24,7 @@ ansi2.test \
 ansi3.test \
 ansi4.test \
 ansi5.test \
+ar.test \
 asm.test \
 auxdir.test \
 auxdir2.test \
index 6e69068..23e9de9 100644 (file)
@@ -97,6 +97,7 @@ ansi2.test \
 ansi3.test \
 ansi4.test \
 ansi5.test \
+ar.test \
 asm.test \
 auxdir.test \
 auxdir2.test \
diff --git a/tests/ar.test b/tests/ar.test
new file mode 100755 (executable)
index 0000000..60c1f47
--- /dev/null
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+# Test for setting AR in configure.in.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE($me, 1.0)
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_PATH_PROG(AR, arppc)
+AC_CONFIG_FILES(Makefile)
+END
+
+cat > Makefile.am << 'END'
+lib_LIBRARIES = libfoo.a
+libfoo_a_SOURCES = maude.c
+END
+
+$ACLOCAL || exit 1
+$AUTOMAKE || exit 1
+
+grep 'AR = ar' Makefile.in && exit 1
+exit 0