Skip to content
Snippets Groups Projects
Commit 190d494e authored by Oliver Sander's avatar Oliver Sander
Browse files

The section on config.h copied here from the grid howto. And fix a few mistakes while I'm here

[[Imported from SVN: r5557]]
parent f86f4fcf
No related branches found
No related tags found
No related merge requests found
......@@ -696,7 +696,7 @@ the web page. This conversion can be done using inkscape
\label{configure.ac}
\configureac is a normal text file that contains several \autoconf
macros. These macros are evaluated my the \texttt{m4} macro processor
macros. These macros are evaluated by the \texttt{m4} macro processor
and transformed into a shell script.
\begin{lst}[File dune-common/configure.ac] \mbox{}
......@@ -732,7 +732,7 @@ We offer a set of macros that can be used in your \configureac:
\texttt{DUNE\_CHECK\_ALL}.
\end{itemize}
\texttt{DUNE\_CHECK\_ALL} and \texttt{DUNE\_CHECK\_ALL\_M} define certain
\texttt{DUNE\_CHECK\_ALL} defines certain
variables that can be used in the \configure script or in the
\makefileam:
......@@ -743,21 +743,44 @@ variables that can be used in the \configure script or in the
\item \texttt{DUNE\textit{\,MODULE\,}ROOT}
\end{itemize}
The last step to a complete \configureac is that you tell autoconf
which files should be generated by \configure. Therefor you add an
The last step to a complete \configureac is that you tell \autoconf
which files should be generated by \configure. Therefore you add an
\texttt{AC\_CONFIG\_FILES([\textit{WhiteSpaceSeparatedListOfFiles}])}
statement to your \configureac. The list of files should be the list
of files that are to be generated, not the input -- i.e. you would
of files that are to be generated, not the input---i.e. you would
write
\begin{lstlisting}[language=make]
AC_CONFIG_FILES([Makefile doc/Makefile])
\end{lstlisting}
end not
instead of
\begin{lstlisting}[language=make]
AC_CONFIG_FILES([Makefile.in doc/Makefile.in])
\end{lstlisting}
After you told \autoconf which files to create you have to actually
trigger their creation with command \texttt{AC\_OUTPUT}
trigger their creation with command \texttt{AC\_OUTPUT}.
\subsection{Using configuration information provided by configure}
The \lstinline!./configure! script in the module produces a file
\lstinline!config.h!\ that contains information about the configuration
parameters, for example which of the optional grid implementations is
available and which dimension has been selected (if applicable). This
information can then be used at compile-time to include header files
or code that depend on optional packages.
As an example, the macro \lstinline!HAVE_UG!\ can be used to compile
UG-specific code as in
\begin{lstlisting}[basicstyle=\ttfamily\scriptsize]
#if HAVE_UG
#include"dune/grid/uggrid.hh"
#endif
\end{lstlisting}
It is important that the file \lstinline!config.h! is the first
include file in your application!
\subsection{dune-autogen}
\label{autogen}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment