[FFmpeg-devel] [PATCH] Support building dependency files with non-GCC compilers
Måns Rullgård
mans
Thu Oct 2 19:05:35 CEST 2008
Diego 'Flameeyes' Petten? <flameeyes at gmail.com> writes:
> When not building with GCC, the dependency creation command has to be
> adapted to the compiler used.
>
> When using the Intel C Compiler no further editing through sed of the
> output is needed.
>
> When using the Sun Studio compiler, a different command-line syntax
> has to be used.
> ---
>
> configure | 14 +++++++++++---
> 1 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index b66a515..339d08e 100755
> --- a/configure
> +++ b/configure
> @@ -997,9 +997,6 @@ SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
> SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
> LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
>
> -# gcc stupidly only outputs the basename of targets with -MM
> -DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "1s,^,$(@D)/," -e "s,\\([[:space:]]\\)\\(version\\.h\\),\\1\$$(BUILD_ROOT_REL)/\\2,"'
> -
> # find source path
> source_path="`dirname \"$0\"`"
> enable source_path_used
> @@ -1133,6 +1130,17 @@ TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
> TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
> TMPSH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.sh"
>
> +if $cc -v 2>&1 | grep -q gcc; then
> + # gcc stupidly only outputs the basename of targets with -MM
> + DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "1s,^,$(@D)/," -e "s,\\([[:space:]]\\)\\(version\\.h\\),\\1\$$(BUILD_ROOT_REL)/\\2,"'
> +elif $cc --version 2>&1 | grep -q Intel; then
> + DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $<'
> +elif $cc -V 2>&1 | grep -q Sun; then
> + DEPEND_CMD='$(CC) $(CFLAGS) -xM1 $<'
> +else
> + DEPEND_CMD="false"
> +fi
Why did you move this block? Do the Intel and Sun compilers produce
correct output? Setting the command to "false" is a bit harsh, since
it makes building with any other compiler impossible.
I'm still in favour of always using gcc. It has quirks aplenty, but
there will be no new surprises.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list