You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2651 lines
81 KiB

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