build: Move build-system-related helper files to a separate subdirectory
authorDiego Biurrun <diego@biurrun.de>
Tue, 26 Mar 2013 00:11:11 +0000 (01:11 +0100)
committerDiego Biurrun <diego@biurrun.de>
Thu, 22 Dec 2016 10:07:50 +0000 (11:07 +0100)
This unclutters the top-level directory and groups related files together.

13 files changed:
.gitignore
Makefile
arch.mak [deleted file]
avbuild/.gitignore [new file with mode: 0644]
avbuild/arch.mak [new file with mode: 0644]
avbuild/common.mak [new file with mode: 0644]
avbuild/library.mak [new file with mode: 0644]
avbuild/version.sh [new file with mode: 0755]
common.mak [deleted file]
configure
library.mak [deleted file]
tests/fate.sh
version.sh [deleted file]

index e71246c..f6d97b0 100644 (file)
@@ -23,7 +23,8 @@
 /avplay
 /avprobe
 /avversion.h
-/config.*
+/config.asm
+/config.h
 /coverage.info
 /lcov/
 /mapfile
index d4c2b8e..c9fa162 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-include config.mak
+include avbuild/config.mak
 
 vpath %.c    $(SRC_PATH)
 vpath %.m    $(SRC_PATH)
@@ -110,7 +110,7 @@ SKIPHEADERS = cmdutils_common_opts.h                                    \
 all: all-yes
 
 include $(SRC_PATH)/tools/Makefile
-include $(SRC_PATH)/common.mak
+include $(SRC_PATH)/avbuild/common.mak
 
 FF_EXTRALIBS := $(FFEXTRALIBS)
 FF_DEP_LIBS  := $(DEP_LIBS)
@@ -129,8 +129,8 @@ CONFIGURABLE_COMPONENTS =                                           \
     $(SRC_PATH)/libavcodec/bitstream_filters.c                      \
     $(SRC_PATH)/libavformat/protocols.c                             \
 
-config.h: .config
-.config: $(CONFIGURABLE_COMPONENTS)
+config.h: avbuild/.config
+avbuild/.config: $(CONFIGURABLE_COMPONENTS)
        @-tput bold 2>/dev/null
        @-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
        @-tput sgr0 2>/dev/null
@@ -152,7 +152,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)/avbuild/library.mak
 endef
 
 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
@@ -173,10 +173,10 @@ $(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(EXESUF)=))))
 $(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS)
        $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
 
-VERSION_SH  = $(SRC_PATH)/version.sh
+VERSION_SH  = $(SRC_PATH)/avbuild/version.sh
 GIT_LOG     = $(SRC_PATH)/.git/logs/HEAD
 
-.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
+.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) avbuild/config.mak
 .version: M=@
 
 cmdutils.o libavutil/utils.o: avversion.h
@@ -221,8 +221,9 @@ clean::
 
 distclean::
        $(RM) $(DISTCLEANSUFFIXES)
