Merge commit '11a9320de54759340531177c9f2b1e31e6112cc2'

* commit '11a9320de54759340531177c9f2b1e31e6112cc2':
  build: Move build-system-related helper files to a separate subdirectory

"ffbuild" directory name is used instead of "avbuild".

Merged-by: Clément Bœsch <u@pkh.me>
This commit is contained in:
Clément Bœsch 2017-05-03 12:51:48 +02:00
commit 3f17751eeb
19 changed files with 47 additions and 38 deletions

3
.gitignore vendored
View File

@ -27,7 +27,8 @@
/ffplay
/ffprobe
/ffserver
/config.*
/config.asm
/config.h
/coverage.info
/avversion.h
/lcov/

View File

@ -1,5 +1,5 @@
MAIN_MAKEFILE=1
include config.mak
include ffbuild/config.mak
vpath %.c $(SRC_PATH)
vpath %.cpp $(SRC_PATH)
@ -66,7 +66,7 @@ SKIPHEADERS = cmdutils_common_opts.h \
all: all-yes
include $(SRC_PATH)/tools/Makefile
include $(SRC_PATH)/common.mak
include $(SRC_PATH)/ffbuild/common.mak
FF_EXTRALIBS := $(FFEXTRALIBS)
FF_DEP_LIBS := $(DEP_LIBS)
@ -91,8 +91,8 @@ CONFIGURABLE_COMPONENTS = \
$(SRC_PATH)/libavcodec/bitstream_filters.c \
$(SRC_PATH)/libavformat/protocols.c \
config.h: .config
.config: $(CONFIGURABLE_COMPONENTS)
config.h: ffbuild/.config
ffbuild/.config: $(CONFIGURABLE_COMPONENTS)
@-tput bold 2>/dev/null
@-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
@-tput sgr0 2>/dev/null
@ -115,7 +115,7 @@ SUBDIR := $(1)/
include $(SRC_PATH)/$(1)/Makefile
-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
-include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
include $(SRC_PATH)/library.mak
include $(SRC_PATH)/ffbuild/library.mak
endef
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
@ -142,10 +142,10 @@ $(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
%$(PROGSSUF)_g$(EXESUF): %.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
VERSION_SH = $(SRC_PATH)/version.sh
VERSION_SH = $(SRC_PATH)/ffbuild/version.sh
GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) ffbuild/config.mak
.version: M=@
libavutil/ffversion.h .version:
@ -194,7 +194,10 @@ clean::
distclean::
$(RM) $(DISTCLEANSUFFIXES)
$(RM) config.* .config libavutil/avconfig.h .version mapfile avversion.h version.h libavutil/ffversion.h libavcodec/codec_names.h libavcodec/bsf_list.c libavformat/protocol_list.c
$(RM) .version avversion.h config.asm config.h mapfile \
ffbuild/.config ffbuild/config.* libavutil/avconfig.h \
version.h libavutil/ffversion.h libavcodec/codec_names.h \
libavcodec/bsf_list.c libavformat/protocol_list.c
ifeq ($(SRC_LINK),src)
$(RM) src
endif

25
configure vendored
View File

@ -77,7 +77,7 @@ Help options:
--list-filters show all available filters
Standard options:
--logfile=FILE log tests and output to FILE [config.log]
--logfile=FILE log tests and output to FILE [ffbuild/config.log]
--disable-logging do not log configure debug information
--fatal-warnings fail if any configure warning is generated
--prefix=PREFIX install in PREFIX [$prefix_default]
@ -3224,7 +3224,7 @@ doc_deps_any="manpages htmlpages podpages txtpages"
# default parameters
logfile="config.log"
logfile="ffbuild/config.log"
# installation paths
prefix_default="/usr/local"
@ -3581,6 +3581,7 @@ disable_components(){
map 'disable_components $v' $LIBRARY_LIST
mkdir -p ffbuild
echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
set >> $logfile
@ -5152,7 +5153,7 @@ esc(){
echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
}
echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" > ffbuild/config.fate
check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
@ -6619,9 +6620,9 @@ test -e Makefile || echo "include $source_path/Makefile" > Makefile
enabled stripping || strip="echo skipping strip"
config_files="$TMPH config.mak doc/config.texi"
config_files="$TMPH ffbuild/config.mak doc/config.texi"
cat > config.mak <<EOF
cat > ffbuild/config.mak <<EOF
# Automatically generated by configure - do not modify!
ifndef FFMPEG_CONFIG_MAK
FFMPEG_CONFIG_MAK=1
@ -6755,18 +6756,18 @@ get_version(){
eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
eval echo "${lcname}_VERSION=\$${name}_VERSION" >> ffbuild/config.mak
eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> ffbuild/config.mak
eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> ffbuild/config.mak
}
map 'get_version $v' $LIBRARY_LIST
map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST
map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST
print_program_extralibs(){
eval "program_extralibs=\$${1}_extralibs"
eval echo "EXTRALIBS-${1}=${program_extralibs}" >> config.mak
eval echo "EXTRALIBS-${1}=${program_extralibs}" >> ffbuild/config.mak
}
map 'print_program_extralibs $v' $PROGRAM_LIST
@ -6816,11 +6817,11 @@ print_config CONFIG_ "$config_files" $CONFIG_LIST \
$ALL_COMPONENTS \
echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
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 .config
touch ffbuild/.config
enabled yasm && cp_if_changed $TMPASM config.asm

View File

@ -128,7 +128,7 @@ $(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
OBJDIRS += doc/examples
DOXY_INPUT = $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c)
DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) config.mak
DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) ffbuild/config.mak
doc/doxy/html: TAG = DOXY
doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS)

