echo "Advanced options (experts only):"
echo " --source-path=PATH path to source code [$source_path]"
echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
+ echo " --cross-compile assume a cross-compiler is used"
echo " --cc=CC use C compiler CC [$cc]"
echo " --make=MAKE use specified make [$make]"
echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
}
check_exec(){
- check_ld "$@" && { test -n "$cross_prefix" || $TMPE; }
+ check_ld "$@" && { test "$cross_compile" = yes || $TMPE 2>&1 >>$logfile; }
}
require(){
mandir=""
bindir=""
cross_prefix=""
+cross_compile="no"
cc="gcc"
ar="ar"
ranlib="ranlib"
"Power Macintosh"|ppc|powerpc)
cpu="powerpc"
;;
- mips|mipsel)
+ mips|mipsel|IP*)
cpu="mips"
;;
sun4u|sparc64)
audio_oss="yes"
dv1394="no"
make="gmake"
-FFLDFLAGS="$FFLDFLAGS -export-dynamic"
extralibs="$extralibs -lossaudio"
;;
OpenBSD)
dv1394="no"
make="gmake"
LIBOBJFLAGS="\$(PIC)"
-FFLDFLAGS="$FFLDFLAGS -export-dynamic -pthread"
LDCONFIG="ldconfig -m \$(libdir)"
extralibs="$extralibs -lossaudio"
;;
dv1394="no"
make="gmake"
CFLAGS="$CFLAGS -pthread"
-FFLDFLAGS="$FFLDFLAGS -export-dynamic -pthread"
;;
GNU/kFreeBSD)
v4l="no"
audio_oss="yes"
dv1394="no"
CFLAGS="$CFLAGS -pthread"
-LDFLAGS="$LDFLAGS -rdynamic"
;;
BSD/OS)
v4l="no"
EXESUF=".exe"
;;
Linux)
-FFLDFLAGS="$FFLDFLAGS -rdynamic"
;;
IRIX*)
ranlib="echo ignoring ranlib"
;;
--cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
;;
+ --cross-compile) cross_compile=yes
+ ;;
--cc=*) cc=`echo $opt | cut -d '=' -f 2-`
;;
--make=*) make=`echo $opt | cut -d '=' -f 2`
# Combine FFLDFLAGS and the LDFLAGS environment variable
LDFLAGS="$FFLDFLAGS $LDFLAGS"
+test -n "$cross_prefix" && cross_compile=yes
cc="${cross_prefix}${cc}"
ar="${cross_prefix}${ar}"
ranlib="${cross_prefix}${ranlib}"
esac
fi
+# compiler sanity check
+check_exec <<EOF
+int main(){
+ return 0;
+}
+EOF
+if test "$?" != 0; then
+ echo "$cc is unable to create an executable file."
+ if test -z "$cross_prefix" -a "$cross_compile" = no; then
+ echo "If $cc is a cross-compiler, use the --cross-compile option."
+ fi
+ die "C compiler test failed."
+fi
+
# check for SIMD availability
# AltiVec flags: The FSF version of GCC differs from the Apple version
SLIBPREF=""
SLIBSUF=".dll"
EXESUF=".exe"
- if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
+ if test "$force_prefix" != yes; then prefix="$PROGRAMFILES/FFmpeg"; fi
if test "$force_libdir" != yes; then bindir="$prefix"; fi
fi
# ---
# big/little-endian test
-if test -z "$cross_prefix" ; then
+if test "$cross_compile" = "no"; then
check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes"
#include <inttypes.h>
int main(int argc, char ** argv){
enabled dts && require libdts dts.h dts_init -ldts
enabled libgsm && require libgsm gsm.h gsm_create -lgsm
enabled mp3lame && require LAME lame/lame.h lame_init -lmp3lame
-enabled libogg && require libogg ogg/ogg.h ogg_sync_init -logg
enabled vorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbis -lvorbisenc
+enabled libogg && require libogg ogg/ogg.h ogg_sync_init -logg
enabled theora && require libtheora theora/theora.h theora_info_init -ltheora
enabled xvid && require XviD xvid.h xvid_global -lxvidcore
enabled x264 && require x264 x264.h x264_encoder_open -lx264
add_extralibs $ldl
fi
+if enabled vhook; then
+ check_ldflags -rdynamic
+ check_ldflags -export-dynamic
+fi
##########################################
# imlib check