Mercurial > hg > xemacs-beta
comparison lib-autoconf-1/acgeneral.m4 @ 48:56c54cf7c5b6 r19-16b90
Import from CVS: tag r19-16b90
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:56:04 +0200 |
parents | |
children | 05472e90ae02 |
comparison
equal
deleted
inserted
replaced
47:11c6df210d7f | 48:56c54cf7c5b6 |
---|---|
1 dnl Parameterized macros that do not check for something specific. | |
2 dnl This file is part of Autoconf. | |
3 dnl Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. | |
4 dnl | |
5 dnl This program is free software; you can redistribute it and/or modify | |
6 dnl it under the terms of the GNU General Public License as published by | |
7 dnl the Free Software Foundation; either version 2, or (at your option) | |
8 dnl any later version. | |
9 dnl | |
10 dnl This program is distributed in the hope that it will be useful, | |
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 dnl GNU General Public License for more details. | |
14 dnl | |
15 dnl You should have received a copy of the GNU General Public License | |
16 dnl along with this program; if not, write to the Free Software | |
17 dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
18 dnl | |
19 dnl Written by David MacKenzie, with help from | |
20 dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, | |
21 dnl Roland McGrath, Noah Friedman, and david d zuhn. | |
22 dnl | |
23 changequote([,])dnl | |
24 undefine([eval])dnl | |
25 undefine([include])dnl | |
26 undefine([shift])dnl | |
27 undefine([format])dnl | |
28 dnl | |
29 ifdef([__gnu__], , [errprint(Autoconf requires GNU m4 | |
30 )m4exit(2)])dnl | |
31 dnl | |
32 dnl | |
33 dnl Utility functions for stamping the configure script. | |
34 dnl | |
35 dnl | |
36 define(AC_ACVERSION, 1.11)dnl | |
37 dnl This is defined by the --version option of the autoconf script. | |
38 ifdef([AC_PRINT_VERSION], [errprint(Autoconf version AC_ACVERSION | |
39 )])dnl | |
40 dnl | |
41 dnl These are currently not used, for the sake of people who diff | |
42 dnl configure scripts and don't want spurious differences. | |
43 dnl But they are too clever to just delete. | |
44 dnl | |
45 define(AC_USER, [esyscmd( | |
46 changequote({,})dnl | |
47 # Extract the user name from the first pair of parentheses. | |
48 ({ac_sedcmd='s/[^(]*(\([^)]*\)).*/\1/';} | |
49 changequote([,])dnl | |
50 whoami || id|sed "$ac_sedcmd") 2>/dev/null|tr -d '\012')])dnl | |
51 dnl | |
52 define(AC_HOST, [esyscmd((hostname || uname -n) 2>/dev/null|tr -d '\012')])dnl | |
53 dnl | |
54 define(AC_DATE, [esyscmd(date|tr -d '\012')])dnl | |
55 dnl | |
56 dnl | |
57 dnl Controlling Autoconf operation | |
58 dnl | |
59 dnl | |
60 dnl This is separate from AC_INIT to prevent GNU m4 1.0 from coredumping | |
61 dnl when AC_CONFIG_HEADER is used. | |
62 define(AC_NOTICE, | |
63 [# Guess values for system-dependent variables and create Makefiles. | |
64 dnl [#] Generated automatically using autoconf. | |
65 # Generated automatically using autoconf version] AC_ACVERSION [ | |
66 dnl [#] by AC_USER@AC_HOST on AC_DATE | |
67 # Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. | |
68 | |
69 # This configure script is free software; you can redistribute it and/or | |
70 # modify it under the terms of the GNU General Public License as published | |
71 # by the Free Software Foundation; either version 2, or (at your option) | |
72 # any later version. | |
73 | |
74 # This script is distributed in the hope that it will be useful, but | |
75 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
76 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | |
77 # Public License for more details. | |
78 | |
79 # You should have received a copy of the GNU General Public License | |
80 # along with this program; if not, write to the Free Software | |
81 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
82 ])dnl | |
83 dnl | |
84 define(AC_PARSEARGS, | |
85 [# Save the original args to write them into config.status later. | |
86 configure_args="[$]*" | |
87 | |
88 # Only options that might do something get documented. | |
89 changequote(,)dnl | |
90 ac_usage="Usage: configure [options] [host] | |
91 Options: [defaults in brackets after descriptions] | |
92 --build=BUILD configure for building on BUILD [BUILD=HOST] | |
93 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) | |
94 --enable-FEATURE[=ARG] include FEATURE [ARG=yes] | |
95 --exec-prefix=PREFIX install host dependent files in PREFIX [/usr/local] | |
96 --help print this message | |
97 --host=HOST configure for HOST [guessed] | |
98 --prefix=PREFIX install host independent files in PREFIX [/usr/local] | |
99 --quiet, --silent do not print \`checking for...' messages | |
100 --srcdir=DIR find the sources in DIR [configure dir or ..] | |
101 --target=TARGET configure for TARGET [TARGET=HOST] | |
102 --verbose print results of checks | |
103 --version print the version of autoconf that created configure | |
104 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] | |
105 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) | |
106 --x-includes=DIR X include files are in DIR | |
107 --x-libraries=DIR X library files are in DIR" | |
108 changequote([,])dnl | |
109 | |
110 # Initialize some variables set by options. | |
111 # The variables have the same names as the options, with | |
112 # dashes changed to underlines. | |
113 build=NONE | |
114 exec_prefix= | |
115 host=NONE | |
116 no_create= | |
117 nonopt=NONE | |
118 norecursion= | |
119 prefix= | |
120 program_prefix= | |
121 program_suffix= | |
122 program_transform_name= | |
123 silent= | |
124 srcdir= | |
125 target=NONE | |
126 verbose= | |
127 x_includes= | |
128 x_libraries= | |
129 | |
130 ac_prev= | |
131 for ac_option | |
132 do | |
133 | |
134 # If the previous option needs an argument, assign it. | |
135 if test -n "$ac_prev"; then | |
136 eval "$ac_prev=\$ac_option" | |
137 ac_prev= | |
138 continue | |
139 fi | |
140 | |
141 # Accept (but ignore some of) the important Cygnus configure | |
142 # options, so we can diagnose typos. | |
143 | |
144 case "$ac_option" in | |
145 changequote(,)dnl | |
146 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; | |
147 changequote([,])dnl | |
148 *) ac_optarg= ;; | |
149 esac | |
150 | |
151 case "$ac_option" in | |
152 | |
153 -build | --build | --buil | --bui | --bu | --b) | |
154 ac_prev=build ;; | |
155 -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*) | |
156 build="$ac_optarg" ;; | |
157 | |
158 -disable-* | --disable-*) | |
159 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` | |
160 # Reject names that aren't valid shell variable names. | |
161 changequote(,)dnl | |
162 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then | |
163 changequote([,])dnl | |
164 AC_ERROR($ac_feature: invalid feature name) | |
165 fi | |
166 ac_feature=`echo $ac_feature| sed 's/-/_/g'` | |
167 eval "enable_${ac_feature}=no" ;; | |
168 | |
169 -enable-* | --enable-*) | |
170 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` | |
171 # Reject names that aren't valid shell variable names. | |
172 changequote(,)dnl | |
173 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then | |
174 changequote([,])dnl | |
175 AC_ERROR($ac_feature: invalid feature name) | |
176 fi | |
177 ac_feature=`echo $ac_feature| sed 's/-/_/g'` | |
178 case "$ac_option" in | |
179 *=*) ;; | |
180 *) ac_optarg=yes ;; | |
181 esac | |
182 eval "enable_${ac_feature}='$ac_optarg'" ;; | |
183 | |
184 # For backward compatibility, recognize -exec-prefix and --exec_prefix. | |
185 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | |
186 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | |
187 | --exec | --exe | --ex) | |
188 ac_prev=exec_prefix ;; | |
189 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | |
190 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | |
191 | --exec=* | --exe=* | --ex=*) | |
192 exec_prefix="$ac_optarg" ;; | |
193 | |
194 -gas | --gas | --ga | --g) | |
195 with_gas=yes ;; # Obsolete; use --with-gas. | |
196 | |
197 -help | --help | --hel | --he) | |
198 cat << EOF | |
199 $ac_usage | |
200 EOF | |
201 exit 0 ;; | |
202 | |
203 -host | --host | --hos | --ho) | |
204 ac_prev=host ;; | |
205 -host=* | --host=* | --hos=* | --ho=*) | |
206 host="$ac_optarg" ;; | |
207 | |
208 -nfp | --nfp | --nf) | |
209 with_fp=no ;; # Obsolete; use --without-fp. | |
210 | |
211 -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | |
212 | --no-cr | --no-c) | |
213 no_create=yes ;; | |
214 | |
215 -norecursion | --norecursion | --norecursio | --norecursi \ | |
216 | --norecurs | --norecur | --norecu | --norec | --nore | --nor) | |
217 norecursion=yes ;; | |
218 | |
219 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) | |
220 ac_prev=prefix ;; | |
221 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) | |
222 prefix="$ac_optarg" ;; | |
223 | |
224 -program-prefix | --program-prefix | --program-prefi | --program-pref \ | |
225 | --program-pre | --program-pr | --program-p) | |
226 ac_prev=program_prefix ;; | |
227 -program-prefix=* | --program-prefix=* | --program-prefi=* \ | |
228 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) | |
229 program_prefix="$ac_optarg" ;; | |
230 | |
231 -program-suffix | --program-suffix | --program-suffi | --program-suff \ | |
232 | --program-suf | --program-su | --program-s) | |
233 ac_prev=program_suffix ;; | |
234 -program-suffix=* | --program-suffix=* | --program-suffi=* \ | |
235 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) | |
236 program_suffix="$ac_optarg" ;; | |
237 | |
238 -program-transform-name | --program-transform-name \ | |
239 | --program-transform-nam | --program-transform-na \ | |
240 | --program-transform-n | --program-transform- \ | |
241 | --program-transform | --program-transfor \ | |
242 | --program-transfo | --program-transf \ | |
243 | --program-trans | --program-tran \ | |
244 | --progr-tra | --program-tr | --program-t) | |
245 ac_prev=program_transform_name ;; | |
246 -program-transform-name=* | --program-transform-name=* \ | |
247 | --program-transform-nam=* | --program-transform-na=* \ | |
248 | --program-transform-n=* | --program-transform-=* \ | |
249 | --program-transform=* | --program-transfor=* \ | |
250 | --program-transfo=* | --program-transf=* \ | |
251 | --program-trans=* | --program-tran=* \ | |
252 | --progr-tra=* | --program-tr=* | --program-t=*) | |
253 program_transform_name="$ac_optarg" ;; | |
254 | |
255 -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | |
256 | -silent | --silent | --silen | --sile | --sil) | |
257 silent=yes ;; | |
258 | |
259 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) | |
260 ac_prev=srcdir ;; | |
261 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) | |
262 srcdir="$ac_optarg" ;; | |
263 | |
264 -target | --target | --targe | --targ | --tar | --ta | --t) | |
265 ac_prev=target ;; | |
266 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) | |
267 target="$ac_optarg" ;; | |
268 | |
269 -v | -verbose | --verbose | --verbos | --verbo | --verb) | |
270 verbose=yes ;; | |
271 | |
272 -version | --version | --versio | --versi | --vers) | |
273 echo "configure generated by autoconf version AC_ACVERSION" | |
274 exit 0 ;; | |
275 | |
276 -with-* | --with-*) | |
277 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` | |
278 # Reject names that aren't valid shell variable names. | |
279 changequote(,)dnl | |
280 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then | |
281 changequote([,])dnl | |
282 AC_ERROR($ac_package: invalid package name) | |
283 fi | |
284 ac_package=`echo $ac_package| sed 's/-/_/g'` | |
285 case "$ac_option" in | |
286 *=*) ;; | |
287 *) ac_optarg=yes ;; | |
288 esac | |
289 eval "with_${ac_package}='$ac_optarg'" ;; | |
290 | |
291 -without-* | --without-*) | |
292 ac_package=`echo $ac_option|sed -e 's/-*without-//'` | |
293 # Reject names that aren't valid shell variable names. | |
294 changequote(,)dnl | |
295 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then | |
296 changequote([,])dnl | |
297 AC_ERROR($ac_package: invalid package name) | |
298 fi | |
299 ac_package=`echo $ac_package| sed 's/-/_/g'` | |
300 eval "with_${ac_package}=no" ;; | |
301 | |
302 --x) with_x=yes ;; # Obsolete; use --with-x. | |
303 | |
304 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | |
305 | --x-incl | --x-inc | --x-in | --x-i) | |
306 ac_prev=x_includes ;; | |
307 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | |
308 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) | |
309 x_includes="$ac_optarg" ;; | |
310 | |
311 -x-libraries | --x-libraries | --x-librarie | --x-librari \ | |
312 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) | |
313 ac_prev=x_libraries ;; | |
314 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | |
315 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) | |
316 x_libraries="$ac_optarg" ;; | |
317 | |
318 -*) AC_ERROR([$ac_option: invalid option; use --help to show usage]) | |
319 ;; | |
320 | |
321 *) | |
322 changequote(,)dnl | |
323 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then | |
324 changequote([,])dnl | |
325 AC_WARN($ac_option: invalid host type) | |
326 fi | |
327 if test "x$nonopt" != xNONE; then | |
328 AC_ERROR(can only configure for one host and one target at a time) | |
329 fi | |
330 nonopt="$ac_option" | |
331 ;; | |
332 | |
333 esac | |
334 done | |
335 | |
336 if test -n "$ac_prev"; then | |
337 AC_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`) | |
338 fi | |
339 ])dnl | |
340 dnl | |
341 define(AC_INIT, | |
342 [#!/bin/sh | |
343 AC_NOTICE | |
344 AC_PARSEARGS | |
345 AC_PREPARE($1)])dnl | |
346 dnl | |
347 define(AC_PREPARE, | |
348 [trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 | |
349 trap 'rm -fr confdefs* $ac_clean_files' 0 | |
350 | |
351 # Save the original args if we used an alternate arg parser. | |
352 ac_configure_temp="${configure_args-[$]*}" | |
353 # Strip out --no-create and --norecursion so they don't pile up. | |
354 configure_args= | |
355 for ac_arg in $ac_configure_temp; do | |
356 case "$ac_arg" in | |
357 -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | |
358 | --no-cr | --no-c) ;; | |
359 -norecursion | --norecursion | --norecursio | --norecursi \ | |
360 | --norecurs | --norecur | --norecu | --norec | --nore | --nor) ;; | |
361 *) configure_args="$configure_args $ac_arg" ;; | |
362 esac | |
363 done | |
364 | |
365 # NLS nuisances. | |
366 # These must not be set unconditionally because not all systems understand | |
367 # e.g. LANG=C (notably SCO). | |
368 if test "${LC_ALL+set}" = 'set'; then LC_ALL=C; export LC_ALL; fi | |
369 if test "${LANG+set}" = 'set'; then LANG=C; export LANG; fi | |
370 | |
371 # confdefs.h avoids OS command line length limits that DEFS can exceed. | |
372 rm -rf conftest* confdefs.h | |
373 # AIX cpp loses on an empty file, so make sure it contains at least a newline. | |
374 echo > confdefs.h | |
375 | |
376 # A filename unique to this package, relative to the directory that | |
377 # configure is in, which we can look for to find out if srcdir is correct. | |
378 ac_unique_file=$1 | |
379 | |
380 # Find the source files, if location was not specified. | |
381 if test -z "$srcdir"; then | |
382 ac_srcdir_defaulted=yes | |
383 # Try the directory containing this script, then `..'. | |
384 ac_prog=[$]0 | |
385 changequote(,)dnl | |
386 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` | |
387 changequote([,])dnl | |
388 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. | |
389 srcdir=$ac_confdir | |
390 if test ! -r $srcdir/$ac_unique_file; then | |
391 srcdir=.. | |
392 fi | |
393 fi | |
394 if test ! -r $srcdir/$ac_unique_file; then | |
395 if test x$ac_srcdir_defaulted = xyes; then | |
396 AC_ERROR(can not find sources in ${ac_confdir} or ..) | |
397 else | |
398 AC_ERROR(can not find sources in ${srcdir}) | |
399 fi | |
400 fi | |
401 AC_LANG_C | |
402 ])dnl | |
403 dnl | |
404 define(AC_ENABLE, | |
405 [[#] check whether --enable-$1 was given | |
406 enableval="[$enable_]patsubst($1,-,_)" | |
407 if test -n "$enableval"; then | |
408 ifelse([$2], , :, [$2]) | |
409 ifelse([$3], , , [else | |
410 $3 | |
411 ])dnl | |
412 fi | |
413 ])dnl | |
414 dnl | |
415 dnl Giving --with an argument is deprecated. | |
416 define(AC_WITH, | |
417 [[#] check whether --with-$1 or --without-$1 was given. | |
418 withval="[$with_]patsubst($1,-,_)" | |
419 if test -n "$withval"; then | |
420 ifelse([$2], , :, [$2]) | |
421 ifelse([$3], , , [else | |
422 $3 | |
423 ])dnl | |
424 fi | |
425 ])dnl | |
426 dnl | |
427 dnl Guess the value for the `prefix' variable by looking for | |
428 dnl the argument program along PATH and taking its parent. | |
429 dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc, | |
430 dnl set `prefix' to /usr/local/gnu. | |
431 define(AC_PREFIX, | |
432 [if test -z "$prefix" | |
433 then | |
434 AC_CHECKING([for $1 to derive installation directory prefix]) | |
435 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$IFS:" | |
436 for ac_dir in $PATH; do | |
437 test -z "$ac_dir" && ac_dir=. | |
438 if test $ac_dir != . && test -f $ac_dir/$1; then | |
439 changequote(,)dnl | |
440 # Not all systems have dirname. | |
441 prefix=`echo $ac_dir|sed 's%/[^/][^/]*$%%'` | |
442 changequote([,])dnl | |
443 break | |
444 fi | |
445 done | |
446 IFS="$ac_save_ifs" | |
447 AC_VERBOSE(chose installation directory prefix ${prefix}) | |
448 fi | |
449 ])dnl | |
450 dnl | |
451 define(AC_CONFIG_HEADER, [define(AC_CONFIG_NAMES, $1)])dnl | |
452 dnl | |
453 define(AC_DOREV, [#!/bin/sh | |
454 # From configure.in $1 | |
455 ])dnl | |
456 define(AC_REVISION, [AC_DOREV(translit($1,$"))])dnl | |
457 dnl | |
458 dnl Subroutines of AC_PREREQ. | |
459 dnl | |
460 dnl Change the dots in version number $1 into commas. | |
461 define(AC_PREREQ_SPLIT, [translit($1,.,[,])])dnl | |
462 dnl | |
463 dnl Default the ternary version number to 0 (e.g., 1,7 -> 1,7,0). | |
464 define(AC_PREREQ_CANON, [$1,$2,ifelse([$3],,0,[$3])])dnl | |
465 dnl | |
466 dnl Complain and exit if the version number in $1 through $3 is less than | |
467 dnl the version number in $4 through $6. | |
468 dnl $7 is the printable version of the second version number. | |
469 define(AC_PREREQ_COMPARE, | |
470 [ifelse(builtin([eval], | |
471 [$3 + $2 * 100 + $1 * 10000 < $6 + $5 * 100 + $4 * 10000]),1, | |
472 [errprint(Autoconf version $7 or higher is required | |
473 )m4exit(3)])])dnl | |
474 dnl | |
475 dnl Complain and exit if the Autoconf version is less than $1. | |
476 define(AC_PREREQ, | |
477 [AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), | |
478 AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),[$1])])dnl | |
479 dnl | |
480 dnl | |
481 dnl Setting variables | |
482 dnl | |
483 dnl | |
484 dnl Several simple subroutines to do various flavors of quoting. | |
485 dnl | |
486 dnl Quote $1 against shell "s. | |
487 define(AC_QUOTE_DQUOTE, [dnl We use \1 instead of \& to avoid an m4 1.0.3 bug. | |
488 patsubst($1, changequote(,)\([$"`\\]\)changequote([,]), \\\1)])dnl | |
489 dnl | |
490 dnl Quote $1 against shell 's. | |
491 define(AC_QUOTE_SQUOTE, [patsubst($1, ', '\\'')])dnl | |
492 dnl | |
493 dnl Quote $1 against shell here documents (<<EOF). | |
494 define(AC_QUOTE_HERE, [changequote({,})dnl | |
495 dnl We use \1 instead of \& to avoid an m4 1.0.3 bug. | |
496 patsubst(patsubst($1, \(\\[$`\\]\), \\\1), \([$`]\), \\\1){}dnl | |
497 changequote([,])])dnl | |
498 dnl | |
499 dnl Quote $1 against the right hand side of a sed substitution. | |
500 define(AC_QUOTE_SED, [changequote({,})dnl | |
501 dnl We use \1 instead of \& to avoid an m4 1.0.3 bug. | |
502 dnl % and @ and ! are commonly used as the sed s separator character. | |
503 patsubst($1, \([&\\%@!]\), \\\1){}dnl | |
504 changequote([,])])dnl | |
505 dnl | |
506 dnl Quote $1 against tokenization. | |
507 define(AC_QUOTE_TOKEN, [changequote({,})dnl | |
508 patsubst($1, \([ ]\), \\\1){}dnl | |
509 changequote([,])])dnl | |
510 dnl | |
511 dnl Subroutines of AC_DEFINE. Does more quoting magic than any sane person | |
512 dnl should be able to understand. The point of it all is that what goes into | |
513 dnl Makefile et al should be verbatim what was written in configure.in. | |
514 define(AC_DEFINE_QUOTE, [dnl | |
515 AC_QUOTE_TOKEN(AC_QUOTE_SQUOTE(AC_QUOTE_DQUOTE($1)))])dnl | |
516 dnl | |
517 define(AC_DEFINE_SEDQUOTE, [dnl | |
518 AC_QUOTE_DQUOTE(AC_QUOTE_HERE(AC_QUOTE_HERE(AC_QUOTE_SED($1))))])dnl | |
519 dnl | |
520 dnl Don't compare $2 to a blank, so we can support "-Dfoo=". | |
521 dnl If creating a configuration header file, we add | |
522 dnl commands to ac_sed_defs to define the variable. ac_[due][ABCD] | |
523 dnl get defined in config.status. Here we just insert the | |
524 dnl variable parts of the string: the variable name to define | |
525 dnl and the value to give it. | |
526 dnl The newlines around the curly braces prevent sh syntax errors. | |
527 define(AC_DEFINE,[ | |
528 { | |
529 dnl Uniformly use AC_DEFINE_[SED]QUOTE, so callers of AC_DEFINE_UNQUOTED | |
530 dnl can use AC_QUOTE_* manually if they want to. | |
531 test -n "$verbose" && \ | |
532 ifelse($#, 2, | |
533 [define([AC_VAL], $2)dnl | |
534 echo " defining" $1 to be ifelse(AC_VAL,, empty, "AC_QUOTE_SQUOTE(AC_VAL)")], | |
535 [define([AC_VAL], 1)dnl | |
536 echo " defining $1"]) | |
537 dnl | |
538 echo "[#][define]" $1 "AC_QUOTE_SQUOTE(AC_VAL)" >> confdefs.h | |
539 dnl Define DEFS even if AC_CONFIG_NAMES for use in user case statements. | |
540 DEFS="$DEFS -D$1=AC_QUOTE_SQUOTE(AC_VAL)" | |
541 ifdef([AC_CONFIG_NAMES], | |
542 ac_sed_defs="dnl | |
543 ${ac_sed_defs}\${ac_dA}$1\${ac_dB}$1\${ac_dC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_dD} | |
544 \${ac_uA}$1\${ac_uB}$1\${ac_uC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_uD} | |
545 \${ac_eA}$1\${ac_eB}$1\${ac_eC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_eD} | |
546 " | |
547 )dnl | |
548 } | |
549 ])dnl | |
550 dnl | |
551 dnl Unsafe version of AC_DEFINE. | |
552 dnl Users are responsible for the quoting nightmare. | |
553 dnl Well, not all of it. We need to pull the identify function out to | |
554 dnl the top level, because m4 doesn't really support nested functions; | |
555 dnl it doesn't distinguish between the arguments to the outer | |
556 dnl function, which should be expanded, and the arguments to the inner | |
557 dnl function, which shouldn't yet. | |
558 define(AC_IDENTITY,$1)dnl | |
559 define(AC_DEFINE_UNQUOTED,[dnl | |
560 pushdef([AC_QUOTE_SQUOTE],defn([AC_IDENTITY]))dnl | |
561 pushdef([AC_DEFINE_SEDQUOTE],defn([AC_IDENTITY]))dnl | |
562 AC_DEFINE($1,$2)dnl | |
563 popdef([AC_DEFINE_SEDQUOTE])dnl | |
564 popdef([AC_QUOTE_SQUOTE])dnl | |
565 ])dnl | |
566 dnl | |
567 dnl Protects the argument from being diverted twice | |
568 dnl if this macro is called twice for it. | |
569 dnl Diversion 0 is the normal output. | |
570 dnl Diversion 1 is sed substitutions for output files. | |
571 dnl Diversion 2 is variable assignments for config.status. | |
572 define(AC_SUBST, | |
573 [ifdef([AC_SUBST_$1], , | |
574 [define([AC_SUBST_$1], )dnl | |
575 divert(1)dnl | |
576 s%@$1@%[$]$1%g | |
577 divert(2)dnl | |
578 $1='[$]$1' | |
579 divert(0)dnl | |
580 ])])dnl | |
581 dnl | |
582 dnl | |
583 dnl Printing messages | |
584 dnl | |
585 dnl | |
586 define(AC_CHECKING, | |
587 [test -n "$silent" || echo "checking $1"])dnl | |
588 dnl | |
589 define(AC_VERBOSE, | |
590 [test -n "$verbose" && echo " $1"])dnl | |
591 dnl | |
592 define(AC_WARN, | |
593 [echo "configure: warning: $1" >&2])dnl | |
594 dnl | |
595 define(AC_ERROR, | |
596 [echo "configure: $1" >&2; exit 1])dnl | |
597 dnl | |
598 dnl | |
599 dnl Selecting which language to use for testing | |
600 dnl | |
601 dnl | |
602 define(AC_LANG_C, | |
603 [define([AC_LANG],[C])AC_PROVIDE([$0])ac_ext=c | |
604 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
605 ac_cpp='${CPP}' | |
606 ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1' | |
607 ])dnl | |
608 dnl | |
609 define(AC_LANG_CPLUSPLUS, | |
610 [define([AC_LANG],[CPLUSPLUS])AC_PROVIDE([$0])ac_ext=C | |
611 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
612 ac_cpp='${CXXCPP}' | |
613 ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1' | |
614 ])dnl | |
615 dnl | |
616 dnl Push the current language on a stack. | |
617 define(AC_LANG_SAVE, [pushdef([AC_LANG_STACK], AC_LANG)])dnl | |
618 dnl | |
619 dnl Restore the current language from the stack. | |
620 define(AC_LANG_RESTORE, | |
621 [ifelse(AC_LANG_STACK,C,[ifelse(AC_LANG,C,,[AC_LANG_C])],[ifelse(AC_LANG,CPLUSPLUS,,[AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])dnl | |
622 dnl | |
623 dnl | |
624 dnl Enforcing ordering constraints | |
625 dnl | |
626 dnl | |
627 define(AC_BEFORE, | |
628 [ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1 | |
629 ])])])dnl | |
630 dnl | |
631 define(AC_REQUIRE, | |
632 [ifdef([AC_PROVIDE_$1],,[indir([$1]) | |
633 ])])dnl | |
634 dnl | |
635 define(AC_PROVIDE, | |
636 [define([AC_PROVIDE_$1],)])dnl | |
637 dnl | |
638 define(AC_OBSOLETE, | |
639 [errprint(__file__:__line__: warning: [$1] is obsolete[$2] | |
640 )])dnl | |
641 dnl | |
642 dnl | |
643 dnl Checking for kinds of features | |
644 dnl | |
645 dnl | |
646 define(AC_PROGRAM_CHECK, | |
647 [if test -z "[$]$1"; then | |
648 # Extract the first word of `$2', so it can be a program name with args. | |
649 set ac_dummy $2; ac_word=[$]2 | |
650 AC_CHECKING([for $ac_word]) | |
651 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
652 for ac_dir in $PATH; do | |
653 test -z "$ac_dir" && ac_dir=. | |
654 if test -f $ac_dir/$ac_word; then | |
655 $1="$3" | |
656 break | |
657 fi | |
658 done | |
659 IFS="$ac_save_ifs" | |
660 fi | |
661 ifelse([$4],,, [test -z "[$]$1" && $1="$4"]) | |
662 test -n "[$]$1" && AC_VERBOSE(setting $1 to [$]$1) | |
663 AC_SUBST($1)dnl | |
664 ])dnl | |
665 dnl | |
666 define(AC_PROGRAMS_CHECK, | |
667 [for ac_prog in $2 | |
668 do | |
669 AC_PROGRAM_CHECK($1, [$]ac_prog, [$]ac_prog, ) | |
670 test -n "[$]$1" && break | |
671 done | |
672 ifelse([$3],,, [test -n "[$]$1" || $1="$3" | |
673 ])])dnl | |
674 dnl | |
675 define(AC_PROGRAM_PATH, | |
676 [if test -z "[$]$1"; then | |
677 # Extract the first word of `$2', so it can be a program name with args. | |
678 set ac_dummy $2; ac_word=[$]2 | |
679 AC_CHECKING([for $ac_word]) | |
680 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
681 for ac_dir in $PATH; do | |
682 test -z "$ac_dir" && ac_dir=. | |
683 if test -f $ac_dir/$ac_word; then | |
684 $1="$ac_dir/$ac_word" | |
685 break | |
686 fi | |
687 done | |
688 IFS="$ac_save_ifs" | |
689 fi | |
690 ifelse([$3],,, [test -z "[$]$1" && $1="$3"]) | |
691 test -n "[$]$1" && AC_VERBOSE(setting $1 to [$]$1) | |
692 AC_SUBST($1)dnl | |
693 ])dnl | |
694 define(AC_PROGRAMS_PATH, | |
695 [for ac_prog in $2 | |
696 do | |
697 AC_PROGRAM_PATH($1, [$]ac_prog) | |
698 test -n "[$]$1" && break | |
699 done | |
700 ifelse([$3],,, [test -n "[$]$1" || $1="$3" | |
701 ])])dnl | |
702 define(AC_HEADER_EGREP, | |
703 [AC_REQUIRE_CPP()AC_PROVIDE([$0])echo '#include "confdefs.h" | |
704 #include <$2>' > conftest.${ac_ext} | |
705 eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1" | |
706 if egrep "$1" conftest.out >/dev/null 2>&1; then | |
707 ifelse([$3], , :, [rm -rf conftest* | |
708 $3 | |
709 ]) | |
710 ifelse([$4], , , [else | |
711 rm -rf conftest* | |
712 $4 | |
713 ])dnl | |
714 fi | |
715 rm -f conftest* | |
716 ])dnl | |
717 dnl | |
718 dnl Because this macro is used by AC_GCC_TRADITIONAL, which must come early, | |
719 dnl it is not included in AC_BEFORE checks. | |
720 define(AC_PROGRAM_EGREP, | |
721 [AC_REQUIRE_CPP()AC_PROVIDE([$0])cat > conftest.${ac_ext} <<EOF | |
722 #include "confdefs.h" | |
723 [$2] | |
724 EOF | |
725 eval "$ac_cpp conftest.${ac_ext} > conftest.out 2>&1" | |
726 if egrep "$1" conftest.out >/dev/null 2>&1; then | |
727 ifelse([$3], , :, [rm -rf conftest* | |
728 $3 | |
729 ]) | |
730 ifelse([$4], , , [else | |
731 rm -rf conftest* | |
732 $4 | |
733 ])dnl | |
734 fi | |
735 rm -f conftest* | |
736 ])dnl | |
737 dnl | |
738 define(AC_HEADER_CHECK, | |
739 [AC_CHECKING([for $1]) | |
740 ifelse([$3], , [AC_TEST_CPP([#include <$1>], [$2])], | |
741 [AC_TEST_CPP([#include <$1>], [$2], [$3])]) | |
742 ])dnl | |
743 dnl | |
744 define(AC_COMPILE_CHECK, | |
745 [AC_PROVIDE([$0])dnl | |
746 ifelse([$1], , , [AC_CHECKING([for $1])] | |
747 )dnl | |
748 dnl We use return because because C++ requires a prototype for exit. | |
749 cat > conftest.${ac_ext} <<EOF | |
750 #include "confdefs.h" | |
751 [$2] | |
752 int main() { return 0; } | |
753 int t() { [$3]; return 0; } | |
754 EOF | |
755 dnl Don't try to run the program, which would prevent cross-configuring. | |
756 if eval $ac_compile; then | |
757 ifelse([$4], , :, [rm -rf conftest* | |
758 $4 | |
759 ]) | |
760 ifelse([$5], , , [else | |
761 rm -rf conftest* | |
762 $5 | |
763 ])dnl | |
764 fi | |
765 rm -f conftest*] | |
766 )dnl | |
767 dnl | |
768 define(AC_TEST_PROGRAM, | |
769 [AC_PROVIDE([$0])ifelse([$4], , , [AC_REQUIRE([AC_CROSS_CHECK])if test -n "$cross_compiling" | |
770 then | |
771 $4 | |
772 else | |
773 ])dnl | |
774 cat > conftest.${ac_ext} <<EOF | |
775 #include "confdefs.h" | |
776 [$1] | |
777 EOF | |
778 eval $ac_compile | |
779 if test -s conftest && (./conftest; exit) 2>/dev/null; then | |
780 ifelse([$2], , :, [$2 | |
781 ]) | |
782 ifelse([$3], , , [else | |
783 $3 | |
784 ])dnl | |
785 fi | |
786 ifelse([$4], , , fi | |
787 )dnl | |
788 rm -fr conftest*])dnl | |
789 dnl | |
790 define(AC_TEST_CPP, | |
791 [AC_REQUIRE_CPP()dnl | |
792 cat > conftest.${ac_ext} <<EOF | |
793 #include "confdefs.h" | |
794 [$1] | |
795 EOF | |
796 # Some shells (Coherent) do redirections in the wrong order, so need | |
797 # the parens. | |
798 ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"` | |
799 if test -z "$ac_err"; then | |
800 ifelse([$2], , :, [rm -rf conftest* | |
801 $2 | |
802 ]) | |
803 ifelse([$3], , , [else | |
804 rm -rf conftest* | |
805 $3 | |
806 ])dnl | |
807 fi | |
808 rm -f conftest*])dnl | |
809 dnl | |
810 define(AC_REPLACE_FUNCS, | |
811 [for ac_func in $1 | |
812 do | |
813 AC_COMPILE_CHECK([${ac_func}], [#include <ctype.h>], [ | |
814 /* The GNU C library defines this for functions which it implements | |
815 to always fail with ENOSYS. Some functions are actually named | |
816 something starting with __ and the normal name is an alias. */ | |
817 #if defined (__stub_${ac_func}) || defined (__stub___${ac_func}) | |
818 choke me | |
819 #else | |
820 /* Override any gcc2 internal prototype to avoid an error. */ | |
821 extern char ${ac_func}(); ${ac_func}(); | |
822 #endif | |
823 ], , [LIBOBJS="$LIBOBJS ${ac_func}.o" | |
824 AC_VERBOSE(using ${ac_func}.o instead)]) | |
825 done | |
826 AC_SUBST(LIBOBJS)dnl | |
827 ])dnl | |
828 dnl | |
829 define(AC_FUNC_CHECK, | |
830 [ifelse([$3], , [AC_COMPILE_CHECK($1, [#include <ctype.h>], [ | |
831 /* The GNU C library defines this for functions which it implements | |
832 to always fail with ENOSYS. Some functions are actually named | |
833 something starting with __ and the normal name is an alias. */ | |
834 #if defined (__stub_$1) || defined (__stub___$1) | |
835 choke me | |
836 #else | |
837 /* Override any gcc2 internal prototype to avoid an error. */ | |
838 extern char $1(); $1(); | |
839 #endif | |
840 ], | |
841 $2)], [AC_COMPILE_CHECK($1, [#include <ctype.h>], [ | |
842 /* The GNU C library defines this for functions which it implements | |
843 to always fail with ENOSYS. Some functions are actually named | |
844 something starting with __ and the normal name is an alias. */ | |
845 #if defined (__stub_$1) || defined (__stub___$1) | |
846 choke me | |
847 #else | |
848 /* Override any gcc2 internal prototype to avoid an error. */ | |
849 extern char $1(); $1(); | |
850 #endif | |
851 ], | |
852 $2, $3)])dnl | |
853 ])dnl | |
854 dnl | |
855 define(AC_HAVE_FUNCS, | |
856 [for ac_func in $1 | |
857 do | |
858 changequote(,)dnl | |
859 ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` | |
860 changequote([,])dnl | |
861 AC_FUNC_CHECK(${ac_func}, | |
862 AC_DEFINE(${ac_tr_func}))dnl | |
863 done | |
864 ])dnl | |
865 dnl | |
866 define(AC_HAVE_HEADERS, | |
867 [AC_REQUIRE_CPP()dnl Make sure the cpp check happens outside the loop. | |
868 for ac_hdr in $1 | |
869 do | |
870 changequote(,)dnl | |
871 ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'` | |
872 changequote([,])dnl | |
873 AC_HEADER_CHECK(${ac_hdr}, | |
874 AC_DEFINE(${ac_tr_hdr}))dnl | |
875 done | |
876 ])dnl | |
877 dnl | |
878 define(AC_HAVE_LIBRARY, [dnl | |
879 changequote(/,/)dnl | |
880 define(/AC_LIB_NAME/, dnl | |
881 patsubst(patsubst($1, /lib\([^\.]*\)\.a/, /\1/), /-l/, //))dnl | |
882 changequote([,])dnl | |
883 ac_save_LIBS="${LIBS}" | |
884 LIBS="${LIBS} -l[]AC_LIB_NAME[]" | |
885 ac_have_lib="" | |
886 AC_COMPILE_CHECK([-l[]AC_LIB_NAME[]], , [main();], [ac_have_lib="1"])dnl | |
887 LIBS="${ac_save_LIBS}" | |
888 ifelse($#, 1, [dnl | |
889 if test -n "${ac_have_lib}"; then | |
890 AC_DEFINE([HAVE_LIB]translit(AC_LIB_NAME, [a-z], [A-Z])) | |
891 LIBS="${LIBS} -l[]AC_LIB_NAME[]" | |
892 fi | |
893 undefine(AC_LIB_NAME)dnl | |
894 ], [dnl | |
895 if test -n "${ac_have_lib}"; then | |
896 :; $2 | |
897 else | |
898 :; $3 | |
899 fi | |
900 ])])dnl | |
901 dnl | |
902 define(AC_SIZEOF_TYPE, | |
903 [AC_CHECKING(size of $1) | |
904 AC_TEST_PROGRAM([#include <stdio.h> | |
905 main() | |
906 { | |
907 FILE *f=fopen("conftestval", "w"); | |
908 if (!f) exit(1); | |
909 fprintf(f, "%d\n", sizeof($1)); | |
910 exit(0); | |
911 }], ac_size=`cat conftestval`, AC_ERROR(can not determine size of $1)) | |
912 AC_DEFINE_UNQUOTED(changequote(<<,>>) translit(sizeof_$1, [a-z *], [A-Z_P])<<>>changequote([,]), $ac_size)])dnl | |
913 dnl | |
914 dnl | |
915 dnl The big finish | |
916 dnl | |
917 dnl | |
918 define(AC_OUTPUT, | |
919 [changequote(,)dnl | |
920 | |
921 # The preferred way to propogate these variables is regular @ substitutions. | |
922 if test -n "$prefix"; then | |
923 ac_prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%" | |
924 else | |
925 prefix=/usr/local | |
926 fi | |
927 if test -n "$exec_prefix"; then | |
928 ac_prsub="$ac_prsub | |
929 s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%" | |
930 else | |
931 exec_prefix='${prefix}' # Let make expand it. | |
932 fi | |
933 | |
934 # Any assignment to VPATH causes Sun make to only execute | |
935 # the first set of double-colon rules, so remove it if not needed. | |
936 # If there is a colon in the path, we need to keep it. | |
937 if test "x$srcdir" = x.; then | |
938 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' | |
939 fi | |
940 | |
941 # Quote sed substitution magic chars in DEFS. | |
942 cat >conftest.def <<EOF | |
943 $DEFS | |
944 EOF | |
945 ac_escape_ampersand_and_backslash='s%[&\\]%\\&%g' | |
946 DEFS=`sed "$ac_escape_ampersand_and_backslash" <conftest.def` | |
947 rm -f conftest.def | |
948 # Substitute for predefined variables. | |
949 changequote([,])dnl | |
950 AC_SUBST(LIBS)dnl | |
951 AC_SUBST(srcdir)dnl | |
952 AC_SUBST(top_srcdir)dnl | |
953 AC_SUBST(prefix)dnl | |
954 AC_SUBST(exec_prefix)dnl | |
955 dnl Substituting for DEFS would confuse sed if it contains multiple lines. | |
956 ifdef([AC_CONFIG_NAMES], | |
957 [divert(1)dnl | |
958 s%@DEFS@%-DHAVE_CONFIG_H%], | |
959 [divert(1)dnl | |
960 s%@DEFS@%$DEFS%] | |
961 [divert(2)dnl | |
962 DEFS='$DEFS' | |
963 ])dnl | |
964 divert(2)dnl | |
965 ac_prsub='$ac_prsub' | |
966 ac_vpsub='$ac_vpsub' | |
967 extrasub='$extrasub' | |
968 divert(0)dnl | |
969 | |
970 trap 'rm -f config.status; exit 1' 1 2 15 | |
971 echo creating config.status | |
972 rm -f config.status | |
973 cat > config.status <<EOF | |
974 #!/bin/sh | |
975 # Generated automatically by configure. | |
976 # Run this file to recreate the current configuration. | |
977 # This directory was configured as follows, | |
978 dnl hostname on some systems (SVR3.2, Linux) returns a bogus exit status, | |
979 dnl so uname gets run too. | |
980 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`: | |
981 # | |
982 [#] [$]0 [$]quoted_arguments | |
983 | |
984 changequote(,)dnl | |
985 ac_cs_usage="Usage: config.status [--recheck] [--version] [--help]" | |
986 changequote([,])dnl | |
987 for ac_option | |
988 do | |
989 case "[\$]ac_option" in | |
990 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) | |
991 echo running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]quoted_arguments --no-create | |
992 exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]quoted_arguments --no-create ;; | |
993 -version | --version | --versio | --versi | --vers | --ver | --ve | --v) | |
994 echo "config.status generated by autoconf version AC_ACVERSION" | |
995 exit 0 ;; | |
996 -help | --help | --hel | --he | --h) | |
997 echo "[\$]ac_cs_usage"; exit 0 ;; | |
998 *) echo "[\$]ac_cs_usage"; exit 1 ;; | |
999 esac | |
1000 done | |
1001 | |
1002 ifdef([AC_CONFIG_NAMES], | |
1003 [trap 'rm -fr $1 AC_CONFIG_NAMES conftest*; exit 1' 1 2 15], | |
1004 [trap 'rm -f $1; exit 1' 1 2 15]) | |
1005 dnl Insert the variable assignments. | |
1006 undivert(2)dnl | |
1007 EOF | |
1008 cat >> config.status <<\EOF | |
1009 | |
1010 ac_given_srcdir=$srcdir | |
1011 | |
1012 CONFIG_FILES=${CONFIG_FILES-"$1"} | |
1013 for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then | |
1014 # Remove last slash and all that follows it. Not all systems have dirname. | |
1015 changequote(,)dnl | |
1016 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` | |
1017 changequote([,])dnl | |
1018 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then | |
1019 # The file is in a subdirectory. | |
1020 test ! -d "$ac_dir" && mkdir "$ac_dir" | |
1021 ac_dir_suffix="/$ac_dir" | |
1022 else | |
1023 ac_dir_suffix= | |
1024 fi | |
1025 | |
1026 changequote(,)dnl | |
1027 # A "../" for each directory in $ac_dir_suffix. | |
1028 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` | |
1029 changequote([,])dnl | |
1030 case "$ac_given_srcdir" in | |
1031 .) srcdir=. | |
1032 if test -z "$ac_dir_suffix"; then top_srcdir=. | |
1033 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; | |
1034 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; | |
1035 *) # Relative path. | |
1036 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" | |
1037 top_srcdir="$ac_dots$ac_given_srcdir" ;; | |
1038 esac | |
1039 | |
1040 echo creating "$ac_file" | |
1041 rm -f "$ac_file" | |
1042 comment_str="Generated automatically from `echo $ac_file|sed 's|.*/||'`.in by configure." | |
1043 case "$ac_file" in | |
1044 *.c | *.h | *.C | *.cc | *.m ) echo "/* $comment_str */" > "$ac_file" ;; | |
1045 * ) echo "# $comment_str" > "$ac_file" ;; | |
1046 esac | |
1047 sed -e " | |
1048 $ac_prsub | |
1049 $ac_vpsub | |
1050 dnl Shell code in configure.in might set extrasub. | |
1051 $extrasub | |
1052 dnl Insert the sed substitutions. | |
1053 undivert(1)dnl | |
1054 " $ac_given_srcdir/${ac_file}.in >> $ac_file | |
1055 fi; done | |
1056 AC_OUTPUT_HEADER | |
1057 $2 | |
1058 exit 0 | |
1059 EOF | |
1060 chmod +x config.status | |
1061 # Some shells look in PATH for config.status without the "./". | |
1062 test -n "$no_create" || ${CONFIG_SHELL-/bin/sh} ./config.status | |
1063 ])dnl | |
1064 dnl This is a subroutine of AC_OUTPUT, broken out primarily to avoid bugs | |
1065 dnl with long definitions in GNU m4 1.0. This is called inside a quoted | |
1066 dnl here document whose contents are going into config.status. | |
1067 define(AC_OUTPUT_HEADER,[dnl | |
1068 ifdef([AC_CONFIG_NAMES],[dnl | |
1069 changequote(<<,>>)dnl | |
1070 | |
1071 # These sed commands are put into ac_sed_defs when defining a macro. | |
1072 # They are broken into pieces to make the sed script easier to manage. | |
1073 # They are passed to sed as "A NAME B NAME C VALUE D", where NAME | |
1074 # is the cpp macro being defined and VALUE is the value it is being given. | |
1075 # Each defining turns into a single global substitution command. | |
1076 # Hopefully no one uses "!" as a variable value. | |
1077 # Other candidates for the sed separators, like , and @, do get used. | |
1078 # | |
1079 # ac_d sets the value in "#define NAME VALUE" lines. | |
1080 ac_dA='s!^\([ ]*\)#\([ ]*define[ ][ ]*\)' | |
1081 ac_dB='\([ ][ ]*\)[^ ]*!\1#\2' | |
1082 ac_dC='\3' | |
1083 ac_dD='!g' | |
1084 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". | |
1085 ac_uA='s!^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' | |
1086 ac_uB='\([ ]\)!\1#\2define\3' | |
1087 ac_uC=' ' | |
1088 ac_uD='\4!g' | |
1089 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". | |
1090 ac_eA='s!^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' | |
1091 ac_eB='<<$>>!\1#\2define\3' | |
1092 ac_eC=' ' | |
1093 ac_eD='!g' | |
1094 changequote([,])dnl | |
1095 rm -f conftest.sed | |
1096 EOF | |
1097 # Turn off quoting long enough to insert the sed commands. | |
1098 rm -f conftest.sh | |
1099 cat > conftest.sh <<EOF | |
1100 $ac_sed_defs | |
1101 EOF | |
1102 | |
1103 # Break up $ac_sed_defs (now in conftest.sh) because some shells have a limit | |
1104 # on the size of here documents. | |
1105 | |
1106 # Maximum number of lines to put in a single here document. | |
1107 ac_max_sh_lines=9 | |
1108 | |
1109 while : | |
1110 do | |
1111 # wc gives bogus results for an empty file on some AIX systems. | |
1112 ac_lines=`grep -c . conftest.sh` | |
1113 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi | |
1114 rm -f conftest.s1 conftest.s2 | |
1115 sed ${ac_max_sh_lines}q conftest.sh > conftest.s1 # Like head -9. | |
1116 sed 1,${ac_max_sh_lines}d conftest.sh > conftest.s2 # Like tail +10. | |
1117 # Write a limited-size here document to append to conftest.sed. | |
1118 echo 'cat >> conftest.sed <<CONFEOF' >> config.status | |
1119 cat conftest.s1 >> config.status | |
1120 echo 'CONFEOF' >> config.status | |
1121 rm -f conftest.s1 conftest.sh | |
1122 mv conftest.s2 conftest.sh | |
1123 done | |
1124 rm -f conftest.sh | |
1125 | |
1126 # Now back to your regularly scheduled config.status. | |
1127 cat >> config.status <<\EOF | |
1128 # This sed command replaces #undef's with comments. This is necessary, for | |
1129 # example, in the case of _POSIX_SOURCE, which is predefined and required | |
1130 # on some systems where configure will not decide to define it in | |
1131 [#] AC_CONFIG_NAMES. | |
1132 cat >> conftest.sed <<\CONFEOF | |
1133 changequote(,)dnl | |
1134 s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, | |
1135 changequote([,])dnl | |
1136 CONFEOF | |
1137 rm -f conftest.h | |
1138 # Break up the sed commands because old seds have small limits. | |
1139 ac_max_sed_lines=20 | |
1140 | |
1141 CONFIG_HEADERS=${CONFIG_HEADERS-"AC_CONFIG_NAMES"} | |
1142 for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then | |
1143 echo creating $ac_file | |
1144 | |
1145 cp $ac_given_srcdir/$ac_file.in conftest.h1 | |
1146 cp conftest.sed conftest.stm | |
1147 while : | |
1148 do | |
1149 ac_lines=`grep -c . conftest.stm` | |
1150 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi | |
1151 rm -f conftest.s1 conftest.s2 conftest.h2 | |
1152 sed ${ac_max_sed_lines}q conftest.stm > conftest.s1 # Like head -20. | |
1153 sed 1,${ac_max_sed_lines}d conftest.stm > conftest.s2 # Like tail +21. | |
1154 sed -f conftest.s1 < conftest.h1 > conftest.h2 | |
1155 rm -f conftest.s1 conftest.h1 conftest.stm | |
1156 mv conftest.h2 conftest.h1 | |
1157 mv conftest.s2 conftest.stm | |
1158 done | |
1159 rm -f conftest.stm conftest.h | |
1160 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h | |
1161 cat conftest.h1 >> conftest.h | |
1162 rm -f conftest.h1 | |
1163 if cmp -s $ac_file conftest.h 2>/dev/null; then | |
1164 # The file exists and we would not be changing it. | |
1165 echo "$ac_file is unchanged" | |
1166 rm -f conftest.h | |
1167 else | |
1168 rm -f $ac_file | |
1169 mv conftest.h $ac_file | |
1170 fi | |
1171 fi; done | |
1172 rm -f conftest.sed | |
1173 | |
1174 ])])dnl |