Commit 5f174a00 authored by mru's avatar mru

add --target-os option, and move OS specific settings after command line

processing


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8006 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 590bcf20
...@@ -733,13 +733,14 @@ case "$arch" in ...@@ -733,13 +733,14 @@ case "$arch" in
esac esac
# OS # OS
targetos=`uname -s`
beos_netserver="no" beos_netserver="no"
mingw32="no" mingw32="no"
os2="no" os2="no"
wince="no" wince="no"
# non-library system interfaces # non-library system interfaces
audio_beos="no" audio_beos="default"
audio_oss="yes" audio_oss="yes"
bktr="yes" bktr="yes"
dv1394="yes" dv1394="yes"
...@@ -803,7 +804,6 @@ w32threads="no" ...@@ -803,7 +804,6 @@ w32threads="no"
thread_type="no" thread_type="no"
# build settings # build settings
extralibs="-lm"
SHFLAGS='-shared -Wl,-soname,$@' SHFLAGS='-shared -Wl,-soname,$@'
VHOOKSHFLAGS='$(SHFLAGS)' VHOOKSHFLAGS='$(SHFLAGS)'
LIBOBJFLAGS="" LIBOBJFLAGS=""
...@@ -823,8 +823,121 @@ EXESUF="" ...@@ -823,8 +823,121 @@ EXESUF=""
BUILDSUF="" BUILDSUF=""
LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"' LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
# find source path
source_path="`dirname \"$0\"`"
source_path_used="yes"
if test -z "$source_path" -o "$source_path" = "." ; then
source_path="`pwd`"
source_path_used="no"
else
source_path="`cd \"$source_path\"; pwd`"
echo "$source_path" | grep -q '[[:blank:]]' &&
die "Out of tree builds are impossible with whitespace in source path."
fi
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
show_help
fi
FFMPEG_CONFIGURATION="$@"
ENCODER_LIST=`sed -n 's/^[^#]*ENC.*, *\(.*\)).*/\1_encoder/p' "$source_path/libavcodec/allcodecs.c"`
DECODER_LIST=`sed -n 's/^[^#]*DEC.*, *\(.*\)).*/\1_decoder/p' "$source_path/libavcodec/allcodecs.c"`
PARSER_LIST=`sed -n 's/^[^#]*PARSER.*, *\(.*\)).*/\1_parser/p' "$source_path/libavcodec/allcodecs.c"`
MUXER_LIST=`sed -n 's/^[^#]*_MUX.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavformat/allformats.c"`
DEMUXER_LIST=`sed -n 's/^[^#]*DEMUX.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavformat/allformats.c"`
enable $ENCODER_LIST $DECODER_LIST $PARSER_LIST $MUXER_LIST $DEMUXER_LIST
die_unknown(){
echo "Unknown option \"$1\"."
echo "See $0 --help for available options."
exit 1
}
for opt do
optval="${opt#*=}"
case "$opt" in
--log)
;;
--log=*) logging="$optval"
;;
--prefix=*) PREFIX="$optval"
;;
--libdir=*) libdir="$optval"
;;
--shlibdir=*) shlibdir="$optval"
;;
--incdir=*) incdir="$optval"
;;
--mandir=*) mandir="$optval"
;;
--source-path=*) source_path="$optval"
;;
--cross-prefix=*) cross_prefix="$optval"
;;
--cross-compile) cross_compile="yes"
;;
--target-os=*) targetos="$optval"
;;
--cc=*) cc="$optval"
;;
--make=*) make="$optval"
;;
--extra-cflags=*) add_cflags "$optval"
;;
--extra-ldflags=*) add_ldflags "$optval"
;;
--extra-libs=*) add_extralibs "$optval"
;;
--build-suffix=*) BUILDSUF="$optval"
;;
--arch=*) arch="$optval"
;;
--cpu=*) cpu="$optval"
;;
--enable-mingwce) wince="yes"
;;
--disable-opts) optimize="no"
;;
--enable-small) optimize="small"
;;
--enable-sunmlib) mlib="yes"
;;
--disable-strip) dostrip="no"
;;
--disable-encoders) disable $ENCODER_LIST
;;
--disable-decoders) disable $DECODER_LIST
;;
--disable-muxers) disable $MUXER_LIST
;;
--disable-demuxers) disable $DEMUXER_LIST
;;
--disable-parsers) disable $PARSER_LIST
;;
--enable-*=*|--disable-*=*)
eval `echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/'`
case "$thing" in
encoder|decoder|muxer|demuxer|parser) $action ${optval}_${thing} ;;
*) die_unknown "$opt" ;;
esac
;;
--enable-?*|--disable-?*)
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt
$action $option
;;
--help) show_help
;;
*)
die_unknown $opt
;;
esac
done
# OS specific # OS specific
targetos=`uname -s` osextralibs="-lm"
case $targetos in case $targetos in
BeOS|Haiku|Zeta) BeOS|Haiku|Zeta)
PREFIX="$HOME/config" PREFIX="$HOME/config"
...@@ -845,15 +958,15 @@ case $targetos in ...@@ -845,15 +958,15 @@ case $targetos in
# disable Linux things # disable Linux things
dv1394="no" dv1394="no"
# enable BeOS things # enable BeOS things
audio_beos="yes" disabled audio_beos || enable_audio_beos
# no need for libm, but the inet stuff # no need for libm, but the inet stuff
# Check for BONE # Check for BONE
# XXX: actually should check for NOT net_server # XXX: actually should check for NOT net_server
if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
extralibs="-lbind -lsocket" osextralibs="-lbind -lsocket"
else else
beos_netserver="yes" beos_netserver="yes"
extralibs="-lnet" osextralibs="-lnet"
fi ;; fi ;;
SunOS) SunOS)
dv1394="no" dv1394="no"
...@@ -888,7 +1001,7 @@ case $targetos in ...@@ -888,7 +1001,7 @@ case $targetos in
;; ;;
BSD/OS) BSD/OS)
dv1394="no" dv1394="no"
extralibs="-lpoll -lgnugetopt -lm" osextralibs="-lpoll -lgnugetopt -lm"
strip="strip -d" strip="strip -d"
;; ;;
Darwin) Darwin)
...@@ -897,7 +1010,7 @@ case $targetos in ...@@ -897,7 +1010,7 @@ case $targetos in
need_memalign="no" need_memalign="no"
SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(shlibdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION) -Wl,-read_only_relocs,suppress" SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(shlibdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION) -Wl,-read_only_relocs,suppress"
VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(shlibdir)/vhook/$@' VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(shlibdir)/vhook/$@'
extralibs="" osextralibs=""
strip="strip -x" strip="strip -x"
FFLDFLAGS="-Wl,-dynamic,-search_paths_first" FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
SLIBSUF=".dylib" SLIBSUF=".dylib"
...@@ -916,7 +1029,7 @@ case $targetos in ...@@ -916,7 +1029,7 @@ case $targetos in
dv1394="no" dv1394="no"
VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil' VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)' VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
extralibs="" osextralibs=""
EXESUF=".exe" EXESUF=".exe"
SLIBPREF="cyg" SLIBPREF="cyg"
SLIBSUF=".dll" SLIBSUF=".dll"
...@@ -945,7 +1058,7 @@ case $targetos in ...@@ -945,7 +1058,7 @@ case $targetos in
SLIBPREF="" SLIBPREF=""
SLIBSUF=".dll" SLIBSUF=".dll"
EXESUF=".exe" EXESUF=".exe"
extralibs="" osextralibs=""
pkg_requires="" pkg_requires=""
dv1394="no" dv1394="no"
ffserver="no" ffserver="no"
...@@ -957,116 +1070,7 @@ case $targetos in ...@@ -957,116 +1070,7 @@ case $targetos in
;; ;;
esac esac
# find source path add_extralibs $osextralibs
source_path="`dirname \"$0\"`"
source_path_used="yes"
if test -z "$source_path" -o "$source_path" = "." ; then
source_path="`pwd`"
source_path_used="no"
else
source_path="`cd \"$source_path\"; pwd`"
echo "$source_path" | grep -q '[[:blank:]]' &&
die "Out of tree builds are impossible with whitespace in source path."
fi
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
show_help
fi
FFMPEG_CONFIGURATION="$@"
ENCODER_LIST=`sed -n 's/^[^#]*ENC.*, *\(.*\)).*/\1_encoder/p' "$source_path/libavcodec/allcodecs.c"`
DECODER_LIST=`sed -n 's/^[^#]*DEC.*, *\(.*\)).*/\1_decoder/p' "$source_path/libavcodec/allcodecs.c"`
PARSER_LIST=`sed -n 's/^[^#]*PARSER.*, *\(.*\)).*/\1_parser/p' "$source_path/libavcodec/allcodecs.c"`
MUXER_LIST=`sed -n 's/^[^#]*_MUX.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavformat/allformats.c"`
DEMUXER_LIST=`sed -n 's/^[^#]*DEMUX.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavformat/allformats.c"`
enable $ENCODER_LIST $DECODER_LIST $PARSER_LIST $MUXER_LIST $DEMUXER_LIST
die_unknown(){
echo "Unknown option \"$1\"."
echo "See $0 --help for available options."
exit 1
}
for opt do
optval="${opt#*=}"
case "$opt" in
--log)
;;
--log=*) logging="$optval"
;;
--prefix=*) PREFIX="$optval"
;;
--libdir=*) libdir="$optval"
;;
--shlibdir=*) shlibdir="$optval"
;;
--incdir=*) incdir="$optval"
;;
--mandir=*) mandir="$optval"
;;
--source-path=*) source_path="$optval"
;;
--cross-prefix=*) cross_prefix="$optval"
;;
--cross-compile) cross_compile="yes"
;;
--cc=*) cc="$optval"
;;
--make=*) make="$optval"
;;
--extra-cflags=*) add_cflags "$optval"
;;
--extra-ldflags=*) add_ldflags "$optval"
;;
--extra-libs=*) add_extralibs "$optval"
;;
--build-suffix=*) BUILDSUF="$optval"
;;
--arch=*) arch="$optval"
;;
--cpu=*) cpu="$optval"
;;
--enable-mingwce) wince="yes"
;;
--disable-opts) optimize="no"
;;
--enable-small) optimize="small"
;;
--enable-sunmlib) mlib="yes"
;;
--disable-strip) dostrip="no"
;;
--disable-encoders) disable $ENCODER_LIST
;;
--disable-decoders) disable $DECODER_LIST
;;
--disable-muxers) disable $MUXER_LIST
;;
--disable-demuxers) disable $DEMUXER_LIST
;;
--disable-parsers) disable $PARSER_LIST
;;
--enable-*=*|--disable-*=*)
eval `echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/'`
case "$thing" in
encoder|decoder|muxer|demuxer|parser) $action ${optval}_${thing} ;;
*) die_unknown "$opt" ;;
esac
;;
--enable-?*|--disable-?*)
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt
$action $option
;;
--help) show_help
;;
*)
die_unknown $opt
;;
esac
done
if ! disabled logging ; then if ! disabled logging ; then
enabled logging || logfile="$logging" enabled logging || logfile="$logging"
......
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