]> git.sesse.net Git - ffmpeg/blobdiff - configure
clean up definition of DECLARE_ALIGNED_8 and STRIDE_ALIGN
[ffmpeg] / configure
index 89b2e8765b1a0501b88795cfd214426c8a3a21ba..d83a24a4bb8a68c2c29a104b65721fb8ffa5db4f 100755 (executable)
--- a/configure
+++ b/configure
@@ -68,6 +68,8 @@ show_help(){
   echo "  --disable-shared         do not build shared libraries [default=yes]"
   echo "  --enable-gpl             allow use of GPL code, the resulting libav*"
   echo "                           and ffmpeg will be under GPL [default=no]"
+  echo "  --enable-nonfree         allow use of nonfree code, the resulting libav*"
+  echo "                           and ffmpeg will be unredistributable [default=no]"
   echo "  --enable-pp              enable GPLed postprocessing support [default=no]"
   echo "  --enable-swscaler        software scaler support [default=no]"
   echo "  --enable-beosthreads     use BeOS threads [default=no]"
@@ -196,7 +198,7 @@ die(){
     cat <<EOF
 If you think configure made a mistake, make sure you are using the latest
 version from SVN.  If the latest version fails, report the problem to the
-ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
+ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
 EOF
     if enabled logging; then
         cat <<EOF
@@ -213,13 +215,13 @@ EOF
     exit 1
 }
 
-# "tr '[a-z]' '[A-Z]'" is a workaround for Solaris tr not grokking "tr a-z A-Z"
+# Avoid locale weirdness, besides we really just want to translate ASCII.
 toupper(){
-    echo "$@" | tr '[a-z]' '[A-Z]'
+    echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
 }
 
 tolower(){
-    echo "$@" | tr '[A-Z]' '[a-z]'
+    echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
 }
 
 set_all(){
@@ -491,7 +493,7 @@ check_func2(){
     done
     check_ld "$@" <<EOF && enable $func
 $incs
-int main(void){
+int main(int argc, char **argv){
     (void) $func;
     return 0;
 }
@@ -634,7 +636,6 @@ CONFIG_LIST="
     ipv6
     liba52
     liba52bin
-    libamr
     libamr_nb
     libamr_wb
     libdc1394
@@ -651,6 +652,7 @@ CONFIG_LIST="
     memalign_hack
     mpegaudio_hp
     network
+    nonfree
     powerpc_perf
     pp
     small
@@ -725,6 +727,8 @@ HAVE_LIST="
     getrusage
     imlib2
     inet_aton
+    libdc1394_1
+    libdc1394_2
     llrint
     lrint
     lrintf
@@ -741,7 +745,7 @@ HAVE_LIST="
     sdl_video_size
     socklen_t
     soundcard_h
-    sys_poll_h
+    poll_h
     sys_select_h
     sys_soundcard_h
     termios_h
@@ -920,7 +924,6 @@ SHFLAGS='-shared -Wl,-soname,$@'
 VHOOKSHFLAGS='$(SHFLAGS)'
 LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
 FFSERVERLDFLAGS=-Wl,-E
-LDCONFIG="ldconfig"
 LIBPREF="lib"
 LIBSUF=".a"
 FULLNAME='$(NAME)$(BUILDSUF)'
@@ -1156,7 +1159,6 @@ case $targetos in
             add_cflags "-fno-expensive-optimizations"
             ;;
         esac
-        LDCONFIG="echo ignoring ldconfig"
         SHFLAGS=-nostart
         # enable BeOS things
         enable audio_beos
@@ -1181,7 +1183,6 @@ case $targetos in
     openbsd)
         disable need_memalign
         LIBOBJFLAGS='$(PIC)'
-        LDCONFIG='ldconfig -m $(SHLIBDIR)'
         SHFLAGS='-shared'
         SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF).$(LIBVERSION)'
         SLIBNAME_WITH_VERSION='$(SLIBNAME)'
@@ -1354,6 +1355,10 @@ if ! enabled gpl; then
     die_gpl_disabled "The software scaler"     swscaler
 fi
 
+if ! enabled nonfree && enabled_any libamr_nb libamr_wb; then
+    die "libamr is nonfree and --enable-nonfree is not specified."
+fi
+
 check_deps $ARCH_EXT_LIST
 
 test -z "$need_memalign" && need_memalign="$mmx"
@@ -1424,7 +1429,7 @@ if test $cpu != "generic"; then
             enable fast_cmov
         ;;
         # targets that do support conditional mov but on which it's slow
-        pentium4|prescott|nocona)
+        pentium4|pentium4m|prescott|nocona)
             add_cflags "-march=$cpu"
             enable cmov
             disable fast_cmov
@@ -1432,10 +1437,6 @@ if test $cpu != "generic"; then
         sparc64)
             add_cflags "-mcpu=v9"
         ;;
-        bf*) #bf531 bf532 bf533 bf561 bf5xx all get this config
-            add_cflags "-mfdpic"
-            add_ldflags "-mfdpic"
-        ;;
         arm*)
             add_cflags "-mcpu=$cpu"
         ;;
@@ -1567,7 +1568,7 @@ fi
 check_func  fork
 check_func  gethrtime
 check_func  getrusage
