Skip to content

Commit

Permalink
configure: Use a separate config_components.h header for $ALL_COMPONENTS
Browse files Browse the repository at this point in the history
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ö <[email protected]>
  • Loading branch information
mstorsjo committed Mar 16, 2022
1 parent f3a0e2e commit a78f136
Show file tree
Hide file tree
Showing 243 changed files with 459 additions and 2 deletions.
17 changes: 15 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions fftools/ffplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/

#include "config.h"
#include "config_components.h"
#include <inttypes.h>
#include <math.h>
#include <limits.h>
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/8svx.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
* http://aminet.net/mods/smpl/
*/

#include "config_components.h"

#include "libavutil/avassert.h"
#include "avcodec.h"
#include "internal.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/a64multienc.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* a64 video encoder - multicolor modes
*/

#include "config_components.h"

#include "a64colors.h"
#include "a64tables.h"
#include "elbg.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/aac_ac3_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "parser.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/aactab.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/

#include "config.h"
#include "config_components.h"
#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "aac.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/aarch64/h264cmc_neon.S
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "libavutil/aarch64/asm.S"

/* chroma_mc8(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y) */
Expand Down
1 change: 1 addition & 0 deletions libavcodec/ac3_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/

#include "config.h"
#include "config_components.h"

#include "libavutil/channel_layout.h"
#include "parser.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/ac3dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include <stdio.h>
#include <stddef.h>
#include <math.h>
Expand Down
3 changes: 3 additions & 0 deletions libavcodec/ac3dec_float.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
/**
* Upmix delay samples from stereo to original channel layout.
*/

#include "config_components.h"

#include "ac3dec.h"
#include "eac3dec.c"
#include "ac3dec.c"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/ac3enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "libavutil/opt.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "config_components.h"
#include "encode.h"
#include "internal.h"
#include "me_cmp.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/ac3enc_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* AC-3 encoder float/fixed template
*/

#include "config_components.h"

#include <stdint.h>

#include "libavutil/attributes.h"
Expand Down
3 changes: 3 additions & 0 deletions libavcodec/adpcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "avcodec.h"
#include "get_bits.h"
#include "bytestream.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/adpcmenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "libavutil/opt.h"

#include "avcodec.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/allcodecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <string.h>

#include "config.h"
#include "config_components.h"
#include "libavutil/thread.h"
#include "codec.h"
#include "codec_id.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/amfenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

#include "config.h"
#include "config_components.h"

#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/aptxdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "libavutil/channel_layout.h"
#include "aptx.h"

Expand Down
2 changes: 2 additions & 0 deletions libavcodec/aptxenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "libavutil/channel_layout.h"
#include "aptx.h"
#include "encode.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/arm/flacdsp_init_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "libavutil/attributes.h"
#include "libavcodec/flacdsp.h"
#include "config.h"
#include "config_components.h"

void ff_flac_lpc_16_arm(int32_t *samples, const int coeffs[32], int order,
int qlevel, int len);
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/arm/h264cmc_neon.S
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "libavutil/arm/asm.S"

/* chroma_mc8(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y) */
Expand Down
1 change: 1 addition & 0 deletions libavcodec/assdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "avcodec.h"
#include "ass.h"
#include "config_components.h"
#include "internal.h"
#include "libavutil/internal.h"
#include "libavutil/mem.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/assenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include <string.h>

#include "avcodec.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/asvdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "asv.h"
#include "avcodec.h"
#include "blockdsp.h"
#include "config_components.h"
#include "idctdsp.h"
#include "internal.h"
#include "mpeg12data.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/asvenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
* ASUS V1/V2 encoder.
*/

#include "config_components.h"

#include "libavutil/attributes.h"
#include "libavutil/mem.h"

Expand Down
1 change: 1 addition & 0 deletions libavcodec/audiotoolboxdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <AudioToolbox/AudioToolbox.h>

#include "config.h"
#include "config_components.h"
#include "avcodec.h"
#include "ac3_parser_internal.h"
#include "bytestream.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/av1dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "libavutil/film_grain_params.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/binkaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
* http://wiki.multimedia.cx/index.php?title=Bink_Audio
*/

#include "config_components.h"

#include "libavutil/channel_layout.h"
#include "libavutil/intfloat.h"
#include "libavutil/mem_internal.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/bintext.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
* iCEDraw File decoder
*/

#include "config_components.h"

#include "libavutil/intreadwrite.h"
#include "libavutil/xga_font_data.h"
#include "avcodec.h"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/bsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <string.h>

#include "config.h"
#include "config_components.h"

#include "libavutil/avassert.h"
#include "libavutil/log.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/crystalhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
* Includes
****************************************************************************/

#include "config_components.h"

#define _XOPEN_SOURCE 600
#include <inttypes.h>
#include <stdio.h>
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/cuviddec.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "compat/cuda/dynlink_loader.h"

#include "libavutil/buffer.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/cyuv.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
* Creative YUV (CYUV) Video Decoder.
*/

#include "config_components.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/dxva2_av1.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "libavutil/avassert.h"
#include "libavutil/pixdesc.h"

Expand Down
2 changes: 2 additions & 0 deletions libavcodec/dxva2_h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "libavutil/avassert.h"

#include "dxva2_internal.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/dxva2_hevc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "libavutil/avassert.h"

#include "dxva2_internal.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/dxva2_mpeg2.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "libavutil/log.h"

#include "dxva2_internal.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/dxva2_vc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "dxva2_internal.h"
#include "mpegutils.h"
#include "mpegvideodec.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/dxva2_vp9.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include "libavutil/avassert.h"
#include "libavutil/pixdesc.h"

Expand Down
2 changes: 2 additions & 0 deletions libavcodec/flashsv.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* downloaded from http://www.adobe.com/devnet/swf.html.
*/

#include "config_components.h"

#include <stdio.h>
#include <stdlib.h>
#include <zlib.h>
Expand Down
3 changes: 3 additions & 0 deletions libavcodec/g726.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config_components.h"

#include <limits.h>

#include "libavutil/channel_layout.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/gsmdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* GSM decoder
*/

#include "config_components.h"

#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "get_bits.h"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/h263dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

#define UNCHECKED_BITSTREAM_READER 1

#include "config_components.h"

#include "avcodec.h"
#include "error_resilience.h"
#include "flvdec.h"
Expand Down
Loading

0 comments on commit a78f136

Please sign in to comment.