<?xml version="1.0" encoding="utf-8"?>

<feed xmlns="http://www.w3.org/2005/Atom">
<title>Tyler Cipriani: pages tagged gnu</title>
<link href="https://tylercipriani.com/tags/gnu/"/>
<link href="https://tylercipriani.com/tags/gnu/index.atom" rel="self" type="application/atom+xml"/>
<author>

<name>Tyler Cipriani</name>

</author>




<id>https://tylercipriani.com/tags/gnu/</id>

<subtitle type="html">Tyler Cipriani</subtitle>
<generator uri="http://ikiwiki.info/">ikiwiki</generator>
<updated>2017-02-14T15:11:05Z</updated>
<entry>
	<title>GNU Autotools</title>

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

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

	<author><name>Tyler Cipriani</name></author>


	<rights type="html" xml:lang="en">

		Creative Commons Attribution-ShareAlike License
		Copyright © 2017 Tyler Cipriani

	</rights>



	<category term="computing" />

	<category term="gnu" />

	<category term="notes" />


	<updated>2017-02-14T15:11:05Z</updated>
	<published>2016-05-25T14:22:03Z</published>


	<content type="html" xml:lang="en">
	&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;

	</content>


	<link rel="comments" href="//tylercipriani.com/blog/2016/05/25/gnu-autotools/#comments" type="text/html" />


	<link rel="comments" href="//tylercipriani.com/blog/2016/05/25/gnu-autotools/comments.atom" type="application/atom+xml" />

</entry>

</feed>
