]> git.sesse.net Git - vlc/commitdiff
Contribs: add an option to optimize a bit for the size
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 8 Feb 2012 23:07:16 +0000 (00:07 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 20 Feb 2012 00:00:50 +0000 (01:00 +0100)
Notably for libavcodec

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
contrib/bootstrap
contrib/src/ffmpeg/rules.mak

index a4b541084eff5449bcb8b51eb5c11d4d94eafa38..32db64292d0588c56223cfa05651dbbb6fad40df 100755 (executable)
@@ -28,6 +28,7 @@ usage()
        echo "  --enable-FOO     configure to build package FOO"
        echo "  --disable-disc   configure to not build optical discs packages"
        echo "  --disable-sout   configure to not build stream output packages"
+       echo "  --enable-small   optimize libraries for size with slight speed decrease [DANGEROUS]"
 }
 
 BUILD=
@@ -66,6 +67,9 @@ do
                --disable-sout)
                        BUILD_ENCODERS=
                        ;;
+               --enable-small)
+                       ENABLE_SMALL=1
+                       ;;
                --disable-*)
                        PKGS_DISABLE="${PKGS_DISABLE} ${1#--disable-}"
                        ;;
@@ -161,6 +165,7 @@ check_android_sdk()
 test -z "$PREFIX" || add_make "PREFIX := $PREFIX"
 test -z "$BUILD_DISCS" || add_make_enabled "BUILD_DISCS"
 test -z "$BUILD_ENCODERS" || add_make_enabled "BUILD_ENCODERS"
+test -z "$ENABLE_SMALL" || add_make_enabled "ENABLE_SMALL"
 
 #
 # Checks
index 98ce743669150661abf7c6baec0e02400f4e9cb5..7a326bd1acdf12278d22be743a1813c8697166cf 100644 (file)
@@ -30,7 +30,10 @@ FFMPEGCONF += --enable-libmp3lame --enable-libvpx
 DEPS_ffmpeg += lame $(DEPS_lame) vpx $(DEPS_vpx)
 else
 FFMPEGCONF += --disable-encoders --disable-muxers
-# XXX: REVISIT --enable-small ?
+endif
+
+ifdef ENABLE_SMALL
+FFMPEGCONF += --enable-small --optflags=-O2
 endif
 
 # XXX: REVISIT