% Configure -- an autoconfiguration script with 100% less GNU. % Jessica L. Parsons % Wed Jan 16 01:41:09 PST 2008 #Configure **Configure** is my own autoconfigure script for C programs, something like the [GNU autoconf](http://www.gnu.org/software/autoconf/autoconf.html) program, except that it's * free, * written in bourne shell (with functions; the old v7 shells won't work), * doesn't use config.cache files, * doesn't require that you install a huge GNU toolchain to do anything with it. **Configure** is not nearly as complete as autoconf, because I'm only adding things to it as I need them. Currently, configure is used in most of the code I write (and it's been shoehorned into my copies of [libgd](https://github.com/Orc/libgd) and [dropbear](https://github.com/Orc/dropbear)) because it's being built for macos-current, ~~~RHEL~~~Centos-current, and FreeBSD 4.1 (if I set up a VM for Mastodon Linux, I will fire up an ancient pell image and try building for SLS Linux as well.) [Levee](/~orc/Code/levee), [Magicfilter][], [ndialog](/~orc/Code/ndialog), [xrpm](/~orc/Code/xrpm), [Postoffice](/~orc/Code/postoffice), [cwatch](/~orc/Code/cwatch), [markdown](/~orc/Code/markdown), and [annotations](/~orc/Code/annotations) end up using most of the features in configure, and I tend to test new features out in one of those projects and then pull it back into the baseline before spinning it out everywhere else to see if it makes other code fail. ##Source Code## * [v0.62](configure-0.62.tar.gz) -- after a decade for the code to mature -- is a rollup release for 10 years of incremental changes to the autoconfiguration process as modern Unices gaze more deeply into their own navels. Documentation is being worked on, but it is not finished so you're stuck with looking at the `configure.sh` examples in the code listed above. * [v0.59](configure-0.59.tar.gz), is, as you can probably guess, a rollup of a bunch of tiny feature-ettes. It contains: 1. More support for `--srcdir`. 2. When configure.sh is run, it creates a `config.md` script that is used to create directory trees in a hopefully portable manner. 3. Add the **`AC_SCALAR_TYPES`** function, which creates types for 32 (DWORD), 16(WORD), and 8(BYTE) bit scalars. 4. Add the prefix **`AC_QUIET`**, which makes a detect function run without any output. 5. Add the **`AC_CHECK_STRUCT`** function, which checks for the existance of a structure. 6. Add the **`AC_PROG_AWK`** function, which checks for the existance of `awk`. 7. Add the **`AC_INCLUDE`** function, which adds a `#include` to `config.h`. 8. Add the **`AC_CHECK_RESOLVER`** function, which looks for a bind4 compatable version of the Berkeley resolver library. * [v0.53](configure-0.53.tar.gz) starts adding configure-side support for `--srcdir` (installing a package in one directory and building it in a different directory.) This isn't documented yet (because it's actually fairly complicated, and hasn't been tested anywhere except [Linux](http://www.kernel.org) and [FreeBSD](http://www.freebsd.org), but it roughly works as follows; in your Makefile.in's, you set **`VPATH = @srcdir@`**, define your own makefile rules so that **`.c.o:`** puts `.o` files out in the current directory (Berkeley make does this automatically, GNU make does not), modify your compilation rules so they include things from `@srcdir@/{place}` instead of simple `{place}`, and finally when you publish a release of your software, running `joincfg.sh` to collapse `configure.inc` and `configure.sh` together. (the [magicfilter][] package does this from version 2.2.i onwards.) * [v0.51](configure-0.51.tar.gz) defines a **`OS_`** variable in `config.h` and `configure.sh`, and defines the substitions **`@CONFIGURE_FILES@`** (the files created by `configure.sh`) and **`@GENERATED_FILES@`** (the files generated from `.in` files during `AC_OUTPUT`.) * [v0.4](configure-0.4.tar.gz) fixes a little bug in the generation of the `config.cmd` file; **`CC`** and **`CFLAGS`** were not being quoted properly on some platforms. * [v0.3](configure-0.3.tar.gz) has a few changes in [`configure.inc`](configure-current/configure.inc) that make it work on [Solaris](http://www.sun.com/solaris) and [SLS Linux](http://en.wikipedia.org/wiki/Softlanding_Linux_System). I've also added an `install_manpages` script that can be used to do what you'd expect it to do. * [v0.2](configure-0.2.tar.gz) has more detail in the `HOWTO` and some tweaks to make it work better on [Irix](http://www.sgi.com/products/software/irix/) machines. * [v0.1](configure-0.1.tar.gz) has a minimal testsuite, a small samples directory, and the beginnings of a `HOWTO` file to tell you how it's done. [magicfilter]: /~orc/Code/magicfilter