Newer
Older
Nicolas Boos
committed
fi
sws_version=`grep '#define LIBSWSCALE_VERSION ' "$source_path/libswscale/swscale.h" | sed 's/[^0-9\.]//g'`
pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
lavd_version=`grep '#define LIBAVDEVICE_VERSION ' "$source_path/libavdevice/avdevice.h" | sed 's/[^0-9\.]//g'`
lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
if enabled shared; then
Diego Biurrun
committed
echo "BUILD_SHARED=yes" >> config.mak
echo "PIC=-fPIC -DPIC" >> config.mak
echo "SPPMAJOR=${pp_version%%.*}" >> config.mak
echo "SPPVERSION=$pp_version" >> config.mak
echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
echo "LAVCVERSION=$lavc_version" >> config.mak
echo "LAVDMAJOR=${lavd_version%%.*}" >> config.mak
echo "LAVDVERSION=$lavd_version" >> config.mak
echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
echo "LAVFVERSION=$lavf_version" >> config.mak
echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
echo "LAVUVERSION=$lavu_version" >> config.mak
echo "SWSMAJOR=${sws_version%%.*}" >> config.mak
echo "SWSVERSION=$sws_version" >> config.mak
echo "SLIBNAME=${SLIBNAME}" >> config.mak
echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
echo "SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}" >> config.mak
Diego Biurrun
committed
echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
echo "SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}" >> config.mak
echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> config.mak
echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
echo "EXTRALIBS=$extralibs" >> config.mak
print_config ARCH_ $TMPH config.mak $ARCH_LIST
print_config HAVE_ $TMPH config.mak $HAVE_LIST
Diego Biurrun
committed
print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \
$DECODER_LIST \
$ENCODER_LIST \
$PARSER_LIST \
$BSF_LIST \
$DEMUXER_LIST \
$MUXER_LIST \
$PROTOCOL_LIST \
$INDEV_LIST \
$OUTDEV_LIST \
echo "#define restrict $_restrict" >> $TMPH
if enabled small; then
Diego Biurrun
committed
echo "#define av_always_inline" >> $TMPH
echo "SRC_PATH=\"$source_path\"" >> config.mak
echo "SRC_PATH_BARE=$source_path" >> config.mak
echo "BUILD_ROOT=\"$PWD\"" >> config.mak
Fabrice Bellard
committed
# Apparently it's not possible to portably echo a backslash.
Diego Biurrun
committed
printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH ||
printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH
echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
Diego Biurrun
committed
# Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
cmp -s $TMPH config.h &&
echo "config.h is unchanged" ||
mv -f $TMPH config.h
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
Aurelien Jacobs
committed
# build tree in object directory if source path is different from current one
if enabled source_path_used; then
Diego Biurrun
committed
doc \
libavcodec \
libavcodec/alpha \
libavcodec/armv4l \
libavcodec/bfin \
libavcodec/i386 \
libavcodec/mlib \
libavcodec/ppc \
libavcodec/sh4 \
libavcodec/sparc \
libavdevice \
Diego Biurrun
committed
libavformat \
libavutil \
libpostproc \
libswscale \
tests \
tools \
vhook \
"
Diego Biurrun
committed
Makefile \
common.mak \
doc/texi2pod.pl \
libavcodec/Makefile \
libavdevice/Makefile \
Diego Biurrun
committed
libavformat/Makefile \
libavutil/Makefile \
libpostproc/Makefile \
libswscale/Makefile \
"
Diego Biurrun
committed
mkdir -p $dir
done
for f in $FILES ; do
$ln_s "$source_path/$f" $f
Aurelien Jacobs
committed
# FIXME: libdir and includedir are hardcoded and may differ from the real path.
Aurelien Jacobs
committed
pkgconfig_generate(){
name=$1
comment=$2
version=$3
libs=$4
requires=$5
include=$6
cat <<EOF >$name.pc
prefix=$PREFIX
exec_prefix=\${prefix}
Aurelien Jacobs
committed
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include
Aurelien Jacobs
committed
Name: $name
Description: $comment
Version: $version
Requires: $requires
Aurelien Jacobs
committed
Conflicts:
Cflags: -I\${includedir}/$include
Aurelien Jacobs
committed
EOF
Aurelien Jacobs
committed
pkgconfig_generate_uninstalled(){
name=$1
comment=$2
version=$3
libs=$4
requires=$5
cat <<EOF >$name-uninstalled.pc
Aurelien Jacobs
committed
prefix=
exec_prefix=
libdir=\${pcfiledir}/$name
includedir=\${pcfiledir}/$name
Aurelien Jacobs
committed
Name: $name
Description: $comment
Version: $version
Requires: $requires
Aurelien Jacobs
committed
Conflicts:
Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
Aurelien Jacobs
committed
Cflags: -I\${includedir}
EOF
Aurelien Jacobs
committed
pkgconfig_generate libavutil "FFmpeg utility library" "$lavu_version" -lavutil "" ffmpeg
pkgconfig_generate_uninstalled libavutil "FFmpeg utility library" "$lavu_version"
Aurelien Jacobs
committed
pkgconfig_generate libavcodec "FFmpeg codec library" "$lavc_version" "-lavcodec $extralibs" "$pkg_requires libavutil = $lavu_version" ffmpeg
pkgconfig_generate_uninstalled libavcodec "FFmpeg codec library" "$lavc_version" "$extralibs" "$pkg_requires libavutil = $lavu_version"
Aurelien Jacobs
committed
pkgconfig_generate libavformat "FFmpeg container format library" "$lavf_version" "-lavformat $extralibs" "$pkg_requires libavcodec = $lavc_version" ffmpeg
pkgconfig_generate_uninstalled libavformat "FFmpeg container format library" "$lavf_version" "$extralibs" "$pkg_requires libavcodec = $lavc_version"
Aurelien Jacobs
committed
pkgconfig_generate libavdevice "FFmpeg device handling library" "$lavd_version" "-lavdevice $extralibs" "$pkg_requires libavformat = $lavf_version" ffmpeg
pkgconfig_generate_uninstalled libavdevice "FFmpeg device handling library" "$lavd_version" "$extralibs" "$pkg_requires libavformat = $lavf_version"
if enabled pp; then
Diego Biurrun
committed
pkgconfig_generate libpostproc "FFmpeg post processing library" "$pp_version" -lpostproc "" postproc
pkgconfig_generate_uninstalled libpostproc "FFmpeg post processing library" "$pp_version"
if enabled swscaler; then
Diego Biurrun
committed
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$sws_version" -lswscale "libavutil = $lavu_version" ffmpeg
pkgconfig_generate_uninstalled libswscale "FFmpeg image rescaling library" "$sws_version" "" "libavutil = $lavu_version"
Diego Biurrun
committed
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$sws_version" "" "$pkg_requires libavcodec = $lavc_version" ffmpeg
pkgconfig_generate_uninstalled libswscale "FFmpeg image rescaling library" "$sws_version" "" "$pkg_requires libavcodec = $lavc_version"
apply libswscale.pc sed s/^Libs:.*$/Libs:/
apply libswscale-uninstalled.pc sed s/^Libs:.*$/Libs:/