1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>
Autoconf Macro: ac_create_generic_config
</title>
<link rel="stylesheet" type="text/css" href="ac-archive.css">
</head>
<body>
<table summary="web navigation" style="width:100%;">
<tbody>
<tr>
<td style="width:50%;" align="center">
<a href=
"http://autoconf-archive.cryp.to/ac_create_generic_config.m4">Download M4
Source</a>
</td>
<td style="width:50%;" align="center">
<a href="macros-by-category.html">Macro Index Page</a>
</td>
</tr>
</tbody>
</table>
<hr>
<h1>
ac_create_generic_config
</h1>
<h2>
Synopsis
</h2>
<p class="indent" style="white-space:nowrap;">
<code>AC_CREATE_GENERIC_CONFIG [(PACKAGEnlibs [, VERSION])]</code>
</p>
<h2>
Description
</h2>
<div class="indent">
<p>
Creates a generic PACKAGE-config file that has all the things that you
want, hmm, well, atleast it has --cflags, --version, --libs. Ahhm, did you
see ac_path_generic in the autoconf-archive? ;-)
</p>
<p>
this macros saves you all the typing for a pkg-config.in script, you don't
even need to distribute one along. Place this macro in your configure.ac,
et voila, you got one that you want to install.
</p>
<p>
oh, btw, if the first arg looks like "mylib -lwhat' then it will go to be
added to the --libs, and mylib is extracted.
</p>
<p>
the defaults: $1 = $PACKAGE $LIBS $2 = $VERSION there is also an
AC_SUBST(GENERIC_CONFIG) that will be set to the name of the file that we
did output in this macro. Use as:
</p>
<pre>
install-exec-local: install-generic-config
install-generic-config:
$(mkinstalldirs) $(DESTDIR)$(bindir)
$(INSTALL_SCRIPT) @GENERIC_CONFIG@ $(DESTDIR)$(bindir)
</pre>
</div>
<h2>
Author
</h2>
<p class="indent">
Guido Draheim <guidod@gmx.de>
</p>
<h2>
Last Modified
</h2>
<p class="indent">
2003-01-25
</p>
<h2>
M4 Source Code
</h2>
<div class="indent">
<pre class="m4source">
AC_DEFUN([AC_CREATE_GENERIC_CONFIG],[# create a generic PACKAGE-config file
L=`echo ifelse($1, , $PACKAGE $LIBS, $1)`
P=`echo $L | sed -e 's/ -.*//'`
P=`echo $P`
V=`echo ifelse($2, , $VERSION, $2)`
F=`echo $P-config`
L=`echo -l$L | sed -e 's/^-llib/-l/'`
AC_MSG_RESULT(creating $F - generic $V for $L)
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
echo '#! /bin/sh' >$F
echo ' ' >>$F
echo 'package="'$P'"' >>$F
echo 'version="'$V'"' >>$F
echo 'libs="'$L'"' >>$F
echo ' ' >>$F
# in the order of occurence a standard automake Makefile
echo 'prefix="'$prefix'"' >>$F
echo 'exec_prefix="'$exec_prefix'"' >>$F
echo 'bindir="'$bindir'"' >>$F
echo 'sbindir="'$sbindir'"' >>$F
echo 'libexecdir="'$libexecdir'"' >>$F
echo 'datadir="'$datadir'"' >>$F
echo 'sysconfdir="'$sysconfdir'"' >>$F
echo 'sharedstatedir="'$sharedstatedir'"' >>$F
echo 'localstatedir="'$localstatedir'"' >>$F
echo 'libdir="'$libdir'"' >>$F
echo 'infodir="'$infodir'"' >>$F
echo 'mandir="'$mandir'"' >>$F
echo 'includedir="'$includedir'"' >>$F
echo 'target="'$target'"' >>$F
echo 'host="'$host'"' >>$F
echo 'build="'$build'"' >>$F
echo ' ' >>$F
echo 'if test "'"\$""#"'" -eq 0; then' >>$F
echo ' cat <<EOF' >>$F
echo 'Usage: $package-config [OPTIONS]' >>$F
echo 'Options:' >>$F
echo ' --prefix[=DIR]) : \$prefix' >>$F
echo ' --package) : \$package' >>$F
echo ' --version) : \$version' >>$F
echo ' --cflags) : -I\$includedir' >>$F
echo ' --libs) : -L\$libdir -l\$package' >>$F
echo ' --help) print all the options (not just these)' >>$F
echo 'EOF' >>$F
echo 'fi' >>$F
echo ' ' >>$F
echo 'o=""' >>$F
echo 'h=""' >>$F
echo 'for i in "[$]@"; do' >>$F
echo ' case $i in' >>$F
echo ' --prefix=*) prefix=`echo $i | sed -e "s/--prefix=//"` ;;' >>$F
echo ' --prefix) o="$o $prefix" ;;' >>$F
echo ' --package) o="$o $package" ;;' >>$F
echo ' --version) o="$o $version" ;;' >>$F
echo ' --cflags) if test "_$includedir" != "_/usr/include"' >>$F
echo ' then o="$o -I$includedir" ; fi' >>$F
echo ' ;;' >>$F
echo ' --libs) o="$o -L$libdir $libs" ;;' >>$F
echo ' --exec_prefix|--eprefix) o="$o $exec_prefix" ;;' >>$F
echo ' --bindir) o="$o $bindir" ;;' >>$F
echo ' --sbindir) o="$o $sbindir" ;;' >>$F
echo ' --libexecdir) o="$o $libexecdir" ;;' >>$F
echo ' --datadir) o="$o $datadir" ;;' >>$F
echo ' --datainc) o="$o -I$datadir" ;;' >>$F
echo ' --datalib) o="$o -L$datadir" ;;' >>$F
echo ' --sysconfdir) o="$o $sysconfdir" ;;' >>$F
echo ' --sharedstatedir) o="$o $sharedstatedir" ;;' >>$F
echo ' --localstatedir) o="$o $localstatedir" ;;' >>$F
echo ' --libdir) o="$o $libdir" ;;' >>$F
echo ' --libadd) o="$o -L$libdir" ;;' >>$F
echo ' --infodir) o="$o $infodir" ;;' >>$F
echo ' --mandir) o="$o $mandir" ;;' >>$F
echo ' --target) o="$o $target" ;;' >>$F
echo ' --host) o="$o $host" ;;' >>$F
echo ' --build) o="$o $build" ;;' >>$F
echo ' --data) o="$o -I$datadir/$package" ;;' >>$F
echo ' --pkgdatadir) o="$o $datadir/$package" ;;' >>$F
echo ' --pkgdatainc) o="$o -I$datadir/$package" ;;' >>$F
echo ' --pkgdatalib) o="$o -L$datadir/$package" ;;' >>$F
echo ' --pkglibdir) o="$o $libdir/$package" ;;' >>$F
echo ' --pkglibinc) o="$o -I$libinc/$package" ;;' >>$F
echo ' --pkglibadd) o="$o -L$libadd/$package" ;;' >>$F
echo ' --pkgincludedir) o="$o $includedir/$package" ;;' >>$F
echo ' --help) h="1" ;;' >>$F
echo ' -?//*|-?/*//*|-?./*//*|//*|/*//*|./*//*) ' >>$F
echo ' v=`echo $i | sed -e s://:\$:g`' >>$F
echo ' v=`eval "echo $v"` ' >>$F
echo ' o="$o $v" ;; ' >>$F
echo ' esac' >>$F
echo 'done' >>$F
echo ' ' >>$F
echo 'o=`eval "echo $o"`' >>$F
echo 'o=`eval "echo $o"`' >>$F
echo 'eval "echo $o"' >>$F
echo ' ' >>$F
echo 'if test ! -z "$h" ; then ' >>$F
echo 'cat <<EOF' >>$F
echo ' --prefix=xxx) (what is that for anyway?)' >>$F
echo ' --prefix) \$prefix $prefix' >>$F
echo ' --package) \$package $package' >>$F
echo ' --version) \$version $version' >>$F
echo ' --cflags) -I\$includedir unless it is /usr/include' >>$F
echo ' --libs) -L\$libdir -l\$PACKAGE \$LIBS' >>$F
echo ' --exec_prefix) or... ' >>$F
echo ' --eprefix) \$exec_prefix $exec_prefix' >>$F
echo ' --bindir) \$bindir $bindir' >>$F
echo ' --sbindir) \$sbindir $sbindir' >>$F
echo ' --libexecdir) \$libexecdir $libexecdir' >>$F
echo ' --datadir) \$datadir $datadir' >>$F
echo ' --sysconfdir) \$sysconfdir $sysconfdir' >>$F
echo ' --sharedstatedir) \$sharedstatedir$sharedstatedir' >>$F
echo ' --localstatedir) \$localstatedir $localstatedir' >>$F
echo ' --libdir) \$libdir $libdir' >>$F
echo ' --infodir) \$infodir $infodir' >>$F
echo ' --mandir) \$mandir $mandir' >>$F
echo ' --target) \$target $target' >>$F
echo ' --host) \$host $host' >>$F
echo ' --build) \$build $build' >>$F
echo ' --data) -I\$datadir/\$package' >>$F
echo ' --pkgdatadir) \$datadir/\$package' >>$F
echo ' --pkglibdir) \$libdir/\$package' >>$F
echo ' --pkgincludedir) \$includedir/\$package' >>$F
echo ' --help) generated by ac_create_generic_config.m4' >>$F
echo ' -I//varname and other inc-targets like --pkgdatainc supported' >>$F
echo ' -L//varname and other lib-targets, e.g. --pkgdatalib or --libadd' >>$F
echo 'EOF' >>$F
echo 'fi' >>$F
GENERIC_CONFIG="$F"
AC_SUBST(GENERIC_CONFIG)
])
</pre>
</div>
</body>
</html>
|