echo " --disable-ffms-input disables ffmpegsource input"
echo " --disable-mp4-output disables mp4 output (using gpac)"
echo " --disable-pthread disables multithreaded encoding"
-echo " --disable-asm disables assembly optimizations on x86 and arm"
+echo " --disable-asm disables platform-specific assembly optimizations"
echo " --enable-debug adds -g, doesn't strip"
echo " --enable-gprof adds -pg, doesn't strip"
echo " --enable-visualize enables visualization (X11 only)"
ffms_input="auto"
mp4_output="auto"
pthread="auto"
-asm="yes"
+asm="auto"
debug="no"
gprof="no"
pic="no"
--includedir=*)
includedir="$optarg"
;;
- --enable-asm)
- asm="yes"
- ;;
--disable-asm)
asm="no"
;;
- --enable-avs-input)
- avs_input="auto"
- ;;
--disable-avs-input)
avs_input="no"
;;
- --enable-lavf-input)
- lavf_input="auto"
- ;;
--disable-lavf-input)
lavf_input="no"
;;
- --enable-ffms-input)
- ffms_input="auto"
- ;;
--disable-ffms-input)
ffms_input="no"
;;
- --enable-mp4-output)
- mp4_output="yes"
- ;;
--disable-mp4-output)
mp4_output="no"
;;
--extra-ldflags=*)
LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
;;
- --enable-pthread)
- pthread="auto" # can't skip detection, since it differs by OS
- ;;
--disable-pthread)
pthread="no"
;;
shared="yes"
;;
--enable-visualize)
- LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
- define HAVE_VISUALIZE
vis="yes"
;;
--host=*)
;;
powerpc|powerpc64)
ARCH="PPC"
- if [ $SYS = MACOSX ]
- then
- CFLAGS="$CFLAGS -faltivec -fastf -mcpu=G4"
- else
- CFLAGS="$CFLAGS -maltivec -mabi=altivec"
- define HAVE_ALTIVEC_H
+ if [ $asm = yes ] ; then
+ define HAVE_ALTIVEC
+ AS="${AS-${cross_prefix}gcc}"
+ if [ $SYS = MACOSX ] ; then
+ CFLAGS="$CFLAGS -faltivec -fastf -mcpu=G4"
+ else
+ CFLAGS="$CFLAGS -maltivec -mabi=altivec"
+ define HAVE_ALTIVEC_H
+ fi
fi
;;
sparc)
- if test "$(uname -m)" = "sun4u"; then
+ if [ $asm = yes ] && test "$(uname -m)" = "sun4u"; then
ARCH="UltraSparc"
CFLAGS="$CFLAGS -mcpu=ultrasparc"
LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
- AS="${cross_prefix}as"
+ AS="${AS-${cross_prefix}as}"
ASFLAGS="$ASFLAGS -xarch=v8plusa"
else
ARCH="Sparc"
parisc|parisc64)
ARCH="PARISC"
;;
+ ia64)
+ ARCH="IA64"
+ ;;
*)
ARCH="$(echo $host_cpu | tr a-z A-Z)"
;;
CFLAGS="$CFLAGS -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE"
fi
-if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" -o $ARCH = "ARM" \) ] ; then
+if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" -o $ARCH = "ARM" -o $ARCH = "IA64" \) ] ; then
pic="yes"
fi
-if [ $asm = yes -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
+if [ $asm = auto -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
if ! as_check "lzcnt eax, eax" ; then
VER=`($AS --version || echo no assembler) 2>$DEVNULL | head -n 1`
echo "Found $VER"
define HAVE_MMX
fi
-if [ $asm = yes -a $ARCH = ARM ] ; then
+if [ $asm = auto -a $ARCH = ARM ] ; then
# set flags so neon is built by default
echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-mfloat-abi)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp"
fi
[ $asm = no ] && AS=""
-[ "x$AS" = x ] && asm="no"
+[ "x$AS" = x ] && asm="no" || asm="yes"
define ARCH_$ARCH
define SYS_$SYS
define HAVE_LOG2F
fi
+if [ "$vis" = "yes" ] && cc_check "X11/Xlib.h" "-L/usr/X11R6/lib -lX11" "XOpenDisplay( 0 );" ; then
+ LDFLAGS="-L/usr/X11R6/lib -lX11 $LDFLAGS"
+ define HAVE_VISUALIZE
+else
+ vis="no"
+fi
+
if [ "$lavf_input" = "auto" ] ; then
lavf_input="no"
if ${cross_prefix}pkg-config --exists libavformat libavcodec libswscale 2>$DEVNULL; then
[ $ffms_bump -gt 0 ] && vbump=".$ffms_bump"
if ${cross_prefix}pkg-config --atleast-version="$ffms_major.$ffms_minor$vmicro$vbump" ffms2 2>$DEVNULL; then
FFMS2_LIBS="$FFMS2_LIBS $(${cross_prefix}pkg-config --libs ffms2)"
- FFMS2_CFLAGS="$FFMS2_LIBS $(${cross_prefix}pkg-config --cflags ffms2)"
+ FFMS2_CFLAGS="$FFMS2_CFLAGS $(${cross_prefix}pkg-config --cflags ffms2)"
api_check="no"
else
api_check="yes"
fi
if [ "$mp4_output" = "auto" ] ; then
mp4_output="no"
- cc_check gpac/isomedia.h "$MP4_LDFLAGS" && mp4_output="yes"
+ if cc_check gpac/isomedia.h "$MP4_LDFLAGS" ; then
+ if cc_check gpac/isomedia.h "$MP4_LDFLAGS" "gf_isom_set_pixel_aspect_ratio(0,0,0,0,0);" ; then
+ mp4_output="yes"
+ else
+ echo "Warning: gpac is too old, update to 2007-06-21 UTC or later"
+ fi
+ fi
fi
if [ "$mp4_output" = "yes" ] ; then
define MP4_OUTPUT
+ if cc_check gpac/isomedia.h "-Werror $MP4_LDFLAGS" "gf_malloc(1); gf_free(NULL);" ; then
+ define HAVE_GF_MALLOC
+ fi
LDFLAGSCLI="$LDFLAGSCLI $MP4_LDFLAGS"
fi