automake-patches
[Top][All Lists]
Advanced

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

Re: depcomp: support newer HP compilers


From: Alexandre Duret-Lutz
Subject: Re: depcomp: support newer HP compilers
Date: Sat, 09 Jul 2005 11:07:05 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Hi Zack,

Sorry for the delay.

>>> "zw" == Zack Weinberg <address@hidden> writes:

 zw> I discovered today that the newer HP compilers (for their
 zw> ia64 systems) don't match any depcomp style.  The
 zw> preprocessor has been integrated into the compiler front
 zw> end, so -Wp, is silently ignored.  These systems don't ship
 zw> 'makedepend', so that doesn't work either.  And the
 zw> last-resort "cpp" style doesn't work because these
 zw> compilers print "#line", not "# ", at the beginning of
 zw> their marker lines in -E mode.

 zw> HP's documentation claims that a suitable option for "dashMstdout"
 zw> style would be "+M", but that provokes an error message and the advice
 zw> to use "+Make".  *That* works.  Better still, there's "+Maked" which
 zw> can be used as the basis of a new side-effect style.

Is there an option to specify the name of the dependency output file?

(I tried to find the documentation on HP's website, but got
lost, not knowing the name of the compiler and what OS to search
for.)

[...]

 zw> +ia64hp)
 zw> +  # The "hp" stanza above does not work with HP's ia64 compilers,
 zw> +  # which have integrated preprocessors.  The correct option to use
 zw> +  # with these is +Maked; it writes dependencies to a file named
 zw> +  # 'foo.d', which lands next to the object file, wherever that
 zw> +  # happens to be.

This means that when depcomp runs libtool to do the compilation,
and libtool creates its object down in ./.libs/foo.o, then
we must fetch ./.libs/foo.d ?

Unless we can specify the output file, we would need a scheme
similar to the tru64 mode.

 zw> +  tmpdepfile=`echo "$object" | sed -e 's/\.o$/.d/'`
 zw> +  "$@" +Maked

I think that should be 

  if test "$libtool" = yes; then
    "$@" -Wc,+Maked
  else
    "$@" +Maked
  fi

(so libtool doesn't take the last unrecognized argument as the
source file)

 zw> +  stat=$?
 zw> +  if test $stat -eq 0; then :
 zw> +  else
 zw> +     rm -f "$tmpdepfile"
 zw> +     exit $stat
 zw> +  fi
 zw> +  rm -f "$depfile"
 zw> +
 zw> +  # The object file name is correct already.

I doubt it's true when libtool is used: the compiler sees whatever.o on
its command line, but we want whatever.lo in the dependency file.

 zw> +  cat "$tmpdepfile" > "$depfile"
 zw> +  # Add `dependent.h:' lines.
 zw> +  sed -ne '2,${; s/^ //; s/ \\*$//; s/$/:/; p; }' "$tmpdepfile" >> 
"$depfile"

I assume the first line (ignored) contains the object file?  Is
the leading `;' important?

[...]

 zw> "$@" -E |
 zw> -    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
 zw> +    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
 zw> +       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |

I'll include this bit in 1.9.6.
-- 
Alexandre Duret-Lutz





reply via email to

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