[SCM] ffmpeg/master.snapshot: confflags: only pass -mfloat-abi=softfp if needed

lool at users.alioth.debian.org lool at users.alioth.debian.org
Mon Sep 6 14:32:12 UTC 2010


The following commit has been merged in the master.snapshot branch:
commit 5d8b3a9c7c2fcc822e51a538ded9ccf5ba167674
Author: Loïc Minier <lool at dooz.org>
Date:   Mon Sep 6 16:29:59 2010 +0200

    confflags: only pass -mfloat-abi=softfp if needed
    
    debian/confflags: on ARM, only pass -mfloat-abi=softfp for the NEON and
    VFP flavours if the toolchain defaults to -mfloat-abi=soft.  Otherwise,
    don't pass anything, which means the VFP and NEON flavours will use the
    same calling conventions as the toolchain.
    
    Introduce a new $(check_cpp) macro for testing cpp output and tweak
    comments and cross-gcc invocations.

diff --git a/debian/confflags b/debian/confflags
index 896b5e0..beb8df1 100644
--- a/debian/confflags
+++ b/debian/confflags
@@ -14,28 +14,34 @@ export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
 SVNREVISION=$(shell cat .svnrevision 2>/dev/null || echo "UNKNOWN")
 
-# this is only used for the check_asm macro
-ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
-    CC := gcc
-else
-    CC := $(DEB_HOST_GNU_TYPE)-gcc
+CROSS :=
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+    CROSS :=  $(DEB_HOST_GNU_TYPE)-
 endif
 
+# this outputs 0 or 1 depending on whether a macro appears in the *default* cpp
+# -dM -P output; this is used to test the toolchain *default* configuration
+check_cpp = $(shell $(CROSS)cpp -dM -P /dev/null | grep -q '^\#define $(1)' && echo 1 || echo 0)
+
 # this outputs 0 or 1 depending on whether a piece of assembly can be compiled
 # with the *default* gcc flags; this is used to test the toolchain *default*
 # configuration
-check_asm = $(shell echo 'void foo(void) { __asm__ volatile("$(1)"); }' | $(CC) -x c -c - -o /dev/null 2>/dev/null && echo 1 || echo 0)
+check_asm = $(shell echo 'void foo(void) { __asm__ volatile("$(1)"); }' | $(CROSS)gcc -x c -c - -o /dev/null 2>/dev/null && echo 1 || echo 0)
 
 # the other flavors always build dynamic versions
 # Also, disable architecture-specific optimizations for default shared build
 ifeq ($(DEB_HOST_ARCH_CPU),arm)
-    # whether the toolchain *default* configuration includes vfp and neon
+    # whether the toolchain *default* configuration includes vfp
     vfp_asm := fadds s0, s0, s0
     has_vfp := $(call check_asm, $(vfp_asm))
+    # whether the toolchain *default* configuration includes neon
     neon_asm := vadd.i16 q0, q0, q0
     has_neon := $(call check_asm, $(neon_asm))
+    # whether the toolchain *default* configuration enables ARMv7
     v7_asm := dmb
     has_v7 := $(call check_asm, $(v7_asm))
+    # whether the toolchain *default* configuration uses -mfloat-abi=soft
+    has_soft := $(call check_cpp,__SOFTFP__ 1)
 
     # only build a VFP flavour if the toolchain doesn't enable VFP by default
     ifneq ($(has_vfp),1)
@@ -45,6 +51,14 @@ ifeq ($(DEB_HOST_ARCH_CPU),arm)
     ifneq ($(has_neon),1)
     FLAVORS += neon
     endif
+    # calling-conventions for VFP and NEON flavours: if the toolchain uses
+    # -mfloat-abi=soft, we want to use softfp, otherwise we want to use the
+    # toolchain default (either softfp or hardfp)
+    ifeq ($(has_soft),1)
+    float_abi := -mfloat-abi=softfp
+    else
+    float_abi :=
+    endif
 else ifeq ($(DEB_HOST_ARCH),i386)
     FLAVORS += cmov
 else ifeq ($(DEB_HOST_ARCH),powerpc)
@@ -162,7 +176,7 @@ vfp_build_confflags += $(confflags)
 vfp_build_confflags += --shlibdir=/usr/lib/vfp
 vfp_build_confflags += --enable-shared
 vfp_build_confflags += --disable-static
-vfp_build_confflags += --extra-cflags="-mfpu=vfp -mfloat-abi=softfp"
+vfp_build_confflags += --extra-cflags="-mfpu=vfp $(float_abi)"
 vfp_build_confflags += --disable-ffmpeg
 vfp_build_confflags += --disable-ffplay
 # NB: NEON always implies v7+ and ffmpeg's NEON implementation requires VFP
@@ -174,7 +188,7 @@ neon_build_confflags += --shlibdir=/usr/lib/neon/vfp
 ifneq ($(has_v7),1)
 neon_build_confflags += --extra-cflags="-march=armv7-a"
 endif
-neon_build_confflags += --extra-cflags="-mfpu=neon -mfloat-abi=softfp -fPIC -DPIC"
+neon_build_confflags += --extra-cflags="-mfpu=neon $(float_abi) -fPIC -DPIC"
 neon_build_confflags += --enable-shared
 neon_build_confflags += --disable-static
 neon_build_confflags += --disable-ffmpeg

-- 
FFmpeg packaging



More information about the pkg-multimedia-commits mailing list