aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-05-10 15:47:44 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-06-30 05:30:14 -0300
commit011d84b462a78703b9b939cb5e48b4cc75ebe015 (patch)
treefe2ad82e289323a7749191a6e8f719b011e2b937 /contrib
parentTransmission fixes: drop private-lib (#5213) (diff)
downloadfirejail-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 'contrib')
-rwxr-xr-xcontrib/fj-mkdeb.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/fj-mkdeb.py b/contrib/fj-mkdeb.py
index 854e8d1a8..b215b157b 100755
--- a/contrib/fj-mkdeb.py
+++ b/contrib/fj-mkdeb.py
@@ -12,7 +12,7 @@ import os, subprocess, sys
12def run(srcdir, args): 12def run(srcdir, args):
13 if srcdir: os.chdir(srcdir) 13 if srcdir: os.chdir(srcdir)
14 14
15 if not (os.path.isfile('./mkdeb.sh.in')): 15 if not (os.path.isfile('./mkdeb.sh')):
16 print('Error: Not a firejail source tree? Exiting.') 16 print('Error: Not a firejail source tree? Exiting.')
17 return 1 17 return 1
18 18
@@ -22,7 +22,7 @@ def run(srcdir, args):
22 # prefix should ALWAYS be /usr here. Discard user-set values 22 # prefix should ALWAYS be /usr here. Discard user-set values
23 args.remove(a) 23 args.remove(a)
24 24
25 # Run configure to generate mkdeb.sh. 25 # Run configure to generate config.sh.
26 first_config = subprocess.call(['./configure', '--prefix=/usr'] + args) 26 first_config = subprocess.call(['./configure', '--prefix=/usr'] + args)
27 if first_config != 0: 27 if first_config != 0:
28 return first_config 28 return first_config
@@ -62,9 +62,9 @@ usage:
62 if not (srcdir): 62 if not (srcdir):
63 # srcdir not manually specified, try to auto-detect 63 # srcdir not manually specified, try to auto-detect
64 srcdir = os.path.dirname(os.path.abspath(sys.argv[0] + '/..')) 64 srcdir = os.path.dirname(os.path.abspath(sys.argv[0] + '/..'))
65 if not (os.path.isfile(srcdir + '/mkdeb.sh.in')): 65 if not (os.path.isfile(srcdir + '/mkdeb.sh')):
66 # Script is probably installed. Check the cwd. 66 # Script is probably installed. Check the cwd.
67 if os.path.isfile('./mkdeb.sh.in'): 67 if os.path.isfile('./mkdeb.sh'):
68 srcdir = None 68 srcdir = None
69 else: 69 else:
70 print( 70 print(