Commit cddf3f45 authored by Glenn Maynard's avatar Glenn Maynard Committed by Michael Niedermayer

Debug/optimization patch by (Glenn Maynard <g_sf at zewt dot org>)

Originally committed as revision 2240 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent d0526ecf
...@@ -78,6 +78,8 @@ mingw32="no" ...@@ -78,6 +78,8 @@ mingw32="no"
cygwin="no" cygwin="no"
os2="no" os2="no"
lshared="no" lshared="no"
optimize="yes"
debug="yes"
extralibs="-lm" extralibs="-lm"
simpleidct="yes" simpleidct="yes"
bigendian="no" bigendian="no"
...@@ -97,7 +99,6 @@ LIBSUF=".a" ...@@ -97,7 +99,6 @@ LIBSUF=".a"
SLIBPREF="lib" SLIBPREF="lib"
SLIBSUF=".so" SLIBSUF=".so"
risky="yes" risky="yes"
small="no"
amr_nb="no" amr_nb="no"
amr_nb_fixed="no" amr_nb_fixed="no"
sunmlib="no" sunmlib="no"
...@@ -108,7 +109,7 @@ case $targetos in ...@@ -108,7 +109,7 @@ case $targetos in
BeOS) BeOS)
prefix="/boot/home/config" prefix="/boot/home/config"
# helps building libavcodec # helps building libavcodec
CFLAGS="-O3 -DPIC -fomit-frame-pointer" CFLAGS="-DPIC -fomit-frame-pointer"
# 3 gcc releases known for BeOS, each with ugly bugs # 3 gcc releases known for BeOS, each with ugly bugs
gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)" gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
case "$gcc_version" in case "$gcc_version" in
...@@ -174,13 +175,13 @@ FFSLDFLAGS=-Wl,-bind_at_load ...@@ -174,13 +175,13 @@ FFSLDFLAGS=-Wl,-bind_at_load
gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)" gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
case "$gcc_version" in case "$gcc_version" in
*2.95*) *2.95*)
CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer" CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer"
;; ;;
*3.3*) *3.3*)
CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL" CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL"
;; ;;
*) *)
CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic" CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic"
;; ;;
esac esac
;; ;;
...@@ -215,7 +216,7 @@ TMPE=$TMPE".exe" ...@@ -215,7 +216,7 @@ TMPE=$TMPE".exe"
ar="emxomfar -p64" ar="emxomfar -p64"
ranlib="echo ignoring ranlib" ranlib="echo ignoring ranlib"
strip="echo ignoring strip" strip="echo ignoring strip"
CFLAGS="-Zomf -O3" CFLAGS="-Zomf"
LDFLAGS="-Zomf -Zstack 16384 -s" LDFLAGS="-Zomf -Zstack 16384 -s"
SHFLAGS="" SHFLAGS=""
FFSLDFLAGS="" FFSLDFLAGS=""
...@@ -333,6 +334,10 @@ for opt do ...@@ -333,6 +334,10 @@ for opt do
;; ;;
--enable-shared) lshared="yes" --enable-shared) lshared="yes"
;; ;;
--disable-debug) debug="no"
;;
--disable-opts) optimize="no"
;;
--disable-mpegaudio-hp) mpegaudio_hp="no" --disable-mpegaudio-hp) mpegaudio_hp="no"
;; ;;
--disable-ffserver) ffserver="no" --disable-ffserver) ffserver="no"
...@@ -341,7 +346,7 @@ for opt do ...@@ -341,7 +346,7 @@ for opt do
;; ;;
--disable-risky) risky="no" --disable-risky) risky="no"
;; ;;
--enable-small) small="yes" --enable-small) optimize="small"
;; ;;
--enable-amr_nb) amr_nb="yes" --enable-amr_nb) amr_nb="yes"
;; ;;
...@@ -494,11 +499,6 @@ EOF ...@@ -494,11 +499,6 @@ EOF
$cc -o $TMPE $TMPC 2> /dev/null || mmi="no" $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
fi fi
# Checking for CFLAGS
if test -z "$CFLAGS"; then
CFLAGS="-O3"
fi
if test "$mingw32" = "yes" ; then if test "$mingw32" = "yes" ; then
v4l="no" v4l="no"
audio_oss="no" audio_oss="no"
...@@ -723,11 +723,19 @@ if test "$sdl" = "no" ; then ...@@ -723,11 +723,19 @@ if test "$sdl" = "no" ; then
ffplay=no ffplay=no
fi fi
if test "$small" = "yes"; then if test "$debug" = "yes"; then
CFLAGS="$CFLAGS -g"
fi
if test "$optimize" = "small"; then
# CFLAGS=${CFLAGS//-O3/-Os} # CFLAGS=${CFLAGS//-O3/-Os}
CFLAGS="$CFLAGS -Os" CFLAGS="$CFLAGS -Os"
fi fi
if test "$optimize" = "yes"; then
CFLAGS="$CFLAGS -O3"
fi
if test x"$mandir" = x""; then if test x"$mandir" = x""; then
mandir="${prefix}/man" mandir="${prefix}/man"
fi fi
...@@ -779,6 +787,8 @@ echo " --disable-zlib disable zlib [default=no]" ...@@ -779,6 +787,8 @@ echo " --disable-zlib disable zlib [default=no]"
echo " --disable-simple_idct disable simple IDCT routines [default=no]" echo " --disable-simple_idct disable simple IDCT routines [default=no]"
echo " --disable-vhook disable video hooking support" echo " --disable-vhook disable video hooking support"
echo " --enable-gprof enable profiling with gprof [$gprof]" echo " --enable-gprof enable profiling with gprof [$gprof]"
echo " --disable-debug disable debugging symbols"
echo " --disable-opts disable compiler optimizations"
echo " --disable-mpegaudio-hp faster (but less accurate)" echo " --disable-mpegaudio-hp faster (but less accurate)"
echo " mpegaudio decoding [default=no]" echo " mpegaudio decoding [default=no]"
echo " --disable-ffserver disable ffserver build" echo " --disable-ffserver disable ffserver build"
...@@ -815,6 +825,8 @@ echo "faadbin enabled $faadbin" ...@@ -815,6 +825,8 @@ echo "faadbin enabled $faadbin"
echo "a52 support $a52" echo "a52 support $a52"
echo "a52 dlopened $a52bin" echo "a52 dlopened $a52bin"
echo "pp support $pp" echo "pp support $pp"
echo "debug symbols $debug"
echo "optimize $optimize"
echo "shared pp $shared_pp" echo "shared pp $shared_pp"
echo "Video hooking $vhook" echo "Video hooking $vhook"
echo "SDL support $sdl" echo "SDL support $sdl"
...@@ -822,7 +834,6 @@ if test $sdl_too_old = "yes"; then ...@@ -822,7 +834,6 @@ if test $sdl_too_old = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support" echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
fi fi
echo "risky / patent encumbered codecs $risky" echo "risky / patent encumbered codecs $risky"
echo "optimize for size $small"
if test "$vhook" = "yes" ; then if test "$vhook" = "yes" ; then
echo "Imlib2 support $imlib2" echo "Imlib2 support $imlib2"
......
...@@ -7,8 +7,7 @@ include ../config.mak ...@@ -7,8 +7,7 @@ include ../config.mak
VPATH=$(SRC_PATH)/libavcodec VPATH=$(SRC_PATH)/libavcodec
# NOTE: -I.. is needed to include config.h # NOTE: -I.. is needed to include config.h
CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE CFLAGS= $(OPTFLAGS) -Wall -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
LDFLAGS= -g
OBJS= common.o utils.o mem.o allcodecs.o \ OBJS= common.o utils.o mem.o allcodecs.o \
mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\ mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
......
...@@ -6,7 +6,7 @@ include ../config.mak ...@@ -6,7 +6,7 @@ include ../config.mak
VPATH=$(SRC_PATH)/libavformat VPATH=$(SRC_PATH)/libavformat
CFLAGS= $(OPTFLAGS) -Wall -g -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE CFLAGS= $(OPTFLAGS) -Wall -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
OBJS= utils.o cutils.o os_support.o allformats.o OBJS= utils.o cutils.o os_support.o allformats.o
PPOBJS= PPOBJS=
......
...@@ -2,7 +2,7 @@ include ../config.mak ...@@ -2,7 +2,7 @@ include ../config.mak
VPATH=$(SRC_PATH)/vhook VPATH=$(SRC_PATH)/vhook
CFLAGS=-fPIC $(OPTFLAGS) -g -Wall -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H CFLAGS=-fPIC $(OPTFLAGS) -Wall -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavformat -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H
ifeq ($(CONFIG_DARWIN),yes) ifeq ($(CONFIG_DARWIN),yes)
SHFLAGS+=-bundle -flat_namespace -undefined suppress SHFLAGS+=-bundle -flat_namespace -undefined suppress
......
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