1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
"http://www.w3.org/TR/html4/strict.dtd">
6
<title>Autoconf Macro: ac_caolan_search_package</title>
7
<link rel="stylesheet" type="text/css" href="ac-archive.css">
11
<table summary="web navigation" style="width:100%;">
14
<td style="width:50%;" align="center">[<a href="index.html">Macro Index
17
<td style="width:50%;" align="center">[<a href=
18
"../m4source/ac_caolan_search_package.m4">Download M4 Source</a>]</td>
24
<h1>ac_caolan_search_package</h1>
29
<p style="text-align:left; white-space:nowrap;">
30
<code>AC_caolan_SEARCH_PACKAGE(PACKAGE, FUNCTION, LIBRARY LIST, HEADERFILE
31
[, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])</code></p>
37
<p>Provides --with-PACKAGE, --with-PACKAGE-include and
38
--with-PACKAGE-libdir options to configure. Supports the now standard
39
--with-PACKAGE=DIR approach where the package's include dir and lib dir are
40
underneath DIR, but also allows the include and lib directories to be
41
specified seperately</p>
43
<p>adds the extra -Ipath to CFLAGS if needed adds extra -Lpath to LD_FLAGS
44
if needed searches for the FUNCTION in each of the LIBRARY LIST with
45
AC_SEARCH_LIBRARY and thus adds the lib to LIBS</p>
47
<p>defines HAVE_PKG_PACKAGE if it is found, (where PACKAGE in the
48
HAVE_PKG_PACKAGE is replaced with the actual first parameter passed) note
49
that autoheader will complain of not having the HAVE_PKG_PACKAGE and you
50
will have to add it to acconfig.h manually</p>
52
<p>with fixes from... Alexandre Duret-Lutz <duret_g@lrde.epita.fr>
53
Matthew Mueller <donut@azstarnet.com></p>
59
<p>1.7 (last modified: 2003-10-29)</p>
65
<p>Caolan McNamara <caolan@skynet.ie></p>
68
<h2>M4 Source Code</h2>
71
<pre class="m4source">
72
AC_DEFUN([AC_caolan_SEARCH_PACKAGE],
76
[ --with-$1[=DIR] root directory of $1 installation],
78
if test "${with_$1}" != yes; then
79
$1_include="$withval/include"
80
$1_libdir="$withval/lib"
84
AC_ARG_WITH($1-include,
85
[ --with-$1-include=DIR specify exact include dir for $1 headers],
86
$1_include="$withval")
88
AC_ARG_WITH($1-libdir,
89
[ --with-$1-libdir=DIR specify exact library dir for $1 library
90
--without-$1 disables $1 usage completely],
93
if test "${with_$1}" != no ; then
97
OLD_CPPFLAGS=$CPPFLAGS
99
if test "${$1_libdir}" ; then
100
LDFLAGS="$LDFLAGS -L${$1_libdir}"
102
if test "${$1_include}" ; then
103
CPPFLAGS="$CPPFLAGS -I${$1_include}"
104
CFLAGS="$CFLAGS -I${$1_include}"
108
AC_SEARCH_LIBS($2,$3,success=yes)
109
AC_CHECK_HEADERS($4,success=yes)
110
if test "$success" = yes; then
112
ifelse([$5], , , [$5])
113
AC_DEFINE(HAVE_PKG_$1)
116
ifelse([$6], , , [$6])
119
CPPFLAGS=$OLD_CPPFLAGS
131
<a href="COPYING.html">GNU General Public License</a> with this special
132
<a href="COPYING-Exception.html">exception</a>.