automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ICC


From: Alexandre Duret-Lutz
Subject: Re: ICC
Date: Thu, 03 Jul 2003 22:32:43 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

>>> "Akim" == Akim Demaille <address@hidden> writes:

 Akim> Sorry, I didn't have enough to evaluate your suggestion, but anyway I
 Akim> experience problems with the current depcomp:

[...]

 Akim> src/codegen/mips % make                                          
nostromo 11:05
 Akim> .deps/codegen.Po:120: *** missing separator.  Stop.

Here is an update of my depcomp patch which should address this.

2003-07-03  Alexandre Duret-Lutz  <address@hidden>

        * lib/depcomp (icc): Update grok ICC 7.1's output.
        * m4/depend.m4 (_AM_DEPENDENCIES): Check dependency generation
        in a subdirectory, and with many dependencies.  This
        catch more failures of depcomp.
        Reports from Ralf Wildenhues and Akim Demaille.

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.217
diff -u -r1.217 THANKS
--- THANKS      27 Jun 2003 00:08:04 -0000      1.217
+++ THANKS      3 Jul 2003 20:31:40 -0000
@@ -182,6 +182,7 @@
 Rafael Laboissiere     address@hidden
 Raja R Harinath                address@hidden
 Ralf Corsepius         address@hidden
+Ralf Wildenhues                address@hidden
 Ralph Schleicher       address@hidden
 Ramón García Fernández address@hidden
 Rich Wales             address@hidden
Index: lib/depcomp
===================================================================
RCS file: /cvs/automake/automake/lib/depcomp,v
retrieving revision 1.43
diff -u -r1.43 depcomp
--- lib/depcomp 25 Jun 2003 14:01:23 -0000      1.43
+++ lib/depcomp 3 Jul 2003 20:31:42 -0000
@@ -207,11 +207,9 @@
   ;;
 
 icc)
-  # Must come before tru64.
-
-  # Intel's C compiler understands `-MD -MF file'.  However
+  # Intel's C compiler understands `-MD -MF file'.  However on
   #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
-  # will fill foo.d with something like
+  # ICC 7.0 will fill foo.d with something like
   #    foo.o: sub/foo.c
   #    foo.o: sub/foo.h
   # which is wrong.  We want:
@@ -219,6 +217,12 @@
   #    sub/foo.o: sub/foo.h
   #    sub/foo.c:
   #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
 
   "$@" -MD -MF "$tmpdepfile"
   stat=$?
@@ -228,11 +232,15 @@
     exit $stat
   fi
   rm -f "$depfile"
-  # Each line is of the form `foo.o: dependent.h'.
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.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"
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -270,7 +278,7 @@
    fi
    if test -f "$tmpdepfile"; then
       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a space and a tab in the [].
+      # That's a tab and a space in the [].
       sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    else
       echo "#dummy" > "$depfile"
Index: m4/depend.m4
===================================================================
RCS file: /cvs/automake/automake/m4/depend.m4,v
retrieving revision 1.29
diff -u -r1.29 depend.m4
--- m4/depend.m4        11 Feb 2003 18:20:54 -0000      1.29
+++ m4/depend.m4        3 Jul 2003 20:31:43 -0000
@@ -61,18 +61,32 @@
   # using a relative directory.
   cp "$am_depcomp" conftest.dir
   cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
 
   am_cv_$1_dependencies_compiler_type=none
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
   fi
   for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
     # We need to recreate these files for each test, as the compiler may
     # overwrite some of them when testing with obscure command lines.
     # This happens at least with the AIX C compiler.
-    echo '#include "conftest.h"' > conftest.c
-    echo 'int i;' > conftest.h
-    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      : > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
     case $depmode in
     nosideeffect)
@@ -90,11 +104,12 @@
     # mode.  It turns out that the SunPro C++ compiler does not properly
     # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=conftest.c object=conftest.o \
-       depfile=conftest.Po tmpdepfile=conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o conftest.o conftest.c \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
          >/dev/null 2>conftest.err &&
-       grep conftest.h conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # (even with -Werror).  So we grep stderr for any message
-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]