masqmail-0.2

annotate aclocal.m4 @ 15:f671821d8222

code beautifying; 0 -> \0 if appropriate
author meillo@marmaro.de
date Thu, 06 Nov 2008 09:18:38 +0100
parents 08114f7dcc23
children 9cb4031fa5e0
rev   line source
meillo@0 1 # generated automatically by aclocal 1.7.9 -*- Autoconf -*-
meillo@0 2
meillo@0 3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
meillo@0 4 # Free Software Foundation, Inc.
meillo@0 5 # This file is free software; the Free Software Foundation
meillo@0 6 # gives unlimited permission to copy and/or distribute it,
meillo@0 7 # with or without modifications, as long as this notice is preserved.
meillo@0 8
meillo@0 9 # This program is distributed in the hope that it will be useful,
meillo@0 10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
meillo@0 11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
meillo@0 12 # PARTICULAR PURPOSE.
meillo@0 13
meillo@0 14 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
meillo@0 15
meillo@0 16 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
meillo@0 17
meillo@0 18 # This program is free software; you can redistribute it and/or modify
meillo@0 19 # it under the terms of the GNU General Public License as published by
meillo@0 20 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 21 # any later version.
meillo@0 22
meillo@0 23 # This program is distributed in the hope that it will be useful,
meillo@0 24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 26 # GNU General Public License for more details.
meillo@0 27
meillo@0 28 # You should have received a copy of the GNU General Public License
meillo@0 29 # along with this program; if not, write to the Free Software
meillo@0 30 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 31 # 02111-1307, USA.
meillo@0 32
meillo@0 33 AC_PREREQ([2.52])
meillo@0 34
meillo@0 35 # serial 6
meillo@0 36
meillo@0 37 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
meillo@0 38 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
meillo@0 39
meillo@0 40 # Do all the work for Automake. -*- Autoconf -*-
meillo@0 41
meillo@0 42 # This macro actually does too much some checks are only needed if
meillo@0 43 # your package does certain things. But this isn't really a big deal.
meillo@0 44
meillo@0 45 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
meillo@0 46 # Free Software Foundation, Inc.
meillo@0 47
meillo@0 48 # This program is free software; you can redistribute it and/or modify
meillo@0 49 # it under the terms of the GNU General Public License as published by
meillo@0 50 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 51 # any later version.
meillo@0 52
meillo@0 53 # This program is distributed in the hope that it will be useful,
meillo@0 54 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 55 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 56 # GNU General Public License for more details.
meillo@0 57
meillo@0 58 # You should have received a copy of the GNU General Public License
meillo@0 59 # along with this program; if not, write to the Free Software
meillo@0 60 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 61 # 02111-1307, USA.
meillo@0 62
meillo@0 63 # serial 10
meillo@0 64
meillo@0 65 AC_PREREQ([2.54])
meillo@0 66
meillo@0 67 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
meillo@0 68 # the ones we care about.
meillo@0 69 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
meillo@0 70
meillo@0 71 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
meillo@0 72 # AM_INIT_AUTOMAKE([OPTIONS])
meillo@0 73 # -----------------------------------------------
meillo@0 74 # The call with PACKAGE and VERSION arguments is the old style
meillo@0 75 # call (pre autoconf-2.50), which is being phased out. PACKAGE
meillo@0 76 # and VERSION should now be passed to AC_INIT and removed from
meillo@0 77 # the call to AM_INIT_AUTOMAKE.
meillo@0 78 # We support both call styles for the transition. After
meillo@0 79 # the next Automake release, Autoconf can make the AC_INIT
meillo@0 80 # arguments mandatory, and then we can depend on a new Autoconf
meillo@0 81 # release and drop the old call support.
meillo@0 82 AC_DEFUN([AM_INIT_AUTOMAKE],
meillo@0 83 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
meillo@0 84 AC_REQUIRE([AC_PROG_INSTALL])dnl
meillo@0 85 # test to see if srcdir already configured
meillo@0 86 if test "`cd $srcdir && pwd`" != "`pwd`" &&
meillo@0 87 test -f $srcdir/config.status; then
meillo@0 88 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
meillo@0 89 fi
meillo@0 90
meillo@0 91 # test whether we have cygpath
meillo@0 92 if test -z "$CYGPATH_W"; then
meillo@0 93 if (cygpath --version) >/dev/null 2>/dev/null; then
meillo@0 94 CYGPATH_W='cygpath -w'
meillo@0 95 else
meillo@0 96 CYGPATH_W=echo
meillo@0 97 fi
meillo@0 98 fi
meillo@0 99 AC_SUBST([CYGPATH_W])
meillo@0 100
meillo@0 101 # Define the identity of the package.
meillo@0 102 dnl Distinguish between old-style and new-style calls.
meillo@0 103 m4_ifval([$2],
meillo@0 104 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
meillo@0 105 AC_SUBST([PACKAGE], [$1])dnl
meillo@0 106 AC_SUBST([VERSION], [$2])],
meillo@0 107 [_AM_SET_OPTIONS([$1])dnl
meillo@0 108 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
meillo@0 109 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
meillo@0 110
meillo@0 111 _AM_IF_OPTION([no-define],,
meillo@0 112 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
meillo@0 113 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
meillo@0 114
meillo@0 115 # Some tools Automake needs.
meillo@0 116 AC_REQUIRE([AM_SANITY_CHECK])dnl
meillo@0 117 AC_REQUIRE([AC_ARG_PROGRAM])dnl
meillo@0 118 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
meillo@0 119 AM_MISSING_PROG(AUTOCONF, autoconf)
meillo@0 120 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
meillo@0 121 AM_MISSING_PROG(AUTOHEADER, autoheader)
meillo@0 122 AM_MISSING_PROG(MAKEINFO, makeinfo)
meillo@0 123 AM_MISSING_PROG(AMTAR, tar)
meillo@0 124 AM_PROG_INSTALL_SH
meillo@0 125 AM_PROG_INSTALL_STRIP
meillo@0 126 # We need awk for the "check" target. The system "awk" is bad on
meillo@0 127 # some platforms.
meillo@0 128 AC_REQUIRE([AC_PROG_AWK])dnl
meillo@0 129 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
meillo@0 130 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
meillo@0 131
meillo@0 132 _AM_IF_OPTION([no-dependencies],,
meillo@0 133 [AC_PROVIDE_IFELSE([AC_PROG_CC],
meillo@0 134 [_AM_DEPENDENCIES(CC)],
meillo@0 135 [define([AC_PROG_CC],
meillo@0 136 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
meillo@0 137 AC_PROVIDE_IFELSE([AC_PROG_CXX],
meillo@0 138 [_AM_DEPENDENCIES(CXX)],
meillo@0 139 [define([AC_PROG_CXX],
meillo@0 140 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
meillo@0 141 ])
meillo@0 142 ])
meillo@0 143
meillo@0 144
meillo@0 145 # When config.status generates a header, we must update the stamp-h file.
meillo@0 146 # This file resides in the same directory as the config header
meillo@0 147 # that is generated. The stamp files are numbered to have different names.
meillo@0 148
meillo@0 149 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
meillo@0 150 # loop where config.status creates the headers, so we can generate
meillo@0 151 # our stamp files there.
meillo@0 152 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
meillo@0 153 [# Compute $1's index in $config_headers.
meillo@0 154 _am_stamp_count=1
meillo@0 155 for _am_header in $config_headers :; do
meillo@0 156 case $_am_header in
meillo@0 157 $1 | $1:* )
meillo@0 158 break ;;
meillo@0 159 * )
meillo@0 160 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
meillo@0 161 esac
meillo@0 162 done
meillo@0 163 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
meillo@0 164
meillo@0 165 # Copyright 2002 Free Software Foundation, Inc.
meillo@0 166
meillo@0 167 # This program is free software; you can redistribute it and/or modify
meillo@0 168 # it under the terms of the GNU General Public License as published by
meillo@0 169 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 170 # any later version.
meillo@0 171
meillo@0 172 # This program is distributed in the hope that it will be useful,
meillo@0 173 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 174 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 175 # GNU General Public License for more details.
meillo@0 176
meillo@0 177 # You should have received a copy of the GNU General Public License
meillo@0 178 # along with this program; if not, write to the Free Software
meillo@0 179 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 180
meillo@0 181 # AM_AUTOMAKE_VERSION(VERSION)
meillo@0 182 # ----------------------------
meillo@0 183 # Automake X.Y traces this macro to ensure aclocal.m4 has been
meillo@0 184 # generated from the m4 files accompanying Automake X.Y.
meillo@0 185 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
meillo@0 186
meillo@0 187 # AM_SET_CURRENT_AUTOMAKE_VERSION
meillo@0 188 # -------------------------------
meillo@0 189 # Call AM_AUTOMAKE_VERSION so it can be traced.
meillo@0 190 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
meillo@0 191 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
meillo@0 192 [AM_AUTOMAKE_VERSION([1.7.9])])
meillo@0 193
meillo@0 194 # Helper functions for option handling. -*- Autoconf -*-
meillo@0 195
meillo@0 196 # Copyright 2001, 2002 Free Software Foundation, Inc.
meillo@0 197
meillo@0 198 # This program is free software; you can redistribute it and/or modify
meillo@0 199 # it under the terms of the GNU General Public License as published by
meillo@0 200 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 201 # any later version.
meillo@0 202
meillo@0 203 # This program is distributed in the hope that it will be useful,
meillo@0 204 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 205 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 206 # GNU General Public License for more details.
meillo@0 207
meillo@0 208 # You should have received a copy of the GNU General Public License
meillo@0 209 # along with this program; if not, write to the Free Software
meillo@0 210 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 211 # 02111-1307, USA.
meillo@0 212
meillo@0 213 # serial 2
meillo@0 214
meillo@0 215 # _AM_MANGLE_OPTION(NAME)
meillo@0 216 # -----------------------
meillo@0 217 AC_DEFUN([_AM_MANGLE_OPTION],
meillo@0 218 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
meillo@0 219
meillo@0 220 # _AM_SET_OPTION(NAME)
meillo@0 221 # ------------------------------
meillo@0 222 # Set option NAME. Presently that only means defining a flag for this option.
meillo@0 223 AC_DEFUN([_AM_SET_OPTION],
meillo@0 224 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
meillo@0 225
meillo@0 226 # _AM_SET_OPTIONS(OPTIONS)
meillo@0 227 # ----------------------------------
meillo@0 228 # OPTIONS is a space-separated list of Automake options.
meillo@0 229 AC_DEFUN([_AM_SET_OPTIONS],
meillo@0 230 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
meillo@0 231
meillo@0 232 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
meillo@0 233 # -------------------------------------------
meillo@0 234 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
meillo@0 235 AC_DEFUN([_AM_IF_OPTION],
meillo@0 236 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
meillo@0 237
meillo@0 238 #
meillo@0 239 # Check to make sure that the build environment is sane.
meillo@0 240 #
meillo@0 241
meillo@0 242 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
meillo@0 243
meillo@0 244 # This program is free software; you can redistribute it and/or modify
meillo@0 245 # it under the terms of the GNU General Public License as published by
meillo@0 246 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 247 # any later version.
meillo@0 248
meillo@0 249 # This program is distributed in the hope that it will be useful,
meillo@0 250 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 251 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 252 # GNU General Public License for more details.
meillo@0 253
meillo@0 254 # You should have received a copy of the GNU General Public License
meillo@0 255 # along with this program; if not, write to the Free Software
meillo@0 256 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 257 # 02111-1307, USA.
meillo@0 258
meillo@0 259 # serial 3
meillo@0 260
meillo@0 261 # AM_SANITY_CHECK
meillo@0 262 # ---------------
meillo@0 263 AC_DEFUN([AM_SANITY_CHECK],
meillo@0 264 [AC_MSG_CHECKING([whether build environment is sane])
meillo@0 265 # Just in case
meillo@0 266 sleep 1
meillo@0 267 echo timestamp > conftest.file
meillo@0 268 # Do `set' in a subshell so we don't clobber the current shell's
meillo@0 269 # arguments. Must try -L first in case configure is actually a
meillo@0 270 # symlink; some systems play weird games with the mod time of symlinks
meillo@0 271 # (eg FreeBSD returns the mod time of the symlink's containing
meillo@0 272 # directory).
meillo@0 273 if (
meillo@0 274 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
meillo@0 275 if test "$[*]" = "X"; then
meillo@0 276 # -L didn't work.
meillo@0 277 set X `ls -t $srcdir/configure conftest.file`
meillo@0 278 fi
meillo@0 279 rm -f conftest.file
meillo@0 280 if test "$[*]" != "X $srcdir/configure conftest.file" \
meillo@0 281 && test "$[*]" != "X conftest.file $srcdir/configure"; then
meillo@0 282
meillo@0 283 # If neither matched, then we have a broken ls. This can happen
meillo@0 284 # if, for instance, CONFIG_SHELL is bash and it inherits a
meillo@0 285 # broken ls alias from the environment. This has actually
meillo@0 286 # happened. Such a system could not be considered "sane".
meillo@0 287 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
meillo@0 288 alias in your environment])
meillo@0 289 fi
meillo@0 290
meillo@0 291 test "$[2]" = conftest.file
meillo@0 292 )
meillo@0 293 then
meillo@0 294 # Ok.
meillo@0 295 :
meillo@0 296 else
meillo@0 297 AC_MSG_ERROR([newly created file is older than distributed files!
meillo@0 298 Check your system clock])
meillo@0 299 fi
meillo@0 300 AC_MSG_RESULT(yes)])
meillo@0 301
meillo@0 302 # -*- Autoconf -*-
meillo@0 303
meillo@0 304
meillo@0 305 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
meillo@0 306
meillo@0 307 # This program is free software; you can redistribute it and/or modify
meillo@0 308 # it under the terms of the GNU General Public License as published by
meillo@0 309 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 310 # any later version.
meillo@0 311
meillo@0 312 # This program is distributed in the hope that it will be useful,
meillo@0 313 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 314 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 315 # GNU General Public License for more details.
meillo@0 316
meillo@0 317 # You should have received a copy of the GNU General Public License
meillo@0 318 # along with this program; if not, write to the Free Software
meillo@0 319 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 320 # 02111-1307, USA.
meillo@0 321
meillo@0 322 # serial 3
meillo@0 323
meillo@0 324 # AM_MISSING_PROG(NAME, PROGRAM)
meillo@0 325 # ------------------------------
meillo@0 326 AC_DEFUN([AM_MISSING_PROG],
meillo@0 327 [AC_REQUIRE([AM_MISSING_HAS_RUN])
meillo@0 328 $1=${$1-"${am_missing_run}$2"}
meillo@0 329 AC_SUBST($1)])
meillo@0 330
meillo@0 331
meillo@0 332 # AM_MISSING_HAS_RUN
meillo@0 333 # ------------------
meillo@0 334 # Define MISSING if not defined so far and test if it supports --run.
meillo@0 335 # If it does, set am_missing_run to use it, otherwise, to nothing.
meillo@0 336 AC_DEFUN([AM_MISSING_HAS_RUN],
meillo@0 337 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
meillo@0 338 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
meillo@0 339 # Use eval to expand $SHELL
meillo@0 340 if eval "$MISSING --run true"; then
meillo@0 341 am_missing_run="$MISSING --run "
meillo@0 342 else
meillo@0 343 am_missing_run=
meillo@0 344 AC_MSG_WARN([`missing' script is too old or missing])
meillo@0 345 fi
meillo@0 346 ])
meillo@0 347
meillo@0 348 # AM_AUX_DIR_EXPAND
meillo@0 349
meillo@0 350 # Copyright 2001 Free Software Foundation, Inc.
meillo@0 351
meillo@0 352 # This program is free software; you can redistribute it and/or modify
meillo@0 353 # it under the terms of the GNU General Public License as published by
meillo@0 354 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 355 # any later version.
meillo@0 356
meillo@0 357 # This program is distributed in the hope that it will be useful,
meillo@0 358 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 359 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 360 # GNU General Public License for more details.
meillo@0 361
meillo@0 362 # You should have received a copy of the GNU General Public License
meillo@0 363 # along with this program; if not, write to the Free Software
meillo@0 364 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 365 # 02111-1307, USA.
meillo@0 366
meillo@0 367 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
meillo@0 368 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
meillo@0 369 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
meillo@0 370 #
meillo@0 371 # Of course, Automake must honor this variable whenever it calls a
meillo@0 372 # tool from the auxiliary directory. The problem is that $srcdir (and
meillo@0 373 # therefore $ac_aux_dir as well) can be either absolute or relative,
meillo@0 374 # depending on how configure is run. This is pretty annoying, since
meillo@0 375 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
meillo@0 376 # source directory, any form will work fine, but in subdirectories a
meillo@0 377 # relative path needs to be adjusted first.
meillo@0 378 #
meillo@0 379 # $ac_aux_dir/missing
meillo@0 380 # fails when called from a subdirectory if $ac_aux_dir is relative
meillo@0 381 # $top_srcdir/$ac_aux_dir/missing
meillo@0 382 # fails if $ac_aux_dir is absolute,
meillo@0 383 # fails when called from a subdirectory in a VPATH build with
meillo@0 384 # a relative $ac_aux_dir
meillo@0 385 #
meillo@0 386 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
meillo@0 387 # are both prefixed by $srcdir. In an in-source build this is usually
meillo@0 388 # harmless because $srcdir is `.', but things will broke when you
meillo@0 389 # start a VPATH build or use an absolute $srcdir.
meillo@0 390 #
meillo@0 391 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
meillo@0 392 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
meillo@0 393 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
meillo@0 394 # and then we would define $MISSING as
meillo@0 395 # MISSING="\${SHELL} $am_aux_dir/missing"
meillo@0 396 # This will work as long as MISSING is not called from configure, because
meillo@0 397 # unfortunately $(top_srcdir) has no meaning in configure.
meillo@0 398 # However there are other variables, like CC, which are often used in
meillo@0 399 # configure, and could therefore not use this "fixed" $ac_aux_dir.
meillo@0 400 #
meillo@0 401 # Another solution, used here, is to always expand $ac_aux_dir to an
meillo@0 402 # absolute PATH. The drawback is that using absolute paths prevent a
meillo@0 403 # configured tree to be moved without reconfiguration.
meillo@0 404
meillo@0 405 # Rely on autoconf to set up CDPATH properly.
meillo@0 406 AC_PREREQ([2.50])
meillo@0 407
meillo@0 408 AC_DEFUN([AM_AUX_DIR_EXPAND], [
meillo@0 409 # expand $ac_aux_dir to an absolute path
meillo@0 410 am_aux_dir=`cd $ac_aux_dir && pwd`
meillo@0 411 ])
meillo@0 412
meillo@0 413 # AM_PROG_INSTALL_SH
meillo@0 414 # ------------------
meillo@0 415 # Define $install_sh.
meillo@0 416
meillo@0 417 # Copyright 2001 Free Software Foundation, Inc.
meillo@0 418
meillo@0 419 # This program is free software; you can redistribute it and/or modify
meillo@0 420 # it under the terms of the GNU General Public License as published by
meillo@0 421 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 422 # any later version.
meillo@0 423
meillo@0 424 # This program is distributed in the hope that it will be useful,
meillo@0 425 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 426 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 427 # GNU General Public License for more details.
meillo@0 428
meillo@0 429 # You should have received a copy of the GNU General Public License
meillo@0 430 # along with this program; if not, write to the Free Software
meillo@0 431 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 432 # 02111-1307, USA.
meillo@0 433
meillo@0 434 AC_DEFUN([AM_PROG_INSTALL_SH],
meillo@0 435 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
meillo@0 436 install_sh=${install_sh-"$am_aux_dir/install-sh"}
meillo@0 437 AC_SUBST(install_sh)])
meillo@0 438
meillo@0 439 # AM_PROG_INSTALL_STRIP
meillo@0 440
meillo@0 441 # Copyright 2001 Free Software Foundation, Inc.
meillo@0 442
meillo@0 443 # This program is free software; you can redistribute it and/or modify
meillo@0 444 # it under the terms of the GNU General Public License as published by
meillo@0 445 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 446 # any later version.
meillo@0 447
meillo@0 448 # This program is distributed in the hope that it will be useful,
meillo@0 449 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 450 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 451 # GNU General Public License for more details.
meillo@0 452
meillo@0 453 # You should have received a copy of the GNU General Public License
meillo@0 454 # along with this program; if not, write to the Free Software
meillo@0 455 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 456 # 02111-1307, USA.
meillo@0 457
meillo@0 458 # One issue with vendor `install' (even GNU) is that you can't
meillo@0 459 # specify the program used to strip binaries. This is especially
meillo@0 460 # annoying in cross-compiling environments, where the build's strip
meillo@0 461 # is unlikely to handle the host's binaries.
meillo@0 462 # Fortunately install-sh will honor a STRIPPROG variable, so we
meillo@0 463 # always use install-sh in `make install-strip', and initialize
meillo@0 464 # STRIPPROG with the value of the STRIP variable (set by the user).
meillo@0 465 AC_DEFUN([AM_PROG_INSTALL_STRIP],
meillo@0 466 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
meillo@0 467 # Installed binaries are usually stripped using `strip' when the user
meillo@0 468 # run `make install-strip'. However `strip' might not be the right
meillo@0 469 # tool to use in cross-compilation environments, therefore Automake
meillo@0 470 # will honor the `STRIP' environment variable to overrule this program.
meillo@0 471 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
meillo@0 472 if test "$cross_compiling" != no; then
meillo@0 473 AC_CHECK_TOOL([STRIP], [strip], :)
meillo@0 474 fi
meillo@0 475 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
meillo@0 476 AC_SUBST([INSTALL_STRIP_PROGRAM])])
meillo@0 477
meillo@0 478 # -*- Autoconf -*-
meillo@0 479 # Copyright (C) 2003 Free Software Foundation, Inc.
meillo@0 480
meillo@0 481 # This program is free software; you can redistribute it and/or modify
meillo@0 482 # it under the terms of the GNU General Public License as published by
meillo@0 483 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 484 # any later version.
meillo@0 485
meillo@0 486 # This program is distributed in the hope that it will be useful,
meillo@0 487 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 488 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 489 # GNU General Public License for more details.
meillo@0 490
meillo@0 491 # You should have received a copy of the GNU General Public License
meillo@0 492 # along with this program; if not, write to the Free Software
meillo@0 493 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 494 # 02111-1307, USA.
meillo@0 495
meillo@0 496 # serial 1
meillo@0 497
meillo@0 498 # Check whether the underlying file-system supports filenames
meillo@0 499 # with a leading dot. For instance MS-DOS doesn't.
meillo@0 500 AC_DEFUN([AM_SET_LEADING_DOT],
meillo@0 501 [rm -rf .tst 2>/dev/null
meillo@0 502 mkdir .tst 2>/dev/null
meillo@0 503 if test -d .tst; then
meillo@0 504 am__leading_dot=.
meillo@0 505 else
meillo@0 506 am__leading_dot=_
meillo@0 507 fi
meillo@0 508 rmdir .tst 2>/dev/null
meillo@0 509 AC_SUBST([am__leading_dot])])
meillo@0 510
meillo@0 511 # serial 5 -*- Autoconf -*-
meillo@0 512
meillo@0 513 # Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
meillo@0 514
meillo@0 515 # This program is free software; you can redistribute it and/or modify
meillo@0 516 # it under the terms of the GNU General Public License as published by
meillo@0 517 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 518 # any later version.
meillo@0 519
meillo@0 520 # This program is distributed in the hope that it will be useful,
meillo@0 521 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 522 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 523 # GNU General Public License for more details.
meillo@0 524
meillo@0 525 # You should have received a copy of the GNU General Public License
meillo@0 526 # along with this program; if not, write to the Free Software
meillo@0 527 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 528 # 02111-1307, USA.
meillo@0 529
meillo@0 530
meillo@0 531 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
meillo@0 532 # written in clear, in which case automake, when reading aclocal.m4,
meillo@0 533 # will think it sees a *use*, and therefore will trigger all it's
meillo@0 534 # C support machinery. Also note that it means that autoscan, seeing
meillo@0 535 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
meillo@0 536
meillo@0 537
meillo@0 538
meillo@0 539 # _AM_DEPENDENCIES(NAME)
meillo@0 540 # ----------------------
meillo@0 541 # See how the compiler implements dependency checking.
meillo@0 542 # NAME is "CC", "CXX", "GCJ", or "OBJC".
meillo@0 543 # We try a few techniques and use that to set a single cache variable.
meillo@0 544 #
meillo@0 545 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
meillo@0 546 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
meillo@0 547 # dependency, and given that the user is not expected to run this macro,
meillo@0 548 # just rely on AC_PROG_CC.
meillo@0 549 AC_DEFUN([_AM_DEPENDENCIES],
meillo@0 550 [AC_REQUIRE([AM_SET_DEPDIR])dnl
meillo@0 551 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
meillo@0 552 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
meillo@0 553 AC_REQUIRE([AM_DEP_TRACK])dnl
meillo@0 554
meillo@0 555 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
meillo@0 556 [$1], CXX, [depcc="$CXX" am_compiler_list=],
meillo@0 557 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
meillo@0 558 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
meillo@0 559 [depcc="$$1" am_compiler_list=])
meillo@0 560
meillo@0 561 AC_CACHE_CHECK([dependency style of $depcc],
meillo@0 562 [am_cv_$1_dependencies_compiler_type],
meillo@0 563 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
meillo@0 564 # We make a subdir and do the tests there. Otherwise we can end up
meillo@0 565 # making bogus files that we don't know about and never remove. For
meillo@0 566 # instance it was reported that on HP-UX the gcc test will end up
meillo@0 567 # making a dummy file named `D' -- because `-MD' means `put the output
meillo@0 568 # in D'.
meillo@0 569 mkdir conftest.dir
meillo@0 570 # Copy depcomp to subdir because otherwise we won't find it if we're
meillo@0 571 # using a relative directory.
meillo@0 572 cp "$am_depcomp" conftest.dir
meillo@0 573 cd conftest.dir
meillo@0 574 # We will build objects and dependencies in a subdirectory because
meillo@0 575 # it helps to detect inapplicable dependency modes. For instance
meillo@0 576 # both Tru64's cc and ICC support -MD to output dependencies as a
meillo@0 577 # side effect of compilation, but ICC will put the dependencies in
meillo@0 578 # the current directory while Tru64 will put them in the object
meillo@0 579 # directory.
meillo@0 580 mkdir sub
meillo@0 581
meillo@0 582 am_cv_$1_dependencies_compiler_type=none
meillo@0 583 if test "$am_compiler_list" = ""; then
meillo@0 584 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
meillo@0 585 fi
meillo@0 586 for depmode in $am_compiler_list; do
meillo@0 587 # Setup a source with many dependencies, because some compilers
meillo@0 588 # like to wrap large dependency lists on column 80 (with \), and
meillo@0 589 # we should not choose a depcomp mode which is confused by this.
meillo@0 590 #
meillo@0 591 # We need to recreate these files for each test, as the compiler may
meillo@0 592 # overwrite some of them when testing with obscure command lines.
meillo@0 593 # This happens at least with the AIX C compiler.
meillo@0 594 : > sub/conftest.c
meillo@0 595 for i in 1 2 3 4 5 6; do
meillo@0 596 echo '#include "conftst'$i'.h"' >> sub/conftest.c
meillo@0 597 : > sub/conftst$i.h
meillo@0 598 done
meillo@0 599 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
meillo@0 600
meillo@0 601 case $depmode in
meillo@0 602 nosideeffect)
meillo@0 603 # after this tag, mechanisms are not by side-effect, so they'll
meillo@0 604 # only be used when explicitly requested
meillo@0 605 if test "x$enable_dependency_tracking" = xyes; then
meillo@0 606 continue
meillo@0 607 else
meillo@0 608 break
meillo@0 609 fi
meillo@0 610 ;;
meillo@0 611 none) break ;;
meillo@0 612 esac
meillo@0 613 # We check with `-c' and `-o' for the sake of the "dashmstdout"
meillo@0 614 # mode. It turns out that the SunPro C++ compiler does not properly
meillo@0 615 # handle `-M -o', and we need to detect this.
meillo@0 616 if depmode=$depmode \
meillo@0 617 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
meillo@0 618 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
meillo@0 619 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
meillo@0 620 >/dev/null 2>conftest.err &&
meillo@0 621 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
meillo@0 622 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
meillo@0 623 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
meillo@0 624 # icc doesn't choke on unknown options, it will just issue warnings
meillo@0 625 # (even with -Werror). So we grep stderr for any message
meillo@0 626 # that says an option was ignored.
meillo@0 627 if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
meillo@0 628 am_cv_$1_dependencies_compiler_type=$depmode
meillo@0 629 break
meillo@0 630 fi
meillo@0 631 fi
meillo@0 632 done
meillo@0 633
meillo@0 634 cd ..
meillo@0 635 rm -rf conftest.dir
meillo@0 636 else
meillo@0 637 am_cv_$1_dependencies_compiler_type=none
meillo@0 638 fi
meillo@0 639 ])
meillo@0 640 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
meillo@0 641 AM_CONDITIONAL([am__fastdep$1], [
meillo@0 642 test "x$enable_dependency_tracking" != xno \
meillo@0 643 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
meillo@0 644 ])
meillo@0 645
meillo@0 646
meillo@0 647 # AM_SET_DEPDIR
meillo@0 648 # -------------
meillo@0 649 # Choose a directory name for dependency files.
meillo@0 650 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
meillo@0 651 AC_DEFUN([AM_SET_DEPDIR],
meillo@0 652 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
meillo@0 653 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
meillo@0 654 ])
meillo@0 655
meillo@0 656
meillo@0 657 # AM_DEP_TRACK
meillo@0 658 # ------------
meillo@0 659 AC_DEFUN([AM_DEP_TRACK],
meillo@0 660 [AC_ARG_ENABLE(dependency-tracking,
meillo@0 661 [ --disable-dependency-tracking Speeds up one-time builds
meillo@0 662 --enable-dependency-tracking Do not reject slow dependency extractors])
meillo@0 663 if test "x$enable_dependency_tracking" != xno; then
meillo@0 664 am_depcomp="$ac_aux_dir/depcomp"
meillo@0 665 AMDEPBACKSLASH='\'
meillo@0 666 fi
meillo@0 667 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
meillo@0 668 AC_SUBST([AMDEPBACKSLASH])
meillo@0 669 ])
meillo@0 670
meillo@0 671 # Generate code to set up dependency tracking. -*- Autoconf -*-
meillo@0 672
meillo@0 673 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
meillo@0 674
meillo@0 675 # This program is free software; you can redistribute it and/or modify
meillo@0 676 # it under the terms of the GNU General Public License as published by
meillo@0 677 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 678 # any later version.
meillo@0 679
meillo@0 680 # This program is distributed in the hope that it will be useful,
meillo@0 681 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 682 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 683 # GNU General Public License for more details.
meillo@0 684
meillo@0 685 # You should have received a copy of the GNU General Public License
meillo@0 686 # along with this program; if not, write to the Free Software
meillo@0 687 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 688 # 02111-1307, USA.
meillo@0 689
meillo@0 690 #serial 2
meillo@0 691
meillo@0 692 # _AM_OUTPUT_DEPENDENCY_COMMANDS
meillo@0 693 # ------------------------------
meillo@0 694 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
meillo@0 695 [for mf in $CONFIG_FILES; do
meillo@0 696 # Strip MF so we end up with the name of the file.
meillo@0 697 mf=`echo "$mf" | sed -e 's/:.*$//'`
meillo@0 698 # Check whether this is an Automake generated Makefile or not.
meillo@0 699 # We used to match only the files named `Makefile.in', but
meillo@0 700 # some people rename them; so instead we look at the file content.
meillo@0 701 # Grep'ing the first line is not enough: some people post-process
meillo@0 702 # each Makefile.in and add a new line on top of each file to say so.
meillo@0 703 # So let's grep whole file.
meillo@0 704 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
meillo@0 705 dirpart=`AS_DIRNAME("$mf")`
meillo@0 706 else
meillo@0 707 continue
meillo@0 708 fi
meillo@0 709 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
meillo@0 710 # Extract the definition of DEP_FILES from the Makefile without
meillo@0 711 # running `make'.
meillo@0 712 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
meillo@0 713 test -z "$DEPDIR" && continue
meillo@0 714 # When using ansi2knr, U may be empty or an underscore; expand it
meillo@0 715 U=`sed -n -e '/^U = / s///p' < "$mf"`
meillo@0 716 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
meillo@0 717 # We invoke sed twice because it is the simplest approach to
meillo@0 718 # changing $(DEPDIR) to its actual value in the expansion.
meillo@0 719 for file in `sed -n -e '
meillo@0 720 /^DEP_FILES = .*\\\\$/ {
meillo@0 721 s/^DEP_FILES = //
meillo@0 722 :loop
meillo@0 723 s/\\\\$//
meillo@0 724 p
meillo@0 725 n
meillo@0 726 /\\\\$/ b loop
meillo@0 727 p
meillo@0 728 }
meillo@0 729 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
meillo@0 730 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
meillo@0 731 # Make sure the directory exists.
meillo@0 732 test -f "$dirpart/$file" && continue
meillo@0 733 fdir=`AS_DIRNAME(["$file"])`
meillo@0 734 AS_MKDIR_P([$dirpart/$fdir])
meillo@0 735 # echo "creating $dirpart/$file"
meillo@0 736 echo '# dummy' > "$dirpart/$file"
meillo@0 737 done
meillo@0 738 done
meillo@0 739 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
meillo@0 740
meillo@0 741
meillo@0 742 # AM_OUTPUT_DEPENDENCY_COMMANDS
meillo@0 743 # -----------------------------
meillo@0 744 # This macro should only be invoked once -- use via AC_REQUIRE.
meillo@0 745 #
meillo@0 746 # This code is only required when automatic dependency tracking
meillo@0 747 # is enabled. FIXME. This creates each `.P' file that we will
meillo@0 748 # need in order to bootstrap the dependency handling code.
meillo@0 749 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
meillo@0 750 [AC_CONFIG_COMMANDS([depfiles],
meillo@0 751 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
meillo@0 752 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
meillo@0 753 ])
meillo@0 754
meillo@0 755 # Check to see how 'make' treats includes. -*- Autoconf -*-
meillo@0 756
meillo@0 757 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
meillo@0 758
meillo@0 759 # This program is free software; you can redistribute it and/or modify
meillo@0 760 # it under the terms of the GNU General Public License as published by
meillo@0 761 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 762 # any later version.
meillo@0 763
meillo@0 764 # This program is distributed in the hope that it will be useful,
meillo@0 765 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 766 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 767 # GNU General Public License for more details.
meillo@0 768
meillo@0 769 # You should have received a copy of the GNU General Public License
meillo@0 770 # along with this program; if not, write to the Free Software
meillo@0 771 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 772 # 02111-1307, USA.
meillo@0 773
meillo@0 774 # serial 2
meillo@0 775
meillo@0 776 # AM_MAKE_INCLUDE()
meillo@0 777 # -----------------
meillo@0 778 # Check to see how make treats includes.
meillo@0 779 AC_DEFUN([AM_MAKE_INCLUDE],
meillo@0 780 [am_make=${MAKE-make}
meillo@0 781 cat > confinc << 'END'
meillo@0 782 am__doit:
meillo@0 783 @echo done
meillo@0 784 .PHONY: am__doit
meillo@0 785 END
meillo@0 786 # If we don't find an include directive, just comment out the code.
meillo@0 787 AC_MSG_CHECKING([for style of include used by $am_make])
meillo@0 788 am__include="#"
meillo@0 789 am__quote=
meillo@0 790 _am_result=none
meillo@0 791 # First try GNU make style include.
meillo@0 792 echo "include confinc" > confmf
meillo@0 793 # We grep out `Entering directory' and `Leaving directory'
meillo@0 794 # messages which can occur if `w' ends up in MAKEFLAGS.
meillo@0 795 # In particular we don't look at `^make:' because GNU make might
meillo@0 796 # be invoked under some other name (usually "gmake"), in which
meillo@0 797 # case it prints its new name instead of `make'.
meillo@0 798 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
meillo@0 799 am__include=include
meillo@0 800 am__quote=
meillo@0 801 _am_result=GNU
meillo@0 802 fi
meillo@0 803 # Now try BSD make style include.
meillo@0 804 if test "$am__include" = "#"; then
meillo@0 805 echo '.include "confinc"' > confmf
meillo@0 806 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
meillo@0 807 am__include=.include
meillo@0 808 am__quote="\""
meillo@0 809 _am_result=BSD
meillo@0 810 fi
meillo@0 811 fi
meillo@0 812 AC_SUBST([am__include])
meillo@0 813 AC_SUBST([am__quote])
meillo@0 814 AC_MSG_RESULT([$_am_result])
meillo@0 815 rm -f confinc confmf
meillo@0 816 ])
meillo@0 817
meillo@0 818 # AM_CONDITIONAL -*- Autoconf -*-
meillo@0 819
meillo@0 820 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
meillo@0 821
meillo@0 822 # This program is free software; you can redistribute it and/or modify
meillo@0 823 # it under the terms of the GNU General Public License as published by
meillo@0 824 # the Free Software Foundation; either version 2, or (at your option)
meillo@0 825 # any later version.
meillo@0 826
meillo@0 827 # This program is distributed in the hope that it will be useful,
meillo@0 828 # but WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 829 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
meillo@0 830 # GNU General Public License for more details.
meillo@0 831
meillo@0 832 # You should have received a copy of the GNU General Public License
meillo@0 833 # along with this program; if not, write to the Free Software
meillo@0 834 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
meillo@0 835 # 02111-1307, USA.
meillo@0 836
meillo@0 837 # serial 5
meillo@0 838
meillo@0 839 AC_PREREQ(2.52)
meillo@0 840
meillo@0 841 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
meillo@0 842 # -------------------------------------
meillo@0 843 # Define a conditional.
meillo@0 844 AC_DEFUN([AM_CONDITIONAL],
meillo@0 845 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
meillo@0 846 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
meillo@0 847 AC_SUBST([$1_TRUE])
meillo@0 848 AC_SUBST([$1_FALSE])
meillo@0 849 if $2; then
meillo@0 850 $1_TRUE=
meillo@0 851 $1_FALSE='#'
meillo@0 852 else
meillo@0 853 $1_TRUE='#'
meillo@0 854 $1_FALSE=
meillo@0 855 fi
meillo@0 856 AC_CONFIG_COMMANDS_PRE(
meillo@0 857 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
meillo@0 858 AC_MSG_ERROR([conditional "$1" was never defined.
meillo@0 859 Usually this means the macro was only invoked conditionally.])
meillo@0 860 fi])])
meillo@0 861
meillo@0 862 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
meillo@0 863 #
meillo@0 864 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
meillo@0 865 #
meillo@0 866 # This program is free software; you can redistribute it and/or modify
meillo@0 867 # it under the terms of the GNU General Public License as published by
meillo@0 868 # the Free Software Foundation; either version 2 of the License, or
meillo@0 869 # (at your option) any later version.
meillo@0 870 #
meillo@0 871 # This program is distributed in the hope that it will be useful, but
meillo@0 872 # WITHOUT ANY WARRANTY; without even the implied warranty of
meillo@0 873 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
meillo@0 874 # General Public License for more details.
meillo@0 875 #
meillo@0 876 # You should have received a copy of the GNU General Public License
meillo@0 877 # along with this program; if not, write to the Free Software
meillo@0 878 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
meillo@0 879 #
meillo@0 880 # As a special exception to the GNU General Public License, if you
meillo@0 881 # distribute this file as part of a program that contains a
meillo@0 882 # configuration script generated by Autoconf, you may include it under
meillo@0 883 # the same distribution terms that you use for the rest of that program.
meillo@0 884
meillo@0 885 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
meillo@0 886 # ----------------------------------
meillo@0 887 AC_DEFUN([PKG_PROG_PKG_CONFIG],
meillo@0 888 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
meillo@0 889 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
meillo@0 890 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
meillo@0 891 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
meillo@0 892 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
meillo@0 893 fi
meillo@0 894 if test -n "$PKG_CONFIG"; then
meillo@1 895 _pkg_min_version=m4_default([$1], [0.9.0])
meillo@0 896 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
meillo@0 897 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
meillo@0 898 AC_MSG_RESULT([yes])
meillo@0 899 else
meillo@0 900 AC_MSG_RESULT([no])
meillo@0 901 PKG_CONFIG=""
meillo@0 902 fi
meillo@0 903
meillo@0 904 fi[]dnl
meillo@0 905 ])# PKG_PROG_PKG_CONFIG
meillo@0 906
meillo@0 907 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
meillo@0 908 #
meillo@0 909 # Check to see whether a particular set of modules exists. Similar
meillo@0 910 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
meillo@0 911 #
meillo@0 912 #
meillo@0 913 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
meillo@0 914 # this or PKG_CHECK_MODULES is called, or make sure to call
meillo@0 915 # PKG_CHECK_EXISTS manually
meillo@0 916 # --------------------------------------------------------------
meillo@0 917 AC_DEFUN([PKG_CHECK_EXISTS],
meillo@0 918 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
meillo@0 919 if test -n "$PKG_CONFIG" && \
meillo@0 920 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
meillo@0 921 m4_ifval([$2], [$2], [:])
meillo@0 922 m4_ifvaln([$3], [else
meillo@0 923 $3])dnl
meillo@0 924 fi])
meillo@0 925
meillo@0 926
meillo@0 927 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
meillo@0 928 # ---------------------------------------------
meillo@0 929 m4_define([_PKG_CONFIG],
meillo@0 930 [if test -n "$PKG_CONFIG"; then
meillo@1 931 if test -n "$$1"; then
meillo@1 932 pkg_cv_[]$1="$$1"
meillo@1 933 else
meillo@0 934 PKG_CHECK_EXISTS([$3],
meillo@0 935 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
meillo@0 936 [pkg_failed=yes])
meillo@1 937 fi
meillo@0 938 else
meillo@0 939 pkg_failed=untried
meillo@0 940 fi[]dnl
meillo@0 941 ])# _PKG_CONFIG
meillo@0 942
meillo@1 943 # _PKG_SHORT_ERRORS_SUPPORTED
meillo@1 944 # -----------------------------
meillo@1 945 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
meillo@1 946 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
meillo@1 947 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
meillo@1 948 _pkg_short_errors_supported=yes
meillo@1 949 else
meillo@1 950 _pkg_short_errors_supported=no
meillo@1 951 fi[]dnl
meillo@1 952 ])# _PKG_SHORT_ERRORS_SUPPORTED
meillo@1 953
meillo@1 954
meillo@0 955 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
meillo@0 956 # [ACTION-IF-NOT-FOUND])
meillo@0 957 #
meillo@0 958 #
meillo@0 959 # Note that if there is a possibility the first call to
meillo@0 960 # PKG_CHECK_MODULES might not happen, you should be sure to include an
meillo@0 961 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
meillo@0 962 #
meillo@0 963 #
meillo@0 964 # --------------------------------------------------------------
meillo@0 965 AC_DEFUN([PKG_CHECK_MODULES],
meillo@0 966 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
meillo@0 967 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
meillo@0 968 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
meillo@0 969
meillo@0 970 pkg_failed=no
meillo@0 971 AC_MSG_CHECKING([for $1])
meillo@0 972
meillo@0 973 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
meillo@0 974 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
meillo@0 975
meillo@1 976 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
meillo@1 977 and $1[]_LIBS to avoid the need to call pkg-config.
meillo@1 978 See the pkg-config man page for more details.])
meillo@1 979
meillo@0 980 if test $pkg_failed = yes; then
meillo@1 981 _PKG_SHORT_ERRORS_SUPPORTED
meillo@1 982 if test $_pkg_short_errors_supported = yes; then
meillo@1 983 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
meillo@1 984 else
meillo@1 985 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
meillo@1 986 fi
meillo@0 987 # Put the nasty error message in config.log where it belongs
meillo@1 988 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
meillo@0 989
meillo@0 990 ifelse([$4], , [AC_MSG_ERROR(dnl
meillo@1 991 [Package requirements ($2) were not met:
meillo@1 992
meillo@1 993 $$1_PKG_ERRORS
meillo@1 994
meillo@0 995 Consider adjusting the PKG_CONFIG_PATH environment variable if you
meillo@0 996 installed software in a non-standard prefix.
meillo@0 997
meillo@1 998 _PKG_TEXT
meillo@1 999 ])],
meillo@1 1000 [AC_MSG_RESULT([no])
meillo@1 1001 $4])
meillo@0 1002 elif test $pkg_failed = untried; then
meillo@0 1003 ifelse([$4], , [AC_MSG_FAILURE(dnl
meillo@0 1004 [The pkg-config script could not be found or is too old. Make sure it
meillo@0 1005 is in your PATH or set the PKG_CONFIG environment variable to the full
meillo@0 1006 path to pkg-config.
meillo@0 1007
meillo@1 1008 _PKG_TEXT
meillo@0 1009
meillo@1 1010 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
meillo@0 1011 [$4])
meillo@0 1012 else
meillo@0 1013 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
meillo@0 1014 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
meillo@0 1015 AC_MSG_RESULT([yes])
meillo@0 1016 ifelse([$3], , :, [$3])
meillo@0 1017 fi[]dnl
meillo@0 1018 ])# PKG_CHECK_MODULES
meillo@0 1019