Commit eb351156 authored by diego's avatar diego

Add disabled() function and make use of it.

patch by Ramiro Polla, ramiro lisha.ufsc br


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@7740 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 85c75a61
...@@ -225,6 +225,10 @@ enabled(){ ...@@ -225,6 +225,10 @@ enabled(){
eval test "x\$$1" = "xyes" eval test "x\$$1" = "xyes"
} }
disabled(){
eval test "x\$$1" = "xno"
}
enabled_all(){ enabled_all(){
for opt; do for opt; do
enabled $opt || return 1 enabled $opt || return 1
...@@ -1193,7 +1197,7 @@ ranlib="${cross_prefix}${ranlib}" ...@@ -1193,7 +1197,7 @@ ranlib="${cross_prefix}${ranlib}"
strip="${cross_prefix}${strip}" strip="${cross_prefix}${strip}"
# we need to build at least one lib type # we need to build at least one lib type
if test "$lstatic" = "no" && test "$lshared" = "no" ; then if disabled lstatic && disabled lshared; then
cat <<EOF cat <<EOF
At least one library type must be built. At least one library type must be built.
Specify --enable-static to build the static libraries or --enable-shared to Specify --enable-static to build the static libraries or --enable-shared to
...@@ -1203,11 +1207,11 @@ EOF ...@@ -1203,11 +1207,11 @@ EOF
exit 1; exit 1;
fi fi
if enabled libtheora && test "$libogg" = "no"; then if enabled libtheora && disabled libogg; then
die "libogg must be enabled to enable libtheora." die "libogg must be enabled to enable libtheora."
fi fi
if enabled libvorbis && test "$libogg" = "no"; then if enabled libvorbis && disabled libogg; then
die "libogg must be enabled to enable libvorbis." die "libogg must be enabled to enable libvorbis."
fi fi
...@@ -1284,13 +1288,13 @@ if test $targetos = Darwin; then ...@@ -1284,13 +1288,13 @@ if test $targetos = Darwin; then
;; ;;
*[34].*) *[34].*)
add_cflags "-no-cpp-precomp -pipe -force_cpusubtype_ALL -Wno-sign-compare" add_cflags "-no-cpp-precomp -pipe -force_cpusubtype_ALL -Wno-sign-compare"
if test "$lshared" = no; then if disabled lshared; then
needmdynamicnopic="yes" needmdynamicnopic="yes"
fi fi
;; ;;
*) *)
add_cflags "-no-cpp-precomp -pipe" add_cflags "-no-cpp-precomp -pipe"
if test "$lshared" = no; then if disabled lshared; then
needmdynamicnopic="yes" needmdynamicnopic="yes"
fi fi
;; ;;
...@@ -1341,19 +1345,19 @@ if test $cpu != "generic"; then ...@@ -1341,19 +1345,19 @@ if test $cpu != "generic"; then
;; ;;
G4|g4|745*|ppc745*|PowerPC745*) G4|g4|745*|ppc745*|PowerPC745*)
add_cflags "-mcpu=7450 -mpowerpc-gfxopt" add_cflags "-mcpu=7450 -mpowerpc-gfxopt"
if test $altivec = "no"; then if disabled altivec; then
echo "WARNING: Tuning for PPC745x but AltiVec disabled!"; echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
fi fi
;; ;;
74*|ppc74*|PowerPC74*) 74*|ppc74*|PowerPC74*)
add_cflags "-mcpu=7400 -mpowerpc-gfxopt" add_cflags "-mcpu=7400 -mpowerpc-gfxopt"
if test $altivec = "no"; then if disabled altivec; then
echo "WARNING: Tuning for PPC74xx but AltiVec disabled!"; echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
fi fi
;; ;;
G5|g5|970|ppc970|PowerPC970|power4*|Power4*) G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
add_cflags "-mcpu=970 -mpowerpc-gfxopt -mpowerpc64" add_cflags "-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
if test $altivec = "no"; then if disabled altivec; then
echo "WARNING: Tuning for PPC970 but AltiVec disabled!"; echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
fi fi
POWERPCMODE="64bits" POWERPCMODE="64bits"
...@@ -1506,7 +1510,7 @@ EOF ...@@ -1506,7 +1510,7 @@ EOF
# --- # ---
# big/little-endian test # big/little-endian test
if test "$cross_compile" = "no"; then if disabled cross_compile; then
check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes" check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes"
#include <inttypes.h> #include <inttypes.h>
int main(int argc, char ** argv){ int main(int argc, char ** argv){
...@@ -1916,7 +1920,7 @@ echo "AMR-NB float support $amr_nb" ...@@ -1916,7 +1920,7 @@ echo "AMR-NB float support $amr_nb"
echo "AMR-NB fixed support $amr_nb_fixed" echo "AMR-NB fixed support $amr_nb_fixed"
echo "AMR-WB float support $amr_wb" echo "AMR-WB float support $amr_wb"
echo "AMR-WB IF2 support $amr_if2" echo "AMR-WB IF2 support $amr_if2"
if test "$gpl" = "no" ; then if disabled gpl; then
echo "License: LGPL" echo "License: LGPL"
else else
echo "License: GPL" echo "License: GPL"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment