Originally committed as revision 8006 to svn://svn.ffmpeg.org/ffmpeg/trunk
Måns Rullgård authored on 2007/02/18 03:32:04... | ... |
@@ -733,13 +733,14 @@ case "$arch" in |
733 | 733 |
esac |
734 | 734 |
|
735 | 735 |
# OS |
736 |
+targetos=`uname -s` |
|
736 | 737 |
beos_netserver="no" |
737 | 738 |
mingw32="no" |
738 | 739 |
os2="no" |
739 | 740 |
wince="no" |
740 | 741 |
|
741 | 742 |
# non-library system interfaces |
742 |
-audio_beos="no" |
|
743 |
+audio_beos="default" |
|
743 | 744 |
audio_oss="yes" |
744 | 745 |
bktr="yes" |
745 | 746 |
dv1394="yes" |
... | ... |
@@ -803,7 +804,6 @@ w32threads="no" |
803 | 803 |
thread_type="no" |
804 | 804 |
|
805 | 805 |
# build settings |
806 |
-extralibs="-lm" |
|
807 | 806 |
SHFLAGS='-shared -Wl,-soname,$@' |
808 | 807 |
VHOOKSHFLAGS='$(SHFLAGS)' |
809 | 808 |
LIBOBJFLAGS="" |
... | ... |
@@ -823,8 +823,121 @@ EXESUF="" |
823 | 823 |
BUILDSUF="" |
824 | 824 |
LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"' |
825 | 825 |
|
826 |
+# find source path |
|
827 |
+source_path="`dirname \"$0\"`" |
|
828 |
+source_path_used="yes" |
|
829 |
+if test -z "$source_path" -o "$source_path" = "." ; then |
|
830 |
+ source_path="`pwd`" |
|
831 |
+ source_path_used="no" |
|
832 |
+else |
|
833 |
+ source_path="`cd \"$source_path\"; pwd`" |
|
834 |
+ echo "$source_path" | grep -q '[[:blank:]]' && |
|
835 |
+ die "Out of tree builds are impossible with whitespace in source path." |
|
836 |
+fi |
|
837 |
+ |
|
838 |
+if test x"$1" = x"-h" -o x"$1" = x"--help" ; then |
|
839 |
+ show_help |
|
840 |
+fi |
|
841 |
+ |
|
842 |
+FFMPEG_CONFIGURATION="$@" |
|
843 |
+ |
|
844 |
+ENCODER_LIST=`sed -n 's/^[^#]*ENC.*, *\(.*\)).*/\1_encoder/p' "$source_path/libavcodec/allcodecs.c"` |
|
845 |
+DECODER_LIST=`sed -n 's/^[^#]*DEC.*, *\(.*\)).*/\1_decoder/p' "$source_path/libavcodec/allcodecs.c"` |
|
846 |
+PARSER_LIST=`sed -n 's/^[^#]*PARSER.*, *\(.*\)).*/\1_parser/p' "$source_path/libavcodec/allcodecs.c"` |
|
847 |
+MUXER_LIST=`sed -n 's/^[^#]*_MUX.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavformat/allformats.c"` |
|
848 |
+DEMUXER_LIST=`sed -n 's/^[^#]*DEMUX.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavformat/allformats.c"` |
|
849 |
+ |
|
850 |
+enable $ENCODER_LIST $DECODER_LIST $PARSER_LIST $MUXER_LIST $DEMUXER_LIST |
|
851 |
+ |
|
852 |
+die_unknown(){ |
|
853 |
+ echo "Unknown option \"$1\"." |
|
854 |
+ echo "See $0 --help for available options." |
|
855 |
+ exit 1 |
|
856 |
+} |
|
857 |
+ |
|
858 |
+for opt do |
|
859 |
+ optval="${opt#*=}" |
|
860 |
+ case "$opt" in |
|
861 |
+ --log) |
|
862 |
+ ;; |
|
863 |
+ --log=*) logging="$optval" |
|
864 |
+ ;; |
|
865 |
+ --prefix=*) PREFIX="$optval" |
|
866 |
+ ;; |
|
867 |
+ --libdir=*) libdir="$optval" |
|
868 |
+ ;; |
|
869 |
+ --shlibdir=*) shlibdir="$optval" |
|
870 |
+ ;; |
|
871 |
+ --incdir=*) incdir="$optval" |
|
872 |
+ ;; |
|
873 |
+ --mandir=*) mandir="$optval" |
|
874 |
+ ;; |
|
875 |
+ --source-path=*) source_path="$optval" |
|
876 |
+ ;; |
|
877 |
+ --cross-prefix=*) cross_prefix="$optval" |
|
878 |
+ ;; |
|
879 |
+ --cross-compile) cross_compile="yes" |
|
880 |
+ ;; |
|
881 |
+ --target-os=*) targetos="$optval" |
|
882 |
+ ;; |
|
883 |
+ --cc=*) cc="$optval" |
|
884 |
+ ;; |
|
885 |
+ --make=*) make="$optval" |
|
886 |
+ ;; |
|
887 |
+ --extra-cflags=*) add_cflags "$optval" |
|
888 |
+ ;; |
|
889 |
+ --extra-ldflags=*) add_ldflags "$optval" |
|
890 |
+ ;; |
|
891 |
+ --extra-libs=*) add_extralibs "$optval" |
|
892 |
+ ;; |
|
893 |
+ --build-suffix=*) BUILDSUF="$optval" |
|
894 |
+ ;; |
|
895 |
+ --arch=*) arch="$optval" |
|
896 |
+ ;; |
|
897 |
+ --cpu=*) cpu="$optval" |
|
898 |
+ ;; |
|
899 |
+ --enable-mingwce) wince="yes" |
|
900 |
+ ;; |
|
901 |
+ --disable-opts) optimize="no" |
|
902 |
+ ;; |
|
903 |
+ --enable-small) optimize="small" |
|
904 |
+ ;; |
|
905 |
+ --enable-sunmlib) mlib="yes" |
|
906 |
+ ;; |
|
907 |
+ --disable-strip) dostrip="no" |
|
908 |
+ ;; |
|
909 |
+ --disable-encoders) disable $ENCODER_LIST |
|
910 |
+ ;; |
|
911 |
+ --disable-decoders) disable $DECODER_LIST |
|
912 |
+ ;; |
|
913 |
+ --disable-muxers) disable $MUXER_LIST |
|
914 |
+ ;; |
|
915 |
+ --disable-demuxers) disable $DEMUXER_LIST |
|
916 |
+ ;; |
|
917 |
+ --disable-parsers) disable $PARSER_LIST |
|
918 |
+ ;; |
|
919 |
+ --enable-*=*|--disable-*=*) |
|
920 |
+ eval `echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/'` |
|
921 |
+ case "$thing" in |
|
922 |
+ encoder|decoder|muxer|demuxer|parser) $action ${optval}_${thing} ;; |
|
923 |
+ *) die_unknown "$opt" ;; |
|
924 |
+ esac |
|
925 |
+ ;; |
|
926 |
+ --enable-?*|--disable-?*) |
|
927 |
+ eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` |
|
928 |
+ echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt |
|
929 |
+ $action $option |
|
930 |
+ ;; |
|
931 |
+ --help) show_help |
|
932 |
+ ;; |
|
933 |
+ *) |
|
934 |
+ die_unknown $opt |
|
935 |
+ ;; |
|
936 |
+ esac |
|
937 |
+done |
|
938 |
+ |
|
826 | 939 |
# OS specific |
827 |
-targetos=`uname -s` |
|
940 |
+osextralibs="-lm" |
|
828 | 941 |
case $targetos in |
829 | 942 |
BeOS|Haiku|Zeta) |
830 | 943 |
PREFIX="$HOME/config" |
... | ... |
@@ -845,15 +958,15 @@ case $targetos in |
845 | 845 |
# disable Linux things |
846 | 846 |
dv1394="no" |
847 | 847 |
# enable BeOS things |
848 |
- audio_beos="yes" |
|
848 |
+ disabled audio_beos || enable_audio_beos |
|
849 | 849 |
# no need for libm, but the inet stuff |
850 | 850 |
# Check for BONE |
851 | 851 |
# XXX: actually should check for NOT net_server |
852 | 852 |
if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then |
853 |
- extralibs="-lbind -lsocket" |
|
853 |
+ osextralibs="-lbind -lsocket" |
|
854 | 854 |
else |
855 | 855 |
beos_netserver="yes" |
856 |
- extralibs="-lnet" |
|
856 |
+ osextralibs="-lnet" |
|
857 | 857 |
fi ;; |
858 | 858 |
SunOS) |
859 | 859 |
dv1394="no" |
... | ... |
@@ -888,7 +1001,7 @@ case $targetos in |
888 | 888 |
;; |
889 | 889 |
BSD/OS) |
890 | 890 |
dv1394="no" |
891 |
- extralibs="-lpoll -lgnugetopt -lm" |
|
891 |
+ osextralibs="-lpoll -lgnugetopt -lm" |
|
892 | 892 |
strip="strip -d" |
893 | 893 |
;; |
894 | 894 |
Darwin) |
... | ... |
@@ -897,7 +1010,7 @@ case $targetos in |
897 | 897 |
need_memalign="no" |
898 | 898 |
SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(shlibdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION) -Wl,-read_only_relocs,suppress" |
899 | 899 |
VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(shlibdir)/vhook/$@' |
900 |
- extralibs="" |
|
900 |
+ osextralibs="" |
|
901 | 901 |
strip="strip -x" |
902 | 902 |
FFLDFLAGS="-Wl,-dynamic,-search_paths_first" |
903 | 903 |
SLIBSUF=".dylib" |
... | ... |
@@ -916,7 +1029,7 @@ case $targetos in |
916 | 916 |
dv1394="no" |
917 | 917 |
VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil' |
918 | 918 |
VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)' |
919 |
- extralibs="" |
|
919 |
+ osextralibs="" |
|
920 | 920 |
EXESUF=".exe" |
921 | 921 |
SLIBPREF="cyg" |
922 | 922 |
SLIBSUF=".dll" |
... | ... |
@@ -945,7 +1058,7 @@ case $targetos in |
945 | 945 |
SLIBPREF="" |
946 | 946 |
SLIBSUF=".dll" |
947 | 947 |
EXESUF=".exe" |
948 |
- extralibs="" |
|
948 |
+ osextralibs="" |
|
949 | 949 |
pkg_requires="" |
950 | 950 |
dv1394="no" |
951 | 951 |
ffserver="no" |
... | ... |
@@ -957,116 +1070,7 @@ case $targetos in |
957 | 957 |
;; |
958 | 958 |
esac |
959 | 959 |
|
960 |
-# find source path |
|
961 |
-source_path="`dirname \"$0\"`" |
|
962 |
-source_path_used="yes" |
|
963 |
-if test -z "$source_path" -o "$source_path" = "." ; then |
|
964 |
- source_path="`pwd`" |
|
965 |
- source_path_used="no" |
|
966 |
-else |
|
967 |
- source_path="`cd \"$source_path\"; pwd`" |
|
968 |
- echo "$source_path" | grep -q '[[:blank:]]' && |
|
969 |
- die "Out of tree builds are impossible with whitespace in source path." |
|
970 |
-fi |
|
971 |
- |
|
972 |
-if test x"$1" = x"-h" -o x"$1" = x"--help" ; then |
|
973 |
- show_help |
|
974 |
-fi |
|
975 |
- |
|
976 |
-FFMPEG_CONFIGURATION="$@" |
|
977 |
- |
|
978 |
-ENCODER_LIST=`sed -n 's/^[^#]*ENC.*, *\(.*\)).*/\1_encoder/p' "$source_path/libavcodec/allcodecs.c"` |
|
979 |
-DECODER_LIST=`sed -n 's/^[^#]*DEC.*, *\(.*\)).*/\1_decoder/p' "$source_path/libavcodec/allcodecs.c"` |
|
980 |
-PARSER_LIST=`sed -n 's/^[^#]*PARSER.*, *\(.*\)).*/\1_parser/p' "$source_path/libavcodec/allcodecs.c"` |
|
981 |
-MUXER_LIST=`sed -n 's/^[^#]*_MUX.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavformat/allformats.c"` |
|
982 |
-DEMUXER_LIST=`sed -n 's/^[^#]*DEMUX.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavformat/allformats.c"` |
|
983 |
- |
|
984 |
-enable $ENCODER_LIST $DECODER_LIST $PARSER_LIST $MUXER_LIST $DEMUXER_LIST |
|
985 |
- |
|
986 |
-die_unknown(){ |
|
987 |
- echo "Unknown option \"$1\"." |
|
988 |
- echo "See $0 --help for available options." |
|
989 |
- exit 1 |
|
990 |
-} |
|
991 |
- |
|
992 |
-for opt do |
|
993 |
- optval="${opt#*=}" |
|
994 |
- case "$opt" in |
|
995 |
- --log) |
|
996 |
- ;; |
|
997 |
- --log=*) logging="$optval" |
|
998 |
- ;; |
|
999 |
- --prefix=*) PREFIX="$optval" |
|
1000 |
- ;; |
|
1001 |
- --libdir=*) libdir="$optval" |
|
1002 |
- ;; |
|
1003 |
- --shlibdir=*) shlibdir="$optval" |
|
1004 |
- ;; |
|
1005 |
- --incdir=*) incdir="$optval" |
|
1006 |
- ;; |
|
1007 |
- --mandir=*) mandir="$optval" |
|
1008 |
- ;; |
|
1009 |
- --source-path=*) source_path="$optval" |
|
1010 |
- ;; |
|
1011 |
- --cross-prefix=*) cross_prefix="$optval" |
|
1012 |
- ;; |
|
1013 |
- --cross-compile) cross_compile="yes" |
|
1014 |
- ;; |
|
1015 |
- --cc=*) cc="$optval" |
|
1016 |
- ;; |
|
1017 |
- --make=*) make="$optval" |
|
1018 |
- ;; |
|
1019 |
- --extra-cflags=*) add_cflags "$optval" |
|
1020 |
- ;; |
|
1021 |
- --extra-ldflags=*) add_ldflags "$optval" |
|
1022 |
- ;; |
|
1023 |
- --extra-libs=*) add_extralibs "$optval" |
|
1024 |
- ;; |
|
1025 |
- --build-suffix=*) BUILDSUF="$optval" |
|
1026 |
- ;; |
|
1027 |
- --arch=*) arch="$optval" |
|
1028 |
- ;; |
|
1029 |
- --cpu=*) cpu="$optval" |
|
1030 |
- ;; |
|
1031 |
- --enable-mingwce) wince="yes" |
|
1032 |
- ;; |
|
1033 |
- --disable-opts) optimize="no" |
|
1034 |
- ;; |
|
1035 |
- --enable-small) optimize="small" |
|
1036 |
- ;; |
|
1037 |
- --enable-sunmlib) mlib="yes" |
|
1038 |
- ;; |
|
1039 |
- --disable-strip) dostrip="no" |
|
1040 |
- ;; |
|
1041 |
- --disable-encoders) disable $ENCODER_LIST |
|
1042 |
- ;; |
|
1043 |
- --disable-decoders) disable $DECODER_LIST |
|
1044 |
- ;; |
|
1045 |
- --disable-muxers) disable $MUXER_LIST |
|
1046 |
- ;; |
|
1047 |
- --disable-demuxers) disable $DEMUXER_LIST |
|
1048 |
- ;; |
|
1049 |
- --disable-parsers) disable $PARSER_LIST |
|
1050 |
- ;; |
|
1051 |
- --enable-*=*|--disable-*=*) |
|
1052 |
- eval `echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/'` |
|
1053 |
- case "$thing" in |
|
1054 |
- encoder|decoder|muxer|demuxer|parser) $action ${optval}_${thing} ;; |
|
1055 |
- *) die_unknown "$opt" ;; |
|
1056 |
- esac |
|
1057 |
- ;; |
|
1058 |
- --enable-?*|--disable-?*) |
|
1059 |
- eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` |
|
1060 |
- echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt |
|
1061 |
- $action $option |
|
1062 |
- ;; |
|
1063 |
- --help) show_help |
|
1064 |
- ;; |
|
1065 |
- *) |
|
1066 |
- die_unknown $opt |
|
1067 |
- ;; |
|
1068 |
- esac |
|
1069 |
-done |
|
960 |
+add_extralibs $osextralibs |
|
1070 | 961 |
|
1071 | 962 |
if ! disabled logging ; then |
1072 | 963 |
enabled logging || logfile="$logging" |