[MPlayer-dev-eng] [PATCH] Suppress unsupported options when building with clang

Rowan James rowanj at phere.net
Mon Jul 26 10:05:15 CEST 2010


This patch stops './configure --cc=clang' from generating command lines with options which clang doesn't support.

Specifically, clang does not support the '-mcpu=', '-falign-loops=', and '-shared-libgcc' options.

Developed and tested on OS X 10.6 w/ Xcode 3.2, clang SVN (current), gcc-4.2.1 (Apple)

Effectively removes warnings otherwise generated for each file; gcc (default) ./configure still builds the same.

===================================================================
--- configure	(revision 31826)
+++ configure	(working copy)
@@ -1505,7 +1505,10 @@
fi

if darwin; then
-  extra_cflags="-mdynamic-no-pic -falign-loops=16 -shared-libgcc $extra_cflags"
+  extra_cflags="-mdynamic-no-pic $extra_cflags"
+  if test "$(basename $_cc)" != "clang" ; then
+    extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
+  fi
  _timer=timer-darwin.c
fi

@@ -2449,7 +2452,13 @@
  fi
fi

+# -mcpu option isn't supported by clang
+if test "$(basename $_cc)" = "clang" ; then
+ _mcpu=""
+fi

+
# endian testing
echocheck "byte order"
if test "$_big_endian" = auto ; then



More information about the MPlayer-dev-eng mailing list