[MPlayer-dev-eng] [PATCH 1/2] configure: Set CPPFLAGS to enable commonly used system features

Diego Biurrun diego at biurrun.de
Tue Jan 22 00:52:01 CET 2013


MPlayer relies on BSD, XOPEN and C99 features being available. However,
the necessary CPPFLAGS to enable those features are not set explicitly.
Set flags for these features explicitly in order to ensure they are
always available.
---

BSD features like strsep are used in many places and for glibc probably
get pulled in by -std=gnu99 or something similar.  Not setting the flags
is brittle, however, the libav* libs mostly rely on them being set during
compilation, for example ...

 configure |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 7ebe6b3..3d925c3 100755
--- a/configure
+++ b/configure
@@ -2670,6 +2670,8 @@ else
   warn_cflags=yes
 fi
 
+CFLAGS="-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE $CFLAGS"
+
 if test "$cc_vendor" = "gnu" ; then
   cflag_check -fno-tree-vectorize && CFLAGS="$CFLAGS -fno-tree-vectorize"
   cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
@@ -2679,8 +2681,6 @@ if test "$cc_vendor" = "gnu" ; then
   cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
   cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
   cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
-else
-  CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
 fi
 
 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
-- 
1.7.9.5



More information about the MPlayer-dev-eng mailing list