<meta content="OpenOffice.org 2.0 (Linux)" name="GENERATOR" /><meta content="20061221;23042300" name="CREATED" /><meta content="16010101;0" name="CHANGED" /><style type="text/css"> </style></p> <p>I wanted to mention a few words the Autoconf. Autoconf generates that wonderful configure script which tells you whether you have all the things required the application you’re trying to compile (or not). Configure scripts also build Makefiles out of either Makefile.in or Makefile.am files. This is great because it lets you compile projects differently for different systems (Oh, Lord how I dream of a world with real, transparent, and consistent platform independence but I digress).</p> <p>When the uninitiated (that’s me) start wanting to fool around with they notice two things:</p> <ol> <li>Configure.ac is weird… really weird.</li> <li>Makefile.in has these weird @things@ which seem to magically get replaced with stuff by (presumably configure) and boy wouldn’t it be great if I could do that.</li> </ol> <p>I faced three options on how to learn about autoconf: a) check if someone wrote info on how to do what I need to do online b) read the <a href='http://foobartastic.com/redirect.php?url=sources.redhat.com%2Fautobook%2F' rel="nofollow">book</a> (I’ll probably do that later) c) see if someone will tell me the little parts that I Need To Know and I’ll figure out the rest later.</p> <p>A stab at option a) taught me that the configure.ac file is made of up <a href='http://foobartastic.com/redirect.php?url=en.wikipedia.org%2Fwiki%2FGNU_m4' rel="nofollow">macros</a>, which is a part of why it’s so weird. However I couldn’t find a place that would tell me only what I needed to know to modify an existing configure.ac. So I switched paths.<br /> Following option c) I chatted with <a href='http://foobartastic.com/redirect.php?url=quotes.burntelectrons.org%2Fsearch%3Fquery%3Dluser' rel="nofollow">Luser</a> of the <a href='http://foobartastic.com/redirect.php?url=irc.mozilla.org' rel="nofollow">wonderful mozilla irc community</a> who told me how to make more of those magical @things@. After learning that I figured out two more useful things. making a total of Three Things You Need To Know To Modify configure.ac Files:</p> <ol> <li>Use the AC_SUBST(var) macro to make more of those magical @things@ in a Makefile.in. What happens is that the name of the variable you put in to the macro (e.g. foo) is will create a magical @thing@ (e.g. @foo@). The vaule of foo during the running of ./configure will determine the value with which @foo@ will be replaces. Note: is like a preprocessor replacing #define’s so no changing the value of @foo@ when your Makefile runs. That’s why most Makefiles assign @constant@ values to variables at the beginning of the scripts.</li> <li>You may want to inform the user of what you’re checking for, to do this use the AC_MSG_CHECKING([what I’m checking for]) macro. The message, in square brackets not quotes, is what’ll appear to the user (you know that load of “Checking for foo…” lines? That’s how they show up. For an explanation of why square brackets not quotes please check <a href='http://foobartastic.com/redirect.php?url=sources.redhat.com%2Fautobook%2F' rel="nofollow">The Goat/Autoconf Book</a> as I no intention of investigating right now</li> <li>To report results of something you’ve checked for use the AC_MSG_RESULT($var) macro. Where the $var is the var is the variable holding the result which you wish to let the user know about and $var is the result itself.</li> </ol> <p>Finally, remember to run autoconf (no arguments) to generate a configure script from the configure.ac script. Good luck! </p> </div> <span class="clear"> </span> <div class="itemFooter"> <span> 21. December 2006, 20:07 o'clock </span> </div> <div class="commentFooter"> <div class="leftFloat"><a href="http://www.foobartastic.com/category/posts/" title="View all posts in Posts" rel="category tag">Posts</a>, <a href="http://www.foobartastic.com/category/nix/" title="View all posts in *nix" rel="category tag">*nix</a>, <a href="http://www.foobartastic.com/category/distcc/" title="View all posts in distcc" rel="category tag">distcc</a></div> <div class="rightFloat"> </div> </div> <div class="comments"> <p> <a href="http://foobartastic.com/2006/12/21/autoconf-and-makefiles/">Add your own comment</a> or <a href="http://www.foobartastic.com/2006/12/21/autoconf-and-makefiles/trackback/" rel="trackback">set a trackback</a> </p> <h1 id="comments">Currently <span id="cCount">no</span> comments </h1> <div id="theComments"> <ol id="commentlist"> <li id="nocommentyet"><p class="leavecomment">No comment yet</p></li> </ol> </div> <div id="loading" style="display: none;"> <p>Saving your comment now<br /> Please wait</p> </div> <div id="error" style="display: none"> <p>An error occured while saving your comment!</p> </div> <div id="commentbody"> <h1 id="respond">Add your own comment</h1> <form id="commentform" action="http://www.foobartastic.com/wp-comments-post.php" method="post" onsubmit="postAjaxComment(this,'http://www.foobartastic.com/wp-content/themes/wp-binary-blue-101/comments-ajax.php',43,'paged',cCount,'10'); return false;"> <div id="authorinfo"> <p><input class="formular" type="text" name="author" id="author" value="" size="22" tabindex="1" /> <label for="author"><small>Name </small></label></p> <p><input class="formular" type="text" name="email" id="email" value="" size="22" tabindex="2" /> <label for="email"><small>Mail (won't be visible) </small></label></p> <p><input class="formular" type="text" name="url" id="url" value="" size="22" tabindex="3" /> <label for="url"><small>Website</small></label></p> </div> <p><textarea class="formular" name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p> <p> <input class="formular" name="submit" type="submit" id="submit" tabindex="5" value="Post comment" /> <input type="hidden" name="comment_post_ID" value="43" /> </p> </form> </div> <br /><br /> <p><a href='http://www.foobartastic.com/2006/12/21/autoconf-and-makefiles/feed/'>Follow comments according to this article through a RSS 2.0 feed</a></p> </div> </div> <div class="clear"></div> <hr class="hidden" /> <div class="navigation"> <div class="alignleft">« <a href="http://www.foobartastic.com/2006/11/26/software-developers/">Software Developers</a></div> <div class="alignright"><a href="http://www.foobartastic.com/2006/12/23/a-new-look-with-binary-blue/">A New Look With Binary Blue</a> »</div>   </div> </div> <div id="margin"> <hr class="hidden" /> <p class="hidden">Schnellnavigation: <a href="http://foobartastic.com/2006/12/21/autoconf-and-makefiles/">Jump to start of page</a> | <a href="http://foobartastic.com/2006/12/21/autoconf-and-makefiles/">Jump to posts</a> | <a href="http://foobartastic.com/2006/12/21/autoconf-and-makefiles/">Jump to navigation</a></p> <hr class="hidden" /> <a name="sidebar" href="http://foobartastic.com/2006/12/21/autoconf-and-makefiles/"></a> <div id="syndication" class="rubrik"> <h1>Syndication</h1> <ul id="syndicationlist"> <li> <img src="http://www.foobartastic.com/wp-content/themes/wp-binary-blue-101/images/xml.gif" width="26" height="10" alt="RDF feed in XML file format" title="RDF feed in XML file format" /> <strong>RDF:</strong> <a href="http://www.foobartastic.com/feed/rss/" title="RDF-Feed">Articles</a> </li> <li> <img src="http://www.foobartastic.com/wp-content/themes/wp-binary-blue-101/images/xml.gif" width="26" height="10" alt="RSS2 feed in XML file format" title="RSS2 feed in XML file format" /> <strong>RSS2:</strong> <a href="http://www.foobartastic.com/feed/" title="RSS2.0-Feed">Articles</a> </li> <li> <img src="http://www.foobartastic.com/wp-content/themes/wp-binary-blue-101/images/xml.gif" width="26" height="10" alt="ATOM feed in XML file format" title="ATOM feed in XML file format" /> <strong>ATOM:</strong> <a href="http://www.foobartastic.com/feed/atom/" title="Atom-Feed">Articles</a> </li> </ul> </div> <div id="archives" class="rubrik"> <h1><a href='http://foobartastic.com/redirect.php?url=javascript%3AToggleArchives%28%29' title="click here to open/close the archives box" rel="nofollow">Archives</a></h1> <ul id="archiveList"> <li><a href='http://www.foobartastic.com/2006/12/' title='December 2006'>December 2006</a></li> <li><a href='http://www.foobartastic.com/2006/11/' title='November 2006'>November 2006</a></li> <li><a href='http://www.foobartastic.com/2006/10/' title='October 2006'>October 2006</a></li> <li><a href='http://www.foobartastic.com/2006/09/' title='September 2006'>September 2006</a></li> <li><a href='http://www.foobartastic.com/2006/08/' title='August 2006'>August 2006</a></li> <li><a href='http://www.foobartastic.com/2006/06/' title='June 2006'>June 2006</a></li> <li><a href='http://www.foobartastic.com/2006/05/' title='May 2006'>May 2006</a></li> <li><a href='http://www.foobartastic.com/2006/03/' title='March 2006'>March 2006</a></li> <li><a href='http://www.foobartastic.com/2006/02/' title='February 2006'>February 2006</a></li> <li><a href='http://www.foobartastic.com/2006/01/' title='January 2006'>January 2006</a></li> </ul> </div> <div id="categories" class="rubrik"> <h1><a href='http://foobartastic.com/redirect.php?url=javascript%3AToggleCategories%28%29' title="click here to open/close the category box" rel="nofollow">Categories</a></h1> <ul id="categoryList"> <li><a href="http://www.foobartastic.com/category/nix/" title="View all posts filed under *nix">*nix</a> (6) </li> <li><a href="http://www.foobartastic.com/category/db/" title="View all posts filed under DB">DB</a> (2) </li> <li><a href="http://www.foobartastic.com/category/distcc/" title="View all posts filed under distcc">distcc</a> (9) </li> <li><a href="http://www.foobartastic.com/category/java/" title="View all posts filed under Java">Java</a> (2) </li> <li><a href="http://www.foobartastic.com/category/joomla/" title="View all posts filed under Joomla">Joomla</a> (1) </li> <li><a href="http://www.foobartastic.com/category/mozilla/" title="View all posts filed under Mozilla">Mozilla</a> (7) </li> <li><a href="http://www.foobartastic.com/category/personal/" title="View all posts filed under Personal">Personal</a> (1) </li> <li><a href="http://www.foobartastic.com/category/posts/" title="View all posts filed under Posts">Posts</a> (32) </li> <li><a href="http://www.foobartastic.com/category/projects/" title="View all posts filed under Projects">Projects</a> (5) </li> <li><a href="http://www.foobartastic.com/category/site-maintenance/" title="View all posts filed under Site Maintenance">Site Maintenance</a> (1) </li> <li><a href="http://www.foobartastic.com/category/testing/" title="View all posts filed under Testing">Testing</a> (2) </li> <li><a href="http://www.foobartastic.com/category/ubuntu/" title="View all posts filed under Ubuntu">Ubuntu</a> (1) </li> <li><a href="http://www.foobartastic.com/category/web-dev/" title="Anything to do with web development">Web Dev</a> (8) </li> </ul> </div> <div id="calendar" class="calendar"> <table id="wp-calendar"> <caption>December 2006</caption> <thead> <tr> <th abbr="Monday" scope="col" title="Monday">M</th> <th abbr="Tuesday" scope="col" title="Tuesday">T</th> <th abbr="Wednesday" scope="col" title="Wednesday">W</th> <th abbr="Thursday" scope="col" title="Thursday">T</th> <th abbr="Friday" scope="col" title="Friday">F</th> <th abbr="Saturday" scope="col" title="Saturday">S</th> <th abbr="Sunday" scope="col" title="Sunday">S</th> </tr> </thead> <tfoot> <tr> <td abbr="November" colspan="3" id="prev"><a href="http://www.foobartastic.com/2006/11/" title="View posts for November 2006">« Nov</a></td> <td class="pad"> </td> <td colspan="3" id="next" class="pad"> </td> </tr> </tfoot> <tbody> <tr> <td colspan="4" class="pad"> </td><td>1</td><td>2</td><td>3</td> </tr> <tr> <td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td> </tr> <tr> <td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td> </tr> <tr> <td>18</td><td>19</td><td>20</td><td><a href="http://www.foobartastic.com/2006/12/21/" title="Autoconf and Makefiles">21</a></td><td>22</td><td><a href="http://www.foobartastic.com/2006/12/23/" title="A New Look With Binary Blue">23</a></td><td>24</td> </tr> <tr> <td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td><td>31</td> </tr> </tbody> </table> </div> <div id="searchBox" class="rubrik"> <h1>Search</h1> <div class="livesearchform"> <form onsubmit="return liveSearchSubmit()" id="searchform" name="searchform" method="get" action="/index.php"> <fieldset><legend class="hidden"><strong>search in archive</strong></legend> <p> <input type="text" id="livesearch" accesskey="s" name="s" value="Search" onkeypress="liveSearchStart()" onblur="setTimeout('closeResults()',2000); if (this.value == '') {this.value = 'Search';}" onfocus="if (this.value == 'Search') {this.value = '';}" /> <input type="submit" id="searchsubmit" style="display: none;" value="Search" /> </p> </fieldset> <div id="LSResult" style="display: none;"><div id="LSShadow"></div></div> </form> </div> </div> <hr class="hidden" /> </div>   </div> <hr class="hidden" /> <p class="hidden">Schnellnavigation: <a href="http://foobartastic.com/2006/12/21/autoconf-and-makefiles/">Jump to start of page</a> | <a href="http://foobartastic.com/2006/12/21/autoconf-and-makefiles/">Jump to posts</a> | <a href="http://foobartastic.com/2006/12/21/autoconf-and-makefiles/">Jump to navigation</a></p> <hr class="hidden" /> <div id="footer" class="center"> <p> <a href="http://foobartastic.com/">Foobartastic</a> is powered by <a href='http://foobartastic.com/redirect.php?url=wordpress.org' rel="nofollow">WordPress v2.0</a><br />and <a href='http://foobartastic.com/redirect.php?url=www.4null4.de%2Fwordpress-binary-blue-theme%2F' rel="nofollow">WP-Binary-Blue v1.0.1</a> (based on some code from <a href='http://foobartastic.com/redirect.php?url=getk2.com%2F' title="K2 Homepage" target="_blank" rel="nofollow">K2</a>) </p> </div> <div class="center"></div> </div> </div> </div> </div> <div class="hidden"> </div> </body> </html>