[libav-devel] [PATCH] configure: add strip flags checks

Vittorio Giovara vittorio.giovara at gmail.com
Sun Nov 3 08:39:40 CET 2013


this will check if -wN '..@*' is available and fall back on -x if not
---
Updated version with Martin's suggestion.
Vittorio

 configure   | 19 +++++++++++++++++++
 library.mak |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 4aa66c0..1f87f9e 100755
--- a/configure
+++ b/configure
@@ -659,6 +659,10 @@ add_ldflags(){
     append LDFLAGS $($ldflags_filter "$@")
 }
 
+add_stripflags(){
+    append STRIPFLAGS "$@"
+}
+
 add_extralibs(){
     prepend extralibs $($ldflags_filter "$@")
 }
@@ -804,6 +808,16 @@ check_ldflags(){
     test_ldflags "$@" && add_ldflags "$@"
 }
 
+test_stripflags(){
+    log test_stripflags "$@"
+    check_cmd $strip $STRIPFLAGS "$@" $TMPO
+}
+
+check_stripflags(){
+    log check_stripflags "$@"
+    test_stripflags "$@" && add_stripflags "$@"
+}
+
 check_header(){
     log check_header "$@"
     header=$1
@@ -3931,6 +3945,10 @@ check_ldflags -Wl,--warn-common
 check_ldflags -Wl,-rpath-link=libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
 test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
 
+# add some strip flags
+#-wN '..@*' is more selective than -x but not available everywhere
+check_stripflags -wN '..@*' || check_stripflags -x
+
 enabled xmm_clobber_test &&
     check_ldflags -Wl,--wrap,avcodec_open2              \
                   -Wl,--wrap,avcodec_decode_audio4      \
@@ -4206,6 +4224,7 @@ LD_PATH=$LD_PATH
 DLLTOOL=$dlltool
 LDFLAGS=$LDFLAGS
 SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
+STRIPFLAGS=$STRIPFLAGS
 YASMFLAGS=$YASMFLAGS
 BUILDSUF=$build_suffix
 FULLNAME=$FULLNAME
diff --git a/library.mak b/library.mak
index 7292c8a..3876fe3 100644
--- a/library.mak
+++ b/library.mak
@@ -25,7 +25,7 @@ $(SUBDIR)%-test.i: $(SUBDIR)%.c
 $(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
 	$(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
 	$(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
-	-$(STRIP) -wN '..@*' $@
+	-$(STRIP) $(STRIPFLAGS) $@
 
 LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
 $(LIBOBJS) $(LIBOBJS:.o=.i):   CPPFLAGS += -DHAVE_AV_CONFIG_H
-- 
1.8.4



More information about the libav-devel mailing list