]> git.sesse.net Git - ffmpeg/blobdiff - configure
Add missing image formats, patch by Daniel Verkamp, daniel drv nu.
[ffmpeg] / configure
index 4219cc03a56e9a9757c427f679e6f0a8a3edd492..281ce24a17f9d25a08cf3f88107eb99aa861c9ef 100755 (executable)
--- a/configure
+++ b/configure
@@ -174,6 +174,8 @@ show_help(){
   echo "  --source-path=PATH       path to source code [$source_path]"
   echo "  --cross-prefix=PREFIX    use PREFIX for compilation tools [$cross_prefix]"
   echo "  --enable-cross-compile   assume a cross-compiler is used"
+  echo "  --sysroot=PATH           root of cross-build tree"
+  echo "  --sysinclude=PATH        location of cross-build system headers"
   echo "  --target-os=OS           compiler targets OS [$target_os]"
   echo "  --target-exec=CMD        command to run executables on target"
   echo "  --target-path=DIR        path to view of build directory on target"
@@ -323,6 +325,14 @@ disable_weak(){
     set_weak no $*
 }
 
+enable_safe(){
+    enable $(echo "$*" | sed 's/[^A-Za-z0-9_ ]/_/g')
+}
+
+disable_safe(){
+    disable $(echo "$*" | sed 's/[^A-Za-z0-9_ ]/_/g')
+}
+
 do_enable_deep(){
     for var; do
         enabled $var && continue
@@ -564,9 +574,8 @@ check_header(){
     log check_header "$@"
     header=$1
     shift
-    var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
-    disable $var
-    check_cpp "$@" <<EOF && enable $var
+    disable_safe $header
+    check_cpp "$@" <<EOF && enable_safe $header
 #include <$header>
 int x;
 EOF
@@ -594,7 +603,7 @@ check_func_headers(){
         incs="$incs
 #include <$hdr>"
     done
-    check_ld "$@" <<EOF && enable $func
+    check_ld "$@" <<EOF && enable $func && enable_safe $headers
 $incs
 int main(int argc, char **argv){
     (void) $func;
@@ -949,6 +958,8 @@ CMDLINE_SET="
     logfile
     nm
     source_path
+    sysinclude
+    sysroot
     target_exec
     target_os
     target_path
@@ -1316,7 +1327,9 @@ nm_default="${cross_prefix}${nm_default}"
 ranlib="${cross_prefix}${ranlib}"
 strip="${cross_prefix}${strip}"
 
-set_default cc nm
+sysinclude_default="${sysroot}/usr/include"
+
+set_default cc nm sysinclude
 enabled cross_compile || host_cc_default=$cc
 set_default host_cc
 
@@ -1350,6 +1363,29 @@ EOF
 fi
 rm $TMPSH
 
+if   $cc --version 2>/dev/null | grep -qi gcc; then
+    cc_type=gcc
+elif $cc --version 2>/dev/null | grep -q Intel; then
+    cc_type=icc
+elif $cc -v 2>&1 | grep -q xlc; then
+    cc_type=xlc
+elif $cc -V 2>/dev/null | grep -q Compaq; then
+    cc_type=ccc
+    DEPEND_CMD='$(CC) $(CFLAGS) -M $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"'
+    add_ldflags -Wl,-z,now # calls to libots crash without this
+fi
+
+test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
+
+if test -n "$sysroot"; then
+    case "$cc_type" in
+        gcc)
+            add_cflags  --sysroot="$sysroot"
+            add_ldflags --sysroot="$sysroot"
+        ;;
+    esac
+fi
+
 # compiler sanity check
 check_exec <<EOF
 int main(void){ return 0; }
@@ -1668,7 +1704,7 @@ test -z "$need_memalign" && need_memalign="$mmx"
 
 #Darwin CC versions
 if test $target_os = darwin; then
-    if $cc -v 2>&1 | grep -q xlc; then
+    if enabled xlc; then
         add_cflags -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto
     else
         add_cflags -pipe
@@ -1751,7 +1787,7 @@ if test $cpu != "generic"; then
             add_cflags -mcpu=$cpu
         ;;
         ev4|ev45|ev5|ev56|pca56|ev6|ev67)
-            add_cflags -mcpu=$cpu
+            enabled ccc && add_cflags -arch $cpu || add_cflags -mcpu=$cpu
         ;;
         *)
             echo "WARNING: Unknown CPU \"$cpu\", ignored."
@@ -1871,6 +1907,9 @@ elif check_func dlopen -ldl; then
     ldl=-ldl
 fi
 
+# Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
+check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
+
 check_func  fork
 check_func  gethrtime
 check_func  getrusage
@@ -2076,7 +2115,6 @@ check_header dev/ic/bt8xx.h
 check_header sys/soundcard.h
 check_header soundcard.h
 
-check_header alsa/asoundlib.h &&
 check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
 
 # deal with the X11 frame grabber
@@ -2112,9 +2150,11 @@ if enabled small; then
     check_cflags -Os            # not all compilers support -Os
     optimizations="small"
 elif enabled optimizations; then
-    if $cc -v 2>&1 | grep -q xlc; then
+    if enabled xlc; then
         add_cflags  -O5
         add_ldflags -O5
+    elif enabled ccc; then
+        add_cflags -fast
     else
         add_cflags -O3
     fi
@@ -2123,19 +2163,27 @@ check_cflags -fno-math-errno
 check_cflags -fno-signed-zeros
 
 # add some flags for Intel C Compiler
-if $cc --version 2> /dev/null | grep -q Intel; then
-  # Just warnings, no remarks
-  check_cflags -w1
-  # -wd: Disable following warnings
-  # 144, 167, 556: -Wno-pointer-sign
-  # 10006: ignoring unknown option -fno-signed-zeros
-  # 10156: ignoring option '-W'; no argument required
-  check_cflags -wd144,167,556,10006,10156
-  # 11030: Warning unknown option --as-needed
-  # 10156: ignoring option '-export'; no argument required
-  check_ldflags -wd10156,11030
-  # Allow to compile with optimizations
-  check_ldflags -march=$cpu
+if enabled icc; then
+    # Just warnings, no remarks
+    check_cflags -w1
+    # -wd: Disable following warnings
+    # 144, 167, 556: -Wno-pointer-sign
+    # 10006: ignoring unknown option -fno-signed-zeros
+    # 10156: ignoring option '-W'; no argument required
+    check_cflags -wd144,167,556,10006,10156
+    # 11030: Warning unknown option --as-needed
+    # 10156: ignoring option '-export'; no argument required
+    check_ldflags -wd10156,11030
+    # Allow to compile with optimizations
+    check_ldflags -march=$cpu
+elif enabled ccc; then
+    # disable some annoying warnings
+    add_cflags -msg_disable cvtu32to64
+    add_cflags -msg_disable embedcomment
+    add_cflags -msg_disable needconstext
+    add_cflags -msg_disable nomainieee
+    add_cflags -msg_disable ptrmismatch1
+    add_cflags -msg_disable unreachcode
 fi
 
 # PIC flags for shared library objects where they are needed