[PR #5219] [MERGED] build: reduce autoconf input files from 32 to 2 #5406

Closed
opened 2026-05-05 10:37:49 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/5219
Author: @kmk3
Created: 6/25/2022
Status: Merged
Merged: 6/30/2022
Merged by: @netblue30

Base: masterHead: build-reduce-config-files


📝 Commits (3)

  • 011d84b build: reduce autoconf input files from 32 to 2
  • 83ae0ed makefiles: stop failing when config.mk does not exist
  • e21637c makefiles: add generated files as dependencies

📊 Changes

34 files changed (+80 additions, -177 deletions)

View changed files

📝 .gitignore (+0 -3)
📝 Makefile (+19 -16)
📝 configure (+1 -38)
📝 configure.ac (+1 -34)
📝 contrib/fj-mkdeb.py (+4 -4)
📝 mkdeb.sh (+0 -0)
📝 src/bash_completion/Makefile (+2 -3)
📝 src/common.mk (+1 -1)
📝 src/fbuilder/Makefile (+2 -3)
📝 src/fcopy/Makefile (+2 -3)
📝 src/fids/Makefile (+2 -3)
📝 src/firecfg/Makefile (+2 -3)
📝 src/firejail/Makefile (+2 -3)
📝 src/firemon/Makefile (+2 -3)
📝 src/fldd/Makefile (+2 -3)
📝 src/fnet/Makefile (+2 -3)
📝 src/fnetfilter/Makefile (+2 -3)
📝 src/fnettrace-dns/Makefile (+2 -3)
📝 src/fnettrace-sni/Makefile (+2 -3)
📝 src/fnettrace/Makefile (+2 -3)

...and 14 more files

📄 Description

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 }'

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/5219 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 6/25/2022 **Status:** ✅ Merged **Merged:** 6/30/2022 **Merged by:** [@netblue30](https://github.com/netblue30) **Base:** `master` ← **Head:** `build-reduce-config-files` --- ### 📝 Commits (3) - [`011d84b`](https://github.com/netblue30/firejail/commit/011d84b462a78703b9b939cb5e48b4cc75ebe015) build: reduce autoconf input files from 32 to 2 - [`83ae0ed`](https://github.com/netblue30/firejail/commit/83ae0ed8379e2e00815cbe60e2e512665e48c1ed) makefiles: stop failing when config.mk does not exist - [`e21637c`](https://github.com/netblue30/firejail/commit/e21637ca82199d9b659f34d71674090e45fc89db) makefiles: add generated files as dependencies ### 📊 Changes **34 files changed** (+80 additions, -177 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+0 -3) 📝 `Makefile` (+19 -16) 📝 `configure` (+1 -38) 📝 `configure.ac` (+1 -34) 📝 `contrib/fj-mkdeb.py` (+4 -4) 📝 `mkdeb.sh` (+0 -0) 📝 `src/bash_completion/Makefile` (+2 -3) 📝 `src/common.mk` (+1 -1) 📝 `src/fbuilder/Makefile` (+2 -3) 📝 `src/fcopy/Makefile` (+2 -3) 📝 `src/fids/Makefile` (+2 -3) 📝 `src/firecfg/Makefile` (+2 -3) 📝 `src/firejail/Makefile` (+2 -3) 📝 `src/firemon/Makefile` (+2 -3) 📝 `src/fldd/Makefile` (+2 -3) 📝 `src/fnet/Makefile` (+2 -3) 📝 `src/fnetfilter/Makefile` (+2 -3) 📝 `src/fnettrace-dns/Makefile` (+2 -3) 📝 `src/fnettrace-sni/Makefile` (+2 -3) 📝 `src/fnettrace/Makefile` (+2 -3) _...and 14 more files_ </details> ### 📄 Description 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 }' --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:37:49 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#5406
No description provided.