[MPlayer-dev-eng] [PATCH] fix extra include and library options in configure

Bernd Ernesti mplayer-dev-eng at lists.veego.de
Sun Oct 29 20:20:45 CET 2006


Hi,

the current compile_check functions adds the additional compile options
to the end of the $_cc command line. This may cause problems.

xxx-config like the freetype-config knows the best include and
library options, but this will be hidden by other options which
maybe not the best for this specific tool.
e.g. having two freetype implementaion (1.x and 2.x) and the current
default include path finds the 1.x before the 2.x. This would cause
the check to fail, even that freetype-config provides the correct
include path.

I changed the compile_check function and the freetype check. There
are some other xxx-config tools, like sdl-config where the include
path could/should also be changed.
But there is a problem with moving all xxx-config includes to the
beging of $_inc_extra. It would add again the wrong include path
at the begining if some other xxx-config after the freetype-config one
adds the wrong include path again.

In my case freetype 2 lives in /usr/X11R6/include/freetype2 and
freetype 1 in /usr/pkg/include/freetype, but there is a ft2build.h
in /usr/pkg/include so if the include is not correctly set it would
find the 1.x instead of the 2.x.

Bernd

-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 20509)
+++ configure	(working copy)
@@ -59,9 +59,9 @@
   echo >> "$TMPLOG"
   cat "$1" >> "$TMPLOG"
   echo >> "$TMPLOG"
-  echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o $TMPO $@" >> "$TMPLOG"
+  echo "$_cc $CFLAGS $@ $_inc_extra $_ld_static $_ld_extra -o $TMPO" >> "$TMPLOG"
   rm -f "$TMPO"
-  $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o "$TMPO" "$@" >> "$TMPLOG" 2>&1
+  $_cc $CFLAGS "$@" $_inc_extra $_ld_static $_ld_extra -o "$TMPO" >> "$TMPLOG" 2>&1
   TMP="$?"
   echo >> "$TMPLOG"
   echo "ldd $TMPO" >> "$TMPLOG"
@@ -5393,7 +5393,7 @@
 fi
 if test "$_freetype" = yes ; then
     _def_freetype='#define HAVE_FREETYPE'
-    _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
+    _inc_extra="`$_freetypeconfig --cflags` $_inc_extra"
     _ld_freetype=`$_freetypeconfig --libs`
 else
     _def_freetype='#undef HAVE_FREETYPE'


More information about the MPlayer-dev-eng mailing list