]> git.sesse.net Git - ffmpeg/blobdiff - configure
build: split examples cleaning out of docclean.
[ffmpeg] / configure
index c3606bdb32a190a771c5219c4d6863e6579fbcf8..1b8c8521441be437e07f421e57f01f6d64fd3bb9 100755 (executable)
--- a/configure
+++ b/configure
@@ -87,6 +87,8 @@ Standard options:
   --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]
   --incdir=DIR             install includes in DIR [PREFIX/include]
   --mandir=DIR             install man page in DIR [PREFIX/share/man]
+  --enable-rpath           use rpath to allow installing libraries in paths
+                           not part of the dynamic linker search path
 
 Licensing options:
   --enable-gpl             allow use of GPL code, the resulting libs
@@ -1162,6 +1164,18 @@ COMPONENT_LIST="
     protocols
 "
 
+EXAMPLE_LIST="
+    decoding_encoding_example
+    demuxing_decoding_example
+    filtering_audio_example
+    filtering_video_example
+    metadata_example
+    muxing_example
+    resampling_audio_example
+    scaling_video_example
+    transcode_aac_example
+"
+
 EXTERNAL_LIBRARY_LIST="
     avisynth
     bzlib
@@ -1262,6 +1276,7 @@ PROGRAM_LIST="
 CONFIG_LIST="
     $COMPONENT_LIST
     $DOCUMENT_LIST
+    $EXAMPLE_LIST
     $EXTERNAL_LIBRARY_LIST
     $HWACCEL_LIST
     $LIBRARY_LIST
@@ -1557,11 +1572,13 @@ HAVE_LIST="
     threads
     unistd_h
     usleep
+    vdpau_x11
     vfp_args
     VirtualAlloc
     windows_h
     winsock2_h
     xform_asm
+    xlib
     xmm_clobbers
 "
 
@@ -1612,6 +1629,7 @@ CMDLINE_SELECT="
     logging
     lto
     optimizations
+    rpath
     stripping
 "
 
@@ -2002,6 +2020,7 @@ wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
 
 # parsers
 h264_parser_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
+hevc_parser_select="hevc_decoder"
 mpeg4video_parser_select="error_resilience mpegvideo"
 mpegvideo_parser_select="error_resilience mpegvideo"
 vc1_parser_select="mpegvideo"
@@ -2263,6 +2282,17 @@ tinterlace_merge_test_deps="tinterlace_filter"
 tinterlace_pad_test_deps="tinterlace_filter"
 zmq_filter_deps="libzmq"
 
+# examples
+decoding_encoding_example_deps="avcodec avutil"
+demuxing_decoding_example_deps="avcodec avformat avutil"
+filtering_audio_example_deps="avfilter avcodec avformat avutil"
+filtering_video_example_deps="avfilter avcodec avformat avutil"
+metadata_example_deps="avformat avutil"
+muxing_example_deps="avcodec avformat avutil swscale"
+resampling_audio_example_deps="avutil swresample"
+scaling_video_example_deps="avutil swscale"
+transcode_aac_example_deps="avcodec avformat swresample"
+
 # libraries
 avcodec_deps="avutil"
 avdevice_deps="avutil avcodec avformat"
@@ -2333,6 +2363,7 @@ host_os=$target_os_default
 # configurable options
 enable $PROGRAM_LIST
 enable $DOCUMENT_LIST
+enable $EXAMPLE_LIST
 enable $(filter_out avresample $LIBRARY_LIST)
 enable stripping
 
@@ -2625,29 +2656,33 @@ case "$toolchain" in
     msvc)
         # Check whether the current MSVC version needs the C99 converter.
         # From MSVC 2013 (compiler major version 18) onwards, it does actually
-        # support enough of C99 to build ffmpeg, but we still need to use
-        # c99wrap for passing command line parameters with a space (for
-        # avoiding msys path mangling/conversion issues). Default to the new
+        # support enough of C99 to build ffmpeg. Default to the new
         # behaviour if the regexp was unable to match anything, since this
         # successfully parses the version number of existing supported
         # versions that require the converter (MSVC 2010 and 2012).
         cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
         if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
-            cc_default="c99wrap -noconv cl"
+            cc_default="cl"
         else
             cc_default="c99wrap cl"
         fi
-        ld_default="c99wrap link"
+        ld_default="link"
         nm_default="dumpbin -symbols"
         ar_default="lib"
         target_os_default="win32"
+        # Use a relative path for TMPDIR. This makes sure all the
+        # ffconf temp files are written with a relative path, avoiding
+        # issues with msys/win32 path conversion for MSVC parameters
+        # such as -Fo<file> or -out:<file>.
+        TMPDIR=.
     ;;
     icl)
