Commit 4ee250b1 authored by florent's avatar florent
Browse files

Added a page briefly explaining autotools.

parent d35337f4
2008/02/17
8. Added a page briefly explaining autotools.
2008/02/07
7. Some packages have been added.
6. Documentation is not anymore produced by doxygen
......
......@@ -14,35 +14,35 @@ if PKG_CHECK_MODULES(KWSPLUS, kwsPlus); then
AC_SUBST(KWSPLUS_PREFIX)
fi
dnl if PKG_CHECK_MODULES(HPPMODEL, hppModel); then
dnl HPPMODEL_PREFIX=`$PKG_CONFIG hppModel --variable=prefix`
dnl AC_SUBST(HPPMODEL_PREFIX)
dnl fi
if PKG_CHECK_MODULES(HPPMODEL, hppModel); then
HPPMODEL_PREFIX=`$PKG_CONFIG hppModel --variable=prefix`
AC_SUBST(HPPMODEL_PREFIX)
fi
if PKG_CHECK_MODULES(HPPCORE, hppCore); then
HPPCORE_PREFIX=`$PKG_CONFIG hppCore --variable=prefix`
AC_SUBST(HPPCORE_PREFIX)
fi
dnl if PKG_CHECK_MODULES(WALKGENJRL, walkGenJrl); then
dnl WALKGENJRL_PREFIX=`$PKG_CONFIG walkGenJrl --variable=prefix`
dnl AC_SUBST(WALKGENJRL_PREFIX)
dnl fi
if PKG_CHECK_MODULES(WALKGENJRL, walkGenJrl); then
WALKGENJRL_PREFIX=`$PKG_CONFIG walkGenJrl --variable=prefix`
AC_SUBST(WALKGENJRL_PREFIX)
fi
if PKG_CHECK_MODULES(HPPCORBASERVER, hppCorbaServer); then
HPPCORBASERVER_PREFIX=`$PKG_CONFIG hppCorbaServer --variable=prefix`
AC_SUBST(HPPCORBASERVER_PREFIX)
fi
dnl dnl if PKG_CHECK_MODULES(HPPPYTHON, hppPython); then
dnl dnl HPPPYTHON_PREFIX=`$PKG_CONFIG hppPython --variable=prefix`
dnl dnl AC_SUBST(HPPPYTHON_PREFIX)
dnl dnl fi
if PKG_CHECK_MODULES(HPPPYTHON, hppPython); then
HPPPYTHON_PREFIX=`$PKG_CONFIG hppPython --variable=prefix`
AC_SUBST(HPPPYTHON_PREFIX)
fi
dnl if PKG_CHECK_MODULES(HPPWALKPLANNER, hppWalkPlanner); then
dnl HPPWALKPLANNER_PREFIX=`$PKG_CONFIG hppWalkPlanner --variable=prefix`
dnl AC_SUBST(HPPWALKPLANNER_PREFIX)
dnl fi
if PKG_CHECK_MODULES(HPPWALKPLANNER, hppWalkPlanner); then
HPPWALKPLANNER_PREFIX=`$PKG_CONFIG hppWalkPlanner --variable=prefix`
AC_SUBST(HPPWALKPLANNER_PREFIX)
fi
dnl if PKG_CHECK_MODULES(HPPHRPPLANNER, hppHRPPlanner); then
dnl HPPHRPPLANNER_PREFIX=`$PKG_CONFIG hppHRPPlanner --variable=prefix`
......@@ -64,10 +64,10 @@ if PKG_CHECK_MODULES(KPPINTERFACE, kppInterface); then
AC_SUBST(KPPINTERFACE_PREFIX)
fi
dnl if PKG_CHECK_MODULES(KPPINTERFACEWALK, kppInterfaceWalk); then
dnl KPPINTERFACEWALK_PREFIX=`$PKG_CONFIG kppInterfaceWalk --variable=prefix`
dnl AC_SUBST(KPPINTERFACEWALK_PREFIX)
dnl fi
if PKG_CHECK_MODULES(KPPINTERFACEWALK, kppInterfaceWalk); then
KPPINTERFACEWALK_PREFIX=`$PKG_CONFIG kppInterfaceWalk --variable=prefix`
AC_SUBST(KPPINTERFACEWALK_PREFIX)
fi
dnl if PKG_CHECK_MODULES(KPPINTERFACEHRP, kppInterfaceHRP); then
dnl KPPINTERFACEHRP_PREFIX=`$PKG_CONFIG kppInterfaceHRP --variable=prefix`
......@@ -79,45 +79,55 @@ dnl KPPINTERFACECMP_PREFIX=`$PKG_CONFIG kppInterfaceCmp --variable=prefix`
dnl AC_SUBST(KPPINTERFACECMP_PREFIX)
dnl fi
dnl if PKG_CHECK_MODULES(HPPGIK, hppGik); then
dnl HPPGIK_PREFIX=`$PKG_CONFIG hppGik --variable=prefix`
dnl AC_SUBST(HPPGIK_PREFIX)
dnl fi
if PKG_CHECK_MODULES(HPPGIK, hppGik); then
HPPGIK_PREFIX=`$PKG_CONFIG hppGik --variable=prefix`
AC_SUBST(HPPGIK_PREFIX)
fi
dnl if PKG_CHECK_MODULES(HPPLOA, hppLoa); then
dnl HPPLOA_PREFIX=`$PKG_CONFIG hppLoa --variable=prefix`
dnl AC_SUBST(HPPLOA_PREFIX)
dnl fi
if PKG_CHECK_MODULES(HPPLOA, hppLoa); then
HPPLOA_PREFIX=`$PKG_CONFIG hppLoa --variable=prefix`
AC_SUBST(HPPLOA_PREFIX)
fi
dnl if PKG_CHECK_MODULES(DYNAMICSJRLJAPAN, dynamicsJRLJapan); then
dnl DYNAMICSJRLJAPAN_PREFIX=`$PKG_CONFIG dynamicsJRLJapan --variable=prefix`
dnl AC_SUBST(DYNAMICSJRLJAPAN_PREFIX)
dnl fi
if PKG_CHECK_MODULES(DYNAMICSJRLJAPAN, dynamicsJRLJapan); then
DYNAMICSJRLJAPAN_PREFIX=`$PKG_CONFIG dynamicsJRLJapan --variable=prefix`
AC_SUBST(DYNAMICSJRLJAPAN_PREFIX)
fi
dnl if PKG_CHECK_MODULES(ABSTRACTROBOTDYNAMICS, abstractRobotDynamics); then
dnl ABSTRACTROBOTDYNAMICS_PREFIX=`$PKG_CONFIG abstractRobotDynamics --variable=prefix`
dnl AC_SUBST(ABSTRACTROBOTDYNAMICS_PREFIX)
dnl fi
if PKG_CHECK_MODULES(ABSTRACTROBOTDYNAMICS, abstractRobotDynamics); then
ABSTRACTROBOTDYNAMICS_PREFIX=`$PKG_CONFIG abstractRobotDynamics --variable=prefix`
AC_SUBST(ABSTRACTROBOTDYNAMICS_PREFIX)
fi
dnl if PKG_CHECK_MODULES(ABSTRACTGIKTASK, abstractGikTask); then
dnl ABSTRACTGIKTASK_PREFIX=`$PKG_CONFIG abstractGikTask --variable=prefix`
dnl AC_SUBST(ABSTRACTGIKTASK_PREFIX)
dnl fi
if PKG_CHECK_MODULES(ABSTRACTGIKTASK, abstractGikTask); then
ABSTRACTGIKTASK_PREFIX=`$PKG_CONFIG abstractGikTask --variable=prefix`
AC_SUBST(ABSTRACTGIKTASK_PREFIX)
fi
dnl if PKG_CHECK_MODULES(KPPINTERFACETUTORIAL, kppInterfaceTutorial); then
dnl KPPINTERFACETUTORIAL_PREFIX=`$PKG_CONFIG kppInterfaceTutorial --variable=prefix`
dnl AC_SUBST(KPPINTERFACETUTORIAL_PREFIX)
dnl fi
dnl if PKG_CHECK_MODULES(HPPOPENHRP, hppOpenHRP); then
dnl HPPOPENHRP_PREFIX=`$PKG_CONFIG hppOpenHRP --variable=prefix`
dnl AC_SUBST(HPPOPENHRP_PREFIX)
dnl fi
if PKG_CHECK_MODULES(HPPOPENHRP, hppOpenHRP); then
HPPOPENHRP_PREFIX=`$PKG_CONFIG hppOpenHRP --variable=prefix`
AC_SUBST(HPPOPENHRP_PREFIX)
fi
dnl if PKG_CHECK_MODULES(HPPVISUALIZEMOVEPLANNER, hppVisualizeMovePlanner); then
dnl HPPVISUALIZEMOVEPLANNER_PREFIX=`$PKG_CONFIG hppVisualizeMovePlanner --variable=prefix`
dnl AC_SUBST(HPPVISUALIZEMOVEPLANNER_PREFIX)
dnl fi
if PKG_CHECK_MODULES(SLAM3DPLANNER, slam3DPlanner); then
SLAM3DPLANNER_PREFIX=`$PKG_CONFIG slam3DPlanner --variable=prefix`
AC_SUBST(SLAM3DPLANNER_PREFIX)
fi
if PKG_CHECK_MODULES(HPPENVGENERATOR, hppEnvGenerator); then
HPPENVGENERATOR_PREFIX=`$PKG_CONFIG hppEnvGenerator --variable=prefix`
AC_SUBST(HPPENVGENERATOR_PREFIX)
fi
if PKG_CHECK_MODULES(HPPVISUALIZEMOVEPLANNER, hppVisualizeMovePlanner); then
HPPVISUALIZEMOVEPLANNER_PREFIX=`$PKG_CONFIG hppVisualizeMovePlanner --variable=prefix`
AC_SUBST(HPPVISUALIZEMOVEPLANNER_PREFIX)
fi
AC_OUTPUT(
......
......@@ -33,6 +33,7 @@ EXTRA_DIST = \
install:
mkdir -p $(hppDocdir)
$(INSTALL_DATA) html/* $(hppDocdir)
$(INSTALL_DATA) $(srcdir)/html/hppdoc_autotools.html $(hppDocdir)
$(INSTALL_DATA) $(srcdir)/package.css $(hppDocdir)
mkdir -p $(hppDocdir)/pictures
$(INSTALL_DATA) $(srcdir)/pictures/* $(hppDocdir)/pictures
......
<HTML>
<HEAD>
<TITLE>Humanoid Path Planner Documentation</TITLE>
<LINK HREF="package.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
<h1><a class="anchor" name="hppDoc_autotools">About autoconf, automake and pkg-config</a></h1><h2><a class="anchor" name="hppDoc_autotools_intro">
Introduction</a></h2>
HPP (Humanoid Path Planner) is composed of several software modules managed by autotools. This page explains the basics of these tools for more information, the reader is refered to the official documentation pages of each tool.
<h2><a class="anchor" name="hppDoc_autoconf">
Autoconf</a></h2>
Autoconf takes as input file <code>configure.ac</code> and builds <code>configure</code> script.
<h3><a class="anchor" name="hppDoc_autoconf_commands">Main commands in <code>configure.ac</code></a></h3>
<h4><a class="anchor" name="hppDoc_autoconf_init">AC_INIT([packageName], [Version], [Contact])</a></h4>
File <code>configure.ac</code> should start by this command. The command specifies the name of the package, the version number and a contact for bug report.
<h4><a class="anchor" name="hppDoc_autoconf_automake">AM_INIT_AUTOMAKE</a></h4>
This commands specifies that <a href="hppdoc_autotools.html#hppdoc_automake"><code>automake</code></a> will be used to generate <code>Makefile.in</code> files.
<h4><a class="anchor" name="hppDoc_autoconf_pkgcheckmodule">PKG_CHECK_MODULES(PACKAGENAME, packageName)</a></h4>
This command specifies that the dependence to package <code>packageName</code> will be handled by <a href="hppdoc_autotools.html#hppDoc_pkg_config"><code>pkg-config</code></a> at configuration.
For example the following lines will trigger the following operations:
<div class="fragment"><pre class="fragment">
PKG_CHECK_MODULES(KWSPLUS, kwsPlus >= 1.1)
KWSPLUS_PREFIX=`$PKG_CONFIG kwsPlus --variable=prefix`
AC_SUBST(KWSPLUS_PREFIX)
AC_SUBST(KWSPLUS_CFLAGS)
AC_SUBST(KWSPLUS_LIBS)
</pre></div>
The current package depends on <code>kwsPlus</code>, version at least 1.1. The following variable will be defined and substituted by their value by <code>configure</code> script:
<ul>
<li><code>KWSPLUS_PREFIX</code> contains the prefix where <code>kwsPlus</code> has been installed,</li>
<li><code>KWSPLUS_CFLAGS</code> contains compilation flags necessary to compile source files including headers of <code>kwsPlus</code>,</li>
<li><code>KWSPLUS_LIBS</code> contains linking flags necessary to link with <code>kwsPlus</code>.</li>
</ul>
<h4><a class="anchor" name="hppDoc_autoconf_acoutput">AC_OUTPUT</a></h4>
This command specifies which files are generated in the build directory by <code>configure</code> script. For each output, the corresponding file ending with extension <code>.in</code> should exist in the source hierarchy. For instance,
<div class="fragment"><pre class="fragment">
AC_OUTPUT(Makefile
src/Makefile
include/Makefile
doc/package.dox
)
</pre></div>
specifies that configure will create 4 files in the build directory:
<ul>
<li><code>build/Makefile</code></li>
<li><code>build/src/Makefile</code></li>
<li><code>build/include/Makefile</code></li>
<li><code>build/doc/package.dox</code></li>
</ul>
The following files should therefore exist:
<ul>
<li><code>Makefile.in</code></li>
<li><code>src/Makefile.in</code></li>
<li><code>include/Makefile.in</code></li>
<li><code>doc/package.dox.in</code></li>
</ul>
Note that <code>@KWSPLUS_PREFIX@</code> in <code>doc/package.dox.in</code> will be transformed into the string corresponding to the directory where package <code>kwsPlus</code> has been installed in <code>build/doc/package.dox.in</code>
<h2><a class="anchor" name="hppDoc_automake">Automake</a></h2>
Automake builds <code>Makefile.in</code> files from <code>Makefile.am</code> files in the same directory.
<h3><a class="anchor" name="hppDoc_automake_commands">Variables defined in <code>Makefile.am</code></a></h3>
Some variables are automatically defined in file <code>Makefile.am</code>. Following are some of these variables.
<ul>
<li><code>$(srcdir)</code> corresponds to the directory in which the <code>Makefile.am</code> file is,</li>
<li><code>$(top_srcdir)</code> corresponds to the directory where <code>configure.ac</code> is,</li>
<li><code>$(builddir)</code> is the directory in the build hierarchy corresponding to <code>$(srcdir)</code> in the source hierarchy,</li>
<li><code>$(top_builddir)</code> corresponds to the build directory,</li>
<li><code>$(prefix)</code> corresponds to the installation directory.</li>
</ul>
For instance, let us assume that your package source is in directory <code>/local/devel/package</code>.
In file <code>/local/devel/package/src/Makefile.am</code>,
<ul>
<li><code>$(srcdir)</code> is <code>/local/devel/package/src</code></li>
<li><code>$(top_srcdir)</code> is <code>/local/devel/package</code>.</li>
</ul>
Let us assume that you build your package from a build directory.
<div class="fragment"><pre class="fragment">
[~] mkdir /local/devel/package/build
[~] cd /local/devel/package/build
[build] ../configure --prefix=/local/install
</pre></div>
Then, in file <code>/local/devel/package/src/Makefile.am</code>,
<ul>
<li><code>$(builddir)</code> becomes <code>/local/devel/package/build/src</code></li>
<li><code>$(top_builddir)</code> becomes <code>/local/devel/package/build</code>.</li>
<li><code>$(prefix)</code> becomes <code>/local/install</code>.</li>
</ul>
<h3><a class="anchor" name="hppDoc_automake_commands">Main commands in <code>Makefile.am</code></a></h3>
The two main objects created at compilation are libraries and programs.
<h4><a class="anchor" name="hppDoc_automake_libraries">Libraries</a></h4>
The typical commands related to the compilation and installation of a library are the following
<div class="fragment"><pre class="fragment">
lib_LTLIBRARIES = libpackage.la
libpackage_la_SOURCES = \
package1.cpp \
package2.cpp
libpackage_la_CPPFLAGS = -I$(top_srcdir)/include -I@DEPENDENCE_CFLAGS@
libpackage_la_LDFLAGS =\
@DEPENDENCE_LIBS@
</pre></div>
<code>lib_LTLIBRARIES</code> specifies the name of the library to be built and installed by this package. Extension <code>.la</code> means that <code>libtool</code> is used.
<br>
<code>libpackage_la_SOURCES</code> specifies the list of source files that constitute the library.
<br>
<code>libpackage_la_CPPFLAGS</code> specifies the compilation flags to be used. Note that
<ul>
<li><code>-I$(top_srcdir)/include</code> give access to the header of this package that are located in <code>include</code> directory, </li>
<li><code>-I@DEPENDENCE_CFLAGS@</code> specifies compilation flags to access the header files of some dependences. The string eventually produced at configuration in build directory will be produced by <a href="hppdoc_autotools.html#hppDoc_pkg_config"><code>pkg-config</code></a>.</li>
</ul>
<br>
<code>libpackage_la_LDFLAGS</code> defines the linking flags. Note that <a href="hppdoc_autotools.html#hppDoc_pkg_config"><code>pkg-config</code></a> will replace <code>@DEPENDENCE_LIBS@</code> at configuration by linking options <code>-L... -l...</code> to link with dependence libraries.
<h4><a class="anchor" name="hppDoc_automake_programs">Programs</a></h4>
The commands related to programs are almost the same as for libraries. The programs to be compiled are specified by commands
<ul>
<li><code>noinst_PROGRAMS</code> for program compiled but not installed,</li>
<li><code>bin_PROGRAMS</code> for program compiled and installed.</li>
</ul>
Compilation and linking flags work the same way as for libraries.
<h2><a class="anchor" name="hppDoc_pkg_config">Pkg-config</a></h2>
<code>pkg-config</code> is a program that recovers information about installed packages.
<div class="fragment"><pre class="fragment">
pkg-config package options
</pre></div>
will try to find a file named <code>package.pc</code> and read the requested information defined by <code>options</code>.
<h3><a class="anchor" name="hppDoc_pkg_config_path">PKG_CONFIG_PATH environment variable</a></h2>
The directories where <code>pkg-config</code> looks for file <code>package.pc</code> is defined by environment variable <code>PKG_CONFIG_PATH</code>. <code>pkg-config</code> scan directories in the order they are specified in <code>PKG_CONFIG_PATH</code>.
<h3><a class="anchor" name="hppDoc_pkg_config_path">pkg-config syntax</a></h2>
<div class="fragment"><pre class="fragment">
pkg-config package --cflags
</pre></div>
returns the string after <code>Cflags:</code> in <code>package.pc</code>.
<div class="fragment"><pre class="fragment">
pkg-config package --libs
</pre></div>
returns the string after <code>Libs:</code> in <code>package.pc</code>.
<div class="fragment"><pre class="fragment">
pkg-config package --variable=var
</pre></div>
returns the string after <code>var=</code> in <code>package.pc</code>.
</body>
</html>
......@@ -74,6 +74,7 @@
<div id="folder3">
<p><img src="pictures/ftv2blank.png" alt="&nbsp;" width=16 height=22 /><img src="pictures/ftv2node.png" alt="o" width=16 height=22 /><img src="pictures/ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="hppdoc_development.html" target="basefrm">Developing in Hpp</a></p>
<p><img src="pictures/ftv2blank.png" alt="&nbsp;" width=16 height=22 /><img src="pictures/ftv2lastnode.png" alt="\" width=16 height=22 /><img src="pictures/ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="hppdoc_howtoinstall.html" target="basefrm">How to install HPP</a></p>
<p><img src="pictures/ftv2blank.png" alt="&nbsp;" width=16 height=22 /><img src="pictures/ftv2lastnode.png" alt="\" width=16 height=22 /><img src="pictures/ftv2doc.png" alt="*" width=24 height=22 /><a class="el" href="hppdoc_autotools.html" target="basefrm">About autotools</a></p>
</div>
</div>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment