Newer
Older
cat > $TMPH <<EOF
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
#define FFMPEG_LICENSE "$(c_escape $license)"
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
#define av_restrict $restrict_keyword
#define EXTERN_PREFIX "${extern_prefix}"
#define EXTERN_ASM ${extern_prefix}
#define BUILDSUF "$build_suffix"
#define SLIBSUF "$SLIBSUF"
#define HAVE_MMX2 HAVE_MMXEXT
#define SWS_MAX_FILTER_SIZE $sws_max_filter_size
EOF
test -n "$assert_level" &&
echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
test -n "$malloc_prefix" &&
echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
if enabled x86asm; then
cat > $TMPASM <<EOF
; Automatically generated by configure - do not modify!
EOF
enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
Martin Storsjö
committed
mkdir -p tests
echo "@c auto-generated by configure - do not modify! " > doc/config.texi
print_config ARCH_ "$config_files" $ARCH_LIST
print_config HAVE_ "$config_files" $HAVE_LIST
print_config CONFIG_ "$config_files" $CONFIG_LIST \
$ALL_COMPONENTS \
echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak
# Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
cp_if_changed $TMPH config.h
touch ffbuild/.config
enabled x86asm && cp_if_changed $TMPASM config.asm
/* Generated by ffmpeg configure */
#ifndef AVUTIL_AVCONFIG_H
#define AVUTIL_AVCONFIG_H
EOF
print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
cp_if_changed $TMPH libavutil/avconfig.h
# generate the lists of enabled components
print_enabled_components(){
file=$1
struct_name=$2
name=$3
shift 3
echo "static const $struct_name * const $name[] = {" > $TMPH
for c in $*; do
if enabled $c; then
case $name in
indev_list)
c=$(add_suffix _demuxer $(remove_suffix _indev $c))
;;
outdev_list)
c=$(add_suffix _muxer $(remove_suffix _outdev $c))
;;
esac
printf " &ff_%s,\n" $c >> $TMPH
fi
done
echo " NULL };" >> $TMPH
cp_if_changed $TMPH $file
}
print_enabled_components libavcodec/codec_list.c AVCodec codec_list $CODEC_LIST
print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST
print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST
print_enabled_components libavdevice/outdev_list.c AVOutputFormat outdev_list $OUTDEV_LIST
print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST
print_enabled_components libavformat/muxer_list.c AVOutputFormat muxer_list $MUXER_LIST
print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
# Settings for pkg-config files
Aurelien Jacobs
committed
cat > $TMPH <<EOF
# Automatically generated by configure - do not modify!
shared=$shared
build_suffix=$build_suffix
incdir=$incdir
rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}")
source_path=${source_path}
LIBPREF=${LIBPREF}
LIBSUF=${LIBSUF}
extralibs_avutil="$avutil_extralibs"
extralibs_avcodec="$avcodec_extralibs"
extralibs_avformat="$avformat_extralibs"
extralibs_avdevice="$avdevice_extralibs"
extralibs_avfilter="$avfilter_extralibs"
extralibs_avresample="$avresample_extralibs"
extralibs_postproc="$postproc_extralibs"
extralibs_swscale="$swscale_extralibs"
extralibs_swresample="$swresample_extralibs"
Aurelien Jacobs
committed
EOF
for lib in $LIBRARY_LIST; do
lib_deps="$(eval echo \$${lib}_deps)"
echo ${lib}_deps=\"$lib_deps\" >> $TMPH
cp_if_changed $TMPH ffbuild/config.sh