~ubuntu-branches/ubuntu/hardy/autoconf-archive/hardy

« back to all changes in this revision

Viewing changes to htmldoc/ac_caolan_search_package.html

  • Committer: Bazaar Package Importer
  • Author(s): Martin A. Godisch
  • Date: 2004-06-26 09:43:57 UTC
  • Revision ID: james.westby@ubuntu.com-20040626094357-3be3jwcz1vcdhpe8
Tags: upstream-20040616
ImportĀ upstreamĀ versionĀ 20040616

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
 
2
"http://www.w3.org/TR/html4/strict.dtd">
 
3
 
 
4
<html lang="en">
 
5
<head>
 
6
  <title>Autoconf Macro: ac_caolan_search_package</title>
 
7
  <link rel="stylesheet" type="text/css" href="ac-archive.css">
 
8
</head>
 
9
 
 
10
<body>
 
11
  <table summary="web navigation" style="width:100%;">
 
12
    <tbody>
 
13
      <tr>
 
14
        <td style="width:50%;" align="center">[<a href="index.html">Macro Index
 
15
        Page</a>]</td>
 
16
 
 
17
        <td style="width:50%;" align="center">[<a href=
 
18
        "../m4source/ac_caolan_search_package.m4">Download M4 Source</a>]</td>
 
19
      </tr>
 
20
    </tbody>
 
21
  </table>
 
22
  <hr>
 
23
 
 
24
  <h1>ac_caolan_search_package</h1>
 
25
 
 
26
  <h2>Synopsis</h2>
 
27
 
 
28
  <div class="indent">
 
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>
 
32
  </div>
 
33
 
 
34
  <h2>Description</h2>
 
35
 
 
36
  <div class="indent">
 
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>
 
42
 
 
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>
 
46
 
 
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>
 
51
 
 
52
    <p>with fixes from... Alexandre Duret-Lutz &lt;duret_g@lrde.epita.fr&gt;
 
53
    Matthew Mueller &lt;donut@azstarnet.com&gt;</p>
 
54
  </div>
 
55
 
 
56
  <h2>Version</h2>
 
57
 
 
58
  <div class="indent">
 
59
    <p>1.7 (last modified: 2003-10-29)</p>
 
60
  </div>
 
61
 
 
62
  <h2>Author</h2>
 
63
 
 
64
  <div class="indent">
 
65
    <p>Caolan McNamara &lt;caolan@skynet.ie&gt;</p>
 
66
  </div>
 
67
 
 
68
  <h2>M4 Source Code</h2>
 
69
 
 
70
  <div class="indent">
 
71
    <pre class="m4source">
 
72
AC_DEFUN([AC_caolan_SEARCH_PACKAGE],
 
73
[
 
74
 
 
75
AC_ARG_WITH($1,
 
76
[  --with-$1[=DIR]      root directory of $1 installation],
 
77
with_$1=$withval
 
78
if test "${with_$1}" != yes; then
 
79
        $1_include="$withval/include"
 
80
        $1_libdir="$withval/lib"
 
81
fi
 
82
)
 
83
 
 
84
AC_ARG_WITH($1-include,
 
85
[  --with-$1-include=DIR        specify exact include dir for $1 headers],
 
86
$1_include="$withval")
 
87
 
 
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],
 
91
$1_libdir="$withval")
 
92
 
 
93
if test "${with_$1}" != no ; then
 
94
        OLD_LIBS=$LIBS
 
95
        OLD_LDFLAGS=$LDFLAGS
 
96
        OLD_CFLAGS=$CFLAGS
 
97
        OLD_CPPFLAGS=$CPPFLAGS
 
98
 
 
99
        if test "${$1_libdir}" ; then
 
100
                LDFLAGS="$LDFLAGS -L${$1_libdir}"
 
101
        fi
 
102
        if test "${$1_include}" ; then
 
103
                CPPFLAGS="$CPPFLAGS -I${$1_include}"
 
104
                CFLAGS="$CFLAGS -I${$1_include}"
 
105
        fi
 
106
 
 
107
        success=no
 
108
        AC_SEARCH_LIBS($2,$3,success=yes)
 
109
        AC_CHECK_HEADERS($4,success=yes)
 
110
        if test "$success" = yes; then
 
111
dnl     fixed
 
112
                ifelse([$5], , , [$5])
 
113
                AC_DEFINE(HAVE_PKG_$1)
 
114
        else
 
115
dnl     broken
 
116
                ifelse([$6], , , [$6])
 
117
                LIBS=$OLD_LIBS
 
118
                LDFLAGS=$OLD_LDFLAGS
 
119
                CPPFLAGS=$OLD_CPPFLAGS
 
120
                CFLAGS=$OLD_CFLAGS
 
121
        fi
 
122
fi
 
123
 
 
124
])
 
125
</pre>
 
126
  </div>
 
127
 
 
128
  <h2>Copyright</h2>
 
129
 
 
130
  <div class="indent">
 
131
    <a href="COPYING.html">GNU General Public License</a> with this special
 
132
    <a href="COPYING-Exception.html">exception</a>.
 
133
  </div>
 
134
</body>
 
135
</html>