From 011d84b462a78703b9b939cb5e48b4cc75ebe015 Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Tue, 10 May 2022 15:47:44 -0300 Subject: 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 }' --- .gitignore | 3 --- 1 file changed, 3 deletions(-) (limited to '.gitignore') diff --git a/.gitignore b/.gitignore index 70dba09b2..66daccf5d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ .directory *.man .vscode -Makefile autom4te.cache/ config.log config.mk @@ -25,7 +24,6 @@ firejail.1 firemon.1 firecfg.1 jailcheck.1 -mkdeb.sh src/fnettrace-dns/fnettrace-dns src/fnettrace-sni/fnettrace-sni src/firejail/firejail @@ -57,7 +55,6 @@ seccomp.64 seccomp.block_secondary seccomp.mdwx seccomp.mdwx.32 -src/common.mk aclocal.m4 __pycache__ *.pyc -- cgit v1.2.3-54-g00ecf