[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
11.1 Compiler options
Until you have installed CLN in a public place, the following options are needed:
When you compile CLN application code, add the flags
-I$CLN_DIR/include -I$CLN_TARGETDIR/include
to the C++ compiler’s command line (make
variable CFLAGS or CXXFLAGS).
When you link CLN application code to form an executable, add the flags
$CLN_TARGETDIR/src/libcln.a
to the C/C++ compiler’s command line (make
variable LIBS).
If you did a make install
, the include files are installed in a
public directory (normally /usr/local/include
), hence you don’t
need special flags for compiling. The library has been installed to a
public directory as well (normally /usr/local/lib
), hence when
linking a CLN application it is sufficient to give the flag -lcln
.
To make the creation of software packages that use CLN easier, the
pkg-config
utility can be used. CLN provides all the necessary
metainformation in a file called cln.pc
(installed in
/usr/local/lib/pkgconfig
by default). A program using CLN can
be compiled and linked using (1)
g++ `pkg-config --libs cln` `pkg-config --cflags cln` prog.cc -o prog
Software using GNU autoconf can check for CLN with the
PKG_CHECK_MODULES
macro supplied with pkg-config
.
PKG_CHECK_MODULES([CLN], [cln >= MIN-VERSION])
This will check for CLN version at least MIN-VERSION. If the required version was found, the variables CLN_CFLAGS and CLN_LIBS are set. Otherwise the configure script aborts. If this is not the desired behaviour, use the following code instead (2)
PKG_CHECK_MODULES([CLN], [cln >= MIN-VERSION], [], [AC_MSG_WARNING([No suitable version of CLN can be found])])
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on August 27, 2013 using texi2html 5.0.