4 ms·
> A better solution is just to write a plain ass shell script that tests if various C snippets compile. Then standardize those scripts and share them so others
by Gormo 3y ago
> A better solution is just to write a plain ass shell script that tests if various C snippets compile.
Then standardize those scripts and share them so others can benefit from code reuse.
Then build a configuration tool to make it easy for everyone to define collections of tests applicable to their software.
Then create a meta-level scripting system so all of the above can be integrated into the software build process.
Then complain about how confusing and complicated the whole thing has become and start over from the beginning again.
- chubot 3y agoIf you redid all that work, and managed to avoid m4, it would still be a win! I believe m4 was used because some Unix shells at the time did not have functions. All shells have functions now -- it's in POSIX. If you have shell functions, then you can have modularity without concatenating blocks of code. You can make a library of functions, and then allow people to reuse them. It could just be source lib_configure.sh detect_foo detect_bar etc. POSIX shell can do everything that m4 can, and it's MORE deployed, not less. (Related: some people missed that m4 never runs on the end user machine which compiles the source code -- only on the machine that makes the tarball from the repo.)