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