Cleaned up spec file including change of group, adding manifest file, style changes...
[external/byacc.git] / aclocal.m4
1 dnl $Id: aclocal.m4,v 1.8 2009/10/26 23:41:51 tom Exp $
2 dnl
3 dnl Macros for byacc configure script (Thomas E. Dickey)
4 dnl ---------------------------------------------------------------------------
5 dnl ---------------------------------------------------------------------------
6 dnl CF_ADD_CFLAGS version: 8 updated: 2009/01/06 19:33:30
7 dnl -------------
8 dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
9 dnl The second parameter if given makes this macro verbose.
10 dnl
11 dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS,
12 dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily
13 dnl confused by the quotes (which require backslashes to keep them usable).
14 AC_DEFUN([CF_ADD_CFLAGS],
15 [
16 cf_fix_cppflags=no
17 cf_new_cflags=
18 cf_new_cppflags=
19 cf_new_extra_cppflags=
20
21 for cf_add_cflags in $1
22 do
23 case $cf_fix_cppflags in
24 no)
25         case $cf_add_cflags in #(vi
26         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
27                 case $cf_add_cflags in
28                 -D*)
29                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
30
31                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
32                         && test -z "${cf_tst_cflags}" \
33                         && cf_fix_cppflags=yes
34
35                         if test $cf_fix_cppflags = yes ; then
36                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
37                                 continue
38                         elif test "${cf_tst_cflags}" = "\"'" ; then
39                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
40                                 continue
41                         fi
42                         ;;
43                 esac
44                 case "$CPPFLAGS" in
45                 *$cf_add_cflags) #(vi
46                         ;;
47                 *) #(vi
48                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
49                         ;;
50                 esac
51                 ;;
52         *)
53                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
54                 ;;
55         esac
56         ;;
57 yes)
58         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
59
60         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
61
62         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
63         && test -z "${cf_tst_cflags}" \
64         && cf_fix_cppflags=no
65         ;;
66 esac
67 done
68
69 if test -n "$cf_new_cflags" ; then
70         ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
71         CFLAGS="$CFLAGS $cf_new_cflags"
72 fi
73
74 if test -n "$cf_new_cppflags" ; then
75         ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
76         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
77 fi
78
79 if test -n "$cf_new_extra_cppflags" ; then
80         ifelse($2,,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
81         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
82 fi
83
84 AC_SUBST(EXTRA_CPPFLAGS)
85
86 ])dnl
87 dnl ---------------------------------------------------------------------------
88 dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34
89 dnl ----------------
90 dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
91 dnl in the sharutils 4.2 distribution.
92 AC_DEFUN([CF_ANSI_CC_CHECK],
93 [
94 AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[
95 cf_cv_ansi_cc=no
96 cf_save_CFLAGS="$CFLAGS"
97 cf_save_CPPFLAGS="$CPPFLAGS"
98 # Don't try gcc -ansi; that turns off useful extensions and
99 # breaks some systems' header files.
100 # AIX                   -qlanglvl=ansi
101 # Ultrix and OSF/1      -std1
102 # HP-UX                 -Aa -D_HPUX_SOURCE
103 # SVR4                  -Xc
104 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
105 for cf_arg in "-DCC_HAS_PROTOS" \
106         "" \
107         -qlanglvl=ansi \
108         -std1 \
109         -Ae \
110         "-Aa -D_HPUX_SOURCE" \
111         -Xc
112 do
113         CF_ADD_CFLAGS($cf_arg)
114         AC_TRY_COMPILE(
115 [
116 #ifndef CC_HAS_PROTOS
117 #if !defined(__STDC__) || (__STDC__ != 1)
118 choke me
119 #endif
120 #endif
121 ],[
122         int test (int i, double x);
123         struct s1 {int (*f) (int a);};
124         struct s2 {int (*f) (double a);};],
125         [cf_cv_ansi_cc="$cf_arg"; break])
126 done
127 CFLAGS="$cf_save_CFLAGS"
128 CPPFLAGS="$cf_save_CPPFLAGS"
129 ])
130
131 if test "$cf_cv_ansi_cc" != "no"; then
132 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
133         CF_ADD_CFLAGS($cf_cv_ansi_cc)
134 else
135         AC_DEFINE(CC_HAS_PROTOS)
136 fi
137 fi
138 ])dnl
139 dnl ---------------------------------------------------------------------------
140 dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54
141 dnl ---------------
142 dnl For programs that must use an ANSI compiler, obtain compiler options that
143 dnl will make it recognize prototypes.  We'll do preprocessor checks in other
144 dnl macros, since tools such as unproto can fake prototypes, but only part of
145 dnl the preprocessor.
146 AC_DEFUN([CF_ANSI_CC_REQD],
147 [AC_REQUIRE([CF_ANSI_CC_CHECK])
148 if test "$cf_cv_ansi_cc" = "no"; then
149         AC_MSG_ERROR(
150 [Your compiler does not appear to recognize prototypes.
151 You have the following choices:
152         a. adjust your compiler options
153         b. get an up-to-date compiler
154         c. use a wrapper such as unproto])
155 fi
156 ])dnl
157 dnl ---------------------------------------------------------------------------
158 dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
159 dnl --------------
160 dnl Allow user to disable a normally-on option.
161 AC_DEFUN([CF_ARG_DISABLE],
162 [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
163 dnl ---------------------------------------------------------------------------
164 dnl CF_ARG_OPTION version: 3 updated: 1997/10/18 14:42:41
165 dnl -------------
166 dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
167 dnl values.
168 dnl
169 dnl Parameters:
170 dnl $1 = option name
171 dnl $2 = help-string
172 dnl $3 = action to perform if option is not default
173 dnl $4 = action if perform if option is default
174 dnl $5 = default option value (either 'yes' or 'no')
175 AC_DEFUN([CF_ARG_OPTION],
176 [AC_ARG_ENABLE($1,[$2],[test "$enableval" != ifelse($5,no,yes,no) && enableval=ifelse($5,no,no,yes)
177   if test "$enableval" != "$5" ; then
178 ifelse($3,,[    :]dnl
179 ,[    $3]) ifelse($4,,,[
180   else
181     $4])
182   fi],[enableval=$5 ifelse($4,,,[
183   $4
184 ])dnl
185   ])])dnl
186 dnl ---------------------------------------------------------------------------
187 dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59
188 dnl --------------
189 dnl Check if we're accidentally using a cache from a different machine.
190 dnl Derive the system name, as a check for reusing the autoconf cache.
191 dnl
192 dnl If we've packaged config.guess and config.sub, run that (since it does a
193 dnl better job than uname).  Normally we'll use AC_CANONICAL_HOST, but allow
194 dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
195 dnl which is useful in cross-compiles.
196 dnl
197 dnl Note: we would use $ac_config_sub, but that is one of the places where
198 dnl autoconf 2.5x broke compatibility with autoconf 2.13
199 AC_DEFUN([CF_CHECK_CACHE],
200 [
201 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
202         ifelse([$1],,[AC_CANONICAL_HOST],[$1])
203         system_name="$host_os"
204 else
205         system_name="`(uname -s -r) 2>/dev/null`"
206         if test -z "$system_name" ; then
207                 system_name="`(hostname) 2>/dev/null`"
208         fi
209 fi
210 test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
211 AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
212
213 test -z "$system_name" && system_name="$cf_cv_system_name"
214 test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
215
216 if test ".$system_name" != ".$cf_cv_system_name" ; then
217         AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
218         AC_MSG_ERROR("Please remove config.cache and try again.")
219 fi
220 ])dnl
221 dnl ---------------------------------------------------------------------------
222 dnl CF_DISABLE_ECHO version: 10 updated: 2003/04/17 22:27:11
223 dnl ---------------
224 dnl You can always use "make -n" to see the actual options, but it's hard to
225 dnl pick out/analyze warning messages when the compile-line is long.
226 dnl
227 dnl Sets:
228 dnl     ECHO_LT - symbol to control if libtool is verbose
229 dnl     ECHO_LD - symbol to prefix "cc -o" lines
230 dnl     RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o)
231 dnl     SHOW_CC - symbol to put before explicit "cc -c" lines
232 dnl     ECHO_CC - symbol to put before any "cc" line
233 dnl
234 AC_DEFUN([CF_DISABLE_ECHO],[
235 AC_MSG_CHECKING(if you want to see long compiling messages)
236 CF_ARG_DISABLE(echo,
237         [  --disable-echo          display "compiling" commands],
238         [
239     ECHO_LT='--silent'
240     ECHO_LD='@echo linking [$]@;'
241     RULE_CC='   @echo compiling [$]<'
242     SHOW_CC='   @echo compiling [$]@'
243     ECHO_CC='@'
244 ],[
245     ECHO_LT=''
246     ECHO_LD=''
247     RULE_CC='# compiling'
248     SHOW_CC='# compiling'
249     ECHO_CC=''
250 ])
251 AC_MSG_RESULT($enableval)
252 AC_SUBST(ECHO_LT)
253 AC_SUBST(ECHO_LD)
254 AC_SUBST(RULE_CC)
255 AC_SUBST(SHOW_CC)
256 AC_SUBST(ECHO_CC)
257 ])dnl
258 dnl ---------------------------------------------------------------------------
259 dnl CF_DISABLE_LEAKS version: 4 updated: 2006/12/16 15:10:42
260 dnl ----------------
261 dnl Combine no-leak checks with the libraries or tools that are used for the
262 dnl checks.
263 AC_DEFUN([CF_DISABLE_LEAKS],[
264
265 AC_REQUIRE([CF_WITH_DMALLOC])
266 AC_REQUIRE([CF_WITH_DBMALLOC])
267 AC_REQUIRE([CF_WITH_VALGRIND])
268
269 AC_MSG_CHECKING(if you want to perform memory-leak testing)
270 AC_ARG_ENABLE(leaks,
271         [  --disable-leaks         test: free permanent memory, analyze leaks],
272         [with_no_leaks=yes],
273         : ${with_no_leaks:=no})
274 AC_MSG_RESULT($with_no_leaks)
275
276 if test "$with_no_leaks" = yes ; then
277         AC_DEFINE(NO_LEAKS)
278 fi
279 ])dnl
280 dnl ---------------------------------------------------------------------------
281 dnl CF_GCC_ATTRIBUTES version: 13 updated: 2009/08/11 20:19:56
282 dnl -----------------
283 dnl Test for availability of useful gcc __attribute__ directives to quiet
284 dnl compiler warnings.  Though useful, not all are supported -- and contrary
285 dnl to documentation, unrecognized directives cause older compilers to barf.
286 AC_DEFUN([CF_GCC_ATTRIBUTES],
287 [
288 if test "$GCC" = yes
289 then
290 cat > conftest.i <<EOF
291 #ifndef GCC_PRINTF
292 #define GCC_PRINTF 0
293 #endif
294 #ifndef GCC_SCANF
295 #define GCC_SCANF 0
296 #endif
297 #ifndef GCC_NORETURN
298 #define GCC_NORETURN /* nothing */
299 #endif
300 #ifndef GCC_UNUSED
301 #define GCC_UNUSED /* nothing */
302 #endif
303 EOF
304 if test "$GCC" = yes
305 then
306         AC_CHECKING([for $CC __attribute__ directives])
307 cat > conftest.$ac_ext <<EOF
308 #line __oline__ "${as_me-configure}"
309 #include "confdefs.h"
310 #include "conftest.h"
311 #include "conftest.i"
312 #if     GCC_PRINTF
313 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
314 #else
315 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
316 #endif
317 #if     GCC_SCANF
318 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
319 #else
320 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
321 #endif
322 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
323 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
324 extern void foo(void) GCC_NORETURN;
325 int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; }
326 EOF
327         cf_printf_attribute=no
328         cf_scanf_attribute=no
329         for cf_attribute in scanf printf unused noreturn
330         do
331                 CF_UPPER(cf_ATTRIBUTE,$cf_attribute)
332                 cf_directive="__attribute__(($cf_attribute))"
333                 echo "checking for $CC $cf_directive" 1>&AC_FD_CC
334
335                 case $cf_attribute in #(vi
336                 printf) #(vi
337                         cf_printf_attribute=yes
338                         cat >conftest.h <<EOF
339 #define GCC_$cf_ATTRIBUTE 1
340 EOF
341                         ;;
342                 scanf) #(vi
343                         cf_scanf_attribute=yes
344                         cat >conftest.h <<EOF
345 #define GCC_$cf_ATTRIBUTE 1
346 EOF
347                         ;;
348                 *) #(vi
349                         cat >conftest.h <<EOF
350 #define GCC_$cf_ATTRIBUTE $cf_directive
351 EOF
352                         ;;
353                 esac
354
355                 if AC_TRY_EVAL(ac_compile); then
356                         test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
357                         cat conftest.h >>confdefs.h
358                         case $cf_attribute in #(vi
359                         printf) #(vi
360                                 if test "$cf_printf_attribute" = no ; then
361                                         cat >>confdefs.h <<EOF
362 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
363 EOF
364                                 else
365                                         cat >>confdefs.h <<EOF
366 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
367 EOF
368                                 fi
369                                 ;;
370                         scanf) #(vi
371                                 if test "$cf_scanf_attribute" = no ; then
372                                         cat >>confdefs.h <<EOF
373 #define GCC_SCANFLIKE(fmt,var) /* nothing */
374 EOF
375                                 else
376                                         cat >>confdefs.h <<EOF
377 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
378 EOF
379                                 fi
380                                 ;;
381                         esac
382                 fi
383         done
384 else
385         fgrep define conftest.i >>confdefs.h
386 fi
387 rm -rf conftest*
388 fi
389 ])dnl
390 dnl ---------------------------------------------------------------------------
391 dnl CF_GCC_VERSION version: 4 updated: 2005/08/27 09:53:42
392 dnl --------------
393 dnl Find version of gcc
394 AC_DEFUN([CF_GCC_VERSION],[
395 AC_REQUIRE([AC_PROG_CC])
396 GCC_VERSION=none
397 if test "$GCC" = yes ; then
398         AC_MSG_CHECKING(version of $CC)
399         GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
400         test -z "$GCC_VERSION" && GCC_VERSION=unknown
401         AC_MSG_RESULT($GCC_VERSION)
402 fi
403 ])dnl
404 dnl ---------------------------------------------------------------------------
405 dnl CF_GCC_WARNINGS version: 24 updated: 2009/02/01 15:21:00
406 dnl ---------------
407 dnl Check if the compiler supports useful warning options.  There's a few that
408 dnl we don't use, simply because they're too noisy:
409 dnl
410 dnl     -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
411 dnl     -Wredundant-decls (system headers make this too noisy)
412 dnl     -Wtraditional (combines too many unrelated messages, only a few useful)
413 dnl     -Wwrite-strings (too noisy, but should review occasionally).  This
414 dnl             is enabled for ncurses using "--enable-const".
415 dnl     -pedantic
416 dnl
417 dnl Parameter:
418 dnl     $1 is an optional list of gcc warning flags that a particular
419 dnl             application might want to use, e.g., "no-unused" for
420 dnl             -Wno-unused
421 dnl Special:
422 dnl     If $with_ext_const is "yes", add a check for -Wwrite-strings
423 dnl
424 AC_DEFUN([CF_GCC_WARNINGS],
425 [
426 AC_REQUIRE([CF_GCC_VERSION])
427 CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
428
429 cat > conftest.$ac_ext <<EOF
430 #line __oline__ "${as_me-configure}"
431 int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
432 EOF
433
434 if test "$INTEL_COMPILER" = yes
435 then
436 # The "-wdXXX" options suppress warnings:
437 # remark #1419: external declaration in primary source file
438 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
439 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
440 # remark #193: zero used for undefined preprocessing identifier
441 # remark #593: variable "curs_sb_left_arrow" was set but never used
442 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
443 # remark #869: parameter "tw" was never referenced
444 # remark #981: operands are evaluated in unspecified order
445 # warning #279: controlling expression is constant
446
447         AC_CHECKING([for $CC warning options])
448         cf_save_CFLAGS="$CFLAGS"
449         EXTRA_CFLAGS="-Wall"
450         for cf_opt in \
451                 wd1419 \
452                 wd1683 \
453                 wd1684 \
454                 wd193 \
455                 wd593 \
456                 wd279 \
457                 wd810 \
458                 wd869 \
459                 wd981
460         do
461                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
462                 if AC_TRY_EVAL(ac_compile); then
463                         test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
464                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
465                 fi
466         done
467         CFLAGS="$cf_save_CFLAGS"
468
469 elif test "$GCC" = yes
470 then
471         AC_CHECKING([for $CC warning options])
472         cf_save_CFLAGS="$CFLAGS"
473         EXTRA_CFLAGS="-W -Wall"
474         cf_warn_CONST=""
475         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
476         for cf_opt in \
477                 Wbad-function-cast \
478                 Wcast-align \
479                 Wcast-qual \
480                 Winline \
481                 Wmissing-declarations \
482                 Wmissing-prototypes \
483                 Wnested-externs \
484                 Wpointer-arith \
485                 Wshadow \
486                 Wstrict-prototypes \
487                 Wundef $cf_warn_CONST $1
488         do
489                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
490                 if AC_TRY_EVAL(ac_compile); then
491                         test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
492                         case $cf_opt in #(vi
493                         Wcast-qual) #(vi
494                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
495                                 ;;
496                         Winline) #(vi
497                                 case $GCC_VERSION in
498                                 [[34]].*)
499                                         CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
500                                         continue;;
501                                 esac
502                                 ;;
503                         esac
504                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
505                 fi
506         done
507         CFLAGS="$cf_save_CFLAGS"
508 fi
509 rm -f conftest*
510
511 AC_SUBST(EXTRA_CFLAGS)
512 ])dnl
513 dnl ---------------------------------------------------------------------------
514 dnl CF_INTEL_COMPILER version: 3 updated: 2005/08/06 18:37:29
515 dnl -----------------
516 dnl Check if the given compiler is really the Intel compiler for Linux.  It
517 dnl tries to imitate gcc, but does not return an error when it finds a mismatch
518 dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK.
519 dnl
520 dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
521 dnl ensure that it is not mistaken for gcc/g++.  It is normally invoked from
522 dnl the wrappers for gcc and g++ warnings.
523 dnl
524 dnl $1 = GCC (default) or GXX
525 dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
526 dnl $3 = CFLAGS (default) or CXXFLAGS
527 AC_DEFUN([CF_INTEL_COMPILER],[
528 ifelse($2,,INTEL_COMPILER,[$2])=no
529
530 if test "$ifelse($1,,[$1],GCC)" = yes ; then
531         case $host_os in
532         linux*|gnu*)
533                 AC_MSG_CHECKING(if this is really Intel ifelse($1,GXX,C++,C) compiler)
534                 cf_save_CFLAGS="$ifelse($3,,CFLAGS,[$3])"
535                 ifelse($3,,CFLAGS,[$3])="$ifelse($3,,CFLAGS,[$3]) -no-gcc"
536                 AC_TRY_COMPILE([],[
537 #ifdef __INTEL_COMPILER
538 #else
539 make an error
540 #endif
541 ],[ifelse($2,,INTEL_COMPILER,[$2])=yes
542 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
543 ],[])
544                 ifelse($3,,CFLAGS,[$3])="$cf_save_CFLAGS"
545                 AC_MSG_RESULT($ifelse($2,,INTEL_COMPILER,[$2]))
546                 ;;
547         esac
548 fi
549 ])dnl
550 dnl ---------------------------------------------------------------------------
551 dnl CF_MSG_LOG version: 4 updated: 2007/07/29 09:55:12
552 dnl ----------
553 dnl Write a debug message to config.log, along with the line number in the
554 dnl configure script.
555 AC_DEFUN([CF_MSG_LOG],[
556 echo "${as_me-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
557 ])dnl
558 dnl ---------------------------------------------------------------------------
559 dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05
560 dnl ------------------
561 dnl see CF_WITH_NO_LEAKS
562 AC_DEFUN([CF_NO_LEAKS_OPTION],[
563 AC_MSG_CHECKING(if you want to use $1 for testing)
564 AC_ARG_WITH($1,
565         [$2],
566         [AC_DEFINE($3)ifelse([$4],,[
567          $4
568 ])
569         : ${with_cflags:=-g}
570         : ${with_no_leaks:=yes}
571          with_$1=yes],
572         [with_$1=])
573 AC_MSG_RESULT(${with_$1:-no})
574
575 case .$with_cflags in #(vi
576 .*-g*)
577         case .$CFLAGS in #(vi
578         .*-g*) #(vi
579                 ;;
580         *)
581                 CF_ADD_CFLAGS([-g])
582                 ;;
583         esac
584         ;;
585 esac
586 ])dnl
587 dnl ---------------------------------------------------------------------------
588 dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18
589 dnl -----------
590 dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
591 AC_DEFUN([CF_PROG_EXT],
592 [
593 AC_REQUIRE([CF_CHECK_CACHE])
594 case $cf_cv_system_name in
595 os2*)
596     CFLAGS="$CFLAGS -Zmt"
597     CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
598     CXXFLAGS="$CXXFLAGS -Zmt"
599     # autoconf's macro sets -Zexe and suffix both, which conflict:w
600     LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
601     ac_cv_exeext=.exe
602     ;;
603 esac
604
605 AC_EXEEXT
606 AC_OBJEXT
607
608 PROG_EXT="$EXEEXT"
609 AC_SUBST(PROG_EXT)
610 test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")
611 ])dnl
612 dnl ---------------------------------------------------------------------------
613 dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
614 dnl --------
615 dnl Make an uppercase version of a variable
616 dnl $1=uppercase($2)
617 AC_DEFUN([CF_UPPER],
618 [
619 $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
620 ])dnl
621 dnl ---------------------------------------------------------------------------
622 dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12
623 dnl ----------
624 dnl Use AC_VERBOSE w/o the warnings
625 AC_DEFUN([CF_VERBOSE],
626 [test -n "$verbose" && echo "   $1" 1>&AC_FD_MSG
627 CF_MSG_LOG([$1])
628 ])dnl
629 dnl ---------------------------------------------------------------------------
630 dnl CF_WITH_DBMALLOC version: 6 updated: 2006/12/16 14:24:05
631 dnl ----------------
632 dnl Configure-option for dbmalloc.  The optional parameter is used to override
633 dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
634 AC_DEFUN([CF_WITH_DBMALLOC],[
635 CF_NO_LEAKS_OPTION(dbmalloc,
636         [  --with-dbmalloc         test: use Conor Cahill's dbmalloc library],
637         [USE_DBMALLOC])
638
639 if test "$with_dbmalloc" = yes ; then
640         AC_CHECK_HEADER(dbmalloc.h,
641                 [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse($1,,[],[,$1]))])
642 fi
643 ])dnl
644 dnl ---------------------------------------------------------------------------
645 dnl CF_WITH_DMALLOC version: 6 updated: 2006/12/16 14:24:05
646 dnl ---------------
647 dnl Configure-option for dmalloc.  The optional parameter is used to override
648 dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
649 AC_DEFUN([CF_WITH_DMALLOC],[
650 CF_NO_LEAKS_OPTION(dmalloc,
651         [  --with-dmalloc          test: use Gray Watson's dmalloc library],
652         [USE_DMALLOC])
653
654 if test "$with_dmalloc" = yes ; then
655         AC_CHECK_HEADER(dmalloc.h,
656                 [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse($1,,[],[,$1]))])
657 fi
658 ])dnl
659 dnl ---------------------------------------------------------------------------
660 dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21
661 dnl ----------------
662 AC_DEFUN([CF_WITH_VALGRIND],[
663 CF_NO_LEAKS_OPTION(valgrind,
664         [  --with-valgrind         test: use valgrind],
665         [USE_VALGRIND])
666 ])dnl
667 dnl ---------------------------------------------------------------------------
668 dnl CF_WITH_WARNINGS version: 5 updated: 2004/07/23 14:40:34
669 dnl ----------------
670 dnl Combine the checks for gcc features into a configure-script option
671 dnl
672 dnl Parameters:
673 dnl     $1 - see CF_GCC_WARNINGS
674 AC_DEFUN([CF_WITH_WARNINGS],
675 [
676 if ( test "$GCC" = yes || test "$GXX" = yes )
677 then
678 AC_MSG_CHECKING(if you want to check for gcc warnings)
679 AC_ARG_WITH(warnings,
680         [  --with-warnings         test: turn on gcc warnings],
681         [cf_opt_with_warnings=$withval],
682         [cf_opt_with_warnings=no])
683 AC_MSG_RESULT($cf_opt_with_warnings)
684 if test "$cf_opt_with_warnings" != no ; then
685         CF_GCC_ATTRIBUTES
686         CF_GCC_WARNINGS([$1])
687 fi
688 fi
689 ])dnl