Sophie

Sophie

distrib > Mandriva > 2010.0 > x86_64 > by-pkgid > a6d417e36f6bb1154f4c003e6717e298 > files > 150

a-a-p-1.090-2mdv2009.0.noarch.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 23. Automatic Configuration</title><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"><link rel="start" href="index.html" title="A-A-P Recipe Executive"><link rel="up" href="user.html" title="Part II. User Manual"><link rel="prev" href="user-porting.html" title="Chapter 22. Porting an Application"><link rel="next" href="user-autoconf.html" title="Chapter 24. Using Autoconf"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table width="100%" id="navtable"><tbody><tr><td align="left" class="left" width="33%"><b><a href="http://www.a-a-p.org">A-A-P home page</a></b></td><td align="center" class="center" width="34%"><b><a href="index.html">A-A-P Recipe Executive</a></b></td><td align="right" class="right" width="33%"></td></tr><tr><td align="left" class="left"><a accesskey="p" href="user-porting.html">Prev</a></td><td align="center" class="center">User Manual</td><td align="right" class="right"><a accesskey="n" href="user-autoconf.html">Next</a></td></tr></tbody></table><hr><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="user-configure"></a>Chapter 23. Automatic Configuration</h2></div></div></div><p>
  The <a href="ref-commands.html#cmd-conf">:conf</a> command is used to discover
  properties of the compiler and the system.  With this information a program
  can be compiled to work on many different systems without the user to
  manually specify the properties.
  For Unix systems an alternative is using Autoconf, see
  <a href="user-autoconf.html" title="Chapter 24. Using Autoconf">Chapter 24, <i>Using Autoconf</i></a>.
</p><p>
  TODO  The ":conf" command is still under development.
</p><pre class="programlisting">

  :conf init        Clean the configuration environment.  Only needed when
                    configure checks were done before.

  :conf language lang
                    Use "lang" as the language for tests that do not have a
                    {language} attribute.
                    Only "C" and "C++" are currently supported. "C" is the
                    default.
                    A test will be done if the compiler for the language
                    works.  If not all tests for the language will fail.
                    Example:
                           :conf language C++

  :conf header [mainoptions] headername [itemoptions] ...
                    Check for C or C++ header file(s) "headername".
                    Uses current value of INCLUDE.
                    Defines HAVE_headername if "headername" is available.
                    mainoptions:
                        oneof        first of the items that works is used, at
                                     least one is required
                        required     all items are required to exist
                    itemoptions:
                        header       text included in the test program
                        language     C or C++
                    Examples:
                        :conf header X11/Shell.h
                        :conf header {oneof} sys/time.h times.h

  :conf function [mainoptions] functionname [itemoptions] ...
                    Check for C or C++ function(s) "functionname".
                    Uses the current value of $LIBS.
                    Defines HAVE_functionname if "functionname" is available.
                    Options: see ":conf header"
                    Example:
                        :conf function bcopy

  :conf type [mainoptions] typename [itemoptions] ...
                    Check for C or C++ type(s) "typename".
                    Uses the current value of $LIBS.
                    Defines HAVE_typename if type "typename" is available.
                    Options: see ":conf header".
                    Additional itemoption:
                        fallback     type definition to use for the type when
                                     it is not available
                    Example:
                           :conf type size_t {fallback = unsigned long}

  :conf lib [mainoptions] libname,funcname [itemoptions] ...
                    Check for library/libraries by testing if "funcname"
                    exists when using the "libname" library.
                    Uses the current value of $LIBS and appends "-llibname"
                    if the test succeeds.  Also appends to $_conf.LIBS.
                    Defines HAVE_libname if library "libname" is available.
                    Options: see ":conf header".
                    Example:
                           :conf lib iconv,iconv_open

  :conf write header filename
                    Write the HAVE_ and other symbols collected so far into
                    "filename".
                    Example:
                           :conf write header $BDIR/config.h

  :conf write recipe filename
                    Write the settings in the _conf scope into "filename".
                    Example:
                           :conf write recipe $BDIR/config.aap


The _conf scope stores variables set by configure tests.  For example,
$_conf.LIBS the libraries that ":conf lib" found.  The _conf scope is used in
the tree of scopes just before the toplevel scope, after all callstack and
recipe tree scopes.

Special characters in header, function and type names are changed to an
underscore before defining the HAVE_ symbol.  Lowercase characters are changed
to uppercase.

The preprocessor symbols that are gathered from the tests are available in
the $_conf.have dictionary.  Example:
  	:conf header sys/time.h
	@if _conf.have["HAVE_SYS_TIME_H"]:
	   :print we have time
	@else:
	   :print sorry, no time.

":conf write recipe" writes the variables in the _conf scope.  You can remove
variables you do not want to be written.  Example:
  	saveLIBS = $?_conf.LIBS
	_conf.LIBS =
	:conf lib foo,foobar
	_conf.FOOLIB = $_conf.LIBS
	_conf.LIBS = $saveLIBS

</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="user-porting.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="user.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="user-autoconf.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 22. Porting an Application </td><td width="20%" align="center"><a accesskey="h" href="index.html">
		    Contents</a></td><td width="40%" align="right" valign="top"> Chapter 24. Using Autoconf</td></tr></table></div></body></html>