[MPlayer-dev-eng] LDFLAGS and CPPFLAGS -> ended up in cvs admin -o

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Apr 20 12:29:27 CEST 2006


Hi,
On Thu, Apr 20, 2006 at 11:29:01AM +0200, =?ISO-8859-1?Q? G=E1bor_B=E9rczi_=28Gabucino=29 ?= wrote:
> +_ld_extra="$_ld_extra $LDFLAGS"
> +_inc_extra="$_inc_extra $CPPFLAGS"
> +

I'd prefer the LDFLAGS/CPPCFLAGS/CFLAGS handling to be a bit more
consistent.
What about the attached patch?
I moved the CFLAGS stuff up, since CFLAGS are used in compile_check, I
think it really is better to set them before using that function.
Testing would be very welcome (as well as a discussion about the error
message).

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.1162
diff -u -r1.1162 configure
--- configure	18 Apr 2006 21:16:46 -0000	1.1162
+++ configure	20 Apr 2006 10:28:41 -0000
@@ -477,6 +477,21 @@
   --with-install=*)
     _install=`echo $ac_option | cut -d '=' -f 2 `
     ;;
+  --enable-profile)
+    _profile='-p'
+    ;;
+  --disable-profile)
+    _profile=
+    ;;
+  --enable-debug)
+    _debug='-g'
+    ;;
+  --enable-debug=*)
+    _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
+    ;;
+  --disable-debug)
+    _debug=
+    ;;
   esac
 done
 
@@ -1458,6 +1473,28 @@
 EOF
 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
 
+# Checking for CFLAGS
+_stripbinaries=yes
+if test "$_profile" != "" || test "$_debug" != "" ; then
+  CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
+  if test "$_cc_major" -ge "3" ; then
+    CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
+  fi
+  _stripbinaries=no
+elif test -z "$CFLAGS" ; then
+    CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
+else
+  _warn_CFLAGS=yes
+fi
+if test -n "$LDFLAGS" ; then
+  _ld_extra="$_ld_extra $LDFLAGS"
+  _warn_CFLAGS=yes
+fi
+if test -n "$CPPFLAGS" ; then
+  _inc_extra="$_inc_extra $LDFLAGS"
+  _warn_CFLAGS=yes
+fi
+
 _prefix="/usr/local"
 
 # GOTCHA: the variables below defines the default behavior for autodetection
@@ -1629,6 +1666,11 @@
   --disable-cross-compile) ;;
   --install-path=*) ;;
   --with-install=*) ;;
+  --enable-profile) ;;
+  --disable-profile) ;;
+  --enable-debug) ;;
+  --enable-debug=*) ;;
+  --disable-debug) ;;
 
   # Real 2nd pass
   --enable-mencoder)	_mencoder=yes	;;
@@ -1964,21 +2006,6 @@
     _xmmsplugindir=`echo $ac_option | cut -d '=' -f 2`
     ;;
 
-  --enable-profile)
-    _profile='-p'
-    ;;
-  --disable-profile)
-    _profile=
-    ;;
-  --enable-debug)
-    _debug='-g'
-    ;;
-  --enable-debug=*)
-    _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
-    ;;
-  --disable-debug)
-    _debug=
-    ;;
   --enable-crash-debug)
     _crash_debug=yes
     ;;
@@ -6943,20 +6975,6 @@
 
 #############################################################################
 
-# Checking for CFLAGS
-_stripbinaries=yes
-if test "$_profile" != "" || test "$_debug" != "" ; then
-  CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
-  if test "$_cc_major" -ge "3" ; then
-    CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
-  fi
-  _stripbinaries=no
-elif test -z "$CFLAGS" ; then
-    CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
-else
-  _warn_CFLAGS=yes
-fi
-
 echocheck "automatic gdb attach"
 if test "$_crash_debug" = yes ; then
   _def_crash_debug='#define CRASH_DEBUG 1'
@@ -8229,7 +8247,7 @@
 if test "$_warn_CFLAGS" = yes; then
   cat <<EOF
 
-MPlayer compilation will use the CFLAGS set by you, but:
+MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
 
     *** ***  DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK!  *** ***
 


More information about the MPlayer-dev-eng mailing list