ignored options.
* lib/depcomp (icc): New mode.
* tests/depcomp5.test: New file.
* tests/defs.in: Handle required=icc.
* tests/Makefile.am (TESTS): Add it.
2003-02-11 Alexandre Duret-Lutz <adl@gnu.org>
+ * m4/depend.m4: Grep depcomp's stderr for icc warnings about
+ ignored options.
+ * lib/depcomp (icc): New mode.
+ * tests/depcomp5.test: New file.
+ * tests/defs.in: Handle required=icc.
+ * tests/Makefile.am (TESTS): Add it.
+
Temporary hack for PR automake/381:
* automake.in (handle_gettext): Turn missing po/ and intl/ errors
into -Wsyntax warnings.
rm -f "$tmpdepfile"
;;
+icc) # Must come before tru64.
+
+ # Intel's C compiler understands `-MD -MF file'. However
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^[^:]*: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
if depmode=$depmode \
source=conftest.c object=conftest.o \
depfile=conftest.Po tmpdepfile=conftest.TPo \
- $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
+ $SHELL ./depcomp $depcc -c -o conftest.o conftest.c \
+ >/dev/null 2>conftest.err &&
grep conftest.h conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- am_cv_$1_dependencies_compiler_type=$depmode
- break
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
fi
done
depcomp2.test \
depcomp3.test \
depcomp4.test \
+depcomp5.test \
depdist.test \
depend.test \
depend2.test \
depcomp2.test \
depcomp3.test \
depcomp4.test \
+depcomp5.test \
depdist.test \
depend.test \
depend2.test \
echo "$me: running $CXX --version"
( $CXX --version ) || exit 77
;;
+ icc)
+ CC=icc
+ export CC
+ # There is no way to ask *only* the compiler's version.
+ # This tool always want to do something (by default
+ # it will try link *nothing* and complain it cannot find
+ # main(); funny). -dryrun is a workaround.
+ echo "$me: running $CC -V -dryrun"
+ ( $CC -V -dryrun ) || exit 77
+ ;;
non-root)
# Skip this test case if the user is root.
# We try to append to a read-only file to detect this.
--- /dev/null
+#! /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 Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check icc's dependency mode.
+
+required='icc'
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+check_PROGRAMS = prg
+prg_SOURCES = src/sub.c src/foo.h
+
+grepdeps:
+ grep 'src/sub.$(OBJEXT).*:' src/$(DEPDIR)/sub.Po
+
+END
+
+mkdir src
+
+touch src/foo.h
+
+cat >src/sub.c <<EOF
+#include "foo.h"
+int
+main ()
+{
+ return 0;
+}
+EOF
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+grep 'depmode=icc' Makefile
+$MAKE check
+$MAKE grepdeps