]> git.sesse.net Git - ffmpeg/blobdiff - configure
Fix #include path, headers from other directories need to have
[ffmpeg] / configure
index 074b3ab844fcda9ce8ff730e38693492e7ee6017..6195d81dce949400eece973dc4ab3f7abaf74913 100755 (executable)
--- a/configure
+++ b/configure
@@ -135,7 +135,6 @@ show_help(){
   echo "  --disable-zlib           disable zlib [default=no]"
   echo "  --disable-bzlib          disable bzlib [default=no]"
   echo "  --disable-vhook          disable video hooking support"
-  echo "  --disable-debug          disable debugging symbols"
   echo "  --disable-mpegaudio-hp   faster (but less accurate)"
   echo "                           MPEG audio decoding [default=no]"
   echo "  --enable-gray            enable full grayscale support (slower color)"
@@ -178,6 +177,8 @@ show_help(){
   echo "  --list-outdevs           show all available output devices"
   echo
   echo "Developer options (useful when working on FFmpeg itself):"
+  echo "  --disable-debug          disable debugging symbols"
+  echo "  --enable-debug=LEVEL     set the debug level [$debuglevel]"
   echo "  --enable-gprof           enable profiling with gprof [$gprof]"
   echo "  --disable-optimizations  disable compiler optimizations"
   echo "  --enable-extra-warnings  enable more compiler warnings"
@@ -444,6 +445,14 @@ int foo(void){ asm volatile($asm); }
 EOF
 }
 
+check_yasm(){
+    log check_yasm "$@"
+    echo "$1" > $TMPS
+    log_file $TMPS
+    shift 1
+    check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
+}
+
 check_ld(){
     log check_ld "$@"
     check_cc || return
@@ -622,6 +631,9 @@ apply(){
     "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
 }
 
+# CONFIG_LIST contains configurable options, while HAVE_LIST is for
+# system-dependent things.
+
 COMPONENT_LIST="
     bsfs
     decoders
@@ -724,7 +736,6 @@ HAVE_LIST="
     $ARCH_EXT_LIST
     $THREADS_LIST
     altivec_h
-    altivec_vector_braces
     arpa_inet_h
     bswap
     byteswap_h
@@ -778,6 +789,7 @@ HAVE_LIST="
     termios_h
     threads
     winsock2_h
+    yasm
 "
 
 CMDLINE_SELECT="
@@ -927,12 +939,14 @@ shlibdir_default="$libdir_default"
 
 # toolchain
 cc="gcc"
+yasmexe="yasm"
 ar="ar"
 nm="nm"
 ranlib="ranlib"
 strip="strip"
 asmalign_pot="unknown"
 ln_s="ln -sf"
+objformat="elf"
 
 # machine
 arch=`uname -m`
@@ -960,6 +974,7 @@ enable stripping
 vhook="default"
 
 # build settings
+add_cflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
 SHFLAGS='-shared -Wl,-soname,$$(@F)'
 VHOOKSHFLAGS='$(SHFLAGS)'
 FFSERVERLDFLAGS=-Wl,-E
@@ -1088,6 +1103,7 @@ echo "# $0 $@" > $logfile
 set >> $logfile
 
 cc="${cross_prefix}${cc}"
+yasmexe="${cross_prefix}${yasmexe}"
 ar="${cross_prefix}${ar}"
 nm="${cross_prefix}${nm}"
 ranlib="${cross_prefix}${ranlib}"
@@ -1109,6 +1125,9 @@ TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
 TMPSH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.sh"
 
+check_cflags -fasm
+check_cflags -std=c99
+
 case "$arch" in
     i386|i486|i586|i686|i86pc|BePC)
         arch="x86_32"
@@ -1242,6 +1261,8 @@ case $target_os in
         SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
         SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
         FFSERVERLDFLAGS=-Wl,-bind_at_load
+        objformat="macho"
+        enabled x86_64 && objformat="macho64"
         ;;
     mingw32*)
         target_os=mingw32
@@ -1268,6 +1289,7 @@ case $target_os in
             install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"'
         SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
         SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
+        objformat="win32"
         ;;
     cygwin*)
         target_os=cygwin
@@ -1284,12 +1306,14 @@ case $target_os in
         SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
         SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
         SHFLAGS='-shared -Wl,--enable-auto-image-base'
