diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-05-10 15:47:44 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-06-30 05:30:14 -0300 |
commit | 011d84b462a78703b9b939cb5e48b4cc75ebe015 (patch) | |
tree | fe2ad82e289323a7749191a6e8f719b011e2b937 /configure | |
parent | Transmission fixes: drop private-lib (#5213) (diff) | |
download | firejail-011d84b462a78703b9b939cb5e48b4cc75ebe015.tar.gz firejail-011d84b462a78703b9b939cb5e48b4cc75ebe015.tar.zst firejail-011d84b462a78703b9b939cb5e48b4cc75ebe015.zip |
build: reduce autoconf input files from 32 to 2
Configure summary: autoconf essentially only parses configure.ac and
generates the configure script (that is, the "./configure" shell
script). The latter is what actually checks what is available on the
system and internally sets the value of the output variables. It then,
for every filename foo in AC_CONFIG_FILES (and for every output variable
name BAR in AC_SUBST), reads foo.in, replaces every occurrence of
`@BAR@` with the value of the shell variable `$BAR` and generates the
file foo from the result. After this, configure is finished and `make`
could be executed to start the build.
Now that (as of #5140) all output variables are only defined on
config.mk.in and on config.sh.in, there is no need to generate any
makefile nor any other mkfile or shell script at configure time. So
rename every "Makefile.in" to "Makefile", mkdeb.sh.in to mkdeb.sh,
src/common.mk.in to src/common.mk and leave just config.mk and config.sh
as the files to be generated at configure time.
This allows editing and committing all makefiles directly, without
potentially having to run ./configure in between.
Commands used to rename the makefiles:
$ git ls-files -z -- '*Makefile.in' | xargs -0 -I '{}' sh -c \
"git mv '{}' \"\$(dirname '{}')/Makefile\""
Additionally, from my (rudimentary) testing, this commit reduces the
time it takes to run ./configure by about 20~25% compared to commit
72ece92ea ("Transmission fixes: drop private-lib (#5213)", 2022-06-22).
Environment: dash 0.5.11.5-1, gcc 12.1.0-2, Artix Linux, ext4 on an HDD.
Commands used for benchmarking each commit:
$ : >time_configure && ./configure && make distclean &&
for i in $(seq 1 10); do
{ time -p ./configure; } 2>>time_configure; done
$ grep real time_configure |
awk '{ total += $2 } END { print total/NR }'
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 39 |
1 files changed, 1 insertions, 38 deletions
@@ -4085,9 +4085,7 @@ if test "$prefix" = /usr; then | |||
4085 | test "$sysconfdir" = '${prefix}/etc' && sysconfdir="/etc" | 4085 | test "$sysconfdir" = '${prefix}/etc' && sysconfdir="/etc" |
4086 | fi | 4086 | fi |
4087 | 4087 | ||
4088 | ac_config_files="$ac_config_files mkdeb.sh" | 4088 | ac_config_files="$ac_config_files config.mk config.sh" |
4089 | |||
4090 | ac_config_files="$ac_config_files Makefile config.mk config.sh src/bash_completion/Makefile src/common.mk src/fbuilder/Makefile src/fcopy/Makefile src/fids/Makefile src/firecfg/Makefile src/firejail/Makefile src/firemon/Makefile src/fldd/Makefile src/fnet/Makefile src/fnetfilter/Makefile src/fnettrace-dns/Makefile src/fnettrace-sni/Makefile src/fnettrace/Makefile src/fsec-optimize/Makefile src/fsec-print/Makefile src/fseccomp/Makefile src/ftee/Makefile src/fzenity/Makefile src/jailcheck/Makefile src/lib/Makefile src/libpostexecseccomp/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/man/Makefile src/profstats/Makefile src/zsh_completion/Makefile test/Makefile" | ||
4091 | 4089 | ||
4092 | cat >confcache <<\_ACEOF | 4090 | cat >confcache <<\_ACEOF |
4093 | # This file is a shell script that caches the results of configure | 4091 | # This file is a shell script that caches the results of configure |
@@ -4795,38 +4793,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | |||
4795 | for ac_config_target in $ac_config_targets | 4793 | for ac_config_target in $ac_config_targets |
4796 | do | 4794 | do |
4797 | case $ac_config_target in | 4795 | case $ac_config_target in |
4798 | "mkdeb.sh") CONFIG_FILES="$CONFIG_FILES mkdeb.sh" ;; | ||
4799 | "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; | ||
4800 | "config.mk") CONFIG_FILES="$CONFIG_FILES config.mk" ;; | 4796 | "config.mk") CONFIG_FILES="$CONFIG_FILES config.mk" ;; |
4801 | "config.sh") CONFIG_FILES="$CONFIG_FILES config.sh" ;; | 4797 | "config.sh") CONFIG_FILES="$CONFIG_FILES config.sh" ;; |
4802 | "src/bash_completion/Makefile") CONFIG_FILES="$CONFIG_FILES src/bash_completion/Makefile" ;; | ||
4803 | "src/common.mk") CONFIG_FILES="$CONFIG_FILES src/common.mk" ;; | ||
4804 | "src/fbuilder/Makefile") CONFIG_FILES="$CONFIG_FILES src/fbuilder/Makefile" ;; | ||
4805 | "src/fcopy/Makefile") CONFIG_FILES="$CONFIG_FILES src/fcopy/Makefile" ;; | ||
4806 | "src/fids/Makefile") CONFIG_FILES="$CONFIG_FILES src/fids/Makefile" ;; | ||
4807 | "src/firecfg/Makefile") CONFIG_FILES="$CONFIG_FILES src/firecfg/Makefile" ;; | ||
4808 | "src/firejail/Makefile") CONFIG_FILES="$CONFIG_FILES src/firejail/Makefile" ;; | ||
4809 | "src/firemon/Makefile") CONFIG_FILES="$CONFIG_FILES src/firemon/Makefile" ;; | ||
4810 | "src/fldd/Makefile") CONFIG_FILES="$CONFIG_FILES src/fldd/Makefile" ;; | ||
4811 | "src/fnet/Makefile") CONFIG_FILES="$CONFIG_FILES src/fnet/Makefile" ;; | ||
4812 | "src/fnetfilter/Makefile") CONFIG_FILES="$CONFIG_FILES src/fnetfilter/Makefile" ;; | ||
4813 | "src/fnettrace-dns/Makefile") CONFIG_FILES="$CONFIG_FILES src/fnettrace-dns/Makefile" ;; | ||
4814 | "src/fnettrace-sni/Makefile") CONFIG_FILES="$CONFIG_FILES src/fnettrace-sni/Makefile" ;; | ||
4815 | "src/fnettrace/Makefile") CONFIG_FILES="$CONFIG_FILES src/fnettrace/Makefile" ;; | ||
4816 | "src/fsec-optimize/Makefile") CONFIG_FILES="$CONFIG_FILES src/fsec-optimize/Makefile" ;; | ||
4817 | "src/fsec-print/Makefile") CONFIG_FILES="$CONFIG_FILES src/fsec-print/Makefile" ;; | ||
4818 | "src/fseccomp/Makefile") CONFIG_FILES="$CONFIG_FILES src/fseccomp/Makefile" ;; | ||
4819 | "src/ftee/Makefile") CONFIG_FILES="$CONFIG_FILES src/ftee/Makefile" ;; | ||
4820 | "src/fzenity/Makefile") CONFIG_FILES="$CONFIG_FILES src/fzenity/Makefile" ;; | ||
4821 | "src/jailcheck/Makefile") CONFIG_FILES="$CONFIG_FILES src/jailcheck/Makefile" ;; | ||
4822 | "src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;; | ||
4823 | "src/libpostexecseccomp/Makefile") CONFIG_FILES="$CONFIG_FILES src/libpostexecseccomp/Makefile" ;; | ||
4824 | "src/libtrace/Makefile") CONFIG_FILES="$CONFIG_FILES src/libtrace/Makefile" ;; | ||
4825 | "src/libtracelog/Makefile") CONFIG_FILES="$CONFIG_FILES src/libtracelog/Makefile" ;; | ||
4826 | "src/man/Makefile") CONFIG_FILES="$CONFIG_FILES src/man/Makefile" ;; | ||
4827 | "src/profstats/Makefile") CONFIG_FILES="$CONFIG_FILES src/profstats/Makefile" ;; | ||
4828 | "src/zsh_completion/Makefile") CONFIG_FILES="$CONFIG_FILES src/zsh_completion/Makefile" ;; | ||
4829 | "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; | ||
4830 | 4798 | ||
4831 | *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; | 4799 | *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; |
4832 | esac | 4800 | esac |
@@ -5240,11 +5208,6 @@ which seems to be undefined. Please make sure it is defined" >&2;} | |||
5240 | 5208 | ||
5241 | esac | 5209 | esac |
5242 | 5210 | ||
5243 | |||
5244 | case $ac_file$ac_mode in | ||
5245 | "mkdeb.sh":F) chmod +x mkdeb.sh ;; | ||
5246 | |||
5247 | esac | ||
5248 | done # for ac_tag | 5211 | done # for ac_tag |
5249 | 5212 | ||
5250 | 5213 | ||