[vlc-commits] contrib: fix the FPU detection for cross-compiles

Edward Wang git at videolan.org
Fri Dec 21 14:13:50 CET 2012


vlc | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Fri Dec 21 06:54:14 2012 -0500| [701a99af4db0b9f9c3fbedf3088573cb5a3b1505] | committer: Rafaël Carré

contrib: fix the FPU detection for cross-compiles

Previously, FPU detction was done before the variables for compiling (CC, CFLAGS, etc) were set. This broke on cross-compiles, because it was trying to use the default $(CC) to do the checks.

By doing the FPU detection after setting all the variables, FPU detection for cross-compiles works spectacularly.

Signed-off-by: Rafaël Carré <funman at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=701a99af4db0b9f9c3fbedf3088573cb5a3b1505
---

 contrib/src/main.mak |   23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index fc7b877..e8ad7e5 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -36,16 +36,7 @@ ifneq ($(HOST),$(BUILD))
 HAVE_CROSS_COMPILE = 1
 endif
 ARCH := $(shell $(SRC)/get-arch.sh $(HOST))
-ifneq ($(findstring $(ARCH),i386 sparc sparc64 ppc ppc64 x86_64),)
-# This should be consistent with include/vlc_cpu.h
-HAVE_FPU = 1
-else ifneq ($(findstring $(ARCH),arm),)
-ifneq ($(call cppcheck, __VFP_FP__)),)
-ifeq ($(call cppcheck, __SOFTFP__),)
-HAVE_FPU = 1
-endif
-endif
-endif
+
 ifeq ($(ARCH)-$(HAVE_WIN32),x86_64-1)
 HAVE_WIN64 := 1
 endif
@@ -171,6 +162,18 @@ EXTRA_LDFLAGS += -L$(PREFIX)/lib
 LDFLAGS := $(LDFLAGS) $(EXTRA_LDFLAGS)
 # Do not export those! Use HOSTVARS.
 
+# Do the FPU detection, after we have figured out our compilers and flags.
+ifneq ($(findstring $(ARCH),i386 sparc sparc64 ppc ppc64 x86_64),)
+# This should be consistent with include/vlc_cpu.h
+HAVE_FPU = 1
+else ifneq ($(findstring $(ARCH),arm),)
+ifneq ($(call cppcheck, __VFP_FP__)),)
+ifeq ($(call cppcheck, __SOFTFP__),)
+HAVE_FPU = 1
+endif
+endif
+endif
+
 ACLOCAL_AMFLAGS += -I$(PREFIX)/share/aclocal
 export ACLOCAL_AMFLAGS
 



More information about the vlc-commits mailing list