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.

2650 lines
81 KiB

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