summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-07-20 01:25:14 +0000
committerTom Tromey <tromey@redhat.com>2001-07-20 01:25:14 +0000
commit50bea03197327850050e0c05321f3c6345699a2a (patch)
tree27393d55f371a642bc4b98b0cbe7887bf85bfcfe
parent0a3bbd519e032a90e3063d84e2b05aad547608c9 (diff)
downloadautomake-50bea03197327850050e0c05321f3c6345699a2a.tar.gz
2001-07-19 Tom Tromey <tromey@redhat.com>
Alexandre Duret-Lutz <duret_g@epita.fr> Fix for ccnoco.test, subobj8.test: * m4/Makefile.am (m4data_DATA): Added auxdir.m4. * tests/Makefile.am (XFAIL_TESTS): Removed ccnoco.test, subobj8.test. * m4/minuso.m4 (AM_PROG_CC_C_O): Use absolute path to compile. Use AM_AUX_DIR_EXPAND. * lib/compile: Handle case where `-o' argument is the name of an executable, not an object file. * m4/auxdir.m4: New file, from... * m4/missing.m4: ... here. Moved AM_AUX_DIR_EXPAND. * automake.in (handle_single_transform_list, lang_c_rewrite): Require compile using `require_config_file'.
-rw-r--r--ChangeLog16
-rwxr-xr-xautomake.in5
-rwxr-xr-xlib/compile10
-rw-r--r--m4/Makefile.am4
-rw-r--r--m4/Makefile.in4
-rw-r--r--m4/auxdir.m423
-rw-r--r--m4/minuso.m47
-rw-r--r--m4/missing.m424
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/Makefile.in2
10 files changed, 63 insertions, 34 deletions
diff --git a/ChangeLog b/ChangeLog
index a42667d6e..1bf048256 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,20 @@
2001-07-19 Tom Tromey <tromey@redhat.com>
+ Alexandre Duret-Lutz <duret_g@epita.fr>
+
+ Fix for ccnoco.test, subobj8.test:
+ * m4/Makefile.am (m4data_DATA): Added auxdir.m4.
+ * tests/Makefile.am (XFAIL_TESTS): Removed ccnoco.test,
+ subobj8.test.
+ * m4/minuso.m4 (AM_PROG_CC_C_O): Use absolute path to compile.
+ Use AM_AUX_DIR_EXPAND.
+ * lib/compile: Handle case where `-o' argument is the name of an
+ executable, not an object file.
+ * m4/auxdir.m4: New file, from...
+ * m4/missing.m4: ... here. Moved AM_AUX_DIR_EXPAND.
+ * automake.in (handle_single_transform_list, lang_c_rewrite):
+ Require compile using `require_config_file'.
+
+2001-07-19 Tom Tromey <tromey@redhat.com>
* automake.texi (Program and Library Variables): Added X example
for _LDADD.
diff --git a/automake.in b/automake.in
index a15ceb310..f5b444356 100755
--- a/automake.in
+++ b/automake.in
@@ -1869,7 +1869,7 @@ sub handle_single_transform_list ($$$@)
}
$object = $dname . '-' . $object;
- &require_file ($FOREIGN, 'compile')
+ &require_config_file ($FOREIGN, 'compile')
if $lang->name eq 'c';
&prog_error ("$lang->name flags defined without compiler")
@@ -4917,8 +4917,7 @@ sub lang_c_rewrite
&am_error ("C objects in subdir but `AM_PROG_CC_C_O' not in `$configure_ac'");
}
- &require_file ($FOREIGN, 'compile')
- if $relative_dir eq '.';
+ &require_config_file ($FOREIGN, 'compile');
}
$de_ansi_files{$base} = 1;
diff --git a/lib/compile b/lib/compile
index 7370ae595..9bb997a6a 100755
--- a/lib/compile
+++ b/lib/compile
@@ -37,8 +37,18 @@ args=
while test $# -gt 0; do
case "$1" in
-o)
+ # configure might choose to run compile as `compile cc -o foo foo.c'.
+ # So we do something ugly here.
ofile=$2
shift
+ case "$ofile" in
+ *.o | *.obj)
+ ;;
+ *)
+ args="$args -o $ofile"
+ ofile=
+ ;;
+ esac
;;
*.c)
cfile=$1
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 3825b3e21..5bc5d9f27 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -1,8 +1,8 @@
## Process this file with automake to create Makefile.in
m4datadir = $(datadir)/aclocal
-m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \
-error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 make.m4 \
+m4data_DATA = auxdir.m4 ccstdc.m4 cond.m4 depend.m4 depout.m4 \
+dmalloc.m4 error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 make.m4 \
maintainer.m4 minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 \
ptrdiff.m4 python.m4 regex.m4 sanity.m4 strip.m4 strtod.m4 termios.m4 \
winsz.m4
diff --git a/m4/Makefile.in b/m4/Makefile.in
index f1501fb33..42d3c0b9e 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -67,8 +67,8 @@ _am_quote = @_am_quote@
install_sh = @install_sh@
m4datadir = $(datadir)/aclocal
-m4data_DATA = ccstdc.m4 cond.m4 depend.m4 depout.m4 dmalloc.m4 \
-error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 make.m4 \
+m4data_DATA = auxdir.m4 ccstdc.m4 cond.m4 depend.m4 depout.m4 \
+dmalloc.m4 error.m4 gcj.m4 header.m4 init.m4 lex.m4 lispdir.m4 make.m4 \
maintainer.m4 minuso.m4 missing.m4 multi.m4 obstack.m4 protos.m4 \
ptrdiff.m4 python.m4 regex.m4 sanity.m4 strip.m4 strtod.m4 termios.m4 \
winsz.m4
diff --git a/m4/auxdir.m4 b/m4/auxdir.m4
new file mode 100644
index 000000000..a99f76eea
--- /dev/null
+++ b/m4/auxdir.m4
@@ -0,0 +1,23 @@
+# AM_AUX_DIR_EXPAND
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to ${srcdir}/foo. In other projects, it is set to `.'.
+# Of course, Automake must honor this variable whenever it calls a tool
+# from the auxiliary directory. The problem is that $srcdir (and therefore
+# $ac_aux_dir as well) can be either an absolute path or a path relative to
+# $top_srcdir, depending on how configure is run. This is pretty annoying,
+# since it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a relative
+# path needs to be adjusted first.
+# - calling $top_srcdir/$ac_aux_dir/missing would succeed if $ac_aux_dir was
+# relative, but fail if it was absolute.
+# - conversly, calling $ac_aux_dir/missing would fail if $ac_aux_dir was
+# relative, and succeed on absolute paths.
+#
+# Consequently, we define and use $am_aux_dir, the "always absolute"
+# version of $ac_aux_dir.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND], [
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
+])
diff --git a/m4/minuso.m4 b/m4/minuso.m4
index e1ffa3cb1..23a170351 100644
--- a/m4/minuso.m4
+++ b/m4/minuso.m4
@@ -5,12 +5,17 @@
# Like AC_PROG_CC_C_O, but changed for automake.
AC_DEFUN([AM_PROG_CC_C_O],
[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
# FIXME: we rely on the cache variable name because
# there is no other way.
set dummy $CC
ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
# Losing compiler, so override with the script.
- CC="\$(top_srcdir)/compile $CC"
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
fi
])
diff --git a/m4/missing.m4 b/m4/missing.m4
index a8dab4646..1b1577431 100644
--- a/m4/missing.m4
+++ b/m4/missing.m4
@@ -47,27 +47,3 @@ else
AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
fi
])
-
-# AM_AUX_DIR_EXPAND
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to ${srcdir}/foo. In other projects, it is set to `.'.
-# Of course, Automake must honor this variable whenever it calls a tool
-# from the auxiliary directory. The problem is that $srcdir (and therefore
-# $ac_aux_dir as well) can be either an absolute path or a path relative to
-# $top_srcdir, depending on how configure is run. This is pretty annoying,
-# since it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a relative
-# path needs to be adjusted first.
-# - calling $top_srcdir/$ac_aux_dir/missing would succeed if $ac_aux_dir was
-# relative, but fail if it was absolute.
-# - conversly, calling $ac_aux_dir/missing would fail if $ac_aux_dir was
-# relative, and succeed on absolute paths.
-#
-# Consequently, we define and use $am_aux_dir, the "always absolute"
-# version of $ac_aux_dir.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND], [
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
-])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 98865c014..3c9d26235 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in
-XFAIL_TESTS = subdir5.test subobj8.test ccnoco.test
+XFAIL_TESTS = subdir5.test
TESTS = \
acinclude.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 3d4d9cd1e..d2493891e 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -66,7 +66,7 @@ _am_include = @_am_include@
_am_quote = @_am_quote@
install_sh = @install_sh@
-XFAIL_TESTS = subdir5.test subobj8.test ccnoco.test
+XFAIL_TESTS = subdir5.test
TESTS = \
acinclude.test \