-       $(RM) config.* .config libavutil/avconfig.h .version avversion.h \
-            mapfile libavcodec/bsf_list.c libavformat/protocol_list.c
+       $(RM) .version avversion.h config.asm config.h mapfile \
+            avbuild/.config avbuild/config.* libavutil/avconfig.h \
+            libavcodec/bsf_list.c libavformat/protocol_list.c
 
 config:
        $(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
diff --git a/arch.mak b/arch.mak
deleted file mode 100644 (file)
index 720062a..0000000
--- a/arch.mak
+++ /dev/null
@@ -1,11 +0,0 @@
-OBJS-$(HAVE_ARMV5TE) += $(ARMV5TE-OBJS) $(ARMV5TE-OBJS-yes)
-OBJS-$(HAVE_ARMV6)   += $(ARMV6-OBJS)   $(ARMV6-OBJS-yes)
-OBJS-$(HAVE_ARMV8)   += $(ARMV8-OBJS)   $(ARMV8-OBJS-yes)
-OBJS-$(HAVE_VFP)     += $(VFP-OBJS)     $(VFP-OBJS-yes)
-OBJS-$(HAVE_NEON)    += $(NEON-OBJS)    $(NEON-OBJS-yes)
-
-OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
-OBJS-$(HAVE_VSX)     += $(VSX-OBJS) $(VSX-OBJS-yes)
-
-OBJS-$(HAVE_MMX)     += $(MMX-OBJS)     $(MMX-OBJS-yes)
-OBJS-$(HAVE_YASM)    += $(YASM-OBJS)    $(YASM-OBJS-yes)
diff --git a/avbuild/.gitignore b/avbuild/.gitignore
new file mode 100644 (file)
index 0000000..693b7aa
--- /dev/null
@@ -0,0 +1,4 @@
+/.config
+/config.fate
+/config.log
+/config.mak
diff --git a/avbuild/arch.mak b/avbuild/arch.mak
new file mode 100644 (file)
index 0000000..720062a
--- /dev/null
@@ -0,0 +1,11 @@
+OBJS-$(HAVE_ARMV5TE) += $(ARMV5TE-OBJS) $(ARMV5TE-OBJS-yes)
+OBJS-$(HAVE_ARMV6)   += $(ARMV6-OBJS)   $(ARMV6-OBJS-yes)
+OBJS-$(HAVE_ARMV8)   += $(ARMV8-OBJS)   $(ARMV8-OBJS-yes)
+OBJS-$(HAVE_VFP)     += $(VFP-OBJS)     $(VFP-OBJS-yes)
+OBJS-$(HAVE_NEON)    += $(NEON-OBJS)    $(NEON-OBJS-yes)
+
+OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
+OBJS-$(HAVE_VSX)     += $(VSX-OBJS) $(VSX-OBJS-yes)
+
+OBJS-$(HAVE_MMX)     += $(MMX-OBJS)     $(MMX-OBJS-yes)
+OBJS-$(HAVE_YASM)    += $(YASM-OBJS)    $(YASM-OBJS-yes)
diff --git a/avbuild/common.mak b/avbuild/common.mak
new file mode 100644 (file)
index 0000000..9676294
--- /dev/null
@@ -0,0 +1,63 @@
+#
+# common bits used by all libraries
+#
+
+include $(SRC_PATH)/avbuild/arch.mak
+
+OBJS      += $(OBJS-yes)
+FFLIBS    := $($(NAME)_FFLIBS) $(FFLIBS-yes) $(FFLIBS)
+TESTPROGS += $(TESTPROGS-yes)
+
+FFEXTRALIBS := $(FFLIBS:%=$(LD_LIB)) $(EXTRALIBS)
+
+OBJS      := $(sort $(OBJS:%=$(SUBDIR)%))
+TESTOBJS  := $(TESTOBJS:%=$(SUBDIR)tests/%) $(TESTPROGS:%=$(SUBDIR)tests/%.o)
+TESTPROGS := $(TESTPROGS:%=$(SUBDIR)tests/%$(EXESUF))
+HOSTOBJS  := $(HOSTPROGS:%=$(SUBDIR)%.o)
+HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
+TOOLS     += $(TOOLS-yes)
+TOOLOBJS  := $(TOOLS:%=tools/%.o)
+TOOLS     := $(TOOLS:%=tools/%$(EXESUF))
+HEADERS   += $(HEADERS-yes)
+
+PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(2)LIBNAME))
+DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib),$(CONFIG_SHARED:yes=S)))
+STATIC_DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
+
+SRC_DIR    := $(SRC_PATH)/lib$(NAME)
+ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
+SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
+SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
+HOBJS        = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
+$(HOBJS):     CCFLAGS += $(CFLAGS_HEADERS)
+checkheaders: $(HOBJS)
+.SECONDARY:   $(HOBJS:.o=.c)
+
+alltools: $(TOOLS)
+
+$(HOSTOBJS): %.o: %.c
+       $(COMPILE_HOSTC)
+
+$(HOSTPROGS): %$(HOSTEXESUF): %.o
+       $(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $^ $(HOSTEXTRALIBS)
+
+$(OBJS):     | $(sort $(dir $(OBJS)))
+$(HOBJS):    | $(sort $(dir $(HOBJS)))
+$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
+$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
+$(TOOLOBJS): | tools
+
+OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
+
+CLEANSUFFIXES     = *.d *.o *~ *.h.c *.gcda *.gcno *.map *.ver
+DISTCLEANSUFFIXES = *.pc
+LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
+
+define RULES
+clean::
+       $(RM) $(HOSTPROGS) $(TESTPROGS) $(TOOLS)
+endef
+
+$(eval $(RULES))
+
+-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d))
diff --git a/avbuild/library.mak b/avbuild/library.mak
new file mode 100644 (file)
index 0000000..9215a93
--- /dev/null
@@ -0,0 +1,92 @@
+include $(SRC_PATH)/avbuild/common.mak
+
+LIBVERSION := $(lib$(NAME)_VERSION)
+LIBMAJOR   := $(lib$(NAME)_VERSION_MAJOR)
+LIBMINOR   := $(lib$(NAME)_VERSION_MINOR)
+INCINSTDIR := $(INCDIR)/lib$(NAME)
+
+INSTHEADERS := $(INSTHEADERS) $(HEADERS:%=$(SUBDIR)%)
+
+all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)
+all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME)
+
+LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
+$(LIBOBJS) $(LIBOBJS:.o=.i):   CPPFLAGS += -DHAVE_AV_CONFIG_H
+
+$(SUBDIR)$(LIBNAME): $(OBJS)
+       $(RM) $@
+       $(AR) $(ARFLAGS) $(AR_O) $^
+       $(RANLIB) $@
+
+install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
+
+install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
+install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
+
+define RULES
+$(TOOLS):     THISLIB = $(NAME:%=$(LD_LIB))
+$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
+
+$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
+       $$(LD) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
+
+$(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS)
+       $$(M)sed 's/MAJOR/$(lib$(NAME)_VERSION_MAJOR)/' $$< | $(VERSION_SCRIPT_POSTPROCESS_CMD) > $$@
+
+$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
+       $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
+
+$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver $(DEP_LIBS)
+       $(SLIB_CREATE_DEF_CMD)
+       $$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
+       $(SLIB_EXTRA_CMD)
+
+clean::
+       $(RM) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
+           $(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) $(CLEANSUFFIXES:%=$(SUBDIR)tests/%)
+
+distclean:: clean
+       $(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) $(DISTCLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) \
+            $(DISTCLEANSUFFIXES:%=$(SUBDIR)tests/%)
+
+install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
+       $(Q)mkdir -p "$(SHLIBDIR)"
+       $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
+       $(Q)$(foreach F,$(SLIB_INSTALL_LINKS),cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F);)
+       $(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
+       $(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
+       $(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
+
+install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
+       $(Q)mkdir -p "$(LIBDIR)"
+       $$(INSTALL) -m 644 $$< "$(LIBDIR)"
+       $(LIB_INSTALL_EXTRA_CMD)
+
+install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
+       $(Q)mkdir -p "$(INCINSTDIR)"
+       $$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
+
+install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(NAME).pc
+       $(Q)mkdir -p "$(LIBDIR)/pkgconfig"
+       $$(INSTALL) -m 644 $$^ "$(LIBDIR)/pkgconfig"
+
+uninstall-libs::
+       -$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
+              "$(SHLIBDIR)/$(SLIBNAME)"            \
+              "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
+       -$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)"%)
+       -$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)"%)
+       -$(RM) "$(LIBDIR)/$(LIBNAME)"
+
+uninstall-headers::
+       $(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS) $(BUILT_HEADERS))
+       $(RM) "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
+       -rmdir "$(INCINSTDIR)"
+endef
+
+$(eval $(RULES))
+
+$(TOOLS):     $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
+$(TESTPROGS): $(DEP_LIBS) $(SUBDIR)$(LIBNAME)
+
+testprogs: $(TESTPROGS)
diff --git a/avbuild/version.sh b/avbuild/version.sh
new file mode 100755 (executable)
index 0000000..4689627
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# check for git short hash
+revision=$(cd "$1" && git describe --always 2> /dev/null)
+
+# no revision number found
+test "$revision" || revision=$(cd "$1" && cat RELEASE 2> /dev/null)
+
+# releases extract the version number from the VERSION file
+version=$(cd "$1" && cat VERSION 2> /dev/null)
+test "$version" || version=$revision
+
+test -n "$3" && version=$version-$3
+
+if [ -z "$2" ]; then
+    echo "$version"
+    exit
+fi
+
+NEW_REVISION="#define LIBAV_VERSION \"$version\""
+OLD_REVISION=$(cat "$2" 2> /dev/null)
+
+# Update version.h only on revision changes to avoid spurious rebuilds
+if test "$NEW_REVISION" != "$OLD_REVISION"; then
+    echo "$NEW_REVISION" > "$2"
+fi
diff --git a/common.mak b/common.mak
deleted file mode 100644 (file)
index 70ebd4b..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# common bits used by all libraries
-#
-
-include $(SRC_PATH)/arch.mak
-
-OBJS      += $(OBJS-yes)
-FFLIBS    := $($(NAME)_FFLIBS) $(FFLIBS-yes) $(FFLIBS)
-TESTPROGS += $(TESTPROGS-yes)
-
-FFEXTRALIBS := $(FFLIBS:%=$(LD_LIB)) $(EXTRALIBS)
-
-OBJS      := $(sort $(OBJS:%=$(SUBDIR)%))
-TESTOBJS  := $(TESTOBJS:%=$(SUBDIR)tests/%) $(TESTPROGS:%=$(SUBDIR)tests/%.o)
-TESTPROGS := $(TESTPROGS:%=$(SUBDIR)tests/%$(EXESUF))
-HOSTOBJS  := $(HOSTPROGS:%=$(SUBDIR)%.o)
-HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
-TOOLS     += $(TOOLS-yes)
-TOOLOBJS  := $(TOOLS:%=tools/%.o)
-TOOLS     := $(TOOLS:%=tools/%$(EXESUF))
-HEADERS   += $(HEADERS-yes)
-
-PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(2)LIBNAME))
-DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib),$(CONFIG_SHARED:yes=S)))
-STATIC_DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
-
-SRC_DIR    := $(SRC_PATH)/lib$(NAME)
-ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
-SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
-SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
-HOBJS        = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
-$(HOBJS):     CCFLAGS += $(CFLAGS_HEADERS)
-checkheaders: $(HOBJS)
-.SECONDARY:   $(HOBJS:.o=.c)
-
-alltools: $(TOOLS)
-
-$(HOSTOBJS): %.o: %.c
-       $(COMPILE_HOSTC)
-
-$(HOSTPROGS): %$(HOSTEXESUF): %.o
-       $(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $^ $(HOSTEXTRALIBS)
-
-$(OBJS):     | $(sort $(dir $(OBJS)))
-$(HOBJS):    | $(sort $(dir $(HOBJS)))
-$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
-$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
-$(TOOLOBJS): | tools
-
-OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
-
-CLEANSUFFIXES     = *.d *.o *~ *.h.c *.gcda *.gcno *.map *.ver
-DISTCLEANSUFFIXES = *.pc
-LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
-
-define RULES
-clean::
-       $(RM) $(HOSTPROGS) $(TESTPROGS) $(TOOLS)
-endef
-
-$(eval $(RULES))
-
--include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d))
index d30d384..bcc5f6e 100755 (executable)
--- a/configure
+++ b/configure
@@ -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 [avbuild/config.log]
   --disable-logging        do not log configure debug information
   --prefix=PREFIX          install in PREFIX [$prefix_default]
   --bindir=DIR             install binaries in DIR [PREFIX/bin]
@@ -2495,7 +2495,7 @@ texi2html_deps="doc"
 
 # default parameters
 
-logfile="config.log"
+logfile="avbuild/config.log"
 
 # installation paths
 prefix_default="/usr/local"
@@ -2808,6 +2808,7 @@ disable_components(){
 
 map 'disable_components $v' $LIBRARY_LIST
 
+mkdir -p avbuild
 echo "# $0 $LIBAV_CONFIGURATION" > $logfile
 set >> $logfile
 
@@ -4123,7 +4124,7 @@ esc(){
     echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
 }
 
-echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" >config.fate
+echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" > avbuild/config.fate
 
 check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
 
@@ -5210,9 +5211,9 @@ fi # test "$quiet" != "yes"
 
 test -e Makefile || echo "include $source_path/Makefile" > Makefile
 
-config_files="$TMPH config.mak"
+config_files="$TMPH avbuild/config.mak"
 
-cat > config.mak <<EOF
+cat > avbuild/config.mak <<EOF
 # Automatically generated by configure - do not modify!
 LIBAV_CONFIGURATION=$LIBAV_CONFIGURATION
 prefix=$prefix
@@ -5323,18 +5324,18 @@ get_version(){
     file=$source_path/$lcname/version.h
     eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
     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"             >> avbuild/config.mak
+    eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> avbuild/config.mak
+    eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> avbuild/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" >> avbuild/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}" >> avbuild/config.mak
 }
 
 map 'print_program_extralibs $v' $PROGRAM_LIST
@@ -5373,7 +5374,7 @@ echo "#endif /* LIBAV_CONFIG_H */" >> $TMPH
 
 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
 cp_if_changed $TMPH config.h
-touch .config
+touch avbuild/.config
 
 enabled yasm && cp_if_changed $TMPASM config.asm
 
diff --git a/library.mak b/library.mak
deleted file mode 100644 (file)
index bf1853f..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-include $(SRC_PATH)/common.mak
-
-LIBVERSION := $(lib$(NAME)_VERSION)
-LIBMAJOR   := $(lib$(NAME)_VERSION_MAJOR)
-LIBMINOR   := $(lib$(NAME)_VERSION_MINOR)
-INCINSTDIR := $(INCDIR)/lib$(NAME)
-
-INSTHEADERS := $(INSTHEADERS) $(HEADERS:%=$(SUBDIR)%)
-
-all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)
-all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME)
-
-LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
-$(LIBOBJS) $(LIBOBJS:.o=.i):   CPPFLAGS += -DHAVE_AV_CONFIG_H
-
-$(SUBDIR)$(LIBNAME): $(OBJS)
-       $(RM) $@
-       $(AR) $(ARFLAGS) $(AR_O) $^
-       $(RANLIB) $@
-
-install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
-
-install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
-install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
-
-define RULES
-$(TOOLS):     THISLIB = $(NAME:%=$(LD_LIB))
-$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
-
-$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
-       $$(LD) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
-
-$(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS)
-       $$(M)sed 's/MAJOR/$(lib$(NAME)_VERSION_MAJOR)/' $$< | $(VERSION_SCRIPT_POSTPROCESS_CMD) > $$@
-
-$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
-       $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
-
-$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver $(DEP_LIBS)
-       $(SLIB_CREATE_DEF_CMD)
-       $$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
-       $(SLIB_EXTRA_CMD)
-
-clean::
-       $(RM) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
-           $(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) $(CLEANSUFFIXES:%=$(SUBDIR)tests/%)
-
-distclean:: clean
-       $(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) $(DISTCLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) \
-            $(DISTCLEANSUFFIXES:%=$(SUBDIR)tests/%)
-
-install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
-       $(Q)mkdir -p "$(SHLIBDIR)"
-       $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
-       $(Q)$(foreach F,$(SLIB_INSTALL_LINKS),cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F);)
-       $(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
-       $(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
-       $(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
-
-install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
-       $(Q)mkdir -p "$(LIBDIR)"
-       $$(INSTALL) -m 644 $$< "$(LIBDIR)"
-       $(LIB_INSTALL_EXTRA_CMD)
-
-install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
-       $(Q)mkdir -p "$(INCINSTDIR)"
-       $$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
-
-install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(NAME).pc
-       $(Q)mkdir -p "$(LIBDIR)/pkgconfig"
-       $$(INSTALL) -m 644 $$^ "$(LIBDIR)/pkgconfig"
-
-uninstall-libs::
-       -$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
-              "$(SHLIBDIR)/$(SLIBNAME)"            \
-              "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
-       -$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)"%)
-       -$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)"%)
-       -$(RM) "$(LIBDIR)/$(LIBNAME)"
-
-uninstall-headers::
-       $(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS) $(BUILT_HEADERS))
-       $(RM) "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
-       -rmdir "$(INCINSTDIR)"
-endef
-
-$(eval $(RULES))
-
-$(TOOLS):     $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
-$(TESTPROGS): $(DEP_LIBS) $(SUBDIR)$(LIBNAME)
-
-testprogs: $(TESTPROGS)
index f7ca891..4608d2d 100755 (executable)
@@ -83,7 +83,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 ${build}/tests/data/fate/*.rep >>report 2>/dev/null
+    cat ${build}/avbuild/config.fate ${build}/tests/data/fate/*.rep >> report 2> /dev/null
     test -n "$fate_recv" && $tar report *.log | gzip | $fate_recv
 }
 
@@ -105,7 +105,7 @@ test -d "$src" && update || checkout || die "Error fetching source"
 
 cd ${workdir}
 
-version=$(${src}/version.sh ${src})
+version=$(${src}/avbuild/version.sh ${src})
 test "$version" = "$(cat version-$slot 2>/dev/null)" && exit 0
 echo ${version} >version-$slot
 
diff --git a/version.sh b/version.sh
deleted file mode 100755 (executable)
index 4689627..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-# check for git short hash
-revision=$(cd "$1" && git describe --always 2> /dev/null)
-
-# no revision number found
-test "$revision" || revision=$(cd "$1" && cat RELEASE 2> /dev/null)
-
-# releases extract the version number from the VERSION file
-version=$(cd "$1" && cat VERSION 2> /dev/null)
-test "$version" || version=$revision
-
-test -n "$3" && version=$version-$3
-
-if [ -z "$2" ]; then
-    echo "$version"
-    exit
-fi
-
-NEW_REVISION="#define LIBAV_VERSION \"$version\""
-OLD_REVISION=$(cat "$2" 2> /dev/null)
-
-# Update version.h only on revision changes to avoid spurious rebuilds
-if test "$NEW_REVISION" != "$OLD_REVISION"; then
-    echo "$NEW_REVISION" > "$2"
-fi