+        objformat="win32"
         ;;
     *-dos|freedos|opendos)
         disable ffplay ffserver vhook
         disable $INDEV_LIST $OUTDEV_LIST
         network_extralibs="-lsocket"
         EXESUF=".exe"
+        objformat="win32"
         ;;
     linux)
         enable dv1394
@@ -1532,6 +1556,16 @@ EOF
     enabled mmx2  && check_asm mmx2  '"movss %xmm0, %xmm0"'
 
     check_asm bswap '"bswap %%eax" ::: "%eax"'
+
+    YASMFLAGS="-f $objformat -DARCH_$(toupper $arch)"
+    enabled     x86_64        && append YASMFLAGS "-m amd64"
+    enabled_all x86_64 shared && append YASMFLAGS "-DPIC"
+    case "$objformat" in
+        elf) enabled debug && append YASMFLAGS "-g dwarf2" ;;
+        macho64)              append YASMFLAGS "-DPIC -DPREFIX" ;;
+        *)                    append YASMFLAGS "-DPREFIX"  ;;
+    esac
+    check_yasm "pabsw xmm0, xmm0" && enable yasm
 fi
 
 # check for assembler specific support
@@ -1566,10 +1600,9 @@ int main(void) {
 EOF
 
     # check if our compiler supports braces for vector declarations
-    check_cc <<EOF && enable altivec_vector_braces
+    check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations."
 $inc_altivec_h
-#define AVV(x...) {x}
-int main (void) { (vector int) AVV(1); return 0; }
+int main (void) { (vector int) {1}; return 0; }
 EOF
 fi
 
@@ -1613,8 +1646,10 @@ check_header byteswap.h
 check_header conio.h
 check_header dlfcn.h
 check_header malloc.h
+check_header poll.h
 check_header sys/mman.h
 check_header sys/resource.h
+check_header sys/select.h
 check_header termios.h
 
 if ! enabled_any memalign memalign_hack && enabled need_memalign ; then
@@ -1624,13 +1659,6 @@ fi
 enabled  zlib && check_lib  zlib.h      zlibVersion -lz   || disable  zlib
 enabled bzlib && check_lib bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
 
-# ffserver uses poll(),
-# if it's not found we can emulate it using select().
-if enabled ffserver; then
-    check_header poll.h
-    check_header sys/select.h
-fi
-
 # check for some common methods of building with pthread support
 # do this before the optional library checks as some of them require pthreads
 if enabled pthreads; then
@@ -1662,7 +1690,6 @@ check_lib math.h sin -lm
 # test for C99 functions in math.h
 for func in llrint lrint lrintf round roundf; do
     check_exec <<EOF && enable $func || disable $func
-#define _ISOC9X_SOURCE  1
 #include <math.h>
 int main(void) { return ($func(3.999f) > 0)?0:1; }
 EOF
@@ -1755,12 +1782,11 @@ fi
 
 texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
 
-check_type sys/socket.h socklen_t
-
 ##########################################
 # Network check
 
 if enabled network; then
+    check_type sys/socket.h socklen_t
     # Prefer arpa/inet.h over winsock2
     if check_header arpa/inet.h ; then
         check_func closesocket
@@ -1926,6 +1952,7 @@ if test "$build_suffix" != ""; then
 fi
 echo "big-endian                ${bigendian-no}"
 if test $arch = "x86_32" -o $arch = "x86_64"; then
+    echo "yasm                      ${yasm-no}"
     echo "MMX enabled               ${mmx-no}"
     echo "CMOV enabled              ${cmov-no}"
     echo "CMOV is fast              ${fast_cmov-no}"
@@ -2027,6 +2054,7 @@ echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak
 echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak
 echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak
 echo "CC=$cc" >> config.mak
+echo "YASM=$yasmexe" >> config.mak
 echo "AR=$ar" >> config.mak
 echo "RANLIB=$ranlib" >> config.mak
 echo "LN_S=$ln_s" >> config.mak
@@ -2039,6 +2067,7 @@ echo "VHOOKCFLAGS=$VHOOKCFLAGS" >> config.mak
 echo "LDFLAGS=$LDFLAGS" >> config.mak
 echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
 echo "SHFLAGS=$SHFLAGS" >> config.mak
+echo "YASMFLAGS=$YASMFLAGS" >> config.mak
 echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak
 echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak
 echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak