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