Newer
Older
Gildas Bazin
committed
if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
if test "$force_libdir" != yes; then bindir="$prefix"; fi
fi
#include <inttypes.h>
int main(int argc, char ** argv){
volatile uint32_t i=0x01234567;
return (*((uint8_t*)(&i))) == 0x67;
if test $? = 0 ; then
$TMPE && bigendian="yes"
else
echo big/little test failed
fi
# programs cannot be launched if cross compiling, so make a static guess
if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
bigendian="yes"
fi
Chris Flerackers
committed
# ---
# *inttypes.h* test
check_header inttypes.h || inttypes=no
Chris Flerackers
committed
# ---
# *int_fast* test
check_cc <<EOF || emu_fast_int=yes
#include <inttypes.h>
int main(int argc, char ** argv){
volatile uint_fast64_t i=0x01234567;
return 0;
}
EOF
# ---
# check availability of some header files
_memalign=no
_malloc_h=no
if check_header malloc.h; then
_malloc_h=yes
_memalign=yes
check_func memalign || _memalign="no"
if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
echo "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
check_func localtime_r && localtime_r=yes || localtime_r=no
if test "$zlib" = "yes"; then
temp_extralibs -lz
check_header zlib.h && check_func zlibVersion || zlib="no"
# XXX: more tests needed - runtime test
restore_flags
fi
if test "$zlib" = "yes"; then
if test "$lzo" = "yes" -a "$gpl" = "yes"; then
temp_extralibs -llzo
check_header lzo1x.h && check_func lzo_version || lzo="no"
restore_flags
fi
if test "$lzo" = "yes"; then
Michael Niedermayer
committed
# test for lrintf in math.h
check_exec <<EOF && have_lrintf=yes || have_lrintf=no
Michael Niedermayer
committed
#define _ISOC9X_SOURCE 1
#include <math.h>
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
EOF
_restrict=
for restrict_keyword in restrict __restrict__ __restrict; do
check_cc <<EOF
void foo(char * $restrict_keyword p);
EOF
if test $? = 0; then
_restrict=$restrict_keyword
break;
fi
# test gcc version to see if vector builtins can be used
# currently only used on i386 for MMX builtins
check_cc -msse <<EOF && builtin_vector=yes || builtin_vector=no
Aurelien Jacobs
committed
#include <xmmintrin.h>
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
return 0;
#else
#error no vector builtins
#endif
}
EOF
test "$cpu" = "x86_64" && march=k8 || march=athlon
check_cc -march=$march <<EOF && mm3dnow=yes || mm3dnow=no
#include <mm3dnow.h>
int main(void) {
__m64 b1;
b1 = _m_pswapd(b1);
Guillaume Poirier
committed
_m_femms();
check_cflags -Wdeclaration-after-statement
# dlopen/dlfcn.h probing
check_header dlfcn.h && dlfcn=yes
temp_extralibs -ldl
if check_func dlopen; then
dlopen=yes
ldl=-ldl
if check_func dlopen; then
dlopen=yes
ldl=
if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
##########################################
temp_extralibs -lImlib2
check_ld <<EOF && imlib2=yes || imlib2=no
#include <X11/Xlib.h>
#include <Imlib2.h>
int main( void ) { return (int) imlib_load_font("foo"); }
EOF
##########################################
Michael Niedermayer
committed
if test "x$targetos" != "xBeOS"; then
if (freetype-config --version) >/dev/null 2>&1 ; then
temp_cflags `freetype-config --cflags`
temp_extralibs `freetype-config --libs`
check_ld <<EOF && freetype2=yes
#include <ft2build.h>
int main( void ) { return (int) FT_Init_FreeType(0); }
EOF
restore_flags
fi
##########################################
SDL_CONFIG="${cross_prefix}sdl-config"
if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then
temp_cflags `"${SDL_CONFIG}" --cflags`
temp_extralibs `"${SDL_CONFIG}" --libs`
check_ld <<EOF
#include <SDL.h>
#undef main /* We don't want SDL to override our main() */
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
EOF
if test $? = 0; then
_sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
if test "$_sdlversion" -lt 121 ; then
sdl_too_old=yes
else
sdl=yes
check_cc <<EOF && sdl_video_size=yes || sdl_video_size=no
#include <SDL.h>
int main(void){
const SDL_VideoInfo *vi = SDL_GetVideoInfo();
int w = vi->current_w;
return 0;
}
EOF
restore_flags
Nicolas Boos
committed
##########################################
Nicolas Boos
committed
texi2html=no
if (texi2html -version) >/dev/null 2>&1; then
Nicolas Boos
committed
texi2html=yes
fi
##########################################
test "$network" = "yes" && check_ld <<EOF && ipv6=yes || ipv6=no
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
int main( void ) {
struct sockaddr_storage saddr;
struct ipv6_mreq mreq6;
getaddrinfo(0,0,0,0);
getnameinfo(0,0,0,0,0,0,0);
Dan Villiom Podlaski Christiansen
committed
IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
}
EOF
# check for video4linux2 --- V4L2_PIX_FMT_YUV420
test "$v4l2" = "yes" && check_cc <<EOF || v4l2="no"
Alex Beregszaszi
committed
#include <sys/time.h>
#include <asm/types.h>
#include <linux/videodev2.h>
check_cflags -Wall
check_cflags -Wno-switch
if test "$debug" = "yes"; then
fi
if test "$optimize" = "small"; then
# CFLAGS=${CFLAGS//-O3/-Os}
Michael Niedermayer
committed
fi
if test "$optimize" = "yes"; then
if test -n "`$cc -v 2>&1 | grep xlc`"; then
CFLAGS="$CFLAGS -O5"
LDFLAGS="$LDFLAGS -O5"
else
fi
fi
# PIC flags for shared library objects where they are needed
if test "$lshared" = "yes" ; then
# LIBOBJFLAGS may have already been set in the OS configuration
if test -z "$LIBOBJFLAGS" ; then
if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then
LIBOBJFLAGS="\$(PIC)"
fi
fi
fi
if test x"$libdir" = x""; then
fi
echo "install prefix $prefix"
echo "source path $source_path"
Michael Niedermayer
committed
echo "CPU $cpu ($tune)"
if test "$BUILDSUF" != ""; then
Chris Flerackers
committed
echo "inttypes.h $inttypes"
echo "broken inttypes.h $emu_fast_int"
Aurelien Jacobs
committed
if test $cpu = "x86" -o $cpu = "x86_64"; then
echo "MMX enabled $mmx"
echo "Vector Builtins $builtin_vector"
echo "3DNow! Builtins $mm3dnow"
Gildas Bazin
committed
if test $cpu = "armv4l"; then
Gildas Bazin
committed
fi
echo "zlib enabled $zlib"
echo "lzo enabled $lzo"
echo "libgsm enabled $libgsm"
echo "mp3lame enabled $mp3lame"
echo "libogg enabled $libogg"
echo "Vorbis enabled $vorbis"
echo "Theora enabled $theora"
echo "FAAD enabled $faad"
echo "FAAC enabled $faac"
echo "XviD enabled $xvid"
echo "x264 enabled $x264"
echo "debug symbols $debug"
Michel Bardiaux
committed
echo "strip symbols $dostrip"
echo "optimize $optimize"
echo "static $lstatic"
echo "SDL support $sdl"
if test $sdl_too_old = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
Philip Gladstone
committed
if test "$vhook" = "yes"; then
echo "Imlib2 support $imlib2"
echo "FreeType support $freetype2"
Philip Gladstone
committed
fi
echo "Sun medialib support" $sunmlib
echo "pthreads support" $pthreads
echo "AMR-NB float support" $amr_nb
echo "AMR-NB fixed support" $amr_nb_fixed
echo "AMR-WB float support" $amr_wb
Torsten Martinsen
committed
echo "AMR-WB IF2 support" $amr_if2
echo "network support $network"
if test "$network" = "yes" ; then
fi
Michael Niedermayer
committed
if test "$gpl" = "no" ; then
Michael Niedermayer
committed
else
Michael Niedermayer
committed
fi
Michel Bardiaux
committed
date >> config.log
echo " $0 $FFMPEG_CONFIGURATION" >> config.log
echo "# Automatically generated by configure - do not modify!" > config.mak
echo "/* Automatically generated by configure - do not modify! */" > $TMPH
Michel Bardiaux
committed
echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
echo "prefix=\$(DESTDIR)$prefix" >> config.mak
echo "libdir=\$(DESTDIR)$libdir" >> config.mak
echo "incdir=\$(DESTDIR)$incdir" >> config.mak
echo "bindir=\$(DESTDIR)$bindir" >> config.mak
echo "mandir=\$(DESTDIR)$mandir" >> config.mak
echo "CC=$cc" >> config.mak
echo "AR=$ar" >> config.mak
Michel Bardiaux
committed
if test "$dostrip" = "yes" ; then
echo "STRIP=$strip" >> config.mak
echo "INSTALLSTRIP=$installstrip" >> config.mak
Michel Bardiaux
committed
else
echo "STRIP=echo ignoring strip" >> config.mak
echo "INSTALLSTRIP=" >> config.mak
Michel Bardiaux
committed
fi
Michael Niedermayer
committed
# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
Michael Niedermayer
committed
# shared modules on OS/X (vhook/Makefile).
SHCFLAGS=$CFLAGS
if test "$needmdynamicnopic" = yes; then
CFLAGS="$CFLAGS -mdynamic-no-pic"
fi
Michael Niedermayer
committed
echo "SHCFLAGS=$SHCFLAGS">>config.mak
Fabrice Bellard
committed
echo "LDFLAGS=$LDFLAGS" >> config.mak
Jacob Meuser
committed
echo "LDCONFIG=$LDCONFIG" >> config.mak
echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
echo "SHFLAGS=$SHFLAGS" >> config.mak
echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
echo "BUILD_STATIC=$lstatic" >> config.mak
echo "BUILDSUF=$BUILDSUF" >> config.mak
echo "LIBPREF=$LIBPREF" >> config.mak
echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
if test "$lstatic" = "yes" ; then
echo "LIB=$LIB" >> config.mak
else # Some Make complain if this variable does not exist.
echo "LIB=" >> config.mak
fi
echo "SLIBPREF=$SLIBPREF" >> config.mak
echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
Romain Dolbeau
committed
echo "TARGET_OS=$TARGET_OS" >> config.mak
echo "TARGET_ARCH_X86=yes" >> config.mak
Aurelien Jacobs
committed
elif test "$cpu" = "x86_64" ; then
echo "TARGET_ARCH_X86_64=yes" >> config.mak
echo "#define ARCH_X86_64 1" >> $TMPH
Fabrice Bellard
committed
elif test "$cpu" = "armv4l" ; then
echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
echo "#define ARCH_ARMV4L 1" >> $TMPH
Fabrice Bellard
committed
elif test "$cpu" = "alpha" ; then
Nick Kurshev
committed
echo "TARGET_ARCH_ALPHA=yes" >> config.mak
elif test "$cpu" = "sparc64" ; then
echo "TARGET_ARCH_SPARC64=yes" >> config.mak
echo "#define ARCH_SPARC64 1" >> $TMPH
James Morrison
committed
echo "TARGET_ARCH_SPARC=yes" >> config.mak
echo "#define ARCH_SPARC 1" >> $TMPH
elif test "$cpu" = "sparc" ; then
echo "TARGET_ARCH_SPARC=yes" >> config.mak
echo "#define ARCH_SPARC 1" >> $TMPH
Fabrice Bellard
committed
elif test "$cpu" = "powerpc" ; then
echo "TARGET_ARCH_POWERPC=yes" >> config.mak
echo "#define ARCH_POWERPC 1" >> $TMPH
Romain Dolbeau
committed
if test $POWERPCMODE = "32bits"; then
echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
else
echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
fi
if test "$powerpc_perf" = "yes"; then
echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
fi
elif test "$cpu" = "mips" ; then
echo "TARGET_ARCH_MIPS=yes" >> config.mak
echo "#define ARCH_MIPS 1" >> $TMPH
elif test "$cpu" = "sh4" ; then
echo "TARGET_ARCH_SH4=yes" >> config.mak
echo "#define ARCH_SH4 1" >> $TMPH
elif test "$cpu" = "parisc" ; then
echo "TARGET_ARCH_PARISC=yes" >> config.mak
echo "#define ARCH_PARISC 1" >> $TMPH
elif test "$cpu" = "s390" ; then
echo "TARGET_ARCH_S390=yes" >> config.mak
echo "#define ARCH_S390 1" >> $TMPH
elif test "$cpu" = "m68k" ; then
echo "TARGET_ARCH_M68K=yes" >> config.mak
echo "#define ARCH_M68K 1" >> $TMPH
elif test "$cpu" = "ia64" ; then
echo "TARGET_ARCH_IA64=yes" >> config.mak
echo "#define ARCH_IA64 1" >> $TMPH
Michael Niedermayer
committed
echo "#define TUNECPU $TUNECPU" >> $TMPH
Fabrice Bellard
committed
if test "$bigendian" = "yes" ; then
echo "WORDS_BIGENDIAN=yes" >> config.mak
echo "#define WORDS_BIGENDIAN 1" >> $TMPH
Nick Kurshev
committed
fi
Michael Niedermayer
committed
if test "$inttypes" != "yes" ; then
echo "#define EMULATE_INTTYPES 1" >> $TMPH
Chris Flerackers
committed
fi
if test "$emu_fast_int" = "yes" ; then
echo "#define EMULATE_FAST_INT 1" >> $TMPH
fi
echo "TARGET_MMX=yes" >> config.mak
if test "$builtin_vector" = "yes" ; then
echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
fi
if test "$mm3dnow" = "yes" ; then
echo "TARGET_BUILTIN_3DNOW=yes" >> config.mak
echo "#define HAVE_MM3DNOW 1" >> $TMPH
fi
Gildas Bazin
committed
if test "$iwmmxt" = "yes" ; then
echo "TARGET_IWMMXT=yes" >> config.mak
echo "#define HAVE_IWMMXT 1" >> $TMPH
fi
if test "$mmi" = "yes" ; then
echo "TARGET_MMI=yes" >> config.mak
echo "#define HAVE_MMI 1" >> $TMPH
fi
Brian Foley
committed
if test "$altivec" = "yes" ; then
echo "TARGET_ALTIVEC=yes" >> config.mak
echo "#define HAVE_ALTIVEC 1" >> $TMPH
Michael Niedermayer
committed
echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
if test "$_altivec_h" = "yes" ; then
echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
else
fi
Brian Foley
committed
fi
echo "TARGET_GPROF=yes" >> config.mak
if test "$localtime_r" = "yes" ; then
echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
fi
Philip Gladstone
committed
if test "$imlib2" = "yes" ; then
echo "HAVE_IMLIB2=yes" >> config.mak
fi
if test "$freetype2" = "yes" ; then
echo "HAVE_FREETYPE2=yes" >> config.mak
fi
if test "$sunmlib" = "yes" ; then
echo "HAVE_MLIB=yes" >> config.mak
echo "#define HAVE_MLIB 1" >> $TMPH
extralibs="$extralibs -lmlib"
fi
if test "$pthreads" = "yes" ; then
echo "HAVE_PTHREADS=yes" >> config.mak
echo "#define HAVE_PTHREADS 1" >> $TMPH
François Revol
committed
echo "#define HAVE_THREADS 1" >> $TMPH
if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
extralibs="$extralibs -lpthread"
fi
if test "$sdl" = "yes" ; then
echo "CONFIG_SDL=yes" >> config.mak
echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
if test "$sdl_video_size" = "yes"; then
echo "#define HAVE_SDL_VIDEO_SIZE 1" >> $TMPH
fi
Nicolas Boos
committed
if test "$texi2html" = "yes"; then
echo "BUILD_DOC=yes" >> config.mak
fi
Michael Niedermayer
committed
if test "$have_lrintf" = "yes" ; then
echo "#define HAVE_LRINTF 1" >> $TMPH
fi
Philip Gladstone
committed
if test "$vhook" = "yes" ; then
echo "BUILD_VHOOK=yes" >> config.mak
echo "#define HAVE_VHOOK 1" >> $TMPH
fi
pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
echo "#define BUILD_SHARED_AV 1" >> $TMPH
echo "PIC=-fPIC -DPIC" >> config.mak
echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
echo "SPPVERSION=$lavc_version" >> config.mak
echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
echo "LAVCVERSION=$lavc_version" >> config.mak
echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
echo "LAVFVERSION=$lavf_version" >> config.mak
echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
echo "LAVUVERSION=$lavu_version" >> config.mak
Diego Biurrun
committed
echo "SLIBNAME=${SLIBNAME}" >> config.mak
echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
echo "EXTRALIBS=$extralibs" >> config.mak
version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
cut -d '"' -f 2`
echo "VERSION=$version" >>config.mak
echo "#define CONFIG_ENCODERS 1" >> $TMPH
Fabrice Bellard
committed
echo "CONFIG_ENCODERS=yes" >> config.mak
echo "#define CONFIG_DECODERS 1" >> $TMPH
Fabrice Bellard
committed
echo "CONFIG_DECODERS=yes" >> config.mak
# muxers
if test "$muxers" = "yes" ; then
echo "#define CONFIG_MUXERS 1" >> $TMPH
echo "CONFIG_MUXERS=yes" >> config.mak
fi
# demuxers
if test "$demuxers" = "yes" ; then
echo "#define CONFIG_DEMUXERS 1" >> $TMPH
echo "CONFIG_DEMUXERS=yes" >> config.mak
fi
# AC3
if test "$a52" = "yes" ; then
echo "#define CONFIG_AC3 1" >> $TMPH
echo "CONFIG_AC3=yes" >> config.mak
Fabrice Bellard
committed
if test "$a52bin" = "yes" ; then
echo "#define CONFIG_A52BIN 1" >> $TMPH
echo "CONFIG_A52BIN=yes" >> config.mak
fi
fi
# DTS
if test "$dts" = "yes" ; then
echo "#define CONFIG_DTS 1" >> $TMPH
echo "CONFIG_DTS=yes" >> config.mak
fi
# PP
if test "$pp" = "yes" ; then
echo "#define CONFIG_PP 1" >> $TMPH
echo "CONFIG_PP=yes" >> config.mak
fi
Fabrice Bellard
committed
if test "$mpegaudio_hp" = "yes" ; then
echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
fi
if test "$v4l" = "yes" ; then
echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
fi
if test "$v4l2" = "yes" ; then
echo "#define CONFIG_VIDEO4LINUX2 1" >> $TMPH
echo "CONFIG_VIDEO4LINUX2=yes" >> config.mak
fi
if test "$bktr" = "yes" ; then
echo "#define CONFIG_BKTR 1" >> $TMPH
echo "CONFIG_BKTR=yes" >> config.mak
fi
if test "$dv1394" = "yes" ; then
echo "#define CONFIG_DV1394 1" >> $TMPH
echo "CONFIG_DV1394=yes" >> config.mak
fi
if test "$dc1394" = "yes" ; then
echo "#define CONFIG_DC1394 1" >> $TMPH
echo "CONFIG_DC1394=yes" >> config.mak
fi
if test "$dlopen" = "yes" ; then
echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
fi
if test "$dlfcn" = "yes" ; then
echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
fi
if test "$audio_oss" = "yes" ; then
echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
echo "CONFIG_AUDIO_OSS=yes" >> config.mak
if test "$audio_beos" = "yes" ; then
echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
fi
if test "$network" = "yes" ; then
echo "#define CONFIG_NETWORK 1" >> $TMPH
echo "CONFIG_NETWORK=yes" >> config.mak
if test "$ipv6" = "yes" ; then
echo "#define CONFIG_IPV6 1" >> $TMPH
fi
if test "$zlib" = "yes" ; then
echo "#define CONFIG_ZLIB 1" >> $TMPH
echo "CONFIG_ZLIB=yes" >> config.mak
fi
if test "$lzo" = "yes" ; then
echo "#define CONFIG_LZO 1" >> $TMPH
echo "CONFIG_LZO=yes" >> config.mak
fi
if test "$libgsm" = "yes" ; then
echo "#define CONFIG_LIBGSM 1" >> $TMPH
echo "CONFIG_LIBGSM=yes" >> config.mak
fi
echo "#define CONFIG_MP3LAME 1" >> $TMPH
echo "CONFIG_MP3LAME=yes" >> config.mak
fi
if test "$libogg" = "yes" ; then
echo "#define CONFIG_LIBOGG 1" >> $TMPH
echo "CONFIG_LIBOGG=yes" >> config.mak
fi
if test "$vorbis" = "yes" ; then
echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
echo "CONFIG_LIBVORBIS=yes" >> config.mak
fi
if test "$theora" = "yes" ; then
echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
echo "CONFIG_LIBTHEORA=yes" >> config.mak
fi
Zdenek Kabelac
committed
if test "$faad" = "yes" ; then
echo "#define CONFIG_FAAD 1" >> $TMPH
echo "CONFIG_FAAD=yes" >> config.mak
fi
if test "$faadbin" = "yes" ; then
echo "#define CONFIG_FAADBIN 1" >> $TMPH
Zdenek Kabelac
committed
fi
Michael Niedermayer
committed
if test "$faac" = "yes" ; then
echo "#define CONFIG_FAAC 1" >> $TMPH
echo "CONFIG_FAAC=yes" >> config.mak
fi
if test "$xvid" = "yes" ; then
echo "#define CONFIG_XVID 1" >> $TMPH
echo "CONFIG_XVID=yes" >> config.mak
fi
if test "$x264" = "yes" ; then
echo "#define CONFIG_X264 1" >> $TMPH
echo "CONFIG_X264=yes" >> config.mak
fi
if test "$mingw32" = "yes" ; then
echo "#define CONFIG_WIN32 1" >> $TMPH
echo "CONFIG_WIN32=yes" >> config.mak
echo "HAVE_W32THREADS=yes" >> config.mak
echo "#define HAVE_W32THREADS 1" >> $TMPH
François Revol
committed
echo "#define HAVE_THREADS 1" >> $TMPH
echo "#ifndef __MINGW32__" >> $TMPH
echo "#define __MINGW32__ 1" >> $TMPH
echo "#endif" >> $TMPH
Felix Bünemann
committed
fi
if test "$mingwce" = "yes" ; then
echo "#define CONFIG_WIN32 1" >> $TMPH
echo "CONFIG_WIN32=yes" >> config.mak
echo "#define CONFIG_WINCE 1" >> $TMPH
echo "CONFIG_WINCE=yes" >> config.mak
echo "#ifndef __MINGW32__" >> $TMPH
echo "#define __MINGW32__ 1" >> $TMPH
echo "#endif" >> $TMPH
fi
if test "$os2" = "yes" ; then
echo "#define CONFIG_OS2 1" >> $TMPH
echo "CONFIG_OS2=yes" >> config.mak
Michael Niedermayer
committed
echo "HAVE_OS2THREADS=yes" >> config.mak
echo "#define HAVE_OS2THREADS 1" >> $TMPH
echo "#define HAVE_THREADS 1" >> $TMPH
fi
if test "$TARGET_OS" = "SunOS" ; then
echo "#define CONFIG_SUNOS 1" >> $TMPH
fi
François Revol
committed
if test "$TARGET_OS" = "BeOS" ; then
echo "HAVE_BEOSTHREADS=yes" >> config.mak
echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
echo "#define HAVE_THREADS 1" >> $TMPH
fi
if test "$darwin" = "yes"; then
echo "#define CONFIG_DARWIN 1" >> $TMPH
echo "CONFIG_DARWIN=yes" >> config.mak
fi
echo "#define HAVE_MALLOC_H 1" >> $TMPH
echo "#define HAVE_MEMALIGN 1" >> $TMPH
else
echo "#undef HAVE_MEMALIGN" >> $TMPH
fi
Michael Niedermayer
committed
if test "$memalignhack" = "yes" ; then
echo "#define MEMALIGN_HACK 1" >> $TMPH
fi
if test "$netserver" = "yes" ; then
echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
fi
if test "$need_inet_aton" = "yes" ; then
echo "NEED_INET_ATON=yes" >> config.mak
fi
echo "#define SIMPLE_IDCT 1" >> $TMPH
fi
if test "$protocols" = "yes" ; then
echo "#define CONFIG_PROTOCOLS 1" >> $TMPH
echo "CONFIG_PROTOCOLS=yes" >> config.mak
fi
if test "$ffserver" = "yes" ; then
echo "#define CONFIG_FFSERVER 1" >> $TMPH
echo "CONFIG_FFSERVER=yes" >> config.mak
fi
if test "$ffplay" = "yes" ; then
echo "CONFIG_FFPLAY=yes" >> config.mak
fi
Michael Niedermayer
committed
if test "$gpl" = "yes" ; then
echo "#define CONFIG_GPL 1" >> $TMPH
echo "CONFIG_GPL=yes" >> config.mak
fi
echo "#define restrict $_restrict" >> $TMPH
if test "$optimize" = "small"; then
echo "#define always_inline" >> $TMPH
fi
Fabrice Bellard
committed
# build tree in object directory if source path is different from current one
if test "$source_path_used" = "yes" ; then
DIRS="\
doc \
libavformat \
libavcodec \
libavcodec/alpha \
libavcodec/armv4l \
libavcodec/i386 \
libavcodec/sparc \
libavcodec/mlib \
libavcodec/ppc \
libavcodec/liba52 \
libavutil \
tests \
vhook \
"
FILES="\
Makefile \
libavformat/Makefile \
libavcodec/Makefile \
libavutil/Makefile \
tests/Makefile \
vhook/Makefile \
doc/Makefile \
doc/texi2pod.pl \
"
Fabrice Bellard
committed
for dir in $DIRS ; do
mkdir -p $dir
done
for f in $FILES ; do
Fabrice Bellard
committed
done
fi
echo "SRC_PATH=$source_path" >> config.mak
echo "BUILD_ROOT=$PWD" >> config.mak
Fabrice Bellard
committed
if test "$amr" = "yes" ; then
echo "#define AMR 1" >> $TMPH
echo "AMR=yes" >> config.mak
fi
if test "$amr_wb" = "yes" ; then
echo "#define AMR_WB 1" >> $TMPH
echo "AMR_WB=yes" >> config.mak
echo
echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
echo "V5.1.0 from "
echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
echo "and extracted the source to libavcodec/amrwb_float"
fi
if test "$amr_nb" = "yes" ; then
echo "#define AMR_NB 1" >> $TMPH
echo "AMR_NB=yes" >> config.mak
echo
echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
echo "REL-5 V5.1.0 from "
echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip"
echo "and extracted the source to libavcodec/amr_float"
echo "If you try this on alpha, you may need to change Word32 to int in amr/typedef.h"
fi
if test "$amr_nb_fixed" = "yes" ; then
echo "#define AMR_NB_FIXED 1" >> $TMPH
echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
echo "REL-5 version 5.1.0 from "
echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip"
echo "and extracted src to libavcodec/amr"
echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
Torsten Martinsen
committed
if test "$amr_if2" = "yes" ; then
echo "AMR_CFLAGS=-DIF2=1" >> config.mak
fi
Michael Niedermayer
committed
for codec in $CODEC_LIST ; do
echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
Michael Niedermayer
committed
done
Diego Biurrun
committed
# Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
diff $TMPH config.h >/dev/null 2>&1
if test "$?" != "0" ; then
Diego Biurrun
committed
mv -f $TMPH config.h
else
echo "config.h is unchanged"
fi
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
Aurelien Jacobs
committed
# libavutil.pc
cat <<EOF >libavutil.pc
prefix=$prefix
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include
Name: libavutil
Description: FFmpeg utility library
Version: $lavu_version
Conflicts:
Libs: -L\${libdir} -lavutil
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
EOF
cat <<EOF >libavutil-uninstalled.pc
prefix=
exec_prefix=
libdir=\${pcfiledir}/libavutil
includedir=\${pcfiledir}/libavutil
Name: libavutil
Description: FFmpeg utility library
Version: $lavu_version
Conflicts:
Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
Cflags: -I\${includedir}
EOF
Aurelien Jacobs
committed
# libavcodec.pc
cat <<EOF >libavcodec.pc
prefix=$prefix
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include
Name: libavcodec
Description: FFmpeg codec library
Version: $lavc_version
Requires: $pkg_requires libavutil = $lavu_version
Aurelien Jacobs
committed
Conflicts:
Libs: -L\${libdir} -lavcodec $extralibs
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
EOF
cat <<EOF >libavcodec-uninstalled.pc
prefix=
exec_prefix=
libdir=\${pcfiledir}/libavcodec
includedir=\${pcfiledir}/libavcodec
Name: libavcodec
Description: FFmpeg codec library
Version: $lavc_version