home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / autoconf-2.2-src.lha / autoconf-2.2 / acgeneral.m4 < prev    next >
Encoding:
M4 Source File  |  1995-03-10  |  61.2 KB  |  2,082 lines

  1. dnl Parameterized macros.
  2. dnl Requires GNU m4.
  3. dnl This file is part of Autoconf.
  4. dnl Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
  5. dnl
  6. dnl This program is free software; you can redistribute it and/or modify
  7. dnl it under the terms of the GNU General Public License as published by
  8. dnl the Free Software Foundation; either version 2, or (at your option)
  9. dnl any later version.
  10. dnl
  11. dnl This program is distributed in the hope that it will be useful,
  12. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. dnl GNU General Public License for more details.
  15. dnl
  16. dnl You should have received a copy of the GNU General Public License
  17. dnl along with this program; if not, write to the Free Software
  18. dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. dnl
  20. dnl As a special exception, the Free Software Foundation gives unlimited
  21. dnl permission to copy, distribute and modify the configure scripts that
  22. dnl are the output of Autoconf.  You need not follow the terms of the GNU
  23. dnl General Public License when using or distributing such scripts, even
  24. dnl though portions of the text of Autoconf appear in them.  The GNU
  25. dnl General Public License (GPL) does govern all other use of the material
  26. dnl that constitutes the Autoconf program.
  27. dnl
  28. dnl Certain portions of the Autoconf source text are designed to be copied
  29. dnl (in certain cases, depending on the input) into the output of
  30. dnl Autoconf.  We call these the "data" portions.  The rest of the Autoconf
  31. dnl source text consists of comments plus executable code that decides which
  32. dnl of the data portions to output in any given case.  We call these
  33. dnl comments and executable code the "non-data" portions.  Autoconf never
  34. dnl copies any of the non-data portions into its output.
  35. dnl
  36. dnl This special exception to the GPL applies to versions of Autoconf
  37. dnl released by the Free Software Foundation.  When you make and
  38. dnl distribute a modified version of Autoconf, you may extend this special
  39. dnl exception to the GPL to apply to your modified version as well, *unless*
  40. dnl your modified version has the potential to copy into its output some
  41. dnl of the text that was the non-data portion of the version that you started
  42. dnl with.  (In other words, unless your change moves or copies text from
  43. dnl the non-data portions to the data portions.)  If your modification has
  44. dnl such potential, you must delete any notice of this special exception
  45. dnl to the GPL from your modified version.
  46. dnl
  47. dnl Written by David MacKenzie, with help from
  48. dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
  49. dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
  50. dnl
  51. divert(-1)dnl Throw away output until AC_INIT is called.
  52. changequote([, ])
  53.  
  54. define(AC_ACVERSION, 2.2)
  55.  
  56. dnl Some old m4's don't support m4exit.  But they provide
  57. dnl equivalent functionality by core dumping because of the
  58. dnl long macros we define.
  59. ifdef([__gnu__], , [errprint(Autoconf requires GNU m4.
  60. Install it before installing Autoconf or set the
  61. M4 environment variable to its path name.
  62. )m4exit(2)])
  63.  
  64. undefine([eval])
  65. undefine([include])
  66. undefine([shift])
  67. undefine([format])
  68.  
  69.  
  70. dnl ### Defining macros
  71.  
  72.  
  73. dnl m4 output diversions.  We let m4 output them all in order at the end,
  74. dnl except that we explicitly undivert AC_DIVERSION_SED.
  75.  
  76. dnl AC_DIVERSION_NOTICE - 1 (= 0)    AC_REQUIRE'd #! /bin/sh line
  77. define(AC_DIVERSION_NOTICE, 1)dnl    copyright notice & option help strings
  78. define(AC_DIVERSION_INIT, 2)dnl        initialization code
  79. define(AC_DIVERSION_SED, 3)dnl        variable substitutions in config.status
  80. define(AC_DIVERSION_NORMAL_4, 4)dnl    AC_REQUIRE'd code, 4 level deep
  81. define(AC_DIVERSION_NORMAL_3, 5)dnl    AC_REQUIRE'd code, 3 level deep
  82. define(AC_DIVERSION_NORMAL_2, 6)dnl    AC_REQUIRE'd code, 2 level deep
  83. define(AC_DIVERSION_NORMAL_1, 7)dnl    AC_REQUIRE'd code, 1 level deep
  84. define(AC_DIVERSION_NORMAL, 8)dnl    the tests and output code
  85.  
  86. dnl Change the diversion stream to STREAM, while stacking old values.
  87. dnl AC_DIVERT_PUSH(STREAM)
  88. define(AC_DIVERT_PUSH,
  89. [pushdef([AC_DIVERSION_CURRENT], $1)dnl
  90. divert(AC_DIVERSION_CURRENT)dnl
  91. ])
  92.  
  93. dnl Change the diversion stream to its previous value, unstacking it.
  94. dnl AC_DIVERT_POP()
  95. define(AC_DIVERT_POP,
  96. [popdef([AC_DIVERSION_CURRENT])dnl
  97. divert(AC_DIVERSION_CURRENT)dnl
  98. ])
  99.  
  100. dnl Initialize the diversion setup.
  101. define([AC_DIVERSION_CURRENT], AC_DIVERSION_NORMAL)
  102. dnl This will be popped by AC_REQUIRE in AC_INIT.
  103. pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_NOTICE)
  104.  
  105. dnl The prologue for Autoconf macros.
  106. dnl AC_PRO(MACRO-NAME)
  107. define(AC_PRO,
  108. [define([AC_PROVIDE_$1], )dnl
  109. ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL,
  110. [AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))],
  111. [pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_CURRENT)])dnl
  112. ])
  113.  
  114. dnl The Epilogue for Autoconf macros.
  115. dnl AC_EPI()
  116. define(AC_EPI,
  117. [AC_DIVERT_POP()dnl
  118. ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL,
  119. [undivert(AC_DIVERSION_NORMAL_4)dnl
  120. undivert(AC_DIVERSION_NORMAL_3)dnl
  121. undivert(AC_DIVERSION_NORMAL_2)dnl
  122. undivert(AC_DIVERSION_NORMAL_1)dnl
  123. ])dnl
  124. ])
  125.  
  126. dnl Define a macro which automatically provides itself.  Add machinery
  127. dnl so the macro automatically switches expansion to the diversion
  128. dnl stack if it is not already using it.  In this case, once finished,
  129. dnl it will bring back all the code accumulated in the diversion stack.
  130. dnl This, combined with AC_REQUIRE, achieves the topological ordering of
  131. dnl macros.  We don't use this macro to define some frequently called
  132. dnl macros that are not involved in ordering constraints, to save m4
  133. dnl processing. 
  134. dnl AC_DEFUN(NAME, EXPANSION)
  135. define([AC_DEFUN],
  136. [define($1, [AC_PRO([$1])$2[]AC_EPI()])])
  137.  
  138.  
  139. dnl ### Initialization
  140.  
  141.  
  142. dnl AC_INIT_NOTICE()
  143. AC_DEFUN(AC_INIT_NOTICE,
  144. [# Guess values for system-dependent variables and create Makefiles.
  145. # Generated automatically using autoconf version] AC_ACVERSION [
  146. # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
  147. #
  148. # This configure script is free software; the Free Software Foundation
  149. # gives unlimited permission to copy, distribute and modify it.
  150.  
  151. # Defaults:
  152. ac_help=
  153. ac_default_prefix=/gnu
  154. [#] Any additions from configure.in:])
  155.  
  156. dnl AC_PREFIX_DEFAULT(PREFIX)
  157. AC_DEFUN(AC_PREFIX_DEFAULT,
  158. [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
  159. ac_default_prefix=$1
  160. AC_DIVERT_POP()])
  161.  
  162. dnl AC_INIT_PARSE_ARGS()
  163. AC_DEFUN(AC_INIT_PARSE_ARGS,
  164. [
  165. # Initialize some variables set by options.
  166. # The variables have the same names as the options, with
  167. # dashes changed to underlines.
  168. build=NONE
  169. cache_file=./config.cache
  170. exec_prefix=NONE
  171. host=NONE
  172. no_create=
  173. nonopt=NONE
  174. no_recursion=
  175. prefix=NONE
  176. program_prefix=NONE
  177. program_suffix=NONE
  178. program_transform_name=s,x,x,
  179. silent=
  180. site=
  181. srcdir=
  182. target=NONE
  183. verbose=
  184. x_includes=NONE
  185. x_libraries=NONE
  186.  
  187. # Initialize some other variables.
  188. subdirs=
  189.  
  190. ac_prev=
  191. for ac_option
  192. do
  193.  
  194.   # If the previous option needs an argument, assign it.
  195.   if test -n "$ac_prev"; then
  196.     eval "$ac_prev=\$ac_option"
  197.     ac_prev=
  198.     continue
  199.   fi
  200.  
  201.   case "$ac_option" in
  202. changequote(, )dnl
  203.   -*=*) ac_optarg=`/bin/echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  204. changequote([, ])dnl
  205.   *) ac_optarg= ;;
  206.   esac
  207.  
  208.   # Accept the important Cygnus configure options, so we can diagnose typos.
  209.  
  210.   case "$ac_option" in
  211.  
  212.   -build | --build | --buil | --bui | --bu | --b)
  213.     ac_prev=build ;;
  214.   -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
  215.     build="$ac_optarg" ;;
  216.  
  217.   -cache-file | --cache-file | --cache-fil | --cache-fi \
  218.   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
  219.     ac_prev=cache_file ;;
  220.   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  221.   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
  222.     cache_file="$ac_optarg" ;;
  223.  
  224.   -disable-* | --disable-*)
  225.     ac_feature=`/bin/echo $ac_option|sed -e 's/-*disable-//'`
  226.     # Reject names that are not valid shell variable names.
  227. changequote(, )dnl
  228.     if test -n "`/bin/echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
  229. changequote([, ])dnl
  230.       AC_MSG_ERROR($ac_feature: invalid feature name)
  231.     fi
  232.     ac_feature=`/bin/echo $ac_feature| sed 's/-/_/g'`
  233.     eval "enable_${ac_feature}=no" ;;
  234.  
  235.   -enable-* | --enable-*)
  236.     ac_feature=`/bin/echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
  237.     # Reject names that are not valid shell variable names.
  238. changequote(, )dnl
  239.     if test -n "`/bin/echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
  240. changequote([, ])dnl
  241.       AC_MSG_ERROR($ac_feature: invalid feature name)
  242.     fi
  243.     ac_feature=`/bin/echo $ac_feature| sed 's/-/_/g'`
  244.     case "$ac_option" in
  245.       *=*) ;;
  246.       *) ac_optarg=yes ;;
  247.     esac
  248.     eval "enable_${ac_feature}='$ac_optarg'" ;;
  249.  
  250.   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  251.   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  252.   | --exec | --exe | --ex)
  253.     ac_prev=exec_prefix ;;
  254.   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  255.   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  256.   | --exec=* | --exe=* | --ex=*)
  257.     exec_prefix="$ac_optarg" ;;
  258.  
  259.   -gas | --gas | --ga | --g)
  260.     # Obsolete; use --with-gas.
  261.     with_gas=yes ;;
  262.  
  263.   -help | --help | --hel | --he)
  264.     # Omit some internal or obsolete options to make the list less imposing.
  265.     # This message is too long to be a string in the A/UX 3.1 sh.
  266.     cat << EOF
  267. changequote(, )dnl
  268. Usage: configure [options] [host]
  269. Options: [defaults in brackets after descriptions]
  270. Configuration:
  271.   --cache-file=FILE       cache test results in FILE
  272.   --help                  print this message
  273.   --no-create             do not create output files
  274.   --quiet, --silent       do not print \`checking...' messages
  275.   --version               print the version of autoconf that created configure
  276. Directory and file names:
  277.   --prefix=PREFIX         install architecture-independent files in PREFIX
  278.                           [$ac_default_prefix]
  279.   --exec-prefix=PREFIX    install architecture-dependent files in PREFIX
  280.                           [same as prefix]
  281.   --srcdir=DIR            find the sources in DIR [configure dir or ..]
  282.   --program-prefix=PREFIX prepend PREFIX to installed program names
  283.   --program-suffix=SUFFIX append SUFFIX to installed program names
  284.   --program-transform-name=PROGRAM run sed PROGRAM on installed program names
  285. Host type:
  286.   --build=BUILD           configure for building on BUILD [BUILD=HOST]
  287.   --host=HOST             configure for HOST [guessed]
  288.   --target=TARGET         configure for TARGET [TARGET=HOST]
  289. Features and packages:
  290.   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  291.   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  292.   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  293.   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  294.   --x-includes=DIR        X include files are in DIR
  295.   --x-libraries=DIR       X library files are in DIR
  296. --enable and --with options recognized:$ac_help
  297. changequote([, ])dnl
  298. EOF
  299.     exit 0 ;;
  300.  
  301.   -host | --host | --hos | --ho)
  302.     ac_prev=host ;;
  303.   -host=* | --host=* | --hos=* | --ho=*)
  304.     host="$ac_optarg" ;;
  305.  
  306.   -nfp | --nfp | --nf)
  307.     # Obsolete; use --without-fp.
  308.     with_fp=no ;;
  309.  
  310.   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  311.   | --no-cr | --no-c)
  312.     no_create=yes ;;
  313.  
  314.   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  315.   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
  316.     no_recursion=yes ;;
  317.  
  318.   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  319.     ac_prev=prefix ;;
  320.   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  321.     prefix="$ac_optarg" ;;
  322.  
  323.   -program-prefix | --program-prefix | --program-prefi | --program-pref \
  324.   | --program-pre | --program-pr | --program-p)
  325.     ac_prev=program_prefix ;;
  326.   -program-prefix=* | --program-prefix=* | --program-prefi=* \
  327.   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
  328.     program_prefix="$ac_optarg" ;;
  329.  
  330.   -program-suffix | --program-suffix | --program-suffi | --program-suff \
  331.   | --program-suf | --program-su | --program-s)
  332.     ac_prev=program_suffix ;;
  333.   -program-suffix=* | --program-suffix=* | --program-suffi=* \
  334.   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
  335.     program_suffix="$ac_optarg" ;;
  336.  
  337.   -program-transform-name | --program-transform-name \
  338.   | --program-transform-nam | --program-transform-na \
  339.   | --program-transform-n | --program-transform- \
  340.   | --program-transform | --program-transfor \
  341.   | --program-transfo | --program-transf \
  342.   | --program-trans | --program-tran \
  343.   | --progr-tra | --program-tr | --program-t)
  344.     ac_prev=program_transform_name ;;
  345.   -program-transform-name=* | --program-transform-name=* \
  346.   | --program-transform-nam=* | --program-transform-na=* \
  347.   | --program-transform-n=* | --program-transform-=* \
  348.   | --program-transform=* | --program-transfor=* \
  349.   | --program-transfo=* | --program-transf=* \
  350.   | --program-trans=* | --program-tran=* \
  351.   | --progr-tra=* | --program-tr=* | --program-t=*)
  352.     program_transform_name="$ac_optarg" ;;
  353.  
  354.   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  355.   | -silent | --silent | --silen | --sile | --sil)
  356.     silent=yes ;;
  357.  
  358.   -site | --site | --sit)
  359.     ac_prev=site ;;
  360.   -site=* | --site=* | --sit=*)
  361.     site="$ac_optarg" ;;
  362.  
  363.   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  364.     ac_prev=srcdir ;;
  365.   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  366.     srcdir="$ac_optarg" ;;
  367.  
  368.   -target | --target | --targe | --targ | --tar | --ta | --t)
  369.     ac_prev=target ;;
  370.   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  371.     target="$ac_optarg" ;;
  372.  
  373.   -v | -verbose | --verbose | --verbos | --verbo | --verb)
  374.     verbose=yes ;;
  375.  
  376.   -version | --version | --versio | --versi | --vers)
  377.     echo "configure generated by autoconf version AC_ACVERSION"
  378.     exit 0 ;;
  379.  
  380.   -with-* | --with-*)
  381.     ac_package=`/bin/echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
  382.     # Reject names that are not valid shell variable names.
  383. changequote(, )dnl
  384.     if test -n "`/bin/echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
  385. changequote([, ])dnl
  386.       AC_MSG_ERROR($ac_package: invalid package name)
  387.     fi
  388.     ac_package=`/bin/echo $ac_package| sed 's/-/_/g'`
  389.     case "$ac_option" in
  390.       *=*) ;;
  391.       *) ac_optarg=yes ;;
  392.     esac
  393.     eval "with_${ac_package}='$ac_optarg'" ;;
  394.  
  395.   -without-* | --without-*)
  396.     ac_package=`/bin/echo $ac_option|sed -e 's/-*without-//'`
  397.     # Reject names that are not valid shell variable names.
  398. changequote(, )dnl
  399.     if test -n "`/bin/echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  400. changequote([, ])dnl
  401.       AC_MSG_ERROR($ac_package: invalid package name)
  402.     fi
  403.     ac_package=`/bin/echo $ac_package| sed 's/-/_/g'`
  404.     eval "with_${ac_package}=no" ;;
  405.  
  406.   --x)
  407.     # Obsolete; use --with-x.
  408.     with_x=yes ;;
  409.  
  410.   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  411.   | --x-incl | --x-inc | --x-in | --x-i)
  412.     ac_prev=x_includes ;;
  413.   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  414.   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
  415.     x_includes="$ac_optarg" ;;
  416.  
  417.   -x-libraries | --x-libraries | --x-librarie | --x-librari \
  418.   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
  419.     ac_prev=x_libraries ;;
  420.   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  421.   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
  422.     x_libraries="$ac_optarg" ;;
  423.  
  424.   -*) AC_MSG_ERROR([$ac_option: invalid option; use --help to show usage])
  425.     ;;
  426.  
  427.   *) 
  428. changequote(, )dnl
  429.     if test -n "`/bin/echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
  430. changequote([, ])dnl
  431.       AC_MSG_WARN($ac_option: invalid host type)
  432.     fi
  433.     if test "x$nonopt" != xNONE; then
  434.       AC_MSG_ERROR(can only configure for one host and one target at a time)
  435.     fi
  436.     nonopt="$ac_option"
  437.     ;;
  438.  
  439.   esac
  440. done
  441.  
  442. if test -n "$ac_prev"; then
  443.   AC_MSG_ERROR(missing argument to --`/bin/echo $ac_prev | sed 's/_/-/g'`)
  444. fi
  445. ])
  446.  
  447. dnl Try to have only one #! line, so the script doesn't look funny
  448. dnl for users of AC_REVISION.
  449. dnl AC_INIT_BINSH()
  450. AC_DEFUN(AC_INIT_BINSH,
  451. [#! /bin/sh
  452. ])
  453.  
  454. dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
  455. AC_DEFUN(AC_INIT,
  456. [sinclude(acsite.m4)dnl
  457. sinclude(./aclocal.m4)dnl
  458. AC_REQUIRE([AC_INIT_BINSH])dnl
  459. AC_INIT_NOTICE
  460. AC_DIVERT_POP()dnl to NORMAL
  461. AC_DIVERT_PUSH(AC_DIVERSION_INIT)dnl
  462. AC_INIT_PARSE_ARGS
  463. AC_INIT_PREPARE($1)dnl
  464. AC_DIVERT_POP()dnl to NORMAL
  465. ])
  466.  
  467. dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
  468. AC_DEFUN(AC_INIT_PREPARE,
  469. [trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
  470.  
  471. # File descriptor usage:
  472. # 0 standard input
  473. # 1 file creation
  474. # 2 errors and warnings
  475. # 3 some systems may open it to /dev/tty
  476. # 4 used on the Kubota Titan
  477. define(AC_FD_MSG, 6)dnl
  478. [#] AC_FD_MSG checking for... messages and results
  479. define(AC_FD_CC, 5)dnl
  480. [#] AC_FD_CC compiler messages saved in config.log
  481. if test "$silent" = yes; then
  482.   exec AC_FD_MSG>/dev/null
  483. else
  484.   exec AC_FD_MSG>&1
  485. fi
  486. exec AC_FD_CC>./config.log
  487.  
  488. echo "\
  489. This file contains any messages produced by compilers while
  490. running configure, to aid debugging if configure makes a mistake.
  491. " 1>&AC_FD_CC
  492.  
  493. # Strip out --no-create and --no-recursion so they do not pile up.
  494. # Also quote any args containing shell metacharacters.
  495. ac_configure_args=
  496. for ac_arg
  497. do
  498.   case "$ac_arg" in
  499.   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  500.   | --no-cr | --no-c) ;;
  501.   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  502.   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
  503. changequote(<<, >>)dnl
  504. dnl If you change this globbing pattern, test it on an old shell --
  505. dnl it's sensitive.  Putting any kind of quote in it causes syntax errors.
  506.   *" "*|*"    "*|*[\[\]\~\<<#>>\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  507.   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  508. changequote([, ])dnl
  509.   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
  510.   esac
  511. done
  512.  
  513. # NLS nuisances.
  514. # Only set LANG and LC_ALL to C if already set.
  515. # These must not be set unconditionally because not all systems understand
  516. # e.g. LANG=C (notably SCO).
  517. if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  518. if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
  519.  
  520. # confdefs.h avoids OS command line length limits that DEFS can exceed.
  521. rm -rf conftest* confdefs.h
  522. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  523. /bin/echo > confdefs.h
  524.  
  525. # A filename unique to this package, relative to the directory that
  526. # configure is in, which we can look for to find out if srcdir is correct.
  527. ac_unique_file=$1
  528.  
  529. # Find the source files, if location was not specified.
  530. if test -z "$srcdir"; then
  531.   ac_srcdir_defaulted=yes
  532.   # Try the directory containing this script, then its parent.
  533.   ac_prog=[$]0
  534. changequote(, )dnl
  535.   ac_confdir=`/bin/echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  536. changequote([, ])dnl
  537.   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  538.   srcdir=$ac_confdir
  539.   if test ! -r $srcdir/$ac_unique_file; then
  540.     srcdir=..
  541.   fi
  542. else
  543.   ac_srcdir_defaulted=no
  544. fi
  545. if test ! -r $srcdir/$ac_unique_file; then
  546.   if test "$ac_srcdir_defaulted" = yes; then
  547.     AC_MSG_ERROR(can not find sources in $ac_confdir or ..)
  548.   else
  549.     AC_MSG_ERROR(can not find sources in $srcdir)
  550.   fi
  551. fi
  552. dnl Double slashes in pathnames in object file debugging info
  553. dnl mess up M-x gdb in Emacs.
  554. changequote(, )dnl
  555. srcdir=`/bin/echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
  556. changequote([, ])dnl
  557.  
  558. dnl Let the site file select an alternate cache file if it wants to.
  559. AC_SITE_LOAD
  560. AC_CACHE_LOAD
  561. AC_LANG_C
  562. AC_PROG_ECHO_N
  563. dnl Substitute for predefined variables.
  564. AC_SUBST(CFLAGS)dnl
  565. AC_SUBST(CPPFLAGS)dnl
  566. AC_SUBST(CXXFLAGS)dnl
  567. AC_SUBST(DEFS)dnl
  568. AC_SUBST(LDFLAGS)dnl
  569. AC_SUBST(LIBS)dnl
  570. AC_SUBST(exec_prefix)dnl
  571. AC_SUBST(prefix)dnl
  572. AC_SUBST(program_transform_name)dnl
  573. ])
  574.  
  575.  
  576. dnl ### Selecting optional features
  577.  
  578.  
  579. dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
  580. AC_DEFUN(AC_ARG_ENABLE,
  581. [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
  582. ac_help="$ac_help
  583. [$2]"
  584. AC_DIVERT_POP()dnl
  585. [#] Check whether --enable-[$1] or --disable-[$1] was given.
  586. enableval="[$enable_]patsubst([$1], -, _)"
  587. if test -n "$enableval"; then
  588.   ifelse([$3], , :, [$3])
  589. ifelse([$4], , , [else
  590.   $4
  591. ])dnl
  592. fi
  593. ])
  594.  
  595. AC_DEFUN(AC_ENABLE,
  596. [AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE])dnl
  597. AC_ARG_ENABLE([$1], [  --enable-$1], [$2], [$3])dnl
  598. ])
  599.  
  600.  
  601. dnl ### Working with optional software
  602.  
  603.  
  604. dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
  605. AC_DEFUN(AC_ARG_WITH,
  606. [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
  607. ac_help="$ac_help
  608. [$2]"
  609. AC_DIVERT_POP()dnl
  610. [#] Check whether --with-[$1] or --without-[$1] was given.
  611. withval="[$with_]patsubst([$1], -, _)"
  612. if test -n "$withval"; then
  613.   ifelse([$3], , :, [$3])
  614. ifelse([$4], , , [else
  615.   $4
  616. ])dnl
  617. fi
  618. ])
  619.  
  620. AC_DEFUN(AC_WITH,
  621. [AC_OBSOLETE([$0], [; instead use AC_ARG_WITH])dnl
  622. AC_ARG_WITH([$1], [  --with-$1], [$2], [$3])dnl
  623. ])
  624.  
  625.  
  626. dnl ### Transforming program names.
  627.  
  628.  
  629. dnl AC_ARG_PROGRAM()
  630. AC_DEFUN(AC_ARG_PROGRAM,
  631. [if test "$program_transform_name" = s,x,x,; then
  632.   program_transform_name=
  633. else
  634.   # Double any \ or $.
  635.   echo 's,\\,\\\\,g; s,\$,$$,g' > conftestsed
  636.   program_transform_name="`/bin/echo $program_transform_name|sed -f conftestsed`"
  637.   rm -f conftestsed
  638. fi
  639. test "$program_prefix" != NONE &&
  640.   program_transform_name="s,^,${program_prefix},; $program_transform_name"
  641. # Use a double $ so make ignores it.
  642. test "$program_suffix" != NONE &&
  643.   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
  644.  
  645. # sed with no file args requires a program.
  646. test "$program_transform_name" = "" && program_transform_name="s,x,x,"
  647. ])
  648.  
  649.  
  650. dnl ### Version numbers
  651.  
  652.  
  653. dnl AC_REVISION(REVISION-INFO)
  654. AC_DEFUN(AC_REVISION,
  655. [AC_REQUIRE([AC_INIT_BINSH])dnl
  656. [# From configure.in] translit([$1], $")])
  657.  
  658. dnl Subroutines of AC_PREREQ.
  659.  
  660. dnl Change the dots in NUMBER into commas.
  661. dnl AC_PREREQ_SPLIT(NUMBER)
  662. define(AC_PREREQ_SPLIT,
  663. [translit($1, ., [, ])])
  664.  
  665. dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0).
  666. dnl AC_PREREQ_CANON(MAJOR, MINOR [,TERNARY])
  667. define(AC_PREREQ_CANON,
  668. [$1, $2, ifelse([$3], , 0, [$3])])
  669.  
  670. dnl Complain and exit if version number 1 is less than version number 2.
  671. dnl PRINTABLE2 is the printable version of version number 2.
  672. dnl AC_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2, MINOR2, TERNARY2,
  673. dnl                   PRINTABLE2)
  674. define(AC_PREREQ_COMPARE,
  675. [ifelse(builtin([eval],
  676. [$3 + $2 * 1000 + $1 * 1000000 < $6 + $5 * 1000 + $4 * 1000000]), 1,
  677. [errprint(Autoconf version $7 or higher is required for this script
  678. )m4exit(3)])])
  679.  
  680. dnl Complain and exit if the Autoconf version is less than VERSION.
  681. dnl AC_PREREQ(VERSION)
  682. define(AC_PREREQ,
  683. [AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
  684. AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])])
  685.  
  686.  
  687. dnl ### Getting the canonical system type
  688.  
  689.  
  690. dnl Find install-sh, config.sub, config.guess, and Cygnus configure
  691. dnl in directory DIR.  These are auxiliary files used in configuration.
  692. dnl DIR can be either absolute or relative to $srcdir.
  693. dnl AC_CONFIG_AUX_DIR(DIR)
  694. AC_DEFUN(AC_CONFIG_AUX_DIR,
  695. [AC_CONFIG_AUX_DIRS($1 $srcdir/$1)])
  696.  
  697. dnl The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'.
  698. dnl There's no need to call this macro explicitly; just AC_REQUIRE it.
  699. AC_DEFUN(AC_CONFIG_AUX_DIR_DEFAULT,
  700. [AC_CONFIG_AUX_DIRS($srcdir $srcdir/.. $srcdir/../..)])
  701.  
  702. dnl Internal subroutine.
  703. dnl Search for the configuration auxiliary files in directory list $1.
  704. dnl We look only for install-sh, so users of AC_PROG_INSTALL
  705. dnl do not automatically need to distribute the other auxiliary files.
  706. dnl AC_CONFIG_AUX_DIRS(DIR ...)
  707. AC_DEFUN(AC_CONFIG_AUX_DIRS,
  708. [ac_aux_dir=
  709. for ac_dir in $1; do
  710.   if test -f $ac_dir/install-sh; then
  711.     ac_aux_dir=$ac_dir
  712.     ac_install_sh="$ac_aux_dir/install-sh -c"
  713.     break
  714.   elif test -f $ac_dir/install.sh; then
  715.     ac_aux_dir=$ac_dir
  716.     ac_install_sh="$ac_aux_dir/install.sh -c"
  717.     break
  718.   fi
  719. done
  720. if test -z "$ac_aux_dir"; then
  721.   AC_MSG_ERROR([can not find install-sh or install.sh in $1])
  722. fi
  723. ac_config_guess=$ac_aux_dir/config.guess
  724. ac_config_sub=$ac_aux_dir/config.sub
  725. ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
  726. AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  727. ])
  728.  
  729. dnl Canonicalize the host, target, and build system types.
  730. AC_DEFUN(AC_CANONICAL_SYSTEM,
  731. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  732. AC_BEFORE([$0], [AC_ARG_PROGRAM])
  733. # Do some error checking and defaulting for the host and target type.
  734. # The inputs are:
  735. #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
  736. #
  737. # The rules are:
  738. # 1. You are not allowed to specify --host, --target, and nonopt at the
  739. #    same time. 
  740. # 2. Host defaults to nonopt.
  741. # 3. If nonopt is not specified, then host defaults to the current host,
  742. #    as determined by config.guess.
  743. # 4. Target and build default to nonopt.
  744. # 5. If nonopt is not specified, then target and build default to host.
  745.  
  746. # The aliases save the names the user supplied, while $host etc.
  747. # will get canonicalized.
  748. case $host---$target---$nonopt in
  749. NONE---*---* | *---NONE---* | *---*---NONE) ;;
  750. *) AC_MSG_ERROR(can only configure for one host and one target at a time) ;;
  751. esac
  752.  
  753. AC_CANONICAL_HOST
  754. AC_CANONICAL_TARGET
  755. AC_CANONICAL_BUILD
  756. test "$host_alias" != "$target_alias" &&
  757.   test "$program_prefix$program_suffix$program_transform_name" = \
  758.     NONENONEs,x,x, &&
  759.   program_prefix=${target_alias}-
  760. ])
  761.  
  762. dnl Subroutines of AC_CANONICAL_SYSTEM.
  763.  
  764. AC_DEFUN(AC_CANONICAL_HOST,
  765. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  766.  
  767. # Make sure we can run config.sub.
  768. if $ac_config_sub sun4 >/dev/null 2>&1; then :
  769. else AC_MSG_ERROR(can not run $ac_config_sub)
  770. fi
  771.  
  772. AC_MSG_CHECKING(host system type)
  773.  
  774. dnl Set host_alias.
  775. host_alias=$host
  776. case "$host_alias" in
  777. NONE)
  778.   case $nonopt in
  779.   NONE)
  780.     if host_alias=`$ac_config_guess`; then :
  781.     else AC_MSG_ERROR(can not guess host type; you must specify one)
  782.     fi ;;
  783.   *) host_alias=$nonopt ;;
  784.   esac ;;
  785. esac
  786.  
  787. dnl Set the other host vars.
  788. host=`$ac_config_sub $host_alias`
  789. host_cpu=`/bin/echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  790. host_vendor=`/bin/echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  791. host_os=`/bin/echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  792. AC_MSG_RESULT($host)
  793. AC_SUBST(host)dnl
  794. AC_SUBST(host_alias)dnl
  795. AC_SUBST(host_cpu)dnl
  796. AC_SUBST(host_vendor)dnl
  797. AC_SUBST(host_os)dnl
  798. ])
  799.  
  800. dnl Internal use only.
  801. AC_DEFUN(AC_CANONICAL_TARGET,
  802. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  803. AC_MSG_CHECKING(target system type)
  804.  
  805. dnl Set target_alias.
  806. target_alias=$target
  807. case "$target_alias" in
  808. NONE)
  809.   case $nonopt in
  810.   NONE) target_alias=$host_alias ;;
  811.   *) target_alias=$nonopt ;;
  812.   esac ;;
  813. esac
  814.  
  815. dnl Set the other target vars.
  816. target=`$ac_config_sub $target_alias`
  817. target_cpu=`/bin/echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  818. target_vendor=`/bin/echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  819. target_os=`/bin/echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  820. AC_MSG_RESULT($target)
  821. AC_SUBST(target)dnl
  822. AC_SUBST(target_alias)dnl
  823. AC_SUBST(target_cpu)dnl
  824. AC_SUBST(target_vendor)dnl
  825. AC_SUBST(target_os)dnl
  826. ])
  827.  
  828. dnl Internal use only.
  829. AC_DEFUN(AC_CANONICAL_BUILD,
  830. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  831. AC_MSG_CHECKING(build system type)
  832.  
  833. dnl Set build_alias.
  834. build_alias=$build
  835. case "$build_alias" in
  836. NONE)
  837.   case $nonopt in
  838.   NONE) build_alias=$host_alias ;;
  839.   *) build_alias=$nonopt ;;
  840.   esac ;;
  841. esac
  842.  
  843. dnl Set the other build vars.
  844. build=`$ac_config_sub $build_alias`
  845. build_cpu=`/bin/echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  846. build_vendor=`/bin/echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  847. build_os=`/bin/echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  848. AC_MSG_RESULT($build)
  849. AC_SUBST(build)dnl
  850. AC_SUBST(build_alias)dnl
  851. AC_SUBST(build_cpu)dnl
  852. AC_SUBST(build_vendor)dnl
  853. AC_SUBST(build_os)dnl
  854. ])
  855.  
  856.  
  857. dnl ### Caching test results
  858.  
  859.  
  860. dnl Look for site or system specific initialization scripts.
  861. dnl AC_SITE_LOAD()
  862. define(AC_SITE_LOAD,
  863. [# Prefer explicitly selected file to automatically selected ones.
  864. if test -z "$CONFIG_SITE"; then
  865.   if test "x$prefix" != xNONE; then
  866.     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  867.   else
  868.     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  869.   fi
  870. fi
  871. for ac_site_file in $CONFIG_SITE; do
  872.   if test -r "$ac_site_file"; then
  873.     echo "loading site script $ac_site_file"
  874.     . "$ac_site_file"
  875.   fi
  876. done
  877. ])
  878.  
  879. dnl AC_CACHE_LOAD()
  880. define(AC_CACHE_LOAD,
  881. [if test -r "$cache_file"; then
  882.   echo "loading cache $cache_file"
  883.   . $cache_file
  884. else
  885.   echo "creating cache $cache_file"
  886.   > $cache_file
  887. fi
  888. ])
  889.  
  890. dnl AC_CACHE_SAVE()
  891. define(AC_CACHE_SAVE,
  892. [cat > confcache <<\EOF
  893. # This file is a shell script that caches the results of configure
  894. # tests run on this system so they can be shared between configure
  895. # scripts and configure runs.  It is not useful on other systems.
  896. # If it contains results you don't want to keep, you may remove or edit it.
  897. #
  898. # By default, configure uses ./config.cache as the cache file,
  899. # creating it if it does not exist already.  You can give configure
  900. # the --cache-file=FILE option to use a different cache file; that is
  901. # what configure does when it calls configure scripts in
  902. # subdirectories, so they share the cache.
  903. # Giving --cache-file=/dev/null disables caching, for debugging configure.
  904. # config.status only pays attention to the cache file if you give it the
  905. # --recheck option to rerun configure.
  906. #
  907. EOF
  908. changequote(, )dnl
  909. dnl Allow a site initialization script to override cache values.
  910. # Ultrix sh set writes to stderr and can't be redirected directly,
  911. # and sets the high bit in the cache file unless we assign to the vars.
  912. (set) 2>&1 |
  913.   sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
  914.   >> confcache
  915. changequote([, ])dnl
  916. if cmp -s $cache_file confcache; then
  917.   :
  918. else
  919.   if test -w $cache_file; then
  920.     echo "updating cache $cache_file"
  921.     cat confcache > $cache_file
  922.   else
  923.     echo "not updating unwritable cache $cache_file"
  924.   fi
  925. fi
  926. rm -f confcache
  927. ])
  928.  
  929. dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
  930. dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
  931. define(AC_CACHE_VAL,
  932. [dnl We used to use the below line, but it fails if the 1st arg is a
  933. dnl shell variable, so we need the eval.
  934. dnl if test "${$1+set}" = set; then
  935. dnl the '' avoids an AIX 4.1 sh bug ("invalid expansion").
  936. if eval "test \"`echo '$''{'$1'+set}'`\" = set"; then
  937.   /bin/echo $ac_n "(cached) $ac_c" 1>&AC_FD_MSG
  938. else
  939.   $2
  940. fi
  941. ])
  942.  
  943.  
  944. dnl ### Defining symbols
  945.  
  946.  
  947. dnl Set VARIABLE to VALUE, verbatim, or 1.
  948. dnl AC_DEFINE(VARIABLE [, VALUE])
  949. define(AC_DEFINE,
  950. [cat >> confdefs.h <<\EOF
  951. [#define] $1 ifelse($#, 2, [$2], 1)
  952. EOF
  953. ])
  954.  
  955. dnl Similar, but perform shell substitutions $ ` \ once on VALUE.
  956. define(AC_DEFINE_UNQUOTED,
  957. [cat >> confdefs.h <<EOF
  958. [#define] $1 ifelse($#, 2, [$2], 1)
  959. EOF
  960. ])
  961.  
  962.  
  963. dnl ### Setting output variables
  964.  
  965.  
  966. dnl This macro protects VARIABLE from being diverted twice
  967. dnl if this macro is called twice for it.
  968. dnl AC_SUBST(VARIABLE)
  969. define(AC_SUBST,
  970. [ifdef([AC_SUBST_$1], ,
  971. [define([AC_SUBST_$1], )dnl
  972. AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
  973. s%@$1@%[$]$1%g
  974. AC_DIVERT_POP()dnl
  975. ])])
  976.  
  977. dnl AC_SUBST_FILE(VARIABLE)
  978. define(AC_SUBST_FILE,
  979. [ifdef([AC_SUBST_$1], ,
  980. [define([AC_SUBST_$1], )dnl
  981. AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
  982. /@$1@/r [$]$1
  983. s%@$1@%%g
  984. AC_DIVERT_POP()dnl
  985. ])])
  986.  
  987.  
  988. dnl ### Printing messages
  989.  
  990.  
  991. dnl AC_MSG_CHECKING(FEATURE-DESCRIPTION)
  992. define(AC_MSG_CHECKING,
  993. [/bin/echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG])
  994.  
  995. dnl AC_CHECKING(FEATURE-DESCRIPTION)
  996. define(AC_CHECKING,
  997. [echo "checking $1" 1>&AC_FD_MSG])
  998.  
  999. dnl AC_MSG_RESULT(RESULT-DESCRIPTION)
  1000. define(AC_MSG_RESULT,
  1001. [/bin/echo "$ac_t""$1" 1>&AC_FD_MSG])
  1002.  
  1003. dnl AC_VERBOSE(RESULT-DESCRIPTION)
  1004. define(AC_VERBOSE,
  1005. [AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl
  1006. echo "    $1" 1>&AC_FD_MSG])
  1007.  
  1008. dnl AC_MSG_WARN(PROBLEM-DESCRIPTION)
  1009. define(AC_MSG_WARN,
  1010. [echo "configure: warning: $1" 1>&2])
  1011.  
  1012. dnl AC_MSG_ERROR(ERROR-DESCRIPTION)
  1013. define(AC_MSG_ERROR,
  1014. [{ echo "configure: error: $1" 1>&2; exit 1; }])
  1015.  
  1016.  
  1017. dnl ### Selecting which language to use for testing
  1018.  
  1019.  
  1020. dnl AC_LANG_C()
  1021. AC_DEFUN(AC_LANG_C,
  1022. [define([AC_LANG], [C])dnl
  1023. ac_ext=c
  1024. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  1025. ac_cpp='$CPP $CPPFLAGS'
  1026. ac_compile='${CC-cc} conftest.$ac_ext $CFLAGS $CPPFLAGS -c 1>&AC_FD_CC 2>&AC_FD_CC'
  1027. ac_link='${CC-cc} conftest.$ac_ext $CFLAGS $CPPFLAGS $LDFLAGS -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
  1028. ])
  1029.  
  1030. dnl AC_LANG_CPLUSPLUS()
  1031. AC_DEFUN(AC_LANG_CPLUSPLUS,
  1032. [define([AC_LANG], [CPLUSPLUS])dnl
  1033. ac_ext=C
  1034. # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  1035. ac_cpp='$CXXCPP $CPPFLAGS'
  1036. ac_compile='${CXX-g++} $CXXFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&AC_FD_CC 2>&AC_FD_CC'
  1037. ac_link='${CXX-g++} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
  1038. ])
  1039.  
  1040. dnl Push the current language on a stack.
  1041. dnl AC_LANG_SAVE()
  1042. define(AC_LANG_SAVE,
  1043. [pushdef([AC_LANG_STACK], AC_LANG)])
  1044.  
  1045. dnl Restore the current language from the stack.
  1046. dnl AC_LANG_RESTORE()
  1047. define(AC_LANG_RESTORE,
  1048. [ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])
  1049.  
  1050.  
  1051. dnl ### Dependencies between macros
  1052.  
  1053.  
  1054. dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
  1055. define(AC_BEFORE,
  1056. [ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1
  1057. ])])])
  1058.  
  1059. dnl AC_REQUIRE(MACRO-NAME)
  1060. define(AC_REQUIRE,
  1061. [ifdef([AC_PROVIDE_$1], ,
  1062. [AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl
  1063. indir([$1])
  1064. AC_DIVERT_POP()dnl
  1065. ])])
  1066.  
  1067. dnl AC_PROVIDE(MACRO-NAME)
  1068. define(AC_PROVIDE,
  1069. [define([AC_PROVIDE_$1], )])
  1070.  
  1071. dnl AC_OBSOLETE(THIS-MACRO-NAME [, SUGGESTION])
  1072. define(AC_OBSOLETE,
  1073. [errprint(__file__:__line__: warning: [$1] is obsolete[$2]
  1074. )])
  1075.  
  1076.  
  1077. dnl ### Checking for programs
  1078.  
  1079.  
  1080. dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
  1081. dnl               [, VALUE-IF-NOT-FOUND])
  1082. AC_DEFUN(AC_CHECK_PROG,
  1083. [# Extract the first word of "$2", so it can be a program name with args.
  1084. set dummy $2; ac_word=[$]2
  1085. AC_MSG_CHECKING([for $ac_word])
  1086. AC_CACHE_VAL(ac_cv_prog_$1,
  1087. [if test -n "[$]$1"; then
  1088.   ac_cv_prog_$1="[$]$1" # Let the user override the test.
  1089. else
  1090.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  1091.   for ac_dir in $PATH; do
  1092.     test -z "$ac_dir" && ac_dir=.
  1093.     if test -f $ac_dir/$ac_word; then
  1094.       ac_cv_prog_$1="$3"
  1095.       break
  1096.     fi
  1097.   done
  1098.   IFS="$ac_save_ifs"
  1099. dnl If no 4th arg is given, leave the cache variable unset,
  1100. dnl so AC_CHECK_PROGS will keep looking.
  1101. ifelse([$4], , , [  test -z "[$]ac_cv_prog_$1" && ac_cv_prog_$1="$4"
  1102. ])dnl
  1103. fi])dnl
  1104. $1="$ac_cv_prog_$1"
  1105. if test -n "[$]$1"; then
  1106.   AC_MSG_RESULT([$]$1)
  1107. else
  1108.   AC_MSG_RESULT(no)
  1109. fi
  1110. AC_SUBST($1)dnl
  1111. ])
  1112.  
  1113. dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
  1114. AC_DEFUN(AC_PATH_PROG,
  1115. [# Extract the first word of "$2", so it can be a program name with args.
  1116. set dummy $2; ac_word=[$]2
  1117. AC_MSG_CHECKING([for $ac_word])
  1118. AC_CACHE_VAL(ac_cv_path_$1,
  1119. [case "[$]$1" in
  1120.   /*)
  1121.   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  1122.   ;;
  1123.   *)
  1124.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  1125.   for ac_dir in $PATH; do
  1126.     test -z "$ac_dir" && ac_dir=.
  1127.     if test -f $ac_dir/$ac_word; then
  1128.       ac_cv_path_$1="$ac_dir/$ac_word"
  1129.       break
  1130.     fi
  1131.   done
  1132.   IFS="$ac_save_ifs"
  1133. dnl If no 3rd arg is given, leave the cache variable unset,
  1134. dnl so AC_PATH_PROGS will keep looking.
  1135. ifelse([$3], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$3"
  1136. ])dnl
  1137.   ;;
  1138. esac])dnl
  1139. $1="$ac_cv_path_$1"
  1140. if test -n "[$]$1"; then
  1141.   AC_MSG_RESULT([$]$1)
  1142. else
  1143.   AC_MSG_RESULT(no)
  1144. fi
  1145. AC_SUBST($1)dnl
  1146. ])
  1147.  
  1148. dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
  1149. AC_DEFUN(AC_CHECK_PROGS,
  1150. [for ac_prog in $2
  1151. do
  1152. AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, )
  1153. test -n "[$]$1" && break
  1154. done
  1155. ifelse([$3], , , [test -n "[$]$1" || $1="$3"
  1156. ])])
  1157.  
  1158. dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
  1159. AC_DEFUN(AC_PATH_PROGS,
  1160. [for ac_prog in $2
  1161. do
  1162. AC_PATH_PROG($1, [$]ac_prog)
  1163. test -n "[$]$1" && break
  1164. done
  1165. ifelse([$3], , , [test -n "[$]$1" || $1="$3"
  1166. ])])
  1167.  
  1168. dnl Internal subroutine.
  1169. AC_DEFUN(AC_CHECK_TOOL_PREFIX,
  1170. [AC_REQUIRE([AC_CANONICAL_HOST])AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  1171. if test $host != $build; then
  1172.   ac_tool_prefix=${host_alias}-
  1173. else
  1174.   ac_tool_prefix=
  1175. fi
  1176. ])
  1177.  
  1178. dnl AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND])
  1179. AC_DEFUN(AC_CHECK_TOOL,
  1180. [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
  1181. AC_CHECK_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2, 
  1182.           ifelse([$3], , [$2], ))
  1183. ifelse([$3], , , [
  1184. if test -z "$ac_cv_prog_$1"; then
  1185. if test -n "$ac_tool_prefix"; then
  1186.   AC_CHECK_PROG($1, $2, $2, $3)
  1187. else
  1188.   $1="$3"
  1189. fi
  1190. fi])
  1191. ])
  1192.  
  1193. dnl Guess the value for the `prefix' variable by looking for
  1194. dnl the argument program along PATH and taking its parent.
  1195. dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
  1196. dnl set `prefix' to /usr/local/gnu.
  1197. dnl This comes too late to find a site file based on the prefix,
  1198. dnl and it might use a cached value for the path.
  1199. dnl No big loss, I think, since most configures don't use this macro anyway.
  1200. dnl AC_PREFIX_PROGRAM(PROGRAM)
  1201. AC_DEFUN(AC_PREFIX_PROGRAM,
  1202. [if test "x$prefix" = xNONE; then
  1203. changequote(<<, >>)dnl
  1204. define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
  1205. changequote([, ])dnl
  1206. AC_MSG_CHECKING([for prefix by ])
  1207. AC_PATH_PROG(AC_VAR_NAME, $1)
  1208. changequote(<<, >>)dnl
  1209.   if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then
  1210.     prefix=`/bin/echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*//*[^/][^/]*$%%'`
  1211. changequote([, ])dnl
  1212.   fi
  1213. fi
  1214. undefine([AC_VAR_NAME])dnl
  1215. ])
  1216.  
  1217.  
  1218. dnl ### Checking for libraries
  1219.  
  1220.  
  1221. dnl AC_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
  1222. dnl              [, OTHER-LIBRARIES]]])
  1223. AC_DEFUN(AC_CHECK_LIB,
  1224. [AC_MSG_CHECKING([for -l$1])
  1225. AC_CACHE_VAL(ac_cv_lib_$1,
  1226. [ac_save_LIBS="$LIBS"
  1227. LIBS="-l$1 $5 $LIBS"
  1228. AC_TRY_LINK(, [$2()], eval "ac_cv_lib_$1=yes", eval "ac_cv_lib_$1=no")dnl
  1229. LIBS="$ac_save_LIBS"
  1230. ])dnl
  1231. if eval "test \"`echo '$ac_cv_lib_'$1`\" = yes"; then
  1232.   AC_MSG_RESULT(yes)
  1233.   ifelse([$3], , 
  1234. [changequote(, )dnl
  1235.   ac_tr_lib=HAVE_LIB`/bin/echo $1 | tr '[a-z]' '[A-Z]'`
  1236. changequote([, ])dnl
  1237.   AC_DEFINE_UNQUOTED($ac_tr_lib)
  1238.   LIBS="-l$1 $LIBS"
  1239. ], [$3])
  1240. else
  1241.   AC_MSG_RESULT(no)
  1242. ifelse([$4], , , [$4
  1243. ])dnl
  1244. fi
  1245. ])
  1246.  
  1247. dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
  1248. dnl                 [, OTHER-LIBRARIES]]])
  1249. AC_DEFUN(AC_HAVE_LIBRARY,
  1250. [AC_OBSOLETE([$0], [; instead use AC_CHECK_LIB])dnl
  1251. changequote(<<, >>)dnl
  1252. define(<<AC_LIB_NAME>>, dnl
  1253. patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl
  1254. define(<<AC_CV_NAME>>, ac_cv_lib_<<>>AC_LIB_NAME)dnl
  1255. changequote([, ])dnl
  1256. AC_MSG_CHECKING([for -l[]AC_LIB_NAME])
  1257. AC_CACHE_VAL(AC_CV_NAME,
  1258. [ac_save_LIBS="$LIBS"
  1259. LIBS="-l[]AC_LIB_NAME[] $4 $LIBS"
  1260. AC_TRY_LINK( , [main()], AC_CV_NAME=yes, AC_CV_NAME=no)dnl
  1261. LIBS="$ac_save_LIBS"
  1262. ])dnl
  1263. AC_MSG_RESULT($AC_CV_NAME)
  1264. if test "$AC_CV_NAME" = yes; then
  1265.   ifelse([$2], , 
  1266. [AC_DEFINE([HAVE_LIB]translit(AC_LIB_NAME, [a-z], [A-Z]))
  1267.   LIBS="-l[]AC_LIB_NAME[] $LIBS"
  1268. ], [$2])
  1269. ifelse([$3], , , [else
  1270.   $3
  1271. ])dnl
  1272. fi
  1273. undefine([AC_LIB_NAME])dnl
  1274. undefine([AC_CV_NAME])dnl
  1275. ])
  1276.  
  1277.  
  1278. dnl ### Examining declarations
  1279.  
  1280.  
  1281. dnl AC_TRY_CPP(INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE])
  1282. AC_DEFUN(AC_TRY_CPP,
  1283. [AC_REQUIRE_CPP()dnl
  1284. cat > conftest.$ac_ext <<EOF
  1285. [#]line __oline__ "configure"
  1286. #include "confdefs.h"
  1287. [$1]
  1288. EOF
  1289. dnl Capture the stderr of cpp.  eval is necessary to expand ac_cpp.
  1290. dnl We used to copy stderr to stdout and capture it in a variable, but
  1291. dnl that breaks under sh -x, which writes compile commands starting
  1292. dnl with ` +' to stderr in eval and subshells.
  1293. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  1294. ac_err=`grep -v '^ *+' conftest.out`
  1295. if test -z "$ac_err"; then
  1296.   ifelse([$2], , :, [rm -rf conftest*
  1297.   $2])
  1298. else
  1299.   /bin/echo "$ac_err" >&AC_FD_CC
  1300. ifelse([$3], , , [  rm -rf conftest*
  1301.   $3
  1302. ])dnl
  1303. fi
  1304. rm -f conftest*])
  1305.  
  1306. dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [,
  1307. dnl                 ACTION-IF-NOT-FOUND])
  1308. AC_DEFUN(AC_EGREP_HEADER,
  1309. [AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])])
  1310.  
  1311. dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must
  1312. dnl come early, it is not included in AC_BEFORE checks.
  1313. dnl AC_EGREP_CPP(PATTERN, PROGRAM, ACTION-IF-FOUND [,
  1314. dnl              ACTION-IF-NOT-FOUND])
  1315. AC_DEFUN(AC_EGREP_CPP,
  1316. [AC_REQUIRE_CPP()dnl
  1317. cat > conftest.$ac_ext <<EOF
  1318. [#]line __oline__ "configure"
  1319. #include "confdefs.h"
  1320. [$2]
  1321. EOF
  1322. dnl eval is necessary to expand ac_cpp.
  1323. dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
  1324. if (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC |
  1325.   egrep "$1" >/dev/null 2>&1; then
  1326.   ifelse([$3], , :, [rm -rf conftest*
  1327.   $3])
  1328. ifelse([$4], , , [else
  1329.   rm -rf conftest*
  1330.   $4
  1331. ])dnl
  1332. fi
  1333. rm -f conftest*
  1334. ])
  1335.  
  1336.  
  1337. dnl ### Examining syntax
  1338.  
  1339.  
  1340. dnl AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY,
  1341. dnl             ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  1342. AC_DEFUN(AC_TRY_COMPILE,
  1343. [cat > conftest.$ac_ext <<EOF
  1344. dnl This sometimes fails to find confdefs.h, for some reason.
  1345. dnl [#]line __oline__ "[$]0"
  1346. [#]line __oline__ "configure"
  1347. #include "confdefs.h"
  1348. [$1]
  1349. int main() { return 0; }
  1350. int t() {
  1351. [$2]
  1352. ; return 0; }
  1353. EOF
  1354. if eval $ac_compile; then
  1355.   ifelse([$3], , :, [rm -rf conftest*
  1356.   $3])
  1357. ifelse([$4], , , [else
  1358.   rm -rf conftest*
  1359.   $4
  1360. ])dnl
  1361. fi
  1362. rm -f conftest*]
  1363. )
  1364.  
  1365.  
  1366. dnl ### Examining libraries
  1367.  
  1368.  
  1369. dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
  1370. dnl                  ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  1371. AC_DEFUN(AC_COMPILE_CHECK,
  1372. [AC_OBSOLETE([$0], [; instead use AC_TRY_COMPILE or AC_TRY_LINK, and AC_MSG_CHECKING and AC_MSG_RESULT])dnl
  1373. ifelse([$1], , , [AC_CHECKING([for $1])
  1374. ])dnl
  1375. AC_TRY_LINK([$2], [$3], [$4], [$5])dnl
  1376. ])
  1377.  
  1378. dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
  1379. dnl             ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  1380. AC_DEFUN(AC_TRY_LINK,
  1381. [cat > conftest.$ac_ext <<EOF
  1382. dnl This sometimes fails to find confdefs.h, for some reason.
  1383. dnl [#]line __oline__ "[$]0"
  1384. [#]line __oline__ "configure"
  1385. #include "confdefs.h"
  1386. [$1]
  1387. int main() { return 0; }
  1388. int t() {
  1389. [$2]
  1390. ; return 0; }
  1391. EOF
  1392. if eval $ac_link; then
  1393.   ifelse([$3], , :, [rm -rf conftest*
  1394.   $3])
  1395. ifelse([$4], , , [else
  1396.   rm -rf conftest*
  1397.   $4
  1398. ])dnl
  1399. fi
  1400. rm -f conftest*]
  1401. )
  1402.  
  1403.  
  1404. dnl ### Checking for run-time features
  1405.  
  1406.  
  1407. dnl AC_TRY_RUN(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
  1408. dnl            [, ACTION-IF-CROSS-COMPILING]])
  1409. AC_DEFUN(AC_TRY_RUN,
  1410. [AC_REQUIRE([AC_C_CROSS])dnl
  1411. if test "$cross_compiling" = yes; then
  1412.   ifelse([$4], ,
  1413.     [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling
  1414. )dnl
  1415.   AC_MSG_ERROR(can not run test program while cross compiling)],
  1416.   [$4])
  1417. else
  1418. cat > conftest.$ac_ext <<EOF
  1419. [#]line __oline__ "configure"
  1420. #include "confdefs.h"
  1421. ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
  1422. extern "C" void exit(int);
  1423. #endif
  1424. ])dnl
  1425. [$1]
  1426. EOF
  1427. eval $ac_link
  1428. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1429.   ifelse([$2], , :, [$2])
  1430. ifelse([$3], , , [else
  1431.   $3
  1432. ])dnl
  1433. fi
  1434. fi
  1435. rm -fr conftest*])
  1436.  
  1437.  
  1438. dnl ### Checking for header files
  1439.  
  1440.  
  1441. dnl AC_CHECK_HEADER(HEADER-FILE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  1442. AC_DEFUN(AC_CHECK_HEADER,
  1443. [dnl Do the transliteration at runtime so arg 1 can be a shell variable.
  1444. ac_safe=`/bin/echo "$1" | tr './\055' '___'`
  1445. AC_MSG_CHECKING([for $1])
  1446. AC_CACHE_VAL(ac_cv_header_$ac_safe,
  1447. [AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
  1448.   eval "ac_cv_header_$ac_safe=no")])dnl
  1449. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  1450.   AC_MSG_RESULT(yes)
  1451.   ifelse([$2], , :, [$2])
  1452. else
  1453.   AC_MSG_RESULT(no)
  1454. ifelse([$3], , , [$3
  1455. ])dnl
  1456. fi
  1457. ])
  1458.  
  1459. dnl AC_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  1460. AC_DEFUN(AC_CHECK_HEADERS,
  1461. [for ac_hdr in $1
  1462. do
  1463. AC_CHECK_HEADER($ac_hdr,
  1464. [changequote(, )dnl
  1465.   ac_tr_hdr=HAVE_`/bin/echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  1466. changequote([, ])dnl
  1467.   AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)dnl
  1468. done
  1469. ])
  1470.  
  1471.  
  1472. dnl ### Checking for library functions
  1473.  
  1474.  
  1475. dnl AC_CHECK_FUNC(FUNCTION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  1476. AC_DEFUN(AC_CHECK_FUNC,
  1477. [AC_MSG_CHECKING([for $1])
  1478. AC_CACHE_VAL(ac_cv_func_$1,
  1479. [AC_TRY_LINK(
  1480. dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
  1481. dnl which includes <sys/select.h> which contains a prototype for
  1482. dnl select.  Similarly for bzero.
  1483. [/* System header to define __stub macros and hopefully few prototypes,
  1484.     which can conflict with char $1(); below.  */
  1485. #include <assert.h>
  1486. /* Override any gcc2 internal prototype to avoid an error.  */
  1487. ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
  1488. extern "C"
  1489. #endif
  1490. ])dnl
  1491. [char $1(); 
  1492. ], [
  1493. /* The GNU C library defines this for functions which it implements
  1494.     to always fail with ENOSYS.  Some functions are actually named
  1495.     something starting with __ and the normal name is an alias.  */
  1496. #if defined (__stub_$1) || defined (__stub___$1)
  1497. choke me
  1498. #else
  1499. $1();
  1500. #endif
  1501. ], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])dnl
  1502. if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then
  1503.   AC_MSG_RESULT(yes)
  1504.   ifelse([$2], , :, [$2])
  1505. else
  1506.   AC_MSG_RESULT(no)
  1507. ifelse([$3], , , [$3
  1508. ])dnl
  1509. fi
  1510. ])
  1511.  
  1512. dnl AC_CHECK_FUNCS(FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  1513. AC_DEFUN(AC_CHECK_FUNCS,
  1514. [for ac_func in $1
  1515. do
  1516. AC_CHECK_FUNC($ac_func,
  1517. [changequote(, )dnl
  1518.   ac_tr_func=HAVE_`/bin/echo $ac_func | tr '[a-z]' '[A-Z]'`
  1519. changequote([, ])dnl
  1520.   AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl
  1521. done
  1522. ])
  1523.  
  1524. dnl AC_REPLACE_FUNCS(FUNCTION-NAME...)
  1525. AC_DEFUN(AC_REPLACE_FUNCS,
  1526. [for ac_func in $1
  1527. do
  1528. AC_CHECK_FUNC($ac_func, , [LIBOBJS="$LIBOBJS ${ac_func}.o"])
  1529. done
  1530. AC_SUBST(LIBOBJS)dnl
  1531. ])
  1532.  
  1533.  
  1534. dnl ### Checking compiler characteristics
  1535.  
  1536.  
  1537. dnl AC_CHECK_SIZEOF(TYPE)
  1538. AC_DEFUN(AC_CHECK_SIZEOF,
  1539. [changequote(<<, >>)dnl
  1540. dnl The name to #define.
  1541. define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
  1542. dnl The cache variable name.
  1543. define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
  1544. changequote([, ])dnl
  1545. AC_MSG_CHECKING(size of $1)
  1546. AC_CACHE_VAL(AC_CV_NAME,
  1547. [AC_TRY_RUN([#include <stdio.h>
  1548. main()
  1549. {
  1550.   FILE *f=fopen("conftestval", "w");
  1551.   if (!f) exit(1);
  1552.   fprintf(f, "%d\n", sizeof($1));
  1553.   exit(0);
  1554. }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0)])dnl
  1555. AC_MSG_RESULT($AC_CV_NAME)
  1556. AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
  1557. undefine([AC_TYPE_NAME])dnl
  1558. undefine([AC_CV_NAME])dnl
  1559. ])
  1560.  
  1561.  
  1562. dnl ### Checking for typedefs
  1563.  
  1564.  
  1565. dnl AC_CHECK_TYPE(TYPE, DEFAULT)
  1566. AC_DEFUN(AC_CHECK_TYPE,
  1567. [AC_REQUIRE([AC_HEADER_STDC])dnl
  1568. AC_MSG_CHECKING(for $1)
  1569. AC_CACHE_VAL(ac_cv_type_$1,
  1570. [AC_EGREP_CPP($1, [#include <sys/types.h>
  1571. #if STDC_HEADERS
  1572. #include <stdlib.h>
  1573. #endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
  1574. AC_MSG_RESULT($ac_cv_type_$1)
  1575. if test $ac_cv_type_$1 = no; then
  1576.   AC_DEFINE($1, $2)
  1577. fi
  1578. ])
  1579.  
  1580.  
  1581. dnl ### Creating output files
  1582.  
  1583.  
  1584. dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
  1585. AC_DEFUN(AC_CONFIG_HEADER,
  1586. [define(AC_LIST_HEADER, $1)])
  1587.  
  1588. dnl Link each of the existing files SOURCE... to the corresponding
  1589. dnl link name in DEST...
  1590. dnl AC_LINK_FILES(SOURCE..., DEST...)
  1591. AC_DEFUN(AC_LINK_FILES,
  1592. [define([AC_LIST_FILES], [$1])define([AC_LIST_LINKS], [$2])])
  1593.  
  1594. dnl AC_CONFIG_SUBDIRS(DIR ...)
  1595. AC_DEFUN(AC_CONFIG_SUBDIRS,
  1596. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  1597. define([AC_LIST_SUBDIRS], [$1])dnl
  1598. subdirs="AC_LIST_SUBDIRS"
  1599. AC_SUBST(subdirs)dnl
  1600. ])
  1601.  
  1602. dnl The big finish.
  1603. dnl Produce config.status, config.h, and links, and configure subdirs.
  1604. dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS])
  1605. define(AC_OUTPUT,
  1606. [trap '' 1 2 15
  1607. AC_CACHE_SAVE
  1608. trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
  1609.  
  1610. test "x$prefix" = xNONE && prefix=$ac_default_prefix
  1611. # Let make expand exec_prefix.
  1612. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  1613.  
  1614. # Any assignment to VPATH causes Sun make to only execute
  1615. # the first set of double-colon rules, so remove it if not needed.
  1616. # If there is a colon in the path, we need to keep it.
  1617. if test "x$srcdir" = x.; then
  1618. changequote(, )dnl
  1619.   ac_vpsub='/^[     ]*VPATH[     ]*=[^:]*$/d'
  1620. changequote([, ])dnl
  1621. fi
  1622.  
  1623. trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
  1624.  
  1625. ifdef([AC_LIST_HEADER], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
  1626.  
  1627. # Without the "./", some shells look in PATH for config.status.
  1628. : ${CONFIG_STATUS=./config.status}
  1629.  
  1630. echo creating $CONFIG_STATUS
  1631. # Some systems, like AmigaDOS, won't allow you to remove a script that is
  1632. # being executed, so just move it out of the way instead.
  1633. if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
  1634. cat > $CONFIG_STATUS <<EOF
  1635. #! /bin/sh
  1636. # Generated automatically by configure.
  1637. # Run this file to recreate the current configuration.
  1638. # This directory was configured as follows,
  1639. dnl hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
  1640. dnl so uname gets run too.
  1641. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1642. #
  1643. [#] [$]0 [$]ac_configure_args
  1644. #
  1645. # Compiler output produced by configure, useful for debugging
  1646. # configure, is in ./config.log if it exists.
  1647.  
  1648. changequote(, )dnl
  1649. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
  1650. changequote([, ])dnl
  1651. for ac_option
  1652. do
  1653.   case "[\$]ac_option" in
  1654.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1655.     echo "running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion"
  1656.     exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion ;;
  1657.   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
  1658.     /bin/echo "$CONFIG_STATUS generated by autoconf version AC_ACVERSION"
  1659.     exit 0 ;;
  1660.   -help | --help | --hel | --he | --h)
  1661.     echo "[\$]ac_cs_usage"; exit 0 ;;
  1662.   *) echo "[\$]ac_cs_usage"; exit 1 ;;
  1663.   esac
  1664. done
  1665.  
  1666. ac_given_srcdir=$srcdir
  1667. ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL"
  1668. ])dnl
  1669.  
  1670. ifdef([AC_LIST_HEADER],
  1671. [trap 'rm -fr `/bin/echo $1 AC_LIST_HEADER | tr : " "` conftest*; exit 1' 1 2 15],
  1672. [trap 'rm -f $1; exit 1' 1 2 15])
  1673.  
  1674. AC_OUTPUT_FILES($1)
  1675. ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl
  1676. ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_FILES, AC_LIST_LINKS)])dnl
  1677. ifelse([$3], , , 
  1678. [EOF
  1679. cat >> $CONFIG_STATUS <<EOF
  1680. $3
  1681. EOF
  1682. cat >> $CONFIG_STATUS <<\EOF])
  1683. $2
  1684. exit 0
  1685. EOF
  1686. chmod +x $CONFIG_STATUS
  1687. rm -fr confdefs* $ac_clean_files
  1688. test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
  1689. dnl config.status should not do recursion.
  1690. ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl
  1691. ])dnl
  1692.  
  1693. dnl This is a subroutine of AC_OUTPUT.
  1694. dnl It is called inside configure, outside of config.status.
  1695. dnl AC_OUTPUT_MAKE_DEFS()
  1696. define(AC_OUTPUT_MAKE_DEFS,
  1697. [# Transform confdefs.h into DEFS.
  1698. dnl Using a here document instead of a string reduces the quoting nightmare.
  1699. # Protect against shell expansion while executing Makefile rules.
  1700. # Protect against Makefile macro expansion.
  1701. cat > conftest.defs <<\EOF
  1702. changequote(<<, >>)dnl
  1703. s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
  1704. s%[     `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g
  1705. s%\[%\\&%g
  1706. s%\]%\\&%g
  1707. s%\$%$$%g
  1708. changequote([, ])dnl
  1709. EOF
  1710. DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
  1711. rm -f conftest.defs
  1712. ])
  1713.  
  1714. dnl This is a subroutine of AC_OUTPUT.  It is called inside an unquoted
  1715. dnl here document whose contents are going into config.status.
  1716. dnl AC_OUTPUT_FILES(FILE...)
  1717. define(AC_OUTPUT_FILES,
  1718. [# Protect against being on the right side of a sed subst in config.status. 
  1719. changequote(, )dnl
  1720. sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; 
  1721.  s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
  1722. changequote([, ])dnl
  1723. dnl These here document variables are unquoted when configure runs
  1724. dnl but quoted when config.status runs, so variables are expanded once.
  1725. $ac_vpsub
  1726. dnl Shell code in configure.in might set extrasub.
  1727. $extrasub
  1728. dnl Insert the sed substitutions of variables.
  1729. undivert(AC_DIVERSION_SED)
  1730. CEOF
  1731. EOF
  1732. cat >> $CONFIG_STATUS <<EOF
  1733.  
  1734. CONFIG_FILES=\${CONFIG_FILES-"$1"}
  1735. EOF
  1736. cat >> $CONFIG_STATUS <<\EOF
  1737. for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  1738. dnl Specifying an input file breaks the trap to clean up on interrupt,
  1739. dnl but that's not a huge problem.
  1740.   # Support "outfile[:infile]", defaulting infile="outfile.in".
  1741.   case "$ac_file" in
  1742.   *:*) ac_file_in=`/bin/echo "$ac_file"|sed 's%.*:%%'`
  1743.        ac_file=`/bin/echo "$ac_file"|sed 's%:.*%%'` ;;
  1744.   *) ac_file_in="${ac_file}.in" ;;
  1745.   esac
  1746.  
  1747.   # Adjust relative srcdir, etc. for subdirectories.
  1748.  
  1749.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1750. changequote(, )dnl
  1751.   ac_dir=`/bin/echo $ac_file|sed 's%/[^/][^/]*$%%'`
  1752. changequote([, ])dnl
  1753.   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
  1754.     # The file is in a subdirectory.
  1755.     test ! -d "$ac_dir" && mkdir "$ac_dir"
  1756.     ac_dir_suffix="/`/bin/echo $ac_dir|sed 's%^\./%%'`"
  1757.     # A "../" for each directory in $ac_dir_suffix.
  1758. changequote(, )dnl
  1759.     ac_dots=`/bin/echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  1760. changequote([, ])dnl
  1761.   else
  1762.     ac_dir_suffix= ac_dots=
  1763.   fi
  1764.  
  1765.   case "$ac_given_srcdir" in
  1766.   .)  srcdir=.
  1767.       if test -z "$ac_dots"; then top_srcdir=.
  1768.       else top_srcdir=`/bin/echo $ac_dots|sed 's%/$%%'`; fi ;;
  1769.   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  1770.   *) # Relative path.
  1771.     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
  1772.     top_srcdir="$ac_dots$ac_given_srcdir" ;;
  1773.   esac
  1774.  
  1775. ifdef([AC_PROVIDE_AC_PROG_INSTALL],
  1776. [  case "$ac_given_INSTALL" in
  1777. changequote(, )dnl
  1778.   [/$]*) INSTALL="$ac_given_INSTALL" ;;
  1779. changequote([, ])dnl
  1780.   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  1781.   esac
  1782. ])dnl
  1783.   echo creating "$ac_file"
  1784.   rm -f "$ac_file"
  1785.   configure_input="Generated automatically from `/bin/echo $ac_file_in|sed 's%.*/%%'` by configure."
  1786.   case "$ac_file" in
  1787.   *Makefile*) ac_comsub="1i\\
  1788. # $configure_input" ;;
  1789.   *) ac_comsub= ;;
  1790.   esac
  1791.   sed -e "$ac_comsub
  1792. s%@configure_input@%$configure_input%g
  1793. s%@srcdir@%$srcdir%g
  1794. s%@top_srcdir@%$top_srcdir%g
  1795. ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
  1796. ])dnl
  1797. " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
  1798. fi; done
  1799. rm -f conftest.subs
  1800. ])
  1801.  
  1802. dnl This is a subroutine of AC_OUTPUT.  It is called inside a quoted
  1803. dnl here document whose contents are going into config.status.
  1804. dnl AC_OUTPUT_HEADER(HEADER-FILE...)
  1805. define(AC_OUTPUT_HEADER,
  1806. [changequote(<<, >>)dnl
  1807. # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
  1808. # NAME is the cpp macro being defined and VALUE is the value it is being given.
  1809. #
  1810. # ac_d sets the value in "#define NAME VALUE" lines.
  1811. ac_dA='s%^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  1812. ac_dB='\([     ][     ]*\)[^     ]*%\1#\2'
  1813. ac_dC='\3'
  1814. ac_dD='%g'
  1815. # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  1816. ac_uA='s%^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1817. ac_uB='\([     ]\)%\1#\2define\3'
  1818. ac_uC=' '
  1819. ac_uD='\4%g'
  1820. # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  1821. ac_eA='s%^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1822. ac_eB='<<$>>%\1#\2define\3'
  1823. ac_eC=' '
  1824. ac_eD='%g'
  1825. changequote([, ])dnl
  1826.  
  1827. CONFIG_HEADERS=${CONFIG_HEADERS-"$1"}
  1828. for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  1829.   # Support "outfile[:infile]", defaulting infile="outfile.in".
  1830.   case "$ac_file" in
  1831.   *:*) ac_file_in=`/bin/echo "$ac_file"|sed 's%.*:%%'`
  1832.        ac_file=`/bin/echo "$ac_file"|sed 's%:.*%%'` ;;
  1833.   *) ac_file_in="${ac_file}.in" ;;
  1834.   esac
  1835.  
  1836.   echo creating $ac_file
  1837.  
  1838.   rm -f conftest.frag conftest.in conftest.out
  1839.   cp $ac_given_srcdir/$ac_file_in conftest.in
  1840.  
  1841. EOF
  1842.  
  1843. # Transform confdefs.h into a sed script conftest.vals that substitutes
  1844. # the proper values into config.h.in to produce config.h.  And first:
  1845. # Protect against being on the right side of a sed subst in config.status. 
  1846. # Protect against being in an unquoted here document in config.status.
  1847. rm -f conftest.vals
  1848. dnl Using a here document instead of a string reduces the quoting nightmare.
  1849. dnl Putting comments in sed scripts is not portable.
  1850. cat > conftest.hdr <<\EOF
  1851. changequote(<<, >>)dnl
  1852. s/[\\&%]/\\&/g
  1853. s%[\\$`]%\\&%g
  1854. s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
  1855. s%ac_d%ac_u%gp
  1856. s%ac_u%ac_e%gp
  1857. changequote([, ])dnl
  1858. EOF
  1859. sed -n -f conftest.hdr confdefs.h > conftest.vals
  1860. rm -f conftest.hdr
  1861.  
  1862. # This sed command replaces #undef with comments.  This is necessary, for
  1863. # example, in the case of _POSIX_SOURCE, which is predefined and required
  1864. # on some systems where configure will not decide to define it.
  1865. cat >> conftest.vals <<\EOF
  1866. changequote(, )dnl
  1867. s%^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
  1868. changequote([, ])dnl
  1869. EOF
  1870.  
  1871. # Break up conftest.vals because some shells have a limit on
  1872. # the size of here documents, and old seds have small limits too.
  1873. # Maximum number of lines to put in a single here document.
  1874. ac_max_here_lines=12
  1875.  
  1876. rm -f conftest.tail
  1877. while :
  1878. do
  1879.   ac_lines=`grep -c . conftest.vals`
  1880.   # grep -c gives empty output for an empty file on some AIX systems.
  1881.   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  1882.   # Write a limited-size here document to conftest.frag.
  1883.   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  1884.   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  1885.   echo 'CEOF
  1886.   sed -f conftest.frag conftest.in > conftest.out
  1887.   rm -f conftest.in
  1888.   mv conftest.out conftest.in
  1889. ' >> $CONFIG_STATUS
  1890.   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  1891.   rm -f conftest.vals
  1892.   mv conftest.tail conftest.vals
  1893. done
  1894. rm -f conftest.vals
  1895.  
  1896. dnl Now back to your regularly scheduled config.status.
  1897. cat >> $CONFIG_STATUS <<\EOF
  1898.   rm -f conftest.frag conftest.h
  1899.   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  1900.   cat conftest.in >> conftest.h
  1901.   rm -f conftest.in
  1902.   if cmp -s $ac_file conftest.h 2>/dev/null; then
  1903.     /bin/echo "$ac_file is unchanged"
  1904.     rm -f conftest.h
  1905.   else
  1906.     rm -f $ac_file
  1907.     # Make include path if necessary.
  1908.     dir=`dirname $ac_file`
  1909.     if test -d $dir; then true; else mkdir -p $dir; fi
  1910.     mv conftest.h $ac_file
  1911.   fi
  1912. fi; done
  1913.  
  1914. ])
  1915.  
  1916. dnl This is a subroutine of AC_OUTPUT.  It is called inside a quoted
  1917. dnl here document whose contents are going into config.status.
  1918. dnl AC_OUTPUT_LINKS(SOURCE..., DEST...)
  1919. define(AC_OUTPUT_LINKS,
  1920. [EOF
  1921.  
  1922. cat >> $CONFIG_STATUS <<EOF
  1923. ac_sources="$1"
  1924. ac_dests="$2"
  1925. EOF
  1926.  
  1927. cat >> $CONFIG_STATUS <<\EOF
  1928. srcdir=$ac_given_srcdir
  1929. while test -n "$ac_sources"; do
  1930.   set $ac_dests; ac_dest=[$]1; shift; ac_dests=[$]*
  1931.   set $ac_sources; ac_source=[$]1; shift; ac_sources=[$]*
  1932.  
  1933.   echo "linking $srcdir/$ac_source to $ac_dest"
  1934.  
  1935.   if test ! -r $srcdir/$ac_source; then
  1936.     AC_MSG_ERROR($srcdir/$ac_source: File not found)
  1937.   fi
  1938.   rm -f $ac_dest
  1939.  
  1940.   # Make relative symlinks.
  1941.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1942. changequote(, )dnl
  1943.   ac_dest_dir=`/bin/echo $ac_dest|sed 's%/[^/][^/]*$%%'`
  1944. changequote([, ])dnl
  1945.   if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
  1946.     # The dest file is in a subdirectory.
  1947.     test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
  1948.     ac_dest_dir_suffix="/`/bin/echo $ac_dest_dir|sed 's%^\./%%'`"
  1949.     # A "../" for each directory in $ac_dest_dir_suffix.
  1950. changequote(, )dnl
  1951.     ac_dots=`/bin/echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
  1952. changequote([, ])dnl
  1953.   else
  1954.     ac_dest_dir_suffix= ac_dots=
  1955.   fi
  1956.  
  1957.   case "$srcdir" in
  1958. changequote(, )dnl
  1959.   [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
  1960. changequote([, ])dnl
  1961.   *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
  1962.   esac
  1963.  
  1964.   # Make a symlink if possible; otherwise try a hard link.
  1965.   # On the Amiga, we instead try a hard link first and then
  1966.   # just do a cp, since symbolic links still have rough edges.
  1967.   if ln $ac_rel_source $ac_dest 2>/dev/null ||
  1968.     cp -p $srcdir/$ac_source $ac_dest; then :
  1969.   else
  1970.     AC_MSG_ERROR(can not link $ac_dest to $srcdir/$ac_source)
  1971.   fi
  1972. done
  1973. ])
  1974.  
  1975. dnl This is a subroutine of AC_OUTPUT.
  1976. dnl It is called after running config.status.
  1977. dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
  1978. define(AC_OUTPUT_SUBDIRS,
  1979. [
  1980. if test "$no_recursion" != yes; then
  1981.  
  1982.   # Remove --cache-file and --srcdir arguments so they do not pile up.
  1983.   ac_sub_configure_args=
  1984.   ac_prev=
  1985.   for ac_arg in $ac_configure_args; do
  1986.     if test -n "$ac_prev"; then
  1987.       ac_prev=
  1988.       continue
  1989.     fi
  1990.     case "$ac_arg" in
  1991.     -cache-file | --cache-file | --cache-fil | --cache-fi \
  1992.     | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
  1993.       ac_prev=cache_file ;;
  1994.     -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  1995.     | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
  1996.       ;;
  1997.     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  1998.       ac_prev=srcdir ;;
  1999.     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  2000.       ;;
  2001.     *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
  2002.     esac
  2003.   done
  2004.  
  2005.   for ac_config_dir in $1; do
  2006.  
  2007.     # Do not complain, so a configure script can configure whichever
  2008.     # parts of a large source tree are present.
  2009.     if test ! -d $srcdir/$ac_config_dir; then
  2010.       continue
  2011.     fi
  2012.  
  2013.     echo configuring in $ac_config_dir
  2014.  
  2015.     case "$srcdir" in
  2016.     .) ;;
  2017.     *)
  2018.       if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
  2019.       else
  2020.         AC_MSG_ERROR(can not create `pwd`/$ac_config_dir)
  2021.       fi
  2022.       ;;
  2023.     esac
  2024.  
  2025.     ac_popdir=`pwd`
  2026.     cd $ac_config_dir
  2027.  
  2028.     case "$srcdir" in
  2029.     .) # No --srcdir option.  We are building in place.
  2030.       ac_sub_srcdir=$srcdir ;;
  2031.     /*) # Absolute path.
  2032.       ac_sub_srcdir=$srcdir/$ac_config_dir ;;
  2033.     *) # Relative path.
  2034.       ac_sub_srcdir=../$srcdir/$ac_config_dir ;;
  2035.     esac
  2036.  
  2037.     # Check for guested configure; otherwise get Cygnus style configure.
  2038.     if test -f $ac_sub_srcdir/configure; then
  2039.       ac_sub_configure=$ac_sub_srcdir/configure
  2040.     elif test -f $ac_sub_srcdir/configure.in; then
  2041.       ac_sub_configure=$ac_configure
  2042.     else
  2043.       AC_MSG_WARN(no configuration information is in $ac_config_dir)
  2044.       ac_sub_configure=
  2045.     fi
  2046.  
  2047.     # The recursion is here.
  2048.     if test -n "$ac_sub_configure"; then
  2049.  
  2050.       # Make the cache file name correct relative to the subdirectory.
  2051. changequote(, )dnl
  2052.       # A "../" for each directory in /$ac_config_dir.
  2053.       ac_dots=`/bin/echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
  2054. changequote([, ])dnl
  2055.       case "$cache_file" in
  2056.       /*) ac_sub_cache_file=$cache_file ;;
  2057.       *) # Relative path.
  2058.         ac_sub_cache_file="$ac_dots$cache_file" ;;
  2059.       esac
  2060. ifdef([AC_PROVIDE_AC_PROG_INSTALL],
  2061.       [  case "$ac_given_INSTALL" in
  2062. changequote(, )dnl
  2063.         [/$]*) INSTALL="$ac_given_INSTALL" ;;
  2064. changequote([, ])dnl
  2065.         *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  2066.         esac
  2067. ])dnl
  2068.  
  2069.       echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir"
  2070.       # The eval makes quoting arguments work.
  2071.       if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
  2072.       then :
  2073.       else
  2074.         AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir)
  2075.       fi
  2076.     fi
  2077.  
  2078.     cd $ac_popdir
  2079.   done
  2080. fi
  2081. ])
  2082.