--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
append LDFLAGS $($ldflags_filter "$@")
}
+add_stripflags(){
+ append ASMSTRIPFLAGS "$@"
+}
+
add_extralibs(){
prepend extralibs $($ldflags_filter "$@")
}
test_ldflags "$@" && add_ldflags "$@"
}
+test_stripflags(){
+ log test_stripflags "$@"
+ # call check_cc to get a fresh TMPO
+ check_cc <<EOF
+int main(void) { return 0; }
+EOF
+ check_cmd $strip $ASMSTRIPFLAGS "$@" $TMPO
+}
+
+check_stripflags(){
+ log check_stripflags "$@"
+ test_stripflags "$@" && add_stripflags "$@"
+}
+
check_header(){
log check_header "$@"
header=$1
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
CONFIG_LIST="
$COMPONENT_LIST
$DOCUMENT_LIST
+ $EXAMPLE_LIST
$EXTERNAL_LIBRARY_LIST
$HWACCEL_LIST
$LIBRARY_LIST
threads
unistd_h
usleep
+ vdpau_x11
vfp_args
VirtualAlloc
windows_h
winsock2_h
xform_asm
+ xlib
xmm_clobbers
"
logging
lto
optimizations
+ rpath
stripping
"
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"
# configurable options
enable $PROGRAM_LIST
enable $DOCUMENT_LIST
+enable $EXAMPLE_LIST
enable $(filter_out avresample $LIBRARY_LIST)
enable stripping
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
_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:'
# 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'
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.
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)'
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
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 ||
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
# 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
+# add some strip flags
+# -wN '..@*' is more selective than -x, but not available everywhere.
+check_stripflags -wN \'..@*\' || check_stripflags -x
+
enabled xmm_clobber_test &&
check_ldflags -Wl,--wrap,avcodec_open2 \
-Wl,--wrap,avcodec_decode_audio4 \
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"
DLLTOOL=$dlltool
LDFLAGS=$LDFLAGS
SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
+ASMSTRIPFLAGS=$ASMSTRIPFLAGS
YASMFLAGS=$YASMFLAGS
BUILDSUF=$build_suffix
PROGSSUF=$progs_suffix
#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})"
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