-check_func  inet_aton
+check_func  inet_aton $network_extralibs
 check_func  memalign
 check_func  mkstemp
 check_func2 windows.h GetProcessTimes
@@ -1587,7 +1588,7 @@ enabled zlib && check_lib zlib.h zlibVersion -lz || disable zlib
 # ffserver uses poll(),
 # if it's not found we can emulate it using select().
 if enabled ffserver; then
-    check_header sys/poll.h
+    check_header poll.h
     check_header sys/select.h
 fi
 
@@ -1598,10 +1599,10 @@ if enabled pthreads; then
         :
     elif check_func pthread_create -pthread; then
         add_cflags -pthread
-        add_ldflags -pthread
+        add_extralibs -pthread
     elif check_func pthread_create -pthreads; then
         add_cflags -pthreads
-        add_ldflags -pthreads
+        add_extralibs -pthreads
     elif ! check_lib pthread.h pthread_create -lpthread; then
         die "ERROR: can't find pthreads library"
     fi
@@ -1626,14 +1627,11 @@ int main(void) { return ($func(3.999f) > 0)?0:1; }
 EOF
 done
 
-enabled_any libamr_nb libamr_wb && enable libamr
-
 # these are off by default, so fail if requested and not available
 enabled avisynth   && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
 enabled liba52     && require  liba52 a52dec/a52.h a52_init -la52
 enabled libamr_nb  && require  libamrnb amrnb/interf_dec.h Speech_Decode_Frame_init -lamrnb -lm
 enabled libamr_wb  && require  libamrwb amrwb/dec_if.h D_IF_init -lamrwb -lm
-enabled libdc1394  && require  libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
 enabled libfaac    && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
 enabled libfaad    && require2 libfaad faad.h faacDecOpen -lfaad
 enabled libgsm     && require  libgsm gsm.h gsm_create -lgsm
@@ -1648,6 +1646,16 @@ enabled mlib       && require  mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -
 # disable the native AC-3 decoder if liba52 is enabled
 enabled liba52 && disable ac3_decoder
 
+# libdc1394 check
+if enabled libdc1394; then
+    { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
+        enable libdc1394_2; } ||
+    { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
+        enable libdc1394_1; } ||
+    die "ERROR: No version of libdc1394 found "
+fi
+
+
 _restrict=
 for restrict_keyword in restrict __restrict__ __restrict; do
     check_cc <<EOF && _restrict=$restrict_keyword && break
@@ -1683,7 +1691,7 @@ if "${SDL_CONFIG}" --version >/dev/null 2>&1; then
     sdl_cflags=`"${SDL_CONFIG}" --cflags`
     temp_cflags $sdl_cflags
     temp_extralibs `"${SDL_CONFIG}" --libs`
-    if check_lib SDL.h SDL_Init; then
+    if check_lib2 SDL.h SDL_Init; then
         _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
         if test "$_sdlversion" -lt 121 ; then
             enable sdl_too_old
@@ -1691,7 +1699,7 @@ if "${SDL_CONFIG}" --version >/dev/null 2>&1; then
             enable sdl
             check_cc $sdl_cflags <<EOF && enable sdl_video_size
 #include <SDL.h>
-int main(void){
+int main(int argc, char **argv){
     const SDL_VideoInfo *vi = SDL_GetVideoInfo();
     int w = vi->current_w;
     return 0;
@@ -1769,6 +1777,9 @@ check_cflags -Wdisabled-optimization
 check_cflags -Wpointer-arith
 check_cflags -Wredundant-decls
 check_cflags -Wno-pointer-sign
+check_cflags -Wcast-qual
+check_cflags -Wwrite-strings
+check_cflags -Wtype-limits
 enabled extra_warnings && check_cflags -Winline
 
 # add some linker flags
@@ -1907,9 +1918,6 @@ echo "libvorbis enabled         ${libvorbis-no}"
 echo "x264 enabled              ${libx264-no}"
 echo "XviD enabled              ${libxvid-no}"
 echo "zlib enabled              ${zlib-no}"
-enabled gpl &&
-    echo "License: GPL" ||
-    echo "License: LGPL"
 
 for type in decoder encoder parser demuxer muxer protocol bsf indev outdev; do
     echo "Enabled ${type}s:"
@@ -1923,6 +1931,12 @@ for type in decoder encoder parser demuxer muxer protocol bsf indev outdev; do
     echo $partlist
 done
 
+enabled nonfree &&
+    echo "License: unredistributable" ||
+    (enabled gpl &&
+        echo "License: GPL" ||
+        echo "License: LGPL")
+
 echo "Creating config.mak and config.h..."
 
 echo "# Automatically generated by configure - do not modify!" > config.mak
@@ -1942,7 +1956,6 @@ echo "MAKE=$make" >> config.mak
 echo "CC=$cc" >> config.mak
 echo "AR=$ar" >> config.mak
 echo "RANLIB=$ranlib" >> config.mak
-echo "LDCONFIG=$LDCONFIG" >> config.mak
 echo "LN_S=$ln_s" >> config.mak
 enabled dostrip &&
     echo "STRIP=$strip" >> config.mak ||