File:  [Public] / libwww / Library / libwww-config.html
Revision 1.5: download - view: text, annotated - select for diffs
Thu Aug 5 12:16:29 1999 UTC (24 years, 10 months ago) by kahan
Branches: MAIN
CVS tags: repeat-requests, candidate-5-4-1, before_webdav, Release-5-4-0, Release-5-3-1, HEAD
JK: changed Henrik's address to mine (sniff)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
   "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Compiling and Linking against libwww</title>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B">
<p>
<a href="../"><img src="../Icons/WWW/w3c_home" alt="W3C" border="0"></a> <a
href="./"><img src="../Icons/WWW/Lib48x" alt="libwww" border="0"></a></p>

<h1>Compiling and Linking against libwww</h1>
<p>
After you have <a href="../INSTALL.html">installed libwww</a>, you can use it
to build Web applications. However, compiling and linking against libwww
requires various command line options to be passed to your compiler and
linker. These options can be hard to figure out but the <tt>libwww-config</tt>
shell script (installed in <tt>$exec_prefix/bin</tt>) can help you to do some
of the work. This script is based on the <a
href="http://www.gtk.org/tutorial/">GTK <tt>gtk-script</tt></a> and is
contributed by S&oslash;ren Sandmann.</p>

<h2>Invoking libwww-config</h2>
<p>
After being installed, <tt>libwww-config</tt> takes the following flags:</p>
<dl>
<dt><tt>--version</tt></dt>
<dd>
Prints out the version of libwww installed
</dd>
<dt><tt>--cflags</tt></dt>
<dd>
Prints '-I' flags pointing to the installed header files.
</dd>
<dt><tt>--libs</tt></dt>
<dd>
Prints out the linker flags necessary to link a program against libwww
</dd>
<dt><tt>--prefix[=PREFIX]</tt></dt>
<dd>
If <tt>PREFIX</tt> is specified, overrides the configured value of
<tt>$prefix</tt>. (And of exec-prefix, unless <tt>--exec-prefix</tt> is also
specified) Otherwise, prints out the configured value of <tt>$prefix</tt>
</dd>
<dt><tt>--exec-prefix[=PREFIX]</tt></dt>
<dd>
If <tt>PREFIX</tt> is specified, overrides the configured value of
<tt>$exec_prefix</tt>. Otherwise, prints out the configured value of
<tt>$exec_prefix</tt>
</dd>
</dl>

<h2>Example of using libwww-config</h2>
<p>
<tt>libwww-config</tt> can be used to compile and link a program from a
configure script or directly from the command line. To compile and link a
program, say one of the libwww sample programs (although these are compiled
already when compiling libwww), you can do the following:</p>
<pre>% <b>cd libwww</b>
% <b>gcc -o test `libwww-config --cflags` Library/Examples/libapp_1.c `libwww-config --libs`</b></pre>
<p>
</p>
<hr>

<address>
<A HREF="/People/Jose/">Jos&eacute; Kahan</A>,<br>
@(#) $Id: libwww-config.html,v 1.5 1999/08/05 12:16:29 kahan Exp $
</address>
</body>
</html>

Webmaster