%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% This default.mgp is "TrueType fonts" oriented. %% First, you should create "~/.mgprc" whose contents are: %% tfdir "/path/to/truetype/fonts" %% %% To visualize English, install "times.ttf", "arial.ttf", and "cour.ttf" %% into the "tfdir" directory above: %% http://microsoft.com/typography/fontpack/default.htm %% %% To visualize Japanese, install "MSMINCHO.ttf" and %% "watanabenabe-mincho.ttf" into the "tfdir" directory above: %% http://www.mew.org/mgp/xtt-fonts_0.19981020-3.tar.gz %% %deffont "standard" xfont "helvetica-medium-r", tfont "standard.ttf", tmfont "hoso6.ttf" %deffont "thick" xfont "helvetica-bold-r", tfont "thick.ttf", tmfont "hoso6.ttf" %deffont "typewriter" xfont "courier-medium-r", tfont "typewriter.ttf", tmfont "hoso6.ttf" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Default settings per each line numbers. %% %default 1 area 90 90, leftfill, size 2, fore "gray20", back "white", font "standard", hgap 0 %default 2 size 7, vgap 10, prefix " ", ccolor "black" %default 3 size 2, bar "gray70", vgap 10 %default 4 size 5, fore "gray20", vgap 30, prefix " ", font "standard" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Default settings that are applied to TAB-indented lines. %% %tab 1 size 5, vgap 40, prefix " ", icon box "green" 50 %tab 2 size 4, vgap 40, prefix " ", icon arc "yellow" 50 %tab 3 size 3, vgap 40, prefix " ", icon delta3 "white" 40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page %nodefault %size 6.5, font "standard", back "white", ccolor "black" %center, fore "Blue", font "standard", size 10 GNU Autotools %bar "skyblue" 6 15 70 %font "standard", hgap 0 %size 5, fore "darkblue" James Youngman %size 3 $Id: autoconf.mgp,v 1.3 2002/07/19 21:55:46 james Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page %center In the beginning... %pause THERE WAS NO LINUX %pause There was only one version of Unix %pause Then there were two... %pause Now there are dozens... %pause %SIZE 10, fore "red" %font "thick" They're all different! %font "standard", size 5, fore "black" Building portable software becomes a problem. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Life is hard (1) Life is hard for the author of the code The many versions of Unix all have various features. A non-trivial program is likely to be affected by many of the differences between versions of Unix. #ifdef VAX/#ifdef USG - a rat's nest! Too many permutations and combinations Unix Versions * Features in each = Large number! Even simple programs are affected - cc flags, ranlib etc. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Life is hard (2) Life is hard for the user of the code Non-trivial software always needed to be hacked before compilation Un-commenting bits of Makefile usually sufficed... ...but only for smaller programs. ...and making this as easy as possible was more difficult for the author(s) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page This is annoying! Solutions:- Integrate Everything BSD Manual README/INSTALL Inconvenient Automatic imake xmkmf Configure, Metaconfig Perl Elm The inevitable manual interaction is also tedious %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Imake Template-based Configuration files "This is where XXX lives on this kind of system" Pre-determined answer What about new questions? Who makes the templates? Good for some X programs But in general unsatisfactory. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Configure scripts produced by "Metaconfig" Perl Large shell script which figures things out for itself Very clever Very hard to maintain Lowest common denominator /bin/sh is very low - no functions! Still has to ask - and if it doesn't know the answer, will you? "What type of mailbox locking is in use in your system?" Still requires manual interaction Go for a cup of coffe - only to find a question Testing is a problem %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Automating it all Goals Make life simple for the maintainer Make life simple for the person compiling the code Cope with lowest-common-denominator shells Usually, no manual intervention ("--with-foo") Separate the tools the end-user needs from those the developer needs End-user should need only /bin/sh, make and a compiler Sounds difficult %pause The solution is to divide and conquer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page How Autoconf does it Goal-oriented The coder uses a macro which specifies or abstracts ONE property of the CURRENT system Rather than indicate a feature is not there - provide it (e.g. WEXITSTATUS, LIBOBJS) Each macro is associated with a shell script fragment which discovers the appropriate fact The whole lot is brought together with a config file which drives the process - configure.in File substitution (blurfl.h.in -> blurfl.h with @foo@ substituted) No attempt is made to grok the system in fullness %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Benefits Complexity of coders task proportional only to the total number of features out there The number of versions of Unix is irrelevant No combinatorial problems Items can depend on each other To find out if a library function is provided... First figure out how to drive the compiler and linker Then try to link a test program Someone else writes the macros Drawback m4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Outline of operation Disclaimer configure.in is now configure.ac and so on... autoreconf exists configure.ac - (notionally) calls macros to find things out Genereate "configure" script from "configure.in" using "autoconf" Running the "configure" script produces config.h from config.h.in Makefile from Makefile.in ...and so on Running "configure" also caches results in "config.cache". %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Specific example macros explained AC_INIT AC_PROG_{CC,CPP,RANLIB} AC_PATH_PROG AC_CHECK_HEADERS (produces HAVE_FOO_H) AC_TYPE_UID_T AC_TRY_COMPILE AC_CHECK_FUNCS / AC_REPLACE_FNCS AC_CONFIG_SUBDIRS AC_OUTPUT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Automake ...is quite a bit simpler to understand. Overrides some Autoconf macros Produces Makefile.in from Makefile.am (before the release is made) Allows some "hook" targets Makefile.am is much shorter (4K vs. 29K) Automatic dependencies! Makefile.am is very simple %size 4 my_PROGRAMS = foo common_sources = glorp.c foo_SOURCES = wigwam.c blarf.c $(common_sources) bar_SOURCES = quux.c fnord.c $(common_sources) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Further Information The Autoconf and Automake manuals are good See the source code to GNU "hello" for a small example Many built-in macros documented in Autoconf manual GNU Libtool "The Goat Book" home page, Autoconf Macro Archive,