aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2022-02-23 14:56:49 +0200
committerMartin Storsjö <martin@martin.st>2022-03-16 14:12:49 +0200
commita78f136f3fa039fd7ad664fd6e6e976f1448c68b (patch)
tree071be1991a6b641284543e77dbb82a0dcfc8f35d /configure
parentf3a0e2ee2b97e2d46b351c29853c056d126884e2 (diff)
downloadffmpeg-a78f136f3fa039fd7ad664fd6e6e976f1448c68b.tar.gz
configure: Use a separate config_components.h header for $ALL_COMPONENTS
This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure17
1 files changed, 15 insertions, 2 deletions
diff --git a/configure b/configure
index 82642deabe..dff53e88bc 100755
--- a/configure
+++ b/configure
@@ -7791,17 +7791,30 @@ print_config ARCH_ "$config_files" $ARCH_LIST
print_config HAVE_ "$config_files" $HAVE_LIST
print_config CONFIG_ "$config_files" $CONFIG_LIST \
$CONFIG_EXTRA \
- $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
+# Copy config.asm before printing ALL_COMPONENTS; that's not needed in assembly.
enabled x86asm && cp_if_changed $TMPASM config.asm
+# Reopen a new TMPH for config_components.h.
+cat > $TMPH <<EOF
+/* Automatically generated by configure - do not modify! */
+#ifndef FFMPEG_CONFIG_COMPONENTS_H
+#define FFMPEG_CONFIG_COMPONENTS_H
+EOF
+
+print_config CONFIG_ "$config_files" $ALL_COMPONENTS
+
+echo "#endif /* FFMPEG_CONFIG_COMPONENTS_H */" >> $TMPH
+echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak
+
+cp_if_changed $TMPH config_components.h
+
cat > $TMPH <<EOF
/* Generated by ffmpeg configure */
#ifndef AVUTIL_AVCONFIG_H