1 #***************************************************************************
4 # Copyright (C) 2008 by Daniel Stenberg et al
6 # Permission to use, copy, modify, and distribute this software and its
7 # documentation for any purpose and without fee is hereby granted, provided
8 # that the above copyright notice appear in all copies and that both that
9 # copyright notice and this permission notice appear in supporting
10 # documentation, and that the name of M.I.T. not be used in advertising or
11 # publicity pertaining to distribution of the software without specific,
12 # written prior permission. M.I.T. makes no representations about the
13 # suitability of this software for any purpose. It is provided "as is"
14 # without express or implied warranty.
16 #***************************************************************************
18 # File version for 'aclocal' use. Keep it a single number.
22 dnl CARES_CHECK_COMPILER
23 dnl -------------------------------------------------
24 dnl Verify if the C compiler being used is known.
26 AC_DEFUN([CARES_CHECK_COMPILER], [
31 flags_dbg_all="unknown"
32 flags_dbg_yes="unknown"
33 flags_dbg_off="unknown"
34 flags_opt_all="unknown"
35 flags_opt_yes="unknown"
36 flags_opt_off="unknown"
38 CARES_CHECK_COMPILER_DEC
39 CARES_CHECK_COMPILER_HP
40 CARES_CHECK_COMPILER_IBM
41 CARES_CHECK_COMPILER_INTEL
42 CARES_CHECK_COMPILER_GNU
43 CARES_CHECK_COMPILER_SUN
45 if test "$compiler_id" = "unknown"; then
48 *** Warning: This configure script does not have information about the
49 *** compiler you are using, relative to the flags required to enable or
50 *** disable generation of debug info, optimization options or warnings.
52 *** Whatever settings are present in CFLAGS will be used for this run.
54 *** If you wish to help the c-ares project to better support your compiler
55 *** you can report this and the required info on the c-ares development
56 *** mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
63 dnl CARES_CHECK_COMPILER_DEC
64 dnl -------------------------------------------------
65 dnl Verify if the C compiler being used is DEC's.
67 AC_DEFUN([CARES_CHECK_COMPILER_DEC], [
68 AC_MSG_CHECKING([whether we are using the DEC/Compaq C compiler])
69 CURL_CHECK_DEF([__DECC], [], [silent])
70 CURL_CHECK_DEF([__DECC_VER], [], [silent])
71 if test "$curl_cv_have_def___DECC" = "yes" &&
72 test "$curl_cv_have_def___DECC_VER" = "yes"; then
75 flags_dbg_all="-g -g0 -g1 -g2 -g3"
78 flags_opt_all="-O -O0 -O1 -O2 -O3 -O4"
87 dnl CARES_CHECK_COMPILER_GNU
88 dnl -------------------------------------------------
89 dnl Verify if the C compiler being used is GNU's.
91 AC_DEFUN([CARES_CHECK_COMPILER_GNU], [
92 AC_REQUIRE([CARES_CHECK_COMPILER_INTEL])dnl
94 AC_MSG_CHECKING([whether we are using the GNU C compiler])
95 CURL_CHECK_DEF([__GNUC__], [], [silent])
96 if test "$curl_cv_have_def___GNUC__" = "yes" &&
97 test "$compiler_id" = "unknown"; then
100 gccver=`$CC -dumpversion`
101 gccvhi=`echo $gccver | cut -d . -f1`
102 gccvlo=`echo $gccver | cut -d . -f2`
103 compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
104 flags_dbg_all="-g -g0 -g1 -g2 -g3"
105 flags_dbg_all="$flags_dbg_all -ggdb"
106 flags_dbg_all="$flags_dbg_all -gstabs"
107 flags_dbg_all="$flags_dbg_all -gstabs+"
108 flags_dbg_all="$flags_dbg_all -gcoff"
109 flags_dbg_all="$flags_dbg_all -gxcoff"
110 flags_dbg_all="$flags_dbg_all -gdwarf-2"
111 flags_dbg_all="$flags_dbg_all -gvms"
114 flags_opt_all="-O -O0 -O1 -O2 -O3 -Os"
123 dnl CARES_CHECK_COMPILER_HP
124 dnl -------------------------------------------------
125 dnl Verify if the C compiler being used is HP's.
127 AC_DEFUN([CARES_CHECK_COMPILER_HP], [
128 AC_MSG_CHECKING([whether we are using the HP C compiler])
129 CURL_CHECK_DEF([__HP_cc], [], [silent])
130 if test "$curl_cv_have_def___HP_cc" = "yes"; then
133 flags_dbg_all="-g -s"
136 flags_opt_all="-O +O0 +O1 +O2 +O3 +O4"
145 dnl CARES_CHECK_COMPILER_IBM
146 dnl -------------------------------------------------
147 dnl Verify if the C compiler being used is IBM's.
149 AC_DEFUN([CARES_CHECK_COMPILER_IBM], [
150 AC_MSG_CHECKING([whether we are using the IBM C compiler])
151 CURL_CHECK_DEF([__IBMC__], [], [silent])
152 if test "$curl_cv_have_def___IBMC__" = "yes"; then
155 flags_dbg_all="-g -g0 -g1 -g2 -g3"
158 flags_opt_all="-O -O0 -O1 -O2 -O3 -O4 -O5"
159 flags_opt_all="$flags_opt_all -qnooptimize"
160 flags_opt_all="$flags_opt_all -qoptimize=0"
161 flags_opt_all="$flags_opt_all -qoptimize=1"
162 flags_opt_all="$flags_opt_all -qoptimize=2"
163 flags_opt_all="$flags_opt_all -qoptimize=3"
164 flags_opt_all="$flags_opt_all -qoptimize=4"
165 flags_opt_all="$flags_opt_all -qoptimize=5"
167 flags_opt_off="-qnooptimize"
174 dnl CARES_CHECK_COMPILER_INTEL
175 dnl -------------------------------------------------
176 dnl Verify if the C compiler being used is Intel's.
178 AC_DEFUN([CARES_CHECK_COMPILER_INTEL], [
179 AC_BEFORE([$0],[CARES_CHECK_COMPILER_GNU])dnl
180 AC_MSG_CHECKING([whether we are using the Intel C compiler])
181 CURL_CHECK_DEF([__INTEL_COMPILER], [], [silent])
182 if test "$curl_cv_have_def___INTEL_COMPILER" = "yes"; then
184 CURL_CHECK_DEF([__unix__], [], [silent])
185 if test "$curl_cv_have_def___unix__" = "yes"; then
186 compiler_id="ICC_unix"
187 flags_dbg_all="-g -g0"
190 flags_opt_all="-O -O0 -O1 -O2 -O3 -Os"
194 compiler_id="ICC_windows"
195 flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7 /Oy /Oy-"
196 flags_dbg_all="$flags_dbg_all /debug"
197 flags_dbg_all="$flags_dbg_all /debug:none"
198 flags_dbg_all="$flags_dbg_all /debug:minimal"
199 flags_dbg_all="$flags_dbg_all /debug:partial"
200 flags_dbg_all="$flags_dbg_all /debug:full"
201 flags_dbg_all="$flags_dbg_all /debug:semantic_stepping"
202 flags_dbg_all="$flags_dbg_all /debug:extended"
203 flags_dbg_yes="/Zi /Oy-"
204 flags_dbg_off="/debug:none /Oy-"
205 flags_opt_all="/O /O0 /O1 /O2 /O3 /Od /Og /Og- /Oi /Oi-"
209 compiler_num="$curl_cv_def___INTEL_COMPILER"
216 dnl CARES_CHECK_COMPILER_SUN
217 dnl -------------------------------------------------
218 dnl Verify if the C compiler being used is SUN's.
220 AC_DEFUN([CARES_CHECK_COMPILER_SUN], [
221 AC_MSG_CHECKING([whether we are using the SUN C compiler])
222 CURL_CHECK_DEF([__SUNPRO_C], [], [silent])
223 if test "$curl_cv_have_def___SUNPRO_C" = "yes"; then
226 flags_dbg_all="-g -s"
229 flags_opt_all="-O -xO1 -xO2 -xO3 -xO4 -xO5"
238 dnl CARES_COMPILER_WORKS_IFELSE ([ACTION-IF-WORKS], [ACTION-IF-NOT-WORKS])
239 dnl -------------------------------------------------
240 dnl Verify if the C compiler seems to work with the
241 dnl settings that are 'active' at the time the test
244 AC_DEFUN([CARES_COMPILER_WORKS_IFELSE], [
245 dnl compilation capability verification
246 tmp_compiler_works="unknown"
254 tmp_compiler_works="yes"
256 tmp_compiler_works="no"
258 dnl linking capability verification
259 if test "$tmp_compiler_works" = "yes"; then
267 tmp_compiler_works="yes"
269 tmp_compiler_works="no"
272 dnl only do runtime verification when not cross-compiling
273 if test "x$cross_compiling" != "xyes" &&
274 test "$tmp_compiler_works" = "yes"; then
282 tmp_compiler_works="yes"
284 tmp_compiler_works="no"
287 dnl branch upon test result
288 if test "$tmp_compiler_works" = "yes"; then
296 dnl CARES_SET_COMPILER_BASIC_OPTS
297 dnl -------------------------------------------------
298 dnl Sets compiler specific options/flags which do not
299 dnl depend on configure's debug, optimize or warnings
302 AC_DEFUN([CARES_SET_COMPILER_BASIC_OPTS], [
303 AC_REQUIRE([CARES_CHECK_COMPILER])dnl
305 if test "$compiler_id" != "unknown"; then
307 tmp_save_CPPFLAGS="$CPPFLAGS"
308 tmp_save_CFLAGS="$CFLAGS"
312 case "$compiler_id" in
316 dnl Select strict ANSI C compiler mode
317 tmp_CFLAGS="$tmp_CFLAGS -std1"
318 dnl Turn off optimizer ANSI C aliasing rules
319 tmp_CFLAGS="$tmp_CFLAGS -noansi_alias"
320 dnl Generate warnings for missing function prototypes
321 tmp_CFLAGS="$tmp_CFLAGS -warnprotos"
322 dnl Change some warnings into fatal errors
323 tmp_CFLAGS="$tmp_CFLAGS -msg_fatal toofewargs,toomanyargs"
329 tmp_CFLAGS="$tmp_CFLAGS"
334 dnl Disallow run-time dereferencing of null pointers
335 tmp_CFLAGS="$tmp_CFLAGS -z"
336 dnl Disable some remarks
337 dnl #4227: padding struct with n bytes to align member
338 dnl #4255: padding size of struct with n bytes to alignment boundary
339 tmp_CFLAGS="$tmp_CFLAGS +W 4227,4255"
344 dnl Ensure that compiler optimizations are always thread-safe.
345 tmp_CFLAGS="$tmp_CFLAGS -qthreaded"
346 dnl Disable type based strict aliasing optimizations, using worst
347 dnl case aliasing assumptions when compiling. Type based aliasing
348 dnl would restrict the lvalues that could be safely used to access
350 tmp_CFLAGS="$tmp_CFLAGS -qnoansialias"
351 dnl Force compiler to stop after the compilation phase, without
352 dnl generating an object code file when compilation has errors.
353 tmp_CFLAGS="$tmp_CFLAGS -qhalt=e"
358 dnl On unix this compiler uses gcc's header files, so
359 dnl we select ANSI C89 dialect plus GNU extensions.
360 tmp_CPPFLAGS="$tmp_CPPFLAGS -std=gnu89"
361 dnl Change some warnings into errors
362 dnl #140: too many arguments in function call
363 dnl #147: declaration is incompatible with 'previous one'
364 dnl #165: too few arguments in function call
365 dnl #266: function declared implicitly
366 tmp_CPPFLAGS="$tmp_CPPFLAGS -we 140,147,165,266"
367 dnl Disable some remarks
368 dnl #279: controlling expression is constant
369 dnl #981: operands are evaluated in unspecified order
370 dnl #1469: "cc" clobber ignored
371 tmp_CPPFLAGS="$tmp_CPPFLAGS -wd 279,981,1469"
372 dnl Disable use of ANSI C aliasing rules in optimizations
373 tmp_CFLAGS="$tmp_CFLAGS -no-ansi-alias"
374 dnl Disable floating point optimizations
375 tmp_CFLAGS="$tmp_CFLAGS -fp-model precise"
381 tmp_CFLAGS="$tmp_CFLAGS"
387 tmp_CFLAGS="$tmp_CFLAGS"
392 tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS`
393 tmp_CFLAGS=`eval echo $tmp_CFLAGS`
395 if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then
396 AC_MSG_CHECKING([if compiler accepts some basic options])
397 CPPFLAGS=`eval echo $tmp_save_CPPFLAGS $tmp_CPPFLAGS`
398 CFLAGS=`eval echo $tmp_save_CFLAGS $tmp_CFLAGS`
399 CARES_COMPILER_WORKS_IFELSE([
401 AC_MSG_NOTICE([compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS])
404 AC_MSG_NOTICE([compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS])
405 dnl restore initial settings
406 CPPFLAGS="$tmp_save_CPPFLAGS"
407 CFLAGS="$tmp_save_CFLAGS"
415 dnl CARES_SET_COMPILER_DEBUG_OPTS
416 dnl -------------------------------------------------
417 dnl Sets compiler specific options/flags which depend
418 dnl on configure's debug option.
420 AC_DEFUN([CARES_SET_COMPILER_DEBUG_OPTS], [
421 AC_REQUIRE([CARES_CHECK_OPTION_DEBUG])dnl
422 AC_REQUIRE([CARES_CHECK_COMPILER])dnl
424 if test "$compiler_id" != "unknown"; then
426 tmp_save_CFLAGS="$CFLAGS"
427 tmp_save_CPPFLAGS="$CPPFLAGS"
431 tmp_CPPFLAGS="$CPPFLAGS"
432 CARES_VAR_STRIP([tmp_CFLAGS],[$flags_dbg_all])
433 CARES_VAR_STRIP([tmp_CPPFLAGS],[$flags_dbg_all])
435 if test "$want_debug" = "yes"; then
436 AC_MSG_CHECKING([if compiler accepts debug enabling options])
437 tmp_options="$flags_dbg_yes"
439 if test "$want_debug" = "no"; then
440 AC_MSG_CHECKING([if compiler accepts debug disabling options])
441 tmp_options="$flags_dbg_off"
444 CPPFLAGS=`eval echo $tmp_CPPFLAGS`
445 CFLAGS=`eval echo $tmp_CFLAGS $tmp_options`
446 CARES_COMPILER_WORKS_IFELSE([
448 AC_MSG_NOTICE([compiler options added: $tmp_options])
451 AC_MSG_NOTICE([compiler options rejected: $tmp_options])
452 dnl restore initial settings
453 CPPFLAGS="$tmp_save_CPPFLAGS"
454 CFLAGS="$tmp_save_CFLAGS"
461 dnl CARES_SET_COMPILER_OPTIMIZE_OPTS
462 dnl -------------------------------------------------
463 dnl Sets compiler specific options/flags which depend
464 dnl on configure's optimize option.
466 AC_DEFUN([CARES_SET_COMPILER_OPTIMIZE_OPTS], [
467 AC_REQUIRE([CARES_CHECK_OPTION_OPTIMIZE])dnl
468 AC_REQUIRE([CARES_CHECK_COMPILER])dnl
470 if test "$compiler_id" != "unknown"; then
472 tmp_save_CFLAGS="$CFLAGS"
473 tmp_save_CPPFLAGS="$CPPFLAGS"
477 tmp_CPPFLAGS="$CPPFLAGS"
478 honor_optimize_option="yes"
480 dnl If optimization request setting has not been explicitly specified,
481 dnl it has been derived from the debug setting and initially assumed.
482 dnl This initially assumed optimizer setting will finally be ignored
483 dnl if CFLAGS or CPPFLAGS already hold optimizer flags. This implies
484 dnl that an initially assumed optimizer setting might not be honored.
486 if test "$want_optimize" = "assume_no" ||
487 test "$want_optimize" = "assume_yes"; then
488 AC_MSG_CHECKING([if compiler optimizer assumed setting might be used])
489 CARES_VAR_MATCH_IFELSE([tmp_CFLAGS],[$flags_opt_all],[
490 honor_optimize_option="no"
492 CARES_VAR_MATCH_IFELSE([tmp_CPPFLAGS],[$flags_opt_all],[
493 honor_optimize_option="no"
495 AC_MSG_RESULT([$honor_optimize_option])
496 if test "$honor_optimize_option" = "yes"; then
497 if test "$want_optimize" = "assume_yes"; then
500 if test "$want_optimize" = "assume_no"; then
506 if test "$honor_optimize_option" = "yes"; then
507 CARES_VAR_STRIP([tmp_CFLAGS],[$flags_opt_all])
508 CARES_VAR_STRIP([tmp_CPPFLAGS],[$flags_opt_all])
509 if test "$want_optimize" = "yes"; then
510 AC_MSG_CHECKING([if compiler accepts optimizer enabling options])
511 tmp_options="$flags_opt_yes"
513 if test "$want_optimize" = "no"; then
514 AC_MSG_CHECKING([if compiler accepts optimizer disabling options])
515 tmp_options="$flags_opt_off"
517 CPPFLAGS=`eval echo $tmp_CPPFLAGS`
518 CFLAGS=`eval echo $tmp_CFLAGS $tmp_options`
519 CARES_COMPILER_WORKS_IFELSE([
521 AC_MSG_NOTICE([compiler options added: $tmp_options])
524 AC_MSG_NOTICE([compiler options rejected: $tmp_options])
525 dnl restore initial settings
526 CPPFLAGS="$tmp_save_CPPFLAGS"
527 CFLAGS="$tmp_save_CFLAGS"
535 dnl CARES_SET_COMPILER_WARNING_OPTS
536 dnl -------------------------------------------------
537 dnl Sets compiler options/flags which depend on
538 dnl configure's warnings given option.
540 AC_DEFUN([CARES_SET_COMPILER_WARNING_OPTS], [
541 AC_REQUIRE([CARES_CHECK_OPTION_WARNINGS])dnl
542 AC_REQUIRE([CARES_CHECK_COMPILER])dnl
544 if test "$compiler_id" = "DECC"; then
545 if test "$want_warnings" = "yes"; then
546 dnl Select a higher warning level than default level2
547 CFLAGS="$CFLAGS -msg_enable level3"
551 if test "$compiler_id" = "GNUC"; then
553 # FIXME: Some of these warnings should be changed into errors
554 # and moved to CARES-SET-COMPILER-BASIC-OPTS
556 if test "$want_warnings" = "yes"; then
557 dnl this is a set of options we believe *ALL* gcc versions support:
558 WARN="-W -Wall -Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes"
559 dnl -Wcast-align is a bit too annoying on all gcc versions ;-)
560 if test "$compiler_num" -ge "207"; then
562 WARN="$WARN -Wmissing-declarations"
564 if test "$compiler_num" -gt "295"; then
565 dnl only if the compiler is newer than 2.95 since we got lots of
566 dnl "`_POSIX_C_SOURCE' is not defined" in system headers with
567 dnl gcc 2.95.4 on FreeBSD 4.9!
568 WARN="$WARN -Wundef -Wno-long-long -Wsign-compare -Wshadow -Wno-multichar"
570 if test "$compiler_num" -ge "296"; then
571 dnl gcc 2.96 or later
572 WARN="$WARN -Wfloat-equal"
574 if test "$compiler_num" -gt "296"; then
575 dnl this option does not exist in 2.96
576 WARN="$WARN -Wno-format-nonliteral"
578 dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on
579 dnl on i686-Linux as it gives us heaps with false positives.
580 dnl Also, on gcc 4.0.X it is totally unbearable and complains all
581 dnl over making it unusable for generic purposes. Let's not use it.
582 if test "$compiler_num" -ge "303"; then
583 dnl gcc 3.3 and later
584 WARN="$WARN -Wendif-labels -Wstrict-prototypes"
586 if test "$compiler_num" -ge "304"; then
587 # try these on gcc 3.4
588 WARN="$WARN -Wdeclaration-after-statement"
590 for flag in $CPPFLAGS; do
593 dnl Include path, provide a -isystem option for the same dir
594 dnl to prevent warnings in those dirs. The -isystem was not very
595 dnl reliable on earlier gcc versions.
596 add=`echo $flag | sed 's/^-I/-isystem /g'`
601 CFLAGS="$CFLAGS $WARN"
602 AC_MSG_NOTICE([Added this set of compiler options: $WARN])
606 if test "$compiler_id" = "HPUXC"; then
607 if test "$want_warnings" = "yes"; then
608 dnl Issue all warnings
613 if test "$compiler_id" = "ICC_unix"; then
614 if test "$want_warnings" = "yes"; then
615 if test "$compiler_num" -gt "600"; then
616 dnl Show errors, warnings, and remarks
617 CPPFLAGS="$CPPFLAGS -Wall"
618 dnl Perform extra compile-time code checking
619 CPPFLAGS="$CPPFLAGS -Wcheck"
624 if test "$compiler_id" = "SUNC"; then
625 if test "$want_warnings" = "yes"; then
626 dnl Perform stricter semantic and lint-like checks
634 dnl CARES_PROCESS_DEBUG_BUILD_OPTS
635 dnl -------------------------------------------------
636 dnl Settings which depend on configure's debug given
637 dnl option, and further configure the build process.
638 dnl Don't use this macro for compiler dependant stuff.
640 AC_DEFUN([CARES_PROCESS_DEBUG_BUILD_OPTS], [
641 AC_REQUIRE([CARES_CHECK_OPTION_DEBUG])dnl
642 AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl
644 if test "$want_debug" = "yes"; then
646 dnl when doing the debug stuff, use static library only
651 dnl the entire --enable-debug is a hack that lives and runs on top of
652 dnl libcurl stuff so this BUILDING_LIBCURL is not THAT much uglier
653 AC_DEFINE(BUILDING_LIBCURL, 1, [when building as static part of libcurl])
655 CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
657 dnl CHECKME: Do we still need so specify this include path here?
658 CPPFLAGS="$CPPFLAGS -I$srcdir/../include"
665 dnl CARES_CHECK_PROG_CC
666 dnl -------------------------------------------------
667 dnl Check for compiler program, preventing CFLAGS and
668 dnl CPPFLAGS from being unexpectedly changed.
670 AC_DEFUN([CARES_CHECK_PROG_CC], [
671 ac_save_CFLAGS="$CFLAGS"
672 ac_save_CPPFLAGS="$CPPFLAGS"
674 CFLAGS="$ac_save_CFLAGS"
675 CPPFLAGS="$ac_save_CPPFLAGS"
679 dnl CARES_VAR_MATCH (VARNAME, VALUE)
680 dnl -------------------------------------------------
681 dnl Verifies if shell variable VARNAME contains VALUE.
682 dnl Contents of variable VARNAME and VALUE are handled
683 dnl as whitespace separated lists of words. If at least
684 dnl one word of VALUE is present in VARNAME the match
685 dnl is considered positive, otherwise false.
687 AC_DEFUN([CARES_VAR_MATCH], [
688 ac_var_match_word="no"
689 for word1 in "$[$1]"; do
690 for word2 in "[$2]"; do
691 if test "$word1" = "$word2"; then
692 ac_var_match_word="yes"
699 dnl CARES_VAR_MATCH_IFELSE (VARNAME, VALUE,
700 dnl [ACTION-IF-MATCH], [ACTION-IF-NOT-MATCH])
701 dnl -------------------------------------------------
702 dnl This performs a CURL_VAR_MATCH check and executes
703 dnl first branch if the match is positive, otherwise
704 dnl the second branch is executed.
706 AC_DEFUN([CARES_VAR_MATCH_IFELSE], [
707 CARES_VAR_MATCH([$1],[$2])
708 if test "$ac_var_match_word" = "yes"; then
716 dnl CARES_VAR_STRIP (VARNAME, VALUE)
717 dnl -------------------------------------------------
718 dnl Contents of variable VARNAME and VALUE are handled
719 dnl as whitespace separated lists of words. Each word
720 dnl from VALUE is removed from VARNAME when present.
722 AC_DEFUN([CARES_VAR_STRIP], [
724 for word1 in "$[$1]"; do
725 ac_var_strip_word="no"
726 for word2 in "[$2]"; do
727 if test "$word1" = "$word2"; then
728 ac_var_strip_word="yes"
731 if test "$ac_var_strip_word" = "no"; then
732 ac_var_stripped="$ac_var_stripped $word1"
735 dnl squeeze whitespace out of result
736 [$1]=`eval echo $ac_var_stripped`