-        cc_default="c99wrap -noconv icl"
-        ld_default="c99wrap xilink"
+        cc_default="icl"
+        ld_default="xilink"
         nm_default="dumpbin -symbols"
         ar_default="xilib"
         target_os_default="win32"
+        TMPDIR=.
     ;;
     gcov)
         add_cflags  -fprofile-arcs -ftest-coverage
@@ -3012,15 +3047,13 @@ probe_cc(){
         _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
         _cflags_speed="-O2"
         _cflags_size="-O1"
-        # Nonstandard output options, to avoid msys path conversion issues.
-        # Relies on wrapper to remap it.
         if $_cc 2>&1 | grep -q Linker; then
-            _ld_o='-out $@'
+            _ld_o='-out:$@'
         else
             _ld_o='-Fe$@'
         fi
-        _cc_o='-Fo $@'
-        _cc_e='-P -Fi $@'
+        _cc_o='-Fo$@'
+        _cc_e='-P -Fi$@'
         _flags_filter=msvc_flags
         _ld_lib='lib%.a'
         _ld_path='-libpath:'
@@ -3038,14 +3071,12 @@ probe_cc(){
         # versions (tested) as well.
         _cflags_speed="-O2"
         _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
-        # Nonstandard output options, to avoid msys path conversion issues.
-        # Relies on wrapper to remap it.
         if $_cc 2>&1 | grep -q Linker; then
-            _ld_o='-out $@'
+            _ld_o='-out:$@'
         else
             _ld_o='-Fe$@'
         fi
-        _cc_o='-Fo $@'
+        _cc_o='-Fo$@'
         _cc_e='-P'
         _flags_filter=icl_flags
         _ld_lib='lib%.a'
@@ -3614,6 +3645,7 @@ case $target_os in
         enable dos_paths
         ;;
     win32|win64)
+        disable symver
         if enabled shared; then
             # Link to the import library instead of the normal static library
             # for shared libs.
@@ -3626,7 +3658,7 @@ case $target_os in
         SLIBSUF=".dll"
         SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
         SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
-        SLIB_CREATE_DEF_CMD='makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
+        SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
         SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
         SLIB_INSTALL_LINKS=
         SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
@@ -4369,8 +4401,8 @@ enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
 
 texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
 makeinfo --version > /dev/null 2>&1 && enable makeinfo  || disable makeinfo
-perl --version > /dev/null 2>&1 && enable perl || disable perl
-pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
+perl -v            > /dev/null 2>&1 && enable perl      || disable perl
+pod2man --help     > /dev/null 2>&1 && enable pod2man   || disable pod2man
 rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
 
 check_header linux/fb.h
@@ -4421,10 +4453,12 @@ if enabled libcdio; then
     die "ERROR: libcdio-paranoia not found"
 fi
 
+check_lib X11/Xlib.h XOpenDisplay -lX11 && enable xlib
+
 enabled x11grab                                           &&
-require X11 X11/Xlib.h XOpenDisplay -lX11                 &&
 require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
-require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
+require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes &&
+{ enabled xlib || die "ERROR: Xlib not found"; }
 
 enabled vaapi &&
     check_lib va/va.h vaInitialize -lva ||
@@ -4434,6 +4468,10 @@ enabled vdpau &&
     check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
     disable vdpau
 
+enabled vdpau && enabled xlib &&
+    check_lib2 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
+    enable vdpau_x11
+
 # Funny iconv installations are not unusual, so check it after all flags have been set
 disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
 
@@ -4466,6 +4504,7 @@ check_disable_warning -Wno-pointer-sign
 # add some linker flags
 check_ldflags -Wl,--warn-common
 check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
+enabled rpath && add_ldflags -Wl,-rpath=$libdir
 test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
 
 enabled xmm_clobber_test &&
@@ -4760,7 +4799,7 @@ echo "License: $license"
 
 echo "Creating config.mak, config.h, and doc/config.texi..."
 
-test -e Makefile || $ln_s "$source_path/Makefile" .
+test -e Makefile || echo "include $source_path/Makefile" > Makefile
 
 enabled stripping || strip="echo skipping strip"
 
@@ -4896,6 +4935,7 @@ cat > $TMPH <<EOF
 #define FFMPEG_CONFIG_H
 #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
 #define FFMPEG_LICENSE "$(c_escape $license)"
+#define CONFIG_THIS_YEAR 2013
 #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
 #define AVCONV_DATADIR "$(eval c_escape $datadir)"
 #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
@@ -4978,7 +5018,7 @@ Version: $version
 Requires: $(enabled shared || echo $requires)
 Requires.private: $(enabled shared && echo $requires)
 Conflicts:
-Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
+Libs: -L\${libdir} $(enabled rpath && echo "-Wl,-rpath,\${libdir}") -l${shortname} $(enabled shared || echo $libs)
 Libs.private: $(enabled shared && echo $libs)
 Cflags: -I\${includedir}
 EOF