How to generate files ~~~~~~~~~~~~~~~~~~~~~ The output of a ./concigure process is most often a bunch of autogenerated files: typically a config.h and a few Makefiles. However, scconfig is just plain C, so hooks.c is free to do anything else. Option #1: use the builtin template generator language, tmpasm: 1. Enable tmpasm in the Makefile (make sure the following line is not commented: include $(SRC)/tmpasm/Makefile.plugin) 2. In your hooks.c, from hook_generate(), call the template engine: tmpasm("..", "config.h.in", "config.h") The first argument is "where to cd" before doing the generation; the second is the input file and the third is the output file (both relative to the new CWD). The function returns non-zero on failure. 3. Write the input file; for the syntax see trunk/doc/tmpasm.txt and the tutorials in src/tmpasm/regression/Tutor*.gasm Option #2: custom C code Write custom C code in hook_generat() in your hooks.c that creates the output files, using whatever method you see fit, e.g. plain fopen() and fprintf() or even system() or popen() on external scripts written in e.g. awk. (Executing external programs is less preferred as that would introduce dependency on them, e.g. if you want to generate your Makefile with a python script, ./configure will fail on hosts without python even tho scconfig worked perfectly. A true self-contained solution depends only on C).