Adding Some Real Functionality

I've suggested before that you should call config.status in your makefiles to generate those makefiles from templates. Example 3-4 shows the code in configure.ac that actually makes this happen. It's just a single additional macro call between the two original lines of Example 3-1.

Example 3-4. configure.ac: Using the AC_CONFIG_FILES macro

AC_INIT([Jupiter],[1.0])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT

This code assumes that templates exist for Makefile and src/Makefile, called Makefile.in and src/Makefile.in, respectively. These template files look exactly like their Makefile counterparts, with one exception: Any text that I want Autoconf to replace is marked as an Autoconf substitution variable, using ...

Get Autotools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.