~ubuntu-branches/ubuntu/trusty/autoconf/trusty

« back to all changes in this revision

Viewing changes to lib/autoconf/general.m4

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-07-29 11:17:05 UTC
  • mfrom: (4.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090729111705-3td457z1tmjztz4w
Tags: 2.64-1ubuntu1
* Merge from debian unstable, remaining changes: LP: #406182
  - bin/autoreconf.in: Check whether libtoolize supports --install, if it
    does, libtoolize is safe to run at all times since it will not install
    new files unless --install is passed to it as well.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# This file is part of Autoconf.                       -*- Autoconf -*-
2
2
# Parameterized macros.
3
 
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
4
 
# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
3
m4_define([_AC_COPYRIGHT_YEARS],
 
4
[Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 
5
2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
 
6
Foundation, Inc.])
5
7
 
6
8
# This program is free software: you can redistribute it and/or modify
7
9
# it under the terms of the GNU General Public License as published by
104
106
# - VERSION_END
105
107
#   Tail of the handling of --version.
106
108
#
 
109
# - SHELL_FN
 
110
#   Shell functions.
 
111
#
107
112
# - INIT_PREPARE
108
113
#   Tail of initialization code.
109
114
#
146
151
m4_define([_m4_divert(VERSION_USER)],   202)
147
152
m4_define([_m4_divert(VERSION_END)],    203)
148
153
 
 
154
m4_define([_m4_divert(SHELL_FN)],       250)
 
155
 
149
156
m4_define([_m4_divert(INIT_PREPARE)],   300)
150
157
 
151
158
 
186
193
 
187
194
 
188
195
## ----------------------------- ##
 
196
## Implementing shell functions. ##
 
197
## ----------------------------- ##
 
198
 
 
199
 
 
200
# AC_REQUIRE_SHELL_FN(NAME-TO-CHECK, COMMENT, BODY, [DIVERSION = SHELL_FN]
 
201
# ------------------------------------------------------------------------
 
202
# Same as AS_REQUIRE_SHELL_FN except that the default diversion comes
 
203
# later in the script (speeding up configure --help and --version).
 
204
AC_DEFUN([AC_REQUIRE_SHELL_FN],
 
205
[AS_REQUIRE_SHELL_FN([$1], [$2], [$3], m4_default_quoted([$4], [SHELL_FN]))])
 
206
 
 
207
 
 
208
 
 
209
## ----------------------------- ##
189
210
## Implementing Autoconf loops.  ##
190
211
## ----------------------------- ##
191
212
 
226
247
 
227
248
 
228
249
 
229
 
# _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME])
230
 
# --------------------------------------------------------------
 
250
# _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME], [URL])
 
251
# ---------------------------------------------------------------------
231
252
m4_define([_AC_INIT_PACKAGE],
232
253
[AS_LITERAL_IF([$1], [], [m4_warn([syntax], [AC_INIT: not a literal: $1])])
233
254
AS_LITERAL_IF([$2], [],  [m4_warn([syntax], [AC_INIT: not a literal: $2])])
247
268
          [m4_define([AC_PACKAGE_STRING],    [$1 $2])])
248
269
m4_ifndef([AC_PACKAGE_BUGREPORT],
249
270
          [m4_define([AC_PACKAGE_BUGREPORT], [$3])])
 
271
m4_ifndef([AC_PACKAGE_URL],
 
272
          [m4_define([AC_PACKAGE_URL],
 
273
  m4_if([$5], [], [m4_if(m4_index([$1], [GNU ]), [0],
 
274
          [[http://www.gnu.org/software/]m4_defn([AC_PACKAGE_TARNAME])[/]])],
 
275
        [[$5]]))])
250
276
])
251
277
 
252
278
 
253
 
# AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER])
 
279
# AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER],
 
280
#              [FILTER = m4_newline])
254
281
# ------------------------------------------------------
255
282
# Emit TEXT, a copyright notice, in the top of `configure' and in
256
 
# --version output.  Macros in TEXT are evaluated once.
 
283
# --version output.  Macros in TEXT are evaluated once.  Process
 
284
# the --version output through FILTER (m4_newline, m4_do, and
 
285
# m4_copyright_condense are common filters).
257
286
m4_define([AC_COPYRIGHT],
258
 
[AS_COPYRIGHT([$1])[]dnl
259
 
m4_divert_text(m4_default([$2], [VERSION_USER]),
260
 
[
261
 
$1])dnl
262
 
])# AC_COPYRIGHT
 
287
[AS_COPYRIGHT([$1])[]]dnl
 
288
[m4_divert_text(m4_default_quoted([$2], [VERSION_USER]),
 
289
[m4_default([$3], [m4_newline])([$1])])])# AC_COPYRIGHT
263
290
 
264
291
 
265
292
# AC_REVISION(REVISION-INFO)
298
325
# AC_PREREQ(VERSION)
299
326
# ------------------
300
327
# Complain and exit if the Autoconf version is less than VERSION.
 
328
m4_undefine([AC_PREREQ])
301
329
m4_copy([m4_version_prereq], [AC_PREREQ])
302
330
 
303
331
 
324
352
# ---------------
325
353
# Provide useful headers; override the HEADER-COMMENT created by M4sh.
326
354
m4_define([_AC_INIT_NOTICE],
327
 
[m4_divert_text([KILL], [m4_undivert([HEADER-COMMENT])])dnl
328
 
m4_divert_text([HEADER-COMMENT],
 
355
[m4_cleardivert([HEADER-COMMENT])]dnl
 
356
[m4_divert_text([HEADER-COMMENT],
329
357
[@%:@ Guess values for system-dependent variables and create Makefiles.
330
358
@%:@ Generated by m4_PACKAGE_STRING[]dnl
331
359
m4_ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).])
342
370
# We dump to VERSION_FSF to make sure we are inserted before the
343
371
# user copyrights, and after the setup of the --version handling.
344
372
m4_define([_AC_INIT_COPYRIGHT],
345
 
[AC_COPYRIGHT(
346
 
[Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
347
 
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
348
 
This configure script is free software; the Free Software Foundation
 
373
[AC_COPYRIGHT(m4_defn([_AC_COPYRIGHT_YEARS]), [VERSION_FSF], [
 
374
m4_copyright_condense])dnl
 
375
AC_COPYRIGHT(
 
376
[This configure script is free software; the Free Software Foundation
349
377
gives unlimited permission to copy, distribute and modify it.],
350
 
              [VERSION_FSF])dnl
351
 
])
 
378
             [VERSION_FSF], [m4_echo])])
352
379
 
353
380
 
354
381
# File Descriptors
397
424
subdirs=
398
425
MFLAGS=
399
426
MAKEFLAGS=
400
 
AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])dnl
 
427
AC_SUBST([SHELL])dnl
401
428
AC_SUBST([PATH_SEPARATOR])dnl
402
429
 
403
430
# Identity of this package.
411
438
         [m4_ifdef([AC_PACKAGE_STRING],    ['AC_PACKAGE_STRING'])])dnl
412
439
AC_SUBST([PACKAGE_BUGREPORT],
413
440
         [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl
 
441
AC_SUBST([PACKAGE_URL],
 
442
         [m4_ifdef([AC_PACKAGE_URL],       ['AC_PACKAGE_URL'])])dnl
414
443
 
415
444
m4_divert_pop([DEFAULTS])dnl
416
 
m4_wrap([m4_divert_text([DEFAULTS],
 
445
m4_wrap_lifo([m4_divert_text([DEFAULTS],
417
446
[ac_subst_vars='m4_set_dump([_AC_SUBST_VARS], m4_newline)'
418
447
ac_subst_files='m4_ifdef([_AC_SUBST_FILES], [m4_defn([_AC_SUBST_FILES])])'
419
448
ac_user_opts='
863
892
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
864
893
    x_libraries=$ac_optarg ;;
865
894
 
866
 
  -*) AC_MSG_ERROR([unrecognized option: $ac_option
 
895
  -*) AC_MSG_ERROR([unrecognized option: `$ac_option'
867
896
Try `$[0] --help' for more information.])
868
897
    ;;
869
898
 
870
899
  *=*)
871
900
    ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
872
901
    # Reject names that are not valid shell variable names.
873
 
    expr "x$ac_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
874
 
      AC_MSG_ERROR([invalid variable name: $ac_envvar])
 
902
    case $ac_envvar in #(
 
903
      '' | [[0-9]]* | *[[!_$as_cr_alnum]]* )
 
904
      AC_MSG_ERROR([invalid variable name: `$ac_envvar']) ;;
 
905
    esac
875
906
    eval $ac_envvar=\$ac_optarg
876
907
    export $ac_envvar ;;
877
908
 
1095
1126
  cat <<\_ACEOF
1096
1127
m4_divert_pop([HELP_ENABLE])dnl
1097
1128
m4_divert_push([HELP_END])dnl
1098
 
m4_ifset([AC_PACKAGE_BUGREPORT], [
1099
 
Report bugs to <AC_PACKAGE_BUGREPORT>.])
 
1129
 
 
1130
Report bugs to m4_ifset([AC_PACKAGE_BUGREPORT], [<AC_PACKAGE_BUGREPORT>],
 
1131
  [the package provider]).dnl
 
1132
m4_ifdef([AC_PACKAGE_NAME], [m4_ifset([AC_PACKAGE_URL], [
 
1133
AC_PACKAGE_NAME home page: <AC_PACKAGE_URL>.])dnl
 
1134
m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [
 
1135
General help using GNU software: <http://www.gnu.org/gethelp/>.])])
1100
1136
_ACEOF
1101
1137
ac_status=$?
1102
1138
fi
1207
1243
      ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
1208
1244
    esac
1209
1245
    case $ac_pass in
1210
 
    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
 
1246
    1) AS_VAR_APPEND([ac_configure_args0], [" '$ac_arg'"]) ;;
1211
1247
    2)
1212
 
      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
 
1248
      AS_VAR_APPEND([ac_configure_args1], [" '$ac_arg'"])
1213
1249
dnl If trying to remove duplicates, be sure to (i) keep the *last*
1214
1250
dnl value (e.g. --prefix=1 --prefix=2 --prefix=1 might keep 2 only),
1215
1251
dnl and (ii) not to strip long options (--prefix foo --prefix bar might
1231
1267
          -* ) ac_must_keep_next=true ;;
1232
1268
        esac
1233
1269
      fi
1234
 
      ac_configure_args="$ac_configure_args '$ac_arg'"
 
1270
      AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"])
1235
1271
      ;;
1236
1272
    esac
1237
1273
  done
1304
1340
 
1305
1341
# confdefs.h avoids OS command line length limits that DEFS can exceed.
1306
1342
rm -f -r conftest* confdefs.h
 
1343
 
1307
1344
dnl AIX cpp loses on an empty file, NextStep 3.3 (patch 3) loses on a file
1308
1345
dnl containing less than 14 bytes (including the newline).
1309
 
dnl But the defines below solve this problem.
 
1346
AS_ECHO(["/* confdefs.h */"]) > confdefs.h
1310
1347
 
1311
1348
# Predefined preprocessor variables.
1312
1349
AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["$PACKAGE_NAME"],
1313
 
                   [Define to the full name of this package.])
 
1350
                   [Define to the full name of this package.])dnl
1314
1351
AC_DEFINE_UNQUOTED([PACKAGE_TARNAME], ["$PACKAGE_TARNAME"],
1315
 
                   [Define to the one symbol short name of this package.])
 
1352
                   [Define to the one symbol short name of this package.])dnl
1316
1353
AC_DEFINE_UNQUOTED([PACKAGE_VERSION], ["$PACKAGE_VERSION"],
1317
 
                   [Define to the version of this package.])
 
1354
                   [Define to the version of this package.])dnl
1318
1355
AC_DEFINE_UNQUOTED([PACKAGE_STRING], ["$PACKAGE_STRING"],
1319
 
                   [Define to the full name and version of this package.])
 
1356
                   [Define to the full name and version of this package.])dnl
1320
1357
AC_DEFINE_UNQUOTED([PACKAGE_BUGREPORT], ["$PACKAGE_BUGREPORT"],
1321
1358
                   [Define to the address where bug reports for this package
1322
 
                    should be sent.])
 
1359
                    should be sent.])dnl
 
1360
AC_DEFINE_UNQUOTED([PACKAGE_URL], ["$PACKAGE_URL"],
 
1361
                   [Define to the home page for this package.])
1323
1362
 
1324
1363
# Let the site file select an alternate cache file if it wants to.
1325
1364
AC_SITE_LOAD
1339
1378
])
1340
1379
 
1341
1380
 
1342
 
# AC_INIT([PACKAGE, VERSION, [BUG-REPORT])
1343
 
# ----------------------------------------
 
1381
# AC_INIT([PACKAGE, VERSION, [BUG-REPORT], [TARNAME], [URL])
 
1382
# ----------------------------------------------------------
1344
1383
# Include the user macro files, prepare the diversions, and output the
1345
1384
# preamble of the `configure' script.
 
1385
#
 
1386
# If BUG-REPORT is omitted, do without (unless the user previously
 
1387
# defined the m4 macro AC_PACKAGE_BUGREPORT).  If TARNAME is omitted,
 
1388
# use PACKAGE to seed it.  If URL is omitted, use
 
1389
# `http://www.gnu.org/software/TARNAME/' if PACKAGE begins with `GNU',
 
1390
# otherwise, do without.
 
1391
#
1346
1392
# Note that the order is important: first initialize, then set the
1347
1393
# AC_CONFIG_SRCDIR.
1348
1394
m4_define([AC_INIT],
1353
1399
                  [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
1354
1400
# Actually reserved by M4sh.
1355
1401
m4_pattern_allow([^AS_FLAGS$])
1356
 
AS_INIT
1357
 
AS_PREPARE
 
1402
AS_INIT[]dnl
 
1403
AS_PREPARE[]dnl
 
1404
m4_divert_push([KILL])
1358
1405
m4_ifval([$2], [_AC_INIT_PACKAGE($@)])
1359
1406
_AC_INIT_DEFAULTS
1360
1407
_AC_INIT_PARSE_ARGS
1366
1413
_AC_INIT_PREPARE
1367
1414
_AC_INIT_NOTICE
1368
1415
_AC_INIT_COPYRIGHT
 
1416
m4_divert_text([SHELL_FN], [
 
1417
m4_text_box([Autoconf initialization.])])
 
1418
m4_divert_pop
1369
1419
m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
1370
1420
dnl
1371
1421
dnl Substitute for predefined variables.
1410
1460
#
1411
1461
m4_define([_AC_ENABLE_IF],
1412
1462
[@%:@ Check whether --$1-$2 was given.
1413
 
_AC_ENABLE_IF_ACTION([$1], m4_translit([$2], [-.], [__]), [$3], [$4])[]dnl
 
1463
_AC_ENABLE_IF_ACTION([$1], m4_translit([$2], [-.], [__]), [$3], [$4])
1414
1464
])
1415
1465
 
1416
1466
m4_define([_AC_ENABLE_IF_ACTION],
1571
1621
    esac
1572
1622
    case " $ac_configure_args " in
1573
1623
      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
1574
 
      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
 
1624
      *) AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"]) ;;
1575
1625
    esac
1576
1626
  fi
1577
1627
done
1650
1700
AC_DEFUN([AC_CONFIG_AUX_DIRS],
1651
1701
[ac_aux_dir=
1652
1702
for ac_dir in $1; do
1653
 
  if test -f "$ac_dir/install-sh"; then
1654
 
    ac_aux_dir=$ac_dir
1655
 
    ac_install_sh="$ac_aux_dir/install-sh -c"
1656
 
    break
1657
 
  elif test -f "$ac_dir/install.sh"; then
1658
 
    ac_aux_dir=$ac_dir
1659
 
    ac_install_sh="$ac_aux_dir/install.sh -c"
1660
 
    break
1661
 
  elif test -f "$ac_dir/shtool"; then
1662
 
    ac_aux_dir=$ac_dir
1663
 
    ac_install_sh="$ac_aux_dir/shtool install -c"
1664
 
    break
1665
 
  fi
 
1703
  for ac_t in install-sh install.sh shtool; do
 
1704
    if test -f "$ac_dir/$ac_t"; then
 
1705
      ac_aux_dir=$ac_dir
 
1706
      ac_install_sh="$ac_aux_dir/$ac_t -c"
 
1707
      break 2
 
1708
    fi
 
1709
  done
1666
1710
done
1667
1711
if test -z "$ac_aux_dir"; then
1668
 
  AC_MSG_ERROR([cannot find install-sh or install.sh in $1])
 
1712
  AC_MSG_ERROR([cannot find install-sh, install.sh, or shtool in $1])
1669
1713
fi
1670
1714
 
1671
1715
# These three variables are undocumented and unsupported,
1704
1748
# It announces FILE is required in the auxdir.
1705
1749
m4_define([AC_REQUIRE_AUX_FILE],
1706
1750
[AS_LITERAL_IF([$1], [],
1707
 
               [AC_FATAL([$0: requires a literal argument])])])
 
1751
               [m4_fatal([$0: requires a literal argument])])])
1708
1752
 
1709
1753
 
1710
1754
 
1747
1791
 
1748
1792
# AC_CANONICAL_BUILD
1749
1793
# ------------------
1750
 
AC_DEFUN([AC_CANONICAL_BUILD],
 
1794
AC_DEFUN_ONCE([AC_CANONICAL_BUILD],
1751
1795
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1752
1796
AC_REQUIRE_AUX_FILE([config.sub])dnl
1753
1797
AC_REQUIRE_AUX_FILE([config.guess])dnl
1774
1818
 
1775
1819
# AC_CANONICAL_HOST
1776
1820
# -----------------
1777
 
AC_DEFUN([AC_CANONICAL_HOST],
 
1821
AC_DEFUN_ONCE([AC_CANONICAL_HOST],
1778
1822
[AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1779
1823
m4_divert_once([HELP_CANON],
1780
1824
[[  --host=HOST       cross-compile to build programs to run on HOST [BUILD]]])dnl
1792
1836
 
1793
1837
# AC_CANONICAL_TARGET
1794
1838
# -------------------
1795
 
AC_DEFUN([AC_CANONICAL_TARGET],
 
1839
AC_DEFUN_ONCE([AC_CANONICAL_TARGET],
1796
1840
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1797
1841
AC_BEFORE([$0], [AC_ARG_PROGRAM])dnl
1798
1842
m4_divert_once([HELP_CANON],
1900
1944
      case $ac_var in #(
1901
1945
      _ | IFS | as_nl) ;; #(
1902
1946
      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
1903
 
      *) $as_unset $ac_var ;;
 
1947
      *) AS_UNSET([$ac_var]) ;;
1904
1948
      esac ;;
1905
1949
    esac
1906
1950
  done
1908
1952
  (set) 2>&1 |
1909
1953
    case $as_nl`(ac_space=' '; set) 2>&1` in #(
1910
1954
    *${as_nl}ac_space=\ *)
1911
 
      # `set' does not quote correctly, so add quotes (double-quote
1912
 
      # substitution turns \\\\ into \\, and sed turns \\ into \).
 
1955
      # `set' does not quote correctly, so add quotes: double-quote
 
1956
      # substitution turns \\\\ into \\, and sed turns \\ into \.
1913
1957
      sed -n \
1914
1958
        ["s/'/'\\\\''/g;
1915
1959
          s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"]
1985
2029
[where no actions should be taken])])dnl
1986
2030
AS_VAR_SET_IF([$1],
1987
2031
              [_AS_ECHO_N([(cached) ])],
1988
 
              [$2])])
 
2032
              [$2])
 
2033
])
1989
2034
 
1990
2035
 
1991
2036
# AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS)
1996
2041
AC_CACHE_VAL([$2], [$3])dnl
1997
2042
AS_LITERAL_IF([$2],
1998
2043
              [AC_MSG_RESULT([$$2])],
1999
 
              [ac_res=AS_VAR_GET([$2])
 
2044
              [AS_VAR_COPY([ac_res], [$2])
2000
2045
               AC_MSG_RESULT([$ac_res])])dnl
2001
2046
])
2002
2047
 
2030
2075
# This macro is a wrapper around AC_DEFINE_TRACE_LITERAL which filters
2031
2076
# out non literal symbols.  CPP-SYMBOL must not include any parameters.
2032
2077
m4_define([AC_DEFINE_TRACE],
2033
 
[AS_LITERAL_IF([$1], [AC_DEFINE_TRACE_LITERAL([$1])])])
 
2078
[AS_LITERAL_IF([$1], [AC_DEFINE_TRACE_LITERAL(_m4_expand([$1]))])])
2034
2079
 
2035
2080
 
2036
2081
# AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])
2038
2083
# Set VARIABLE to VALUE, verbatim, or 1.  Remember the value
2039
2084
# and if VARIABLE is affected the same VALUE, do nothing, else
2040
2085
# die.  The third argument is used by autoheader.
2041
 
m4_define([AC_DEFINE], [_AC_DEFINE_Q([\], $@)])
 
2086
m4_define([AC_DEFINE], [_AC_DEFINE_Q([_$0], $@)])
 
2087
 
 
2088
# _AC_DEFINE(STRING)
 
2089
# ------------------
 
2090
# Append the pre-expanded STRING and a newline to confdefs.h, as if by
 
2091
# a quoted here-doc.
 
2092
m4_define([_AC_DEFINE],
 
2093
[AS_ECHO(["AS_ESCAPE([[$1]])"]) >>confdefs.h])
2042
2094
 
2043
2095
 
2044
2096
# AC_DEFINE_UNQUOTED(VARIABLE, [VALUE], [DESCRIPTION])
2045
2097
# ----------------------------------------------------
2046
 
# Similar, but perform shell substitutions $ ` \ once on VALUE.
2047
 
m4_define([AC_DEFINE_UNQUOTED], [_AC_DEFINE_Q([], $@)])
2048
 
 
2049
 
 
2050
 
# _AC_DEFINE_Q(QUOTE, VARIABLE, [VALUE], [DESCRIPTION])
 
2098
# Similar, but perform shell substitutions $ ` \ once on VALUE, as
 
2099
# in an unquoted here-doc.
 
2100
m4_define([AC_DEFINE_UNQUOTED], [_AC_DEFINE_Q([_$0], $@)])
 
2101
 
 
2102
# _AC_DEFINE_UNQUOTED(STRING)
 
2103
# ---------------------------
 
2104
# Append the pre-expanded STRING and a newline to confdefs.h, as if
 
2105
# with an unquoted here-doc, but avoiding a fork in the common case of
 
2106
# no backslash, no command substitution, no complex variable
 
2107
# substitution, and no quadrigraphs.
 
2108
m4_define([_AC_DEFINE_UNQUOTED],
 
2109
[m4_if(m4_bregexp([$1], [\\\|`\|\$(\|\${\|@]), [-1],
 
2110
       [AS_ECHO(["AS_ESCAPE([$1], [""])"]) >>confdefs.h],
 
2111
       [cat >>confdefs.h <<_ACEOF
 
2112
[$1]
 
2113
_ACEOF])])
 
2114
 
 
2115
 
 
2116
# _AC_DEFINE_Q(MACRO, VARIABLE, [VALUE], [DESCRIPTION])
2051
2117
# -----------------------------------------------------
2052
2118
# Internal function that performs common elements of AC_DEFINE{,_UNQUOTED}.
2053
 
#
2054
 
# m4_index is roughly 5 to 8 times faster than m4_bpatsubst, so only
2055
 
# use the regex when necessary.  AC_name is defined with over-quotation,
2056
 
# so that we can avoid m4_defn.
 
2119
# MACRO must take one argument, which is the fully expanded string to
 
2120
# append to confdefs.h as if by a possibly-quoted here-doc.
 
2121
#
 
2122
# m4_index is roughly 5 to 8 times faster than m4_bpatsubst, so we use
 
2123
# m4_format rather than regex to grab prefix up to first ().  AC_name
 
2124
# is defined with over-quotation, so that we can avoid m4_defn; this
 
2125
# is only safe because the name should not contain $.
 
2126
#
 
2127
# Guarantee a match in m4_index, so as to avoid a bug with precision
 
2128
# -1 in m4_format in older m4.
2057
2129
m4_define([_AC_DEFINE_Q],
2058
 
[m4_pushdef([AC_name], m4_if(m4_index([$2], [(]), [-1], [[[$2]]],
2059
 
                             [m4_bpatsubst([[[$2]]], [(.*)])]))dnl
2060
 
AC_DEFINE_TRACE(AC_name)dnl
2061
 
m4_cond([m4_index([$3], [
 
2130
[m4_pushdef([AC_name], m4_format([[[%.*s]]], m4_index([$2(], [(]), [$2]))]dnl
 
2131
[AC_DEFINE_TRACE(AC_name)]dnl
 
2132
[m4_cond([m4_index([$3], [
2062
2133
])], [-1], [],
2063
2134
        [AS_LITERAL_IF([$3], [m4_bregexp([[$3]], [[^\\]
2064
2135
], [-])])], [], [],
2065
 
        [m4_warn([syntax], [AC_DEFINE]m4_ifval([$1], [], [[_UNQUOTED]])dnl
2066
 
[: `$3' is not a valid preprocessor define value])])dnl
2067
 
m4_ifval([$4], [AH_TEMPLATE(AC_name, [$4])])dnl
2068
 
m4_popdef([AC_name])dnl
2069
 
cat >>confdefs.h <<$1_ACEOF
2070
 
[@%:@define] $2 m4_if([$#], 2, 1, [$3], [], [/**/], [$3])
2071
 
_ACEOF
 
2136
        [m4_warn([syntax], [AC_DEFINE]m4_if([$1], [_AC_DEFINE], [],
 
2137
  [[_UNQUOTED]])[: `$3' is not a valid preprocessor define value])])]dnl
 
2138
[m4_ifval([$4], [AH_TEMPLATE(AC_name, [$4])
 
2139
])_m4_popdef([AC_name])]dnl
 
2140
[$1(m4_expand([[@%:@define] $2 ]m4_if([$#], 2, 1,
 
2141
  [$3], [], [/**/], [[$3]])))
2072
2142
])
2073
2143
 
2074
2144
 
2092
2162
#
2093
2163
m4_define([AC_SUBST],
2094
2164
[AS_IDENTIFIER_IF([$1], [],
2095
 
  [AC_FATAL([$0: `$1' is not a valid shell variable name])])dnl
2096
 
AC_SUBST_TRACE([$1])dnl
2097
 
m4_pattern_allow([^$1$])dnl
2098
 
m4_ifvaln([$2], [$1=$2])[]dnl
2099
 
m4_set_add([_AC_SUBST_VARS], [$1])dnl
2100
 
])# AC_SUBST
 
2165
  [m4_fatal([$0: `$1' is not a valid shell variable name])])]dnl
 
2166
[AC_SUBST_TRACE([$1])]dnl
 
2167
[m4_pattern_allow([^$1$])]dnl
 
2168
[m4_ifvaln([$2], [$1=$2])[]]dnl
 
2169
[m4_set_add([_AC_SUBST_VARS], [$1])])# AC_SUBST
2101
2170
 
2102
2171
 
2103
2172
# AC_SUBST_FILE(VARIABLE)
2189
2258
# ----------------------------------
2190
2259
# No escaping, so it performed also backtick substitution.
2191
2260
AU_DEFUN([AC_MSG_RESULT_UNQUOTED],
2192
 
[_AS_ECHO_UNQUOTED([$as_me:$LINENO: result: $1], AS_MESSAGE_LOG_FD)
 
2261
[_AS_ECHO_UNQUOTED([$as_me:${as_lineno-$LINENO}: result: $1], AS_MESSAGE_LOG_FD)
2193
2262
_AS_ECHO_UNQUOTED([$1])[]dnl
2194
2263
])
2195
2264
 
2210
2279
 
2211
2280
# _AC_RUN_LOG(COMMAND, LOG-COMMANDS)
2212
2281
# ----------------------------------
2213
 
# Eval COMMAND, save the exit status in ac_status, and log it.
 
2282
# Eval COMMAND, save the exit status in ac_status, and log it.  The return
 
2283
# code is 0 if COMMAND succeeded, so that it can be used directly in AS_IF
 
2284
# constructs.
2214
2285
AC_DEFUN([_AC_RUN_LOG],
2215
 
[{ ($2) >&AS_MESSAGE_LOG_FD
 
2286
[{ { $2; } >&AS_MESSAGE_LOG_FD
2216
2287
  ($1) 2>&AS_MESSAGE_LOG_FD
2217
2288
  ac_status=$?
2218
2289
  _AS_ECHO_LOG([\$? = $ac_status])
2219
 
  (exit $ac_status); }])
 
2290
  test $ac_status = 0; }])
2220
2291
 
2221
2292
 
2222
2293
# _AC_RUN_LOG_STDERR(COMMAND, LOG-COMMANDS)
2226
2297
# use.
2227
2298
# Note that when tracing, most shells will leave the traces in stderr
2228
2299
# starting with "+": that's what this macro tries to address.
 
2300
# The return code is 0 if COMMAND succeeded, so that it can be used directly
 
2301
# in AS_IF constructs.
2229
2302
AC_DEFUN([_AC_RUN_LOG_STDERR],
2230
 
[{ ($2) >&AS_MESSAGE_LOG_FD
2231
 
  ($1) 2>conftest.er1
2232
 
  ac_status=$?
2233
 
  grep -v '^ *+' conftest.er1 >conftest.err
2234
 
  rm -f conftest.er1
2235
 
  cat conftest.err >&AS_MESSAGE_LOG_FD
2236
 
  _AS_ECHO_LOG([\$? = $ac_status])
2237
 
  (exit $ac_status); }])
 
2303
[{ { $2; } >&AS_MESSAGE_LOG_FD
 
2304
  ($1) 2>conftest.err
 
2305
  ac_status=$?
 
2306
  if test -s conftest.err; then
 
2307
    grep -v '^ *+' conftest.err >conftest.er1
 
2308
    cat conftest.er1 >&AS_MESSAGE_LOG_FD
 
2309
    mv -f conftest.er1 conftest.err
 
2310
  fi
 
2311
  _AS_ECHO_LOG([\$? = $ac_status])
 
2312
  test $ac_status = 0; }])
 
2313
 
 
2314
 
 
2315
# _AC_RUN_LOG_LIMIT(COMMAND, LOG-COMMANDS, [LINES])
 
2316
# -------------------------------------------------
 
2317
# Like _AC_RUN_LOG, but only log LINES lines from stderr,
 
2318
# defaulting to 10 lines.
 
2319
AC_DEFUN([_AC_RUN_LOG_LIMIT],
 
2320
[{ { $2; } >&AS_MESSAGE_LOG_FD
 
2321
  ($1) 2>conftest.err
 
2322
  ac_status=$?
 
2323
  if test -s conftest.err; then
 
2324
    sed 'm4_default([$3], [10])a\
 
2325
... rest of stderr output deleted ...
 
2326
         m4_default([$3], [10])q' conftest.err >conftest.er1
 
2327
    cat conftest.er1 >&AS_MESSAGE_LOG_FD
 
2328
    rm -f conftest.er1 conftest.err
 
2329
  fi
 
2330
  _AS_ECHO_LOG([\$? = $ac_status])
 
2331
  test $ac_status = 0; }])
 
2332
 
2238
2333
 
2239
2334
# _AC_DO_ECHO(COMMAND)
2240
2335
# --------------------
2241
2336
# Echo COMMAND.  This is designed to be used just before evaluating COMMAND.
2242
2337
AC_DEFUN([_AC_DO_ECHO],
2243
2338
[m4_if([$1], [$ac_try], [], [ac_try="$1"
2244
 
])dnl
 
2339
])]dnl
2245
2340
dnl If the string contains '\"', '`', or '\\', then just echo it rather
2246
2341
dnl than expanding it.  This is a hack, but it is safer, while also
2247
2342
dnl typically expanding simple substrings like '$CC', which is what we want.
2255
2350
dnl We normally wouldn't bother with this kind of workaround for invalid code
2256
2351
dnl but this change was put in just before Autoconf 2.60 and we wanted to
2257
2352
dnl minimize the integration hassle.
2258
 
[case "(($ac_try" in
 
2353
[[case "(($ac_try" in
2259
2354
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2260
2355
  *) ac_try_echo=$ac_try;;
2261
2356
esac
2262
 
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""]
 
2357
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""]
2263
2358
AS_ECHO(["$ac_try_echo"])])
2264
2359
 
2265
2360
# _AC_DO(COMMAND)
2297
2392
  _AC_DO([$ac_try]); }])
2298
2393
 
2299
2394
 
 
2395
# _AC_DO_LIMIT(COMMAND, [LINES])
 
2396
# ------------------------------
 
2397
# Like _AC_DO, but limit the amount of stderr lines logged to LINES.
 
2398
# For internal use only.
 
2399
AC_DEFUN([_AC_DO_LIMIT],
 
2400
[_AC_RUN_LOG_LIMIT([eval "$1"],
 
2401
                   [_AC_DO_ECHO([$1])], [$2])])
 
2402
 
 
2403
 
2300
2404
# _AC_EVAL(COMMAND)
2301
2405
# -----------------
2302
2406
# Eval COMMAND, save the exit status in ac_status, and log it.
2304
2408
# It is present only for backward compatibility with previous Autoconf versions.
2305
2409
AC_DEFUN([_AC_EVAL],
2306
2410
[_AC_RUN_LOG([eval $1],
2307
 
             [eval echo "$as_me:$LINENO: \"$1\""])])
 
2411
             [eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$1\""])])
2308
2412
 
2309
2413
 
2310
2414
# _AC_EVAL_STDERR(COMMAND)
2314
2418
# It is present only for backward compatibility with previous Autoconf versions.
2315
2419
AC_DEFUN([_AC_EVAL_STDERR],
2316
2420
[_AC_RUN_LOG_STDERR([eval $1],
2317
 
                    [eval echo "$as_me:$LINENO: \"$1\""])])
 
2421
                    [eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$1\""])])
2318
2422
 
2319
2423
 
2320
2424
# AC_TRY_EVAL(VARIABLE)
2350
2454
# -------------------
2351
2455
AC_DEFUN([AC_RUN_LOG],
2352
2456
[_AC_RUN_LOG([$1],
2353
 
             [AS_ECHO(["$as_me:$LINENO: AS_ESCAPE([$1])"])])])
 
2457
             [AS_ECHO(["$as_me:${as_lineno-$LINENO}: AS_ESCAPE([$1])"])])])
2354
2458
 
2355
2459
 
2356
2460
 
2360
2464
## ------------------------ ##
2361
2465
 
2362
2466
 
 
2467
# _AC_PREPROC_IFELSE_BODY
 
2468
# -----------------------
 
2469
# Shell function body for _AC_PREPROC_IFELSE.
 
2470
m4_define([_AC_PREPROC_IFELSE_BODY],
 
2471
[  AS_LINENO_PUSH([$[]1])
 
2472
  AS_IF([_AC_DO_STDERR([$ac_cpp conftest.$ac_ext]) >/dev/null && {
 
2473
         test -z "$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
 
2474
         test ! -s conftest.err
 
2475
       }],
 
2476
    [ac_retval=0],
 
2477
    [_AC_MSG_LOG_CONFTEST
 
2478
    ac_retval=1])
 
2479
  AS_LINENO_POP
 
2480
  return $ac_retval
 
2481
])# _AC_PREPROC_IFELSE_BODY
 
2482
 
2363
2483
 
2364
2484
# _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2365
2485
# ----------------------------------------------------------------
2368
2488
# This macro can be used during the selection of a preprocessor.
2369
2489
# eval is necessary to expand ac_cpp.
2370
2490
AC_DEFUN([_AC_PREPROC_IFELSE],
2371
 
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
2372
 
AS_IF([_AC_DO_STDERR([$ac_cpp conftest.$ac_ext]) >/dev/null && {
2373
 
         test -z "$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
2374
 
         test ! -s conftest.err
2375
 
       }],
2376
 
  [$2],
2377
 
  [_AC_MSG_LOG_CONFTEST
2378
 
  $3])
2379
 
rm -f conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl
 
2491
[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_cpp],
 
2492
  [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_cpp], [LINENO],
 
2493
    [Try to preprocess conftest.$ac_ext, and return whether this succeeded.])],
 
2494
  [$0_BODY])]dnl
 
2495
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
 
2496
[AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_cpp "$LINENO"], [$2], [$3])
 
2497
rm -f conftest.err[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2380
2498
])# _AC_PREPROC_IFELSE
2381
2499
 
2382
 
 
2383
2500
# AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2384
2501
# ---------------------------------------------------------------
2385
2502
# Try to preprocess PROGRAM.  Requires that the preprocessor for the
2415
2532
dnl Quote $1 to prevent m4 from eating character classes
2416
2533
  $EGREP "[$1]" >/dev/null 2>&1],
2417
2534
  [$3],
2418
 
  [$4])dnl
 
2535
  [$4])
2419
2536
rm -f conftest*
2420
2537
])# AC_EGREP_CPP
2421
2538
 
2435
2552
## Examining syntax.  ##
2436
2553
## ------------------ ##
2437
2554
 
 
2555
# _AC_COMPILE_IFELSE_BODY
 
2556
# -----------------------
 
2557
# Shell function body for _AC_COMPILE_IFELSE.
 
2558
m4_define([_AC_COMPILE_IFELSE_BODY],
 
2559
[  AS_LINENO_PUSH([$[]1])
 
2560
  rm -f conftest.$ac_objext
 
2561
  AS_IF([_AC_DO_STDERR($ac_compile) && {
 
2562
         test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
 
2563
         test ! -s conftest.err
 
2564
       } && test -s conftest.$ac_objext],
 
2565
      [ac_retval=0],
 
2566
      [_AC_MSG_LOG_CONFTEST
 
2567
        ac_retval=1])
 
2568
  AS_LINENO_POP
 
2569
  return $ac_retval
 
2570
])# _AC_COMPILE_IFELSE_BODY
 
2571
 
2438
2572
 
2439
2573
# _AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2440
2574
# ----------------------------------------------------------------
2441
2575
# Try to compile PROGRAM.
2442
2576
# This macro can be used during the selection of a compiler.
2443
 
m4_define([_AC_COMPILE_IFELSE],
2444
 
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
2445
 
rm -f conftest.$ac_objext
2446
 
AS_IF([_AC_DO_STDERR($ac_compile) && {
2447
 
         test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
2448
 
         test ! -s conftest.err
2449
 
       } && test -s conftest.$ac_objext],
2450
 
      [$2],
2451
 
      [_AC_MSG_LOG_CONFTEST
2452
 
        $3])
2453
 
rm -f core conftest.err conftest.$ac_objext m4_ifval([$1], [conftest.$ac_ext])[]dnl
 
2577
AC_DEFUN([_AC_COMPILE_IFELSE],
 
2578
[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_compile],
 
2579
  [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_compile], [LINENO],
 
2580
    [Try to compile conftest.$ac_ext, and return whether this succeeded.])],
 
2581
  [$0_BODY])]dnl
 
2582
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
 
2583
[AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_compile "$LINENO"], [$2], [$3])
 
2584
rm -f core conftest.err conftest.$ac_objext[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2454
2585
])# _AC_COMPILE_IFELSE
2455
2586
 
2456
2587
 
2477
2608
## --------------------- ##
2478
2609
 
2479
2610
 
 
2611
# _AC_LINK_IFELSE_BODY
 
2612
# --------------------
 
2613
# Shell function body for _AC_LINK_IFELSE.
 
2614
m4_define([_AC_LINK_IFELSE_BODY],
 
2615
[  AS_LINENO_PUSH([$[]1])
 
2616
  rm -f conftest.$ac_objext conftest$ac_exeext
 
2617
  AS_IF([_AC_DO_STDERR($ac_link) && {
 
2618
         test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
 
2619
         test ! -s conftest.err
 
2620
       } && test -s conftest$ac_exeext && {
 
2621
         test "$cross_compiling" = yes ||
 
2622
         AS_TEST_X([conftest$ac_exeext])
 
2623
       }],
 
2624
      [ac_retval=0],
 
2625
      [_AC_MSG_LOG_CONFTEST
 
2626
        ac_retval=1])
 
2627
  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
 
2628
  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
 
2629
  # interfere with the next link command; also delete a directory that is
 
2630
  # left behind by Apple's compiler.  We do this before executing the actions.
 
2631
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
 
2632
  AS_LINENO_POP
 
2633
  return $ac_retval
 
2634
])# _AC_LINK_IFELSE_BODY
 
2635
 
 
2636
 
2480
2637
# _AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2481
2638
# -------------------------------------------------------------
2482
2639
# Try to link PROGRAM.
2488
2645
# reported by Chris Johns in
2489
2646
# <http://lists.gnu.org/archive/html/autoconf/2007-03/msg00085.html>.
2490
2647
#
2491
 
m4_define([_AC_LINK_IFELSE],
2492
 
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
2493
 
rm -f conftest.$ac_objext conftest$ac_exeext
2494
 
AS_IF([_AC_DO_STDERR($ac_link) && {
2495
 
         test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
2496
 
         test ! -s conftest.err
2497
 
       } && test -s conftest$ac_exeext && {
2498
 
         test "$cross_compiling" = yes ||
2499
 
         AS_TEST_X([conftest$ac_exeext])
2500
 
       }],
2501
 
      [$2],
2502
 
      [_AC_MSG_LOG_CONFTEST
2503
 
        $3])
2504
 
dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
2505
 
dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
2506
 
dnl as it would interfere with the next link command.
2507
 
rm -rf conftest.dSYM
2508
 
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
2509
 
      conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
 
2648
AC_DEFUN([_AC_LINK_IFELSE],
 
2649
[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_link],
 
2650
  [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_link], [LINENO],
 
2651
    [Try to link conftest.$ac_ext, and return whether this succeeded.])],
 
2652
  [$0_BODY])]dnl
 
2653
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
 
2654
[AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_link "$LINENO"], [$2], [$3])
 
2655
rm -f core conftest.err conftest.$ac_objext \
 
2656
    conftest$ac_exeext[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2510
2657
])# _AC_LINK_IFELSE
2511
2658
 
2512
2659
 
2543
2690
## ------------------------------- ##
2544
2691
 
2545
2692
 
 
2693
# _AC_RUN_IFELSE_BODY
 
2694
# -------------------
 
2695
# Shell function body for _AC_RUN_IFELSE.
 
2696
m4_define([_AC_RUN_IFELSE_BODY],
 
2697
[  AS_LINENO_PUSH([$[]1])
 
2698
  AS_IF([_AC_DO_VAR(ac_link) && _AC_DO_TOKENS(./conftest$ac_exeext)],
 
2699
      [ac_retval=0],
 
2700
      [AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
 
2701
       _AC_MSG_LOG_CONFTEST
 
2702
       ac_retval=$ac_status])
 
2703
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
 
2704
  AS_LINENO_POP
 
2705
  return $ac_retval
 
2706
])# _AC_RUN_IFELSE_BODY
 
2707
 
 
2708
 
2546
2709
# _AC_RUN_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2547
2710
# ------------------------------------------------------------
2548
2711
# Compile, link, and run.
2550
2713
# We also remove conftest.o as if the compilation fails, some compilers
2551
2714
# don't remove it.  We remove gmon.out and bb.out, which may be
2552
2715
# created during the run if the program is built with profiling support.
2553
 
m4_define([_AC_RUN_IFELSE],
2554
 
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
2555
 
rm -f conftest$ac_exeext
2556
 
AS_IF([_AC_DO_VAR(ac_link) && _AC_DO_TOKENS(./conftest$ac_exeext)],
2557
 
      [$2],
2558
 
      [AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
2559
 
_AC_MSG_LOG_CONFTEST
2560
 
m4_ifvaln([$3],
2561
 
          [( exit $ac_status )
2562
 
$3])dnl])[]dnl
2563
 
rm -rf conftest.dSYM
2564
 
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext m4_ifval([$1],
2565
 
                                                     [conftest.$ac_ext])[]dnl
 
2716
AC_DEFUN([_AC_RUN_IFELSE],
 
2717
[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_run],
 
2718
  [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_run], [LINENO],
 
2719
    [Try to link conftest.$ac_ext, and return whether this succeeded.
 
2720
     Assumes that executables *can* be run.])],
 
2721
  [$0_BODY])]dnl
 
2722
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
 
2723
[AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_run "$LINENO"], [$2], [$3])
 
2724
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
 
2725
  conftest.$ac_objext conftest.beam[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
2566
2726
])# _AC_RUN_IFELSE
2567
2727
 
2568
 
 
2569
2728
# AC_RUN_IFELSE(PROGRAM,
2570
2729
#               [ACTION-IF-TRUE], [ACTION-IF-FALSE],
2571
2730
#               [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
2614
2773
else
2615
2774
  AS_VAR_SET([ac_File], [no])
2616
2775
fi])
2617
 
AS_VAR_IF([ac_File], [yes], [$2], [$3])[]dnl
 
2776
AS_VAR_IF([ac_File], [yes], [$2], [$3])
2618
2777
AS_VAR_POPDEF([ac_File])dnl
2619
2778
])# AC_CHECK_FILE
2620
2779
 
2621
2780
 
 
2781
# _AC_CHECK_FILES(FILE)
 
2782
# ---------------------
 
2783
# Helper to AC_CHECK_FILES, which generates two of the three arguments
 
2784
# to AC_CHECK_FILE based on FILE.
 
2785
m4_define([_AC_CHECK_FILES],
 
2786
[[$1], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]), [1],
 
2787
  [Define to 1 if you have the file `$1'.])]])
 
2788
 
 
2789
 
2622
2790
# AC_CHECK_FILES(FILE..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2623
2791
# -----------------------------------------------------------------
 
2792
# For each word in the whitespace-separated FILE list, perform either
 
2793
# ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.  For files that exist, also
 
2794
# provide the preprocessor variable HAVE_FILE.
2624
2795
AC_DEFUN([AC_CHECK_FILES],
2625
 
[m4_foreach_w([AC_FILE_NAME], [$1],
2626
 
  [AC_CHECK_FILE(AC_FILE_NAME,
2627
 
                 [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]AC_FILE_NAME), 1,
2628
 
                                    [Define to 1 if you have the
2629
 
                                     file `]AC_File['.])
2630
 
$2],
2631
 
                 [$3])])])
 
2796
[m4_map_args_w([$1], [AC_CHECK_FILE(_$0(], [)[$2], [$3])])])
2632
2797
 
2633
2798
 
2634
2799
## ------------------------------- ##
2636
2801
## ------------------------------- ##
2637
2802
 
2638
2803
 
 
2804
# _AC_CHECK_DECL_BODY
 
2805
# -------------------
 
2806
# Shell function body for AC_CHECK_DECL.
 
2807
m4_define([_AC_CHECK_DECL_BODY],
 
2808
[  AS_LINENO_PUSH([$[]1])
 
2809
  AC_CACHE_CHECK([whether $[]2 is declared], [$[]3],
 
2810
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4],
 
2811
[@%:@ifndef $[]2
 
2812
  (void) $[]2;
 
2813
@%:@endif
 
2814
])],
 
2815
                   [AS_VAR_SET([$[]3], [yes])],
 
2816
                   [AS_VAR_SET([$[]3], [no])])])
 
2817
  AS_LINENO_POP
 
2818
])# _AC_CHECK_DECL_BODY
 
2819
 
2639
2820
# AC_CHECK_DECL(SYMBOL,
2640
2821
#               [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2641
2822
#               [INCLUDES = DEFAULT-INCLUDES])
2642
2823
# -------------------------------------------------------
2643
2824
# Check whether SYMBOL (a function, variable, or constant) is declared.
2644
2825
AC_DEFUN([AC_CHECK_DECL],
2645
 
[AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])dnl
2646
 
AC_CACHE_CHECK([whether $1 is declared], [ac_Symbol],
2647
 
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],
2648
 
[#ifndef $1
2649
 
  (void) $1;
2650
 
#endif
2651
 
])],
2652
 
                   [AS_VAR_SET([ac_Symbol], [yes])],
2653
 
                   [AS_VAR_SET([ac_Symbol], [no])])])
2654
 
AS_VAR_IF([ac_Symbol], [yes], [$2], [$3])[]dnl
 
2826
[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_check_decl],
 
2827
  [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_check_decl],
 
2828
    [LINENO SYMBOL VAR],
 
2829
    [Tests whether SYMBOL is declared, setting cache variable VAR accordingly.])],
 
2830
  [_$0_BODY])]dnl
 
2831
[AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])]dnl
 
2832
[ac_fn_[]_AC_LANG_ABBREV[]_check_decl ]dnl
 
2833
["$LINENO" "$1" "ac_Symbol" "AS_ESCAPE([AC_INCLUDES_DEFAULT([$4])], [""])"
 
2834
AS_VAR_IF([ac_Symbol], [yes], [$2], [$3])
2655
2835
AS_VAR_POPDEF([ac_Symbol])dnl
2656
2836
])# AC_CHECK_DECL
2657
2837
 
2658
2838
 
 
2839
# _AC_CHECK_DECLS(SYMBOL, ACTION-IF_FOUND, ACTION-IF-NOT-FOUND,
 
2840
#                 INCLUDES)
 
2841
# -------------------------------------------------------------
 
2842
# Helper to AC_CHECK_DECLS, which generates the check for a single
 
2843
# SYMBOL with INCLUDES, performs the AC_DEFINE, then expands
 
2844
# ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.
 
2845
m4_define([_AC_CHECK_DECLS],
 
2846
[AC_CHECK_DECL([$1], [ac_have_decl=1], [ac_have_decl=0], [$4])]dnl
 
2847
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_DECL_$1]), [$ac_have_decl],
 
2848
  [Define to 1 if you have the declaration of `$1',
 
2849
   and to 0 if you don't.])]dnl
 
2850
[m4_ifvaln([$2$3], [AS_IF([test $ac_have_decl = 1], [$2], [$3])])])
 
2851
 
2659
2852
# AC_CHECK_DECLS(SYMBOLS,
2660
2853
#                [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2661
2854
#                [INCLUDES = DEFAULT-INCLUDES])
2664
2857
# documentation for a detailed explanation of this difference with
2665
2858
# other AC_CHECK_*S macros.  SYMBOLS is an m4 list.
2666
2859
AC_DEFUN([AC_CHECK_DECLS],
2667
 
[m4_foreach([AC_Symbol], [$1],
2668
 
  [AC_CHECK_DECL(AC_Symbol,
2669
 
                 [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_DECL_]AC_Symbol), 1,
2670
 
                                     [Define to 1 if you have the declaration
2671
 
                                     of `]AC_Symbol[', and to 0 if you don't.])
2672
 
$2],
2673
 
                 [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_DECL_]AC_Symbol), 0)
2674
 
$3],
2675
 
                 [$4])])
2676
 
])# AC_CHECK_DECLS
2677
 
 
 
2860
[m4_map_args_sep([_$0(], [, [$2], [$3], [$4])], [], $1)])
 
2861
 
 
2862
 
 
2863
# _AC_CHECK_DECL_ONCE(SYMBOL)
 
2864
# ---------------------------
 
2865
# Check for a single SYMBOL once.
 
2866
m4_define([_AC_CHECK_DECL_ONCE],
 
2867
[AC_DEFUN([_AC_Check_Decl_$1], [_AC_CHECK_DECLS([$1])])]dnl
 
2868
[AC_REQUIRE([_AC_Check_Decl_$1])])
2678
2869
 
2679
2870
# AC_CHECK_DECLS_ONCE(SYMBOLS)
2680
2871
# ----------------------------
2681
2872
# Like AC_CHECK_DECLS(SYMBOLS), but do it at most once.
2682
2873
AC_DEFUN([AC_CHECK_DECLS_ONCE],
2683
 
[
2684
 
  m4_foreach([AC_Symbol], [$1],
2685
 
    [AC_DEFUN([_AC_Check_Decl_]m4_defn([AC_Symbol]),
2686
 
       [AC_CHECK_DECLS(m4_defn([AC_Symbol]))])
2687
 
     AC_REQUIRE([_AC_Check_Decl_]m4_defn([AC_Symbol]))])
2688
 
])
 
2874
[m4_map_args_sep([_AC_CHECK_DECL_ONCE(], [)], [], $1)])
2689
2875
 
2690
2876
 
2691
2877
 
2710
2896
# AC_LIBSOURCES([FILE-NAME1, ...])
2711
2897
# -------------------------------
2712
2898
# Announce we might need these files.
2713
 
m4_define([AC_LIBSOURCES],
2714
 
[m4_foreach([_AC_FILE_NAME], [$1],
2715
 
            [AC_LIBSOURCE(_AC_FILE_NAME)])])
 
2899
AC_DEFUN([AC_LIBSOURCES],
 
2900
[m4_map_args([AC_LIBSOURCE], $1)])
2716
2901
 
2717
2902
 
2718
2903
# _AC_LIBOBJ(FILE-NAME-NOEXT, ACTION-IF-INDIR)
2732
2917
# AC_LIBOBJ(FILE-NAME-NOEXT)
2733
2918
# -------------------------
2734
2919
# We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'.
2735
 
m4_define([AC_LIBOBJ],
 
2920
AC_DEFUN([AC_LIBOBJ],
2736
2921
[_AC_LIBOBJ([$1],
2737
2922
            [AC_DIAGNOSE(syntax,
2738
2923
                         [$0($1): you should use literals])])dnl
2753
2938
  ac_i=`AS_ECHO(["$ac_i"]) | sed "$ac_script"`
2754
2939
  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
2755
2940
  #    will be set to the directory where LIBOBJS objects are built.
2756
 
  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
2757
 
  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
 
2941
  AS_VAR_APPEND([ac_libobjs], [" \${LIBOBJDIR}$ac_i\$U.$ac_objext"])
 
2942
  AS_VAR_APPEND([ac_ltlibobjs], [" \${LIBOBJDIR}$ac_i"'$U.lo'])
2758
2943
done
2759
2944
AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
2760
2945
AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
2766
2951
## ----------------------------------- ##
2767
2952
 
2768
2953
 
2769
 
# _AC_COMPUTE_INT_COMPILE(EXPRESSION, VARIABLE, PROLOGUE, [IF-FAILS])
2770
 
# -------------------------------------------------------------------
 
2954
# _AC_COMPUTE_INT_COMPILE(EXPRESSION, VARIABLE, PROLOGUE, [IF-SUCCESS],
 
2955
#                         [IF-FAILURE])
 
2956
# ---------------------------------------------------------------------
2771
2957
# Compute the integer EXPRESSION and store the result in the VARIABLE.
2772
2958
# Works OK if cross compiling, but assumes twos-complement arithmetic.
2773
2959
m4_define([_AC_COMPUTE_INT_COMPILE],
2777
2963
  while :; do
2778
2964
    _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
2779
2965
                       [ac_hi=$ac_mid; break],
2780
 
                       [ac_lo=`expr $ac_mid + 1`
 
2966
                       [AS_VAR_ARITH([ac_lo], [$ac_mid + 1])
2781
2967
                        if test $ac_lo -le $ac_mid; then
2782
2968
                          ac_lo= ac_hi=
2783
2969
                          break
2784
2970
                        fi
2785
 
                        ac_mid=`expr 2 '*' $ac_mid + 1`])
 
2971
                        AS_VAR_ARITH([ac_mid], [2 '*' $ac_mid + 1])])
2786
2972
  done],
2787
2973
[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) < 0])],
2788
2974
 [ac_hi=-1 ac_mid=-1
2789
2975
  while :; do
2790
2976
    _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= $ac_mid])],
2791
2977
                       [ac_lo=$ac_mid; break],
2792
 
                       [ac_hi=`expr '(' $ac_mid ')' - 1`
 
2978
                       [AS_VAR_ARITH([ac_hi], ['(' $ac_mid ')' - 1])
2793
2979
                        if test $ac_mid -le $ac_hi; then
2794
2980
                          ac_lo= ac_hi=
2795
2981
                          break
2796
2982
                        fi
2797
 
                        ac_mid=`expr 2 '*' $ac_mid`])
 
2983
                        AS_VAR_ARITH([ac_mid], [2 '*' $ac_mid])])
2798
2984
  done],
2799
2985
 [ac_lo= ac_hi=])])
2800
2986
# Binary search between lo and hi bounds.
2801
2987
while test "x$ac_lo" != "x$ac_hi"; do
2802
 
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
 
2988
  AS_VAR_ARITH([ac_mid], ['(' $ac_hi - $ac_lo ')' / 2 + $ac_lo])
2803
2989
  _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
2804
 
                     [ac_hi=$ac_mid], [ac_lo=`expr '(' $ac_mid ')' + 1`])
 
2990
                     [ac_hi=$ac_mid],
 
2991
                     [AS_VAR_ARITH([ac_lo], ['(' $ac_mid ')' + 1])])
2805
2992
done
2806
 
case $ac_lo in
2807
 
?*) $2=$ac_lo;;
2808
 
'') $4 ;;
 
2993
case $ac_lo in @%:@((
 
2994
?*) AS_VAR_SET([$2], [$ac_lo]); $4 ;;
 
2995
'') $5 ;;
2809
2996
esac[]dnl
2810
2997
])# _AC_COMPUTE_INT_COMPILE
2811
2998
 
2812
2999
 
2813
 
# _AC_COMPUTE_INT_RUN(EXPRESSION, VARIABLE, PROLOGUE, [IF-FAILS])
2814
 
# ---------------------------------------------------------------
 
3000
# _AC_COMPUTE_INT_RUN(EXPRESSION, VARIABLE, PROLOGUE, [IF-SUCCESS],
 
3001
#                     [IF-FAILURE])
 
3002
# -----------------------------------------------------------------
2815
3003
# Store the evaluation of the integer EXPRESSION in VARIABLE.
 
3004
#
 
3005
# AC_LANG_INT_SAVE intentionally does not end the file in a newline, so
 
3006
# we must add one to make it a text file before passing it to read.
2816
3007
m4_define([_AC_COMPUTE_INT_RUN],
2817
3008
[_AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])],
2818
 
                [$2=`cat conftest.val`], [$4])])
2819
 
 
 
3009
                [echo >>conftest.val; read $2 <conftest.val; $4], [$5])
 
3010
rm -f conftest.val
 
3011
])# _AC_COMPUTE_INT_RUN
 
3012
 
 
3013
 
 
3014
# _AC_COMPUTE_INT_BODY
 
3015
# --------------------
 
3016
# Shell function body for AC_COMPUTE_INT.
 
3017
m4_define([_AC_COMPUTE_INT_BODY],
 
3018
[  AS_LINENO_PUSH([$[]1])
 
3019
  if test "$cross_compiling" = yes; then
 
3020
    _AC_COMPUTE_INT_COMPILE([$[]2], [$[]3], [$[]4],
 
3021
                            [ac_retval=0], [ac_retval=1])
 
3022
  else
 
3023
    _AC_COMPUTE_INT_RUN([$[]2], [$[]3], [$[]4],
 
3024
                        [ac_retval=0], [ac_retval=1])
 
3025
  fi
 
3026
  AS_LINENO_POP
 
3027
  return $ac_retval
 
3028
])# _AC_COMPUTE_INT_BODY
2820
3029
 
2821
3030
# AC_COMPUTE_INT(VARIABLE, EXPRESSION, PROLOGUE, [IF-FAILS])
2822
3031
# ----------------------------------------------------------
 
3032
# Store into the shell variable VARIABLE the value of the integer C expression
 
3033
# EXPRESSION.  The value should fit in an initializer in a C variable of type
 
3034
# `signed long'.  If no PROLOGUE are specified, the default includes are used.
 
3035
# IF-FAILS is evaluated if the value cannot be found (which includes the
 
3036
# case of cross-compilation, if EXPRESSION is not computable at compile-time.
2823
3037
AC_DEFUN([AC_COMPUTE_INT],
2824
 
[AC_LANG_COMPILER_REQUIRE()dnl
2825
 
if test "$cross_compiling" = yes; then
2826
 
  _AC_COMPUTE_INT_COMPILE([$2], [$1], [$3], [$4])
2827
 
else
2828
 
  _AC_COMPUTE_INT_RUN([$2], [$1], [$3], [$4])
2829
 
fi
2830
 
rm -f conftest.val[]dnl
2831
 
])# _AC_COMPUTE_INT
 
3038
[AC_LANG_COMPILER_REQUIRE()]dnl
 
3039
[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_compute_int],
 
3040
  [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_compute_int],
 
3041
    [LINENO EXPR VAR INCLUDES],
 
3042
    [Tries to find the compile-time value of EXPR in a program that includes
 
3043
     INCLUDES, setting VAR accordingly.  Returns whether the value could
 
3044
     be computed])],
 
3045
    [_$0_BODY])]dnl
 
3046
[AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_compute_int "$LINENO" "$2" "$1" ]dnl
 
3047
       ["AS_ESCAPE([$3], [""])"],
 
3048
       [], [$4])
 
3049
])# AC_COMPUTE_INT
2832
3050
 
2833
3051
# _AC_COMPUTE_INT(EXPRESSION, VARIABLE, PROLOGUE, [IF-FAILS])
2834
3052
# -----------------------------------------------------------