View File

@ -38,14 +38,14 @@ the build system and the C:
--- after running configure ---
$ grep FOOBAR config.mak
$ grep FOOBAR ffbuild/config.mak
CONFIG_FOOBAR_FILTER=yes
$ grep FOOBAR config.h
#define CONFIG_FOOBAR_FILTER 1
CONFIG_FOOBAR_FILTER=yes from the config.mak is later used to enable the filter in
libavfilter/Makefile and CONFIG_FOOBAR_FILTER=1 from the config.h will be used
for registering the filter in libavfilter/allfilters.c.
CONFIG_FOOBAR_FILTER=yes from the ffbuild/config.mak is later used to enable
the filter in libavfilter/Makefile and CONFIG_FOOBAR_FILTER=1 from the config.h
will be used for registering the filter in libavfilter/allfilters.c.
Filter code layout
==================

4
ffbuild/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
/.config
/config.fate
/config.log
/config.mak

View File

@ -103,7 +103,7 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
$(OBJS):
endif
include $(SRC_PATH)/arch.mak
include $(SRC_PATH)/ffbuild/arch.mak
OBJS += $(OBJS-yes)
SLIBOBJS += $(SLIBOBJS-yes)

View File

@ -1,4 +1,4 @@
include $(SRC_PATH)/common.mak
include $(SRC_PATH)/ffbuild/common.mak
LIBVERSION := $(lib$(NAME)_VERSION)
LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)

View File

@ -1,4 +1,4 @@
include $(SUBDIR)../config.mak
include $(SUBDIR)../ffbuild/config.mak
NAME = avcodec

View File

@ -1,4 +1,4 @@
include $(SUBDIR)../config.mak
include $(SUBDIR)../ffbuild/config.mak
NAME = avdevice

View File

@ -1,4 +1,4 @@
include $(SUBDIR)../config.mak
include $(SUBDIR)../ffbuild/config.mak
NAME = avfilter

View File

@ -1,4 +1,4 @@
include $(SUBDIR)../config.mak
include $(SUBDIR)../ffbuild/config.mak
NAME = avformat

View File

@ -1,4 +1,4 @@
include $(SUBDIR)../config.mak
include $(SUBDIR)../ffbuild/config.mak
NAME = avutil

View File

@ -1,4 +1,4 @@
include $(SUBDIR)../config.mak
include $(SUBDIR)../ffbuild/config.mak
NAME = postproc
FFLIBS = avutil

View File

@ -1,4 +1,4 @@
include $(SUBDIR)../config.mak
include $(SUBDIR)../ffbuild/config.mak
NAME = swresample
FFLIBS = avutil

View File

@ -1,4 +1,4 @@
include $(SUBDIR)../config.mak
include $(SUBDIR)../ffbuild/config.mak
NAME = swscale

View File

@ -85,7 +85,7 @@ clean(){
report(){
date=$(date -u +%Y%m%d%H%M%S)
echo "fate:1:${date}:${slot}:${version}:$1:$2:${branch}:${comment}" >report
cat ${build}/config.fate >>report
cat ${build}/ffbuild/config.fate >>report
cat ${build}/tests/data/fate/*.rep >>report 2>/dev/null || for i in ${build}/tests/data/fate/*.rep ; do cat "$i" >>report 2>/dev/null; done
test -n "$fate_recv" && $tar report *.log | gzip | $fate_recv
}
@ -108,7 +108,7 @@ test -d "$src" && update || checkout || die "Error fetching source"
cd ${workdir}
version=$(${src}/version.sh ${src})
version=$(${src}/ffbuild/version.sh ${src})
test "$version" = "$(cat version-$slot 2>/dev/null)" && exit 0
echo ${version} >version-$slot