Check out my first novel, midnight's simulacra!

GNU Autotools: Difference between revisions

From dankwiki
(Created page with "Ick. ==Setting up autotools== <tt>[http://www.gnu.org/software/autoconf/manual/autoconf.html#autoreconf-Invocation autoreconf]</tt> can be used on initial setup, or after the...")
 
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:


==Setting up autotools==
==Setting up autotools==
<tt>[http://www.gnu.org/software/autoconf/manual/autoconf.html#autoreconf-Invocation autoreconf]</tt> can be used on initial setup, or after the autotools installation has been modified. Use <tt>-f</tt> to force refreshings, and <tt>-i</tt> to install missing files; <tt>autoreconf -fi</tt> is thus a useful recipe for source trees (distributing anything but autotools inputs, including <tt>configure</tt> scripts, makes assumptions regarding the host autotools installation).
<tt>[http://www.gnu.org/software/autoconf/manual/autoconf.html#autoreconf-Invocation autoreconf]</tt> can be used on initial setup, or after the autotools installation has been modified. Use <tt>-f</tt> to force refreshings, and <tt>-i</tt> to install missing files; <tt>autoreconf -fi</tt> is thus a useful recipe for source trees.
 
==Local macros==
Put them in <tt>acinclude.m4</tt>, *not* <tt>aclocal.m4</tt>. The latter is blown away by <tt>autoreconf</tt>. The former is properly included along with <tt>aclocal.m4</tt> (which ought be automatically generated by <tt>aclocal</tt>) by autotools.
 
Alternatively, you can use multiple files in a subdirectory, and then use <tt>AC_CONFIG_MACRO_DIR([dirname])</tt> (and <tt>ACLOCAL_AMFLAGS=-I dirname</tt> in <tt>Makefile.am</tt>).

Latest revision as of 00:44, 13 May 2024

Ick.

Setting up autotools

autoreconf can be used on initial setup, or after the autotools installation has been modified. Use -f to force refreshings, and -i to install missing files; autoreconf -fi is thus a useful recipe for source trees.

Local macros

Put them in acinclude.m4, *not* aclocal.m4. The latter is blown away by autoreconf. The former is properly included along with aclocal.m4 (which ought be automatically generated by aclocal) by autotools.

Alternatively, you can use multiple files in a subdirectory, and then use AC_CONFIG_MACRO_DIR([dirname]) (and ACLOCAL_AMFLAGS=-I dirname in Makefile.am).