aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2023-12-15 13:03:49 +0200
committerMartin Storsjö <martin@martin.st>2023-12-21 11:00:34 +0200
commit1e42a48e37228c679d3ab0764e53ffab62256ce8 (patch)
tree64ecdad711ee1b57b1ff7d20849be3a292077e1f
parent9415c2c11fc7141587c387e59d55a024fe38d0a2 (diff)
downloadffmpeg-1e42a48e37228c679d3ab0764e53ffab62256ce8.tar.gz
configure: Add a --disable-version-tracking option
This disables regenerating ffversion.h whenever the checked out git commit changes, speeding up development rebuilds. Whenever this option is set, force the version to be printed as "unknown" rather than showing potentially stale information. Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--Makefile7
-rwxr-xr-xconfigure4
2 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 2fc3e538c1..dbc930270b 100644
--- a/Makefile
+++ b/Makefile
@@ -133,13 +133,18 @@ endif
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
VERSION_SH = $(SRC_PATH)/ffbuild/version.sh
+ifeq ($(VERSION_TRACKING),yes)
GIT_LOG = $(SRC_PATH)/.git/logs/HEAD
+endif
.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) ffbuild/config.mak
.version: M=@
+ifneq ($(VERSION_TRACKING),yes)
+libavutil/ffversion.h .version: REVISION=unknown
+endif
libavutil/ffversion.h .version:
- $(M)$(VERSION_SH) $(SRC_PATH) libavutil/ffversion.h $(EXTRA_VERSION)
+ $(M)revision=$(REVISION) $(VERSION_SH) $(SRC_PATH) libavutil/ffversion.h $(EXTRA_VERSION)
$(Q)touch .version
# force version.sh to run whenever version might have changed
diff --git a/configure b/configure
index 00495efb1c..af0bebc1ac 100755
--- a/configure
+++ b/configure
@@ -505,6 +505,7 @@ Developer options (useful when working on FFmpeg itself):
--enable-macos-kperf enable macOS kperf (private) API
--disable-large-tests disable tests that use a large amount of memory
--disable-ptx-compression don't compress CUDA PTX code even when possible
+ --disable-version-tracking don't include the git/release version in the build
NOTE: Object files are built at the place where configure is launched.
EOF
@@ -2578,6 +2579,7 @@ CMDLINE_SELECT="
optimizations
rpath
stripping
+ version_tracking
"
PATHS_LIST="
@@ -3996,6 +3998,7 @@ enable $DOCUMENT_LIST
enable $EXAMPLE_LIST
enable $LIBRARY_LIST
enable stripping
+enable version_tracking
enable asm
enable debug
@@ -8032,6 +8035,7 @@ SAMPLES:=${samples:-\$(FATE_SAMPLES)}
NOREDZONE_FLAGS=$noredzone_flags
LIBFUZZER_PATH=$libfuzzer_path
IGNORE_TESTS=$ignore_tests
+VERSION_TRACKING=$version_tracking
EOF
map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST