<?xml version="1.0"?>
<rss version="2.0"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:dcterms="http://purl.org/dc/terms/"
     xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Tyler Cipriani: pages tagged gnu</title>
<link>https://tylercipriani.com/tags/gnu/</link>
<atom:link href="https://tylercipriani.com/tags/gnu/index.rss" rel="self" type="application/rss+xml"/>

<description>Tyler Cipriani</description>
<generator>ikiwiki</generator>
<pubDate>Tue, 14 Feb 2017 15:11:05 +0000</pubDate>
<item>
	<title>GNU Autotools</title>

	<guid isPermaLink="false">https://tylercipriani.com/blog/2016/05/25/gnu-autotools/</guid>

	<link>https://tylercipriani.com/blog/2016/05/25/gnu-autotools/</link>

	<dc:creator>Tyler Cipriani</dc:creator>



	<category>computing</category>

	<category>gnu</category>

	<category>notes</category>


	<pubDate>Wed, 25 May 2016 14:22:03 +0000</pubDate>
	<dcterms:modified>2017-02-14T15:11:05Z</dcterms:modified>


	<description>&lt;section id=&quot;links&quot; class=&quot;level2&quot;&gt;
&lt;h2&gt;Links &lt;a href=&quot;https://tylercipriani.com/tags/gnu/#links&quot;&gt;¶&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://robots.thoughtbot.com/the-magic-behind-configure-make-make-install&quot;&gt;https://robots.thoughtbot.com/the-magic-behind-configure-make-make-install&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;section id=&quot;configure.ac&quot; class=&quot;level2&quot;&gt;
&lt;h2&gt;&lt;code&gt;configure.ac&lt;/code&gt; &lt;a href=&quot;https://tylercipriani.com/tags/gnu/#configure.ac&quot;&gt;¶&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Written in m4sh (m4 + shell)&lt;/li&gt;
&lt;li&gt;Program initialization: &lt;code&gt;AC_INIT&lt;/code&gt; macro—needs name, version, maintainer&lt;/li&gt;
&lt;li&gt;Initialize automake: &lt;code&gt;AM_INIT_AUTOMAKE&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Make sure that C-compiler exists: &lt;code&gt;AC_PROG_CC&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Build &lt;code&gt;Makefile&lt;/code&gt; from &lt;code&gt;Makefile.in&lt;/code&gt;, replaces &lt;code&gt;@PACKAGE_VERSION@&lt;/code&gt;-type variables: &lt;code&gt;AC_CONFIG_FILES([Makefile])&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Output the script: &lt;code&gt;AC_OUTPUT&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;sourceCode&quot; id=&quot;cb1&quot;&gt;&lt;pre class=&quot;sourceCode makefile&quot;&gt;&lt;code class=&quot;sourceCode makefile&quot;&gt;&lt;a class=&quot;sourceLine&quot; id=&quot;cb1-1&quot; title=&quot;1&quot;&gt;AC_INIT([hello-world], [0.1], [tyler@tylercipriani.com])&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb1-2&quot; title=&quot;2&quot;&gt;&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb1-3&quot; title=&quot;3&quot;&gt;&lt;span class=&quot;co&quot;&gt;# Initialize automake&lt;/span&gt;&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb1-4&quot; title=&quot;4&quot;&gt;AM_INIT_AUTOMAKE&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb1-5&quot; title=&quot;5&quot;&gt;&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb1-6&quot; title=&quot;6&quot;&gt;&lt;span class=&quot;co&quot;&gt;# Ensure C-compiler exists&lt;/span&gt;&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb1-7&quot; title=&quot;7&quot;&gt;AC_PROG_CC&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb1-8&quot; title=&quot;8&quot;&gt;&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb1-9&quot; title=&quot;9&quot;&gt;&lt;span class=&quot;co&quot;&gt;# Specify what files are to be created&lt;/span&gt;&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb1-10&quot; title=&quot;10&quot;&gt;AC_CONFIG_FILES([Makefile])&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb1-11&quot; title=&quot;11&quot;&gt;AC_OUTPUT&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id=&quot;makefile.am&quot; class=&quot;level2&quot;&gt;
&lt;h2&gt;&lt;code&gt;Makefile.am&lt;/code&gt; &lt;a href=&quot;https://tylercipriani.com/tags/gnu/#makefile.am&quot;&gt;¶&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;./configure&lt;/code&gt; script (created by &lt;code&gt;configure.ac&lt;/code&gt;), expects to find &lt;code&gt;Makefile.in&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Makefile.in&lt;/code&gt; is long and dumb (just like &lt;code&gt;./configure&lt;/code&gt;), so we make a &lt;code&gt;Makefile.am&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;automake&lt;/code&gt; generates &lt;code&gt;Makefile.in&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;foreign&lt;/code&gt; AUTOMAKE&lt;sub&gt;OPTIONS&lt;/sub&gt; tells that the layout is &quot;non standard&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;sourceCode&quot; id=&quot;cb2&quot;&gt;&lt;pre class=&quot;sourceCode makefile&quot;&gt;&lt;code class=&quot;sourceCode makefile&quot;&gt;&lt;a class=&quot;sourceLine&quot; id=&quot;cb2-1&quot; title=&quot;1&quot;&gt;&lt;span class=&quot;dt&quot;&gt;AUTOMAKE_OPTIONS &lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st&quot;&gt; foreign&lt;/span&gt;&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb2-2&quot; title=&quot;2&quot;&gt;&lt;span class=&quot;dt&quot;&gt;bin_PROGRAMS &lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st&quot;&gt; hello-world&lt;/span&gt;&lt;/a&gt;
&lt;a class=&quot;sourceLine&quot; id=&quot;cb2-3&quot; title=&quot;3&quot;&gt;&lt;span class=&quot;dt&quot;&gt;hello-world_SOURCES &lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st&quot;&gt; hello-world.c&lt;/span&gt;&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id=&quot;put-it-all-together&quot; class=&quot;level2&quot;&gt;
&lt;h2&gt;Put it all together: &lt;a href=&quot;https://tylercipriani.com/tags/gnu/#put-it-all-together&quot;&gt;¶&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;create m4 environment: &lt;code&gt;aclocal&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;autoconf&lt;/code&gt; does: &lt;code&gt;configure.ac&lt;/code&gt; → &lt;code&gt;configure&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;automake --add-missing&lt;/code&gt; does: &lt;code&gt;Makefile.am&lt;/code&gt; → &lt;code&gt;Makefile.in&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;autoreconf --install&lt;/code&gt;: autoreconf runs autoconf, autoheader, aclocal, automake, libtoolize, and autopoint&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</description>


	<comments>//tylercipriani.com/blog/2016/05/25/gnu-autotools/#comments</comments>

</item>

</channel>
</rss>
