1 dnl***************************************************************************
2 dnl Copyright (c) 2003-2005,2006 Free Software Foundation, Inc. *
4 dnl Permission is hereby granted, free of charge, to any person obtaining a *
5 dnl copy of this software and associated documentation files (the *
6 dnl "Software"), to deal in the Software without restriction, including *
7 dnl without limitation the rights to use, copy, modify, merge, publish, *
8 dnl distribute, distribute with modifications, sublicense, and/or sell *
9 dnl copies of the Software, and to permit persons to whom the Software is *
10 dnl furnished to do so, subject to the following conditions: *
12 dnl The above copyright notice and this permission notice shall be included *
13 dnl in all copies or substantial portions of the Software. *
15 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 dnl Except as contained in this notice, the name(s) of the above copyright *
24 dnl holders shall not be used in advertising or otherwise to promote the *
25 dnl sale, use or other dealings in this Software without prior written *
27 dnl***************************************************************************
29 dnl $Id: aclocal.m4,v 1.17 2006/12/03 00:10:15 tom Exp $
31 dnl Author: Thomas E. Dickey
33 dnl Macros used in NCURSES test programs auto-configuration script.
35 dnl These macros are maintained separately from NCURSES. The copyright on
36 dnl this file applies to the aggregation of macros and does not affect use of
37 dnl these macros in other applications.
39 dnl See http://invisible-island.net/autoconf/ for additional information.
41 dnl ---------------------------------------------------------------------------
42 dnl ---------------------------------------------------------------------------
43 dnl CF_ADD_CFLAGS version: 7 updated: 2004/04/25 17:48:30
45 dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
46 dnl The second parameter if given makes this macro verbose.
48 dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS,
49 dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily
50 dnl confused by the quotes (which require backslashes to keep them usable).
51 AC_DEFUN([CF_ADD_CFLAGS],
56 cf_new_extra_cppflags=
58 for cf_add_cflags in $1
60 case $cf_fix_cppflags in
62 case $cf_add_cflags in #(vi
63 -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
64 case $cf_add_cflags in
66 cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
68 test "${cf_add_cflags}" != "${cf_tst_cflags}" \
69 && test -z "${cf_tst_cflags}" \
70 && cf_fix_cppflags=yes
72 if test $cf_fix_cppflags = yes ; then
73 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
75 elif test "${cf_tst_cflags}" = "\"'" ; then
76 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
85 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
90 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
95 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
97 cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
99 test "${cf_add_cflags}" != "${cf_tst_cflags}" \
100 && test -z "${cf_tst_cflags}" \
101 && cf_fix_cppflags=no
106 if test -n "$cf_new_cflags" ; then
107 ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
108 CFLAGS="$CFLAGS $cf_new_cflags"
111 if test -n "$cf_new_cppflags" ; then
112 ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
113 CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
116 if test -n "$cf_new_extra_cppflags" ; then
117 ifelse($2,,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
118 EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
121 AC_SUBST(EXTRA_CPPFLAGS)
124 dnl ---------------------------------------------------------------------------
125 dnl CF_ADD_INCDIR version: 4 updated: 2002/12/21 14:25:52
127 dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's
128 dnl redundant. We don't normally need to add -I/usr/local/include for gcc,
129 dnl but old versions (and some misinstalled ones) need that. To make things
130 dnl worse, gcc 3.x gives error messages if -I/usr/local/include is added to
131 dnl the include-path).
132 AC_DEFUN([CF_ADD_INCDIR],
134 for cf_add_incdir in $1
138 case $cf_add_incdir in
141 /usr/local/include) # (vi
144 cf_save_CPPFLAGS="$CPPFLAGS"
145 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
146 AC_TRY_COMPILE([#include <stdio.h>],
149 [CPPFLAGS="$cf_save_CPPFLAGS"])
153 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
156 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
157 test "$cf_top_incdir" = "$cf_add_incdir" && break
158 cf_add_incdir="$cf_top_incdir"
162 dnl ---------------------------------------------------------------------------
163 dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34
165 dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
166 dnl in the sharutils 4.2 distribution.
167 AC_DEFUN([CF_ANSI_CC_CHECK],
169 AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[
171 cf_save_CFLAGS="$CFLAGS"
172 cf_save_CPPFLAGS="$CPPFLAGS"
173 # Don't try gcc -ansi; that turns off useful extensions and
174 # breaks some systems' header files.
176 # Ultrix and OSF/1 -std1
177 # HP-UX -Aa -D_HPUX_SOURCE
179 # UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes)
180 for cf_arg in "-DCC_HAS_PROTOS" \
185 "-Aa -D_HPUX_SOURCE" \
188 CF_ADD_CFLAGS($cf_arg)
191 #ifndef CC_HAS_PROTOS
192 #if !defined(__STDC__) || (__STDC__ != 1)
197 int test (int i, double x);
198 struct s1 {int (*f) (int a);};
199 struct s2 {int (*f) (double a);};],
200 [cf_cv_ansi_cc="$cf_arg"; break])
202 CFLAGS="$cf_save_CFLAGS"
203 CPPFLAGS="$cf_save_CPPFLAGS"
206 if test "$cf_cv_ansi_cc" != "no"; then
207 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
208 CF_ADD_CFLAGS($cf_cv_ansi_cc)
210 AC_DEFINE(CC_HAS_PROTOS)
214 dnl ---------------------------------------------------------------------------
215 dnl CF_ANSI_CC_REQD version: 3 updated: 1997/09/06 13:40:44
217 dnl For programs that must use an ANSI compiler, obtain compiler options that
218 dnl will make it recognize prototypes. We'll do preprocessor checks in other
219 dnl macros, since tools such as unproto can fake prototypes, but only part of
220 dnl the preprocessor.
221 AC_DEFUN([CF_ANSI_CC_REQD],
222 [AC_REQUIRE([CF_ANSI_CC_CHECK])
223 if test "$cf_cv_ansi_cc" = "no"; then
225 [Your compiler does not appear to recognize prototypes.
226 You have the following choices:
227 a. adjust your compiler options
228 b. get an up-to-date compiler
229 c. use a wrapper such as unproto])
232 dnl ---------------------------------------------------------------------------
233 dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31
235 dnl Allow user to enable a normally-off option.
236 AC_DEFUN([CF_ARG_ENABLE],
237 [CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl
238 dnl ---------------------------------------------------------------------------
239 dnl CF_ARG_OPTION version: 3 updated: 1997/10/18 14:42:41
241 dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
247 dnl $3 = action to perform if option is not default
248 dnl $4 = action if perform if option is default
249 dnl $5 = default option value (either 'yes' or 'no')
250 AC_DEFUN([CF_ARG_OPTION],
251 [AC_ARG_ENABLE($1,[$2],[test "$enableval" != ifelse($5,no,yes,no) && enableval=ifelse($5,no,no,yes)
252 if test "$enableval" != "$5" ; then
254 ,[ $3]) ifelse($4,,,[
257 fi],[enableval=$5 ifelse($4,,,[
261 dnl ---------------------------------------------------------------------------
262 dnl CF_CHECK_CACHE version: 10 updated: 2004/05/23 13:03:31
264 dnl Check if we're accidentally using a cache from a different machine.
265 dnl Derive the system name, as a check for reusing the autoconf cache.
267 dnl If we've packaged config.guess and config.sub, run that (since it does a
268 dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow
269 dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
270 dnl which is useful in cross-compiles.
272 dnl Note: we would use $ac_config_sub, but that is one of the places where
273 dnl autoconf 2.5x broke compatibility with autoconf 2.13
274 AC_DEFUN([CF_CHECK_CACHE],
276 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
277 ifelse([$1],,[AC_CANONICAL_HOST],[$1])
278 system_name="$host_os"
280 system_name="`(uname -s -r) 2>/dev/null`"
281 if test -z "$system_name" ; then
282 system_name="`(hostname) 2>/dev/null`"
285 test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
286 AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
288 test -z "$system_name" && system_name="$cf_cv_system_name"
289 test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
291 if test ".$system_name" != ".$cf_cv_system_name" ; then
292 AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
293 AC_ERROR("Please remove config.cache and try again.")
296 dnl ---------------------------------------------------------------------------
297 dnl CF_CHECK_CFLAGS version: 2 updated: 2001/12/30 19:09:58
299 dnl Conditionally add to $CFLAGS and $CPPFLAGS values which are derived from
300 dnl a build-configuration such as imake. These have the pitfall that they
301 dnl often contain compiler-specific options which we cannot use, mixed with
302 dnl preprocessor options that we usually can.
303 AC_DEFUN([CF_CHECK_CFLAGS],
305 CF_VERBOSE(checking additions to CFLAGS)
306 cf_check_cflags="$CFLAGS"
307 cf_check_cppflags="$CPPFLAGS"
308 CF_ADD_CFLAGS($1,yes)
309 if test "$cf_check_cflags" != "$CFLAGS" ; then
310 AC_TRY_LINK([#include <stdio.h>],[printf("Hello world");],,
311 [CF_VERBOSE(test-compile failed. Undoing change to \$CFLAGS)
312 if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
313 CF_VERBOSE(but keeping change to \$CPPFLAGS)
315 CFLAGS="$cf_check_flags"])
318 dnl ---------------------------------------------------------------------------
319 dnl CF_CURSES_ACS_MAP version: 3 updated: 2003/05/17 22:19:02
320 dnl -----------------
321 dnl Check for likely values of acs_map[]:
322 AC_DEFUN([CF_CURSES_ACS_MAP],
324 AC_CACHE_CHECK(for alternate character set array, cf_cv_curses_acs_map,[
325 cf_cv_curses_acs_map=unknown
326 for name in acs_map _acs_map __acs_map _nc_acs_map
329 #include <${cf_cv_ncurses_header-curses.h}>
331 $name['k'] = ACS_PLUS
332 ],[cf_cv_curses_acs_map=$name; break])
336 test "$cf_cv_curses_acs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_ACS_ARRAY,$cf_cv_curses_acs_map)
338 dnl ---------------------------------------------------------------------------
339 dnl CF_CURSES_CHECK_TYPE version: 2 updated: 2003/03/01 23:40:33
340 dnl --------------------
341 dnl Check if curses.h defines the given type
342 AC_DEFUN([CF_CURSES_CHECK_TYPE],
344 AC_MSG_CHECKING(for type $1 in ${cf_cv_ncurses_header-curses.h})
346 #ifndef _XOPEN_SOURCE_EXTENDED
347 #define _XOPEN_SOURCE_EXTENDED
349 #include <${cf_cv_ncurses_header-curses.h}>],[
351 ],cf_result=yes,cf_result=no)
352 AC_MSG_RESULT($cf_result)
353 if test $cf_result = yes ; then
354 CF_UPPER(cf_result,have_type_$1)
355 AC_DEFINE_UNQUOTED($cf_result)
357 AC_DEFINE_UNQUOTED($1,$2)
360 dnl ---------------------------------------------------------------------------
361 dnl CF_CURSES_CPPFLAGS version: 9 updated: 2006/02/04 19:44:43
362 dnl ------------------
363 dnl Look for the curses headers.
364 AC_DEFUN([CF_CURSES_CPPFLAGS],[
366 AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[
367 cf_cv_curses_incdir=no
368 case $host_os in #(vi
370 test -d /usr/include/curses_colr && \
371 cf_cv_curses_incdir="-I/usr/include/curses_colr"
374 test -d /usr/5lib && \
375 test -d /usr/5include && \
376 cf_cv_curses_incdir="-I/usr/5include"
380 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
385 dnl ---------------------------------------------------------------------------
386 dnl CF_CURSES_HEADER version: 1 updated: 2005/12/31 13:28:25
388 dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
389 dnl variations of ncurses' installs.
391 dnl See also CF_NCURSES_HEADER, which sets the same cache variable.
392 AC_DEFUN([CF_CURSES_HEADER],[
393 AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
394 cf_cv_ncurses_header=none
401 AC_TRY_COMPILE([#include <${cf_header}>],
402 [initscr(); tgoto("?", 0,0)],
403 [cf_cv_ncurses_header=$cf_header; break],[])
407 if test "$cf_cv_ncurses_header" = none ; then
408 AC_MSG_ERROR(No curses header-files found)
411 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
412 AC_CHECK_HEADERS($cf_cv_ncurses_header)
414 dnl ---------------------------------------------------------------------------
415 dnl CF_CURSES_LIBS version: 24 updated: 2006/02/04 19:44:43
417 dnl Look for the curses libraries. Older curses implementations may require
418 dnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first.
419 AC_DEFUN([CF_CURSES_LIBS],[
421 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
422 AC_MSG_CHECKING(if we have identified curses libraries)
423 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
424 [initscr(); tgoto("?", 0,0)],
427 AC_MSG_RESULT($cf_result)
429 if test "$cf_result" = no ; then
430 case $host_os in #(vi
432 AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
435 AC_CHECK_LIB(cur_colr,initscr,[
436 LIBS="-lcur_colr $LIBS"
437 ac_cv_func_initscr=yes
439 AC_CHECK_LIB(Hcurses,initscr,[
440 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
441 LIBS="-lHcurses $LIBS"
442 CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
443 ac_cv_func_initscr=yes
446 linux*) # Suse Linux does not follow /usr/lib convention
450 test -d /usr/5lib && \
451 LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap"
452 ac_cv_func_initscr=yes
456 if test ".$ac_cv_func_initscr" != .yes ; then
461 if test ".${cf_cv_ncurses_version-no}" != .no
463 cf_check_list="ncurses curses cursesX"
465 cf_check_list="cursesX curses ncurses"
468 # Check for library containing tgoto. Do this before curses library
469 # because it may be needed to link the test-case for initscr.
470 AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
471 for cf_term_lib in $cf_check_list termcap termlib unknown
473 AC_CHECK_LIB($cf_term_lib,tgoto,[break])
477 # Check for library containing initscr
478 test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
479 for cf_curs_lib in $cf_check_list xcurses jcurses unknown
481 AC_CHECK_LIB($cf_curs_lib,initscr,[break])
483 test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
485 LIBS="-l$cf_curs_lib $cf_save_LIBS"
486 if test "$cf_term_lib" = unknown ; then
487 AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
488 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
492 AC_MSG_RESULT($cf_result)
493 test $cf_result = no && AC_ERROR(Cannot link curses library)
494 elif test "$cf_curs_lib" = "$cf_term_lib" ; then
496 elif test "$cf_term_lib" != predefined ; then
497 AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
498 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
499 [initscr(); tgoto((char *)0, 0, 0);],
502 LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
503 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
508 AC_MSG_RESULT($cf_result)
514 dnl ---------------------------------------------------------------------------
515 dnl CF_CURSES_WACS_MAP version: 3 updated: 2003/05/17 22:19:02
516 dnl ------------------
517 dnl Check for likely values of wacs_map[]:
518 AC_DEFUN([CF_CURSES_WACS_MAP],
520 AC_CACHE_CHECK(for wide alternate character set array, cf_cv_curses_wacs_map,[
521 cf_cv_curses_wacs_map=unknown
522 for name in wacs_map _wacs_map __wacs_map _nc_wacs
525 #ifndef _XOPEN_SOURCE_EXTENDED
526 #define _XOPEN_SOURCE_EXTENDED
528 #include <${cf_cv_ncurses_header-curses.h}>],
529 [$name['k'] = *WACS_PLUS],
530 [cf_cv_curses_wacs_map=$name
534 dnl ---------------------------------------------------------------------------
535 dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52
537 dnl "dirname" is not portable, so we fake it with a shell script.
538 AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl
539 dnl ---------------------------------------------------------------------------
540 dnl CF_ENABLE_WARNINGS version: 3 updated: 2003/05/24 14:24:29
541 dnl ------------------
542 dnl Configure-option to enable gcc warnings
543 AC_DEFUN([CF_ENABLE_WARNINGS],[
544 if ( test "$GCC" = yes || test "$GXX" = yes )
546 AC_MSG_CHECKING(if you want to turn on gcc warnings)
547 CF_ARG_ENABLE(warnings,
548 [ --enable-warnings test: turn on gcc compiler warnings],
551 AC_MSG_RESULT($with_warnings)
552 if test "$with_warnings" = "yes"
558 dnl ---------------------------------------------------------------------------
559 dnl CF_FIND_LIBRARY version: 8 updated: 2004/11/23 20:14:58
561 dnl Look for a non-standard library, given parameters for AC_TRY_LINK. We
562 dnl prefer a standard location, and use -L options only if we do not find the
563 dnl library in the standard library location(s).
564 dnl $1 = library name
565 dnl $2 = library class, usually the same as library name
567 dnl $4 = code fragment to compile/link
568 dnl $5 = corresponding function-name
569 dnl $6 = flag, nonnull if failure should not cause an error-exit
571 dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had
572 dnl to use a -L option.
573 AC_DEFUN([CF_FIND_LIBRARY],
575 eval 'cf_cv_have_lib_'$1'=no'
578 eval 'cf_cv_have_lib_'$1'=yes',[
580 AC_MSG_CHECKING(for $5 in -l$1)
582 AC_TRY_LINK([$3],[$4],
584 eval 'cf_cv_have_lib_'$1'=yes'
587 CF_LIBRARY_PATH(cf_search,$2)
588 for cf_libdir in $cf_search
590 AC_MSG_CHECKING(for -l$1 in $cf_libdir)
591 LIBS="-L$cf_libdir -l$1 $cf_save_LIBS"
592 AC_TRY_LINK([$3],[$4],
594 eval 'cf_cv_have_lib_'$1'=yes'
597 LIBS="$cf_save_LIBS"])
601 eval 'cf_found_library=[$]cf_cv_have_lib_'$1
603 if test $cf_found_library = no ; then
604 AC_ERROR(Cannot link $1 library)
608 dnl ---------------------------------------------------------------------------
609 dnl CF_FUNC_CURSES_VERSION version: 3 updated: 2003/05/17 22:19:02
610 dnl ----------------------
611 dnl Solaris has a data item 'curses_version', which confuses AC_CHECK_FUNCS.
612 dnl It's a character string "SVR4", not documented.
613 AC_DEFUN([CF_FUNC_CURSES_VERSION],
615 AC_CACHE_CHECK(for function curses_version, cf_cv_func_curses_version,[
617 #include <${cf_cv_ncurses_header-curses.h}>
621 sprintf(temp, "%s\n", curses_version());
624 ,[cf_cv_func_curses_version=yes]
625 ,[cf_cv_func_curses_version=no]
626 ,[cf_cv_func_curses_version=unknown])
628 test "$cf_cv_func_curses_version" = yes && AC_DEFINE(HAVE_CURSES_VERSION)
630 dnl ---------------------------------------------------------------------------
631 dnl CF_GCC_ATTRIBUTES version: 10 updated: 2005/05/28 13:16:28
632 dnl -----------------
633 dnl Test for availability of useful gcc __attribute__ directives to quiet
634 dnl compiler warnings. Though useful, not all are supported -- and contrary
635 dnl to documentation, unrecognized directives cause older compilers to barf.
636 AC_DEFUN([CF_GCC_ATTRIBUTES],
640 cat > conftest.i <<EOF
648 #define GCC_NORETURN /* nothing */
651 #define GCC_UNUSED /* nothing */
656 AC_CHECKING([for $CC __attribute__ directives])
657 cat > conftest.$ac_ext <<EOF
658 #line __oline__ "configure"
659 #include "confdefs.h"
660 #include "conftest.h"
661 #include "conftest.i"
663 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
665 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
668 #define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
670 #define GCC_SCANFLIKE(fmt,var) /*nothing*/
672 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
673 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
674 extern void foo(void) GCC_NORETURN;
675 int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; }
677 for cf_attribute in scanf printf unused noreturn
679 CF_UPPER(cf_ATTRIBUTE,$cf_attribute)
680 cf_directive="__attribute__(($cf_attribute))"
681 echo "checking for $CC $cf_directive" 1>&AC_FD_CC
682 case $cf_attribute in
684 cat >conftest.h <<EOF
685 #define GCC_$cf_ATTRIBUTE 1
689 cat >conftest.h <<EOF
690 #define GCC_$cf_ATTRIBUTE $cf_directive
694 if AC_TRY_EVAL(ac_compile); then
695 test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
696 cat conftest.h >>confdefs.h
700 fgrep define conftest.i >>confdefs.h
705 dnl ---------------------------------------------------------------------------
706 dnl CF_GCC_VERSION version: 4 updated: 2005/08/27 09:53:42
708 dnl Find version of gcc
709 AC_DEFUN([CF_GCC_VERSION],[
710 AC_REQUIRE([AC_PROG_CC])
712 if test "$GCC" = yes ; then
713 AC_MSG_CHECKING(version of $CC)
714 GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
715 test -z "$GCC_VERSION" && GCC_VERSION=unknown
716 AC_MSG_RESULT($GCC_VERSION)
719 dnl ---------------------------------------------------------------------------
720 dnl CF_GCC_WARNINGS version: 20 updated: 2005/08/06 18:37:29
722 dnl Check if the compiler supports useful warning options. There's a few that
723 dnl we don't use, simply because they're too noisy:
725 dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
726 dnl -Wredundant-decls (system headers make this too noisy)
727 dnl -Wtraditional (combines too many unrelated messages, only a few useful)
728 dnl -Wwrite-strings (too noisy, but should review occasionally). This
729 dnl is enabled for ncurses using "--enable-const".
733 dnl $1 is an optional list of gcc warning flags that a particular
734 dnl application might want to use, e.g., "no-unused" for
737 dnl If $with_ext_const is "yes", add a check for -Wwrite-strings
739 AC_DEFUN([CF_GCC_WARNINGS],
741 AC_REQUIRE([CF_GCC_VERSION])
742 CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
744 cat > conftest.$ac_ext <<EOF
745 #line __oline__ "configure"
746 int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
749 if test "$INTEL_COMPILER" = yes
751 # The "-wdXXX" options suppress warnings:
752 # remark #1419: external declaration in primary source file
753 # remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
754 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
755 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
756 # remark #193: zero used for undefined preprocessing identifier
757 # remark #593: variable "curs_sb_left_arrow" was set but never used
758 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
759 # remark #869: parameter "tw" was never referenced
760 # remark #981: operands are evaluated in unspecified order
761 # warning #269: invalid format string conversion
763 AC_CHECKING([for $CC warning options])
764 cf_save_CFLAGS="$CFLAGS"
778 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
779 if AC_TRY_EVAL(ac_compile); then
780 test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
781 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
784 CFLAGS="$cf_save_CFLAGS"
786 elif test "$GCC" = yes
788 AC_CHECKING([for $CC warning options])
789 cf_save_CFLAGS="$CFLAGS"
790 EXTRA_CFLAGS="-W -Wall"
792 test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
798 Wmissing-declarations \
799 Wmissing-prototypes \
804 Wundef $cf_warn_CONST $1
806 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
807 if AC_TRY_EVAL(ac_compile); then
808 test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
811 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
816 CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
821 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
824 CFLAGS="$cf_save_CFLAGS"
828 AC_SUBST(EXTRA_CFLAGS)
830 dnl ---------------------------------------------------------------------------
831 dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07
833 dnl Check if we must define _GNU_SOURCE to get a reasonable value for
834 dnl _XOPEN_SOURCE, upon which many POSIX definitions depend. This is a defect
835 dnl (or misfeature) of glibc2, which breaks portability of many applications,
836 dnl since it is interwoven with GNU extensions.
838 dnl Well, yes we could work around it...
839 AC_DEFUN([CF_GNU_SOURCE],
841 AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
842 AC_TRY_COMPILE([#include <sys/types.h>],[
843 #ifndef _XOPEN_SOURCE
846 [cf_cv_gnu_source=no],
848 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
849 AC_TRY_COMPILE([#include <sys/types.h>],[
853 [cf_cv_gnu_source=no],
854 [cf_cv_gnu_source=yes])
858 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
860 dnl ---------------------------------------------------------------------------
861 dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59
863 dnl Construct a search-list for a nonstandard header-file
864 AC_DEFUN([CF_HEADER_PATH],
865 [CF_SUBDIR_PATH($1,$2,include)
866 test "$includedir" != NONE && \
867 test "$includedir" != "/usr/include" && \
868 test -d "$includedir" && {
869 test -d $includedir && $1="[$]$1 $includedir"
870 test -d $includedir/$2 && $1="[$]$1 $includedir/$2"
873 test "$oldincludedir" != NONE && \
874 test "$oldincludedir" != "/usr/include" && \
875 test -d "$oldincludedir" && {
876 test -d $oldincludedir && $1="[$]$1 $oldincludedir"
877 test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2"
881 dnl ---------------------------------------------------------------------------
882 dnl CF_INHERIT_SCRIPT version: 2 updated: 2003/03/01 23:50:42
883 dnl -----------------
884 dnl If we do not have a given script, look for it in the parent directory.
885 AC_DEFUN([CF_INHERIT_SCRIPT],
887 test -f $1 || ( test -f ../$1 && cp ../$1 ./ )
889 dnl ---------------------------------------------------------------------------
890 dnl CF_INTEL_COMPILER version: 3 updated: 2005/08/06 18:37:29
891 dnl -----------------
892 dnl Check if the given compiler is really the Intel compiler for Linux. It
893 dnl tries to imitate gcc, but does not return an error when it finds a mismatch
894 dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK.
896 dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
897 dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
898 dnl the wrappers for gcc and g++ warnings.
900 dnl $1 = GCC (default) or GXX
901 dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
902 dnl $3 = CFLAGS (default) or CXXFLAGS
903 AC_DEFUN([CF_INTEL_COMPILER],[
904 ifelse($2,,INTEL_COMPILER,[$2])=no
906 if test "$ifelse($1,,[$1],GCC)" = yes ; then
909 AC_MSG_CHECKING(if this is really Intel ifelse($1,GXX,C++,C) compiler)
910 cf_save_CFLAGS="$ifelse($3,,CFLAGS,[$3])"
911 ifelse($3,,CFLAGS,[$3])="$ifelse($3,,CFLAGS,[$3]) -no-gcc"
913 #ifdef __INTEL_COMPILER
917 ],[ifelse($2,,INTEL_COMPILER,[$2])=yes
918 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
920 ifelse($3,,CFLAGS,[$3])="$cf_save_CFLAGS"
921 AC_MSG_RESULT($ifelse($2,,INTEL_COMPILER,[$2]))
926 dnl ---------------------------------------------------------------------------
927 dnl CF_LIBRARY_PATH version: 7 updated: 2002/11/10 14:46:59
929 dnl Construct a search-list for a nonstandard library-file
930 AC_DEFUN([CF_LIBRARY_PATH],
931 [CF_SUBDIR_PATH($1,$2,lib)])dnl
932 dnl ---------------------------------------------------------------------------
933 dnl CF_MSG_LOG version: 3 updated: 1997/09/07 14:05:52
935 dnl Write a debug message to config.log, along with the line number in the
936 dnl configure script.
937 AC_DEFUN([CF_MSG_LOG],[
938 echo "(line __oline__) testing $* ..." 1>&AC_FD_CC
940 dnl ---------------------------------------------------------------------------
941 dnl CF_NCURSES_CC_CHECK version: 3 updated: 2003/01/12 18:59:28
942 dnl -------------------
943 dnl Check if we can compile with ncurses' header file
944 dnl $1 is the cache variable to set
945 dnl $2 is the header-file to include
946 dnl $3 is the root name (ncurses or ncursesw)
947 AC_DEFUN([CF_NCURSES_CC_CHECK],[
949 ]ifelse($3,ncursesw,[
950 #define _XOPEN_SOURCE_EXTENDED
951 #undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */
952 #define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */
955 #ifdef NCURSES_VERSION
956 ]ifelse($3,ncursesw,[
961 printf("%s\n", NCURSES_VERSION);
973 dnl ---------------------------------------------------------------------------
974 dnl CF_NCURSES_CPPFLAGS version: 18 updated: 2005/12/31 13:26:39
975 dnl -------------------
976 dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
977 dnl the CPPFLAGS variable so we can include its header.
979 dnl The header files may be installed as either curses.h, or ncurses.h (would
980 dnl be obsolete, except that some packagers prefer this name to distinguish it
981 dnl from a "native" curses implementation). If not installed for overwrite,
982 dnl the curses.h file would be in an ncurses subdirectory (e.g.,
983 dnl /usr/include/ncurses), but someone may have installed overwriting the
984 dnl vendor's curses. Only very old versions (pre-1.9.2d, the first autoconf'd
985 dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in
988 dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header
989 dnl is already in the include-path, don't even bother with this, since we cannot
990 dnl easily determine which file it is. In this case, it has to be <curses.h>.
992 dnl The optional parameter gives the root name of the library, in case it is
993 dnl not installed as the default curses library. That is how the
994 dnl wide-character version of ncurses is installed.
995 AC_DEFUN([CF_NCURSES_CPPFLAGS],
996 [AC_REQUIRE([CF_WITH_CURSES_DIR])
998 AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl
999 cf_ncuhdr_root=ifelse($1,,ncurses,$1)
1001 test -n "$cf_cv_curses_dir" && \
1002 test "$cf_cv_curses_dir" != "no" && \
1003 CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
1005 AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[
1006 cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
1007 ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
1008 for cf_header in $cf_header_list
1010 CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1)
1011 test "$cf_cv_ncurses_h" != no && break
1018 # some applications need this, but should check for NCURSES_VERSION
1023 dnl ---------------------------------------------------------------------------
1024 dnl CF_NCURSES_HEADER version: 1 updated: 2005/12/31 13:28:37
1025 dnl -----------------
1026 dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
1027 dnl variations of ncurses' installs.
1029 dnl See also CF_CURSES_HEADER, which sets the same cache variable.
1030 AC_DEFUN([CF_NCURSES_HEADER],[
1032 if test "$cf_cv_ncurses_h" != no ; then
1033 cf_cv_ncurses_header=$cf_cv_ncurses_h
1036 AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[
1037 test -n "$verbose" && echo
1038 CF_HEADER_PATH(cf_search,$cf_ncuhdr_root)
1039 test -n "$verbose" && echo search path $cf_search
1040 cf_save2_CPPFLAGS="$CPPFLAGS"
1041 for cf_incdir in $cf_search
1043 CF_ADD_INCDIR($cf_incdir)
1048 CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1)
1049 if test "$cf_cv_ncurses_h2" != no ; then
1050 cf_cv_ncurses_h2=$cf_incdir/$cf_header
1051 test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&AC_FD_MSG
1054 test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG
1056 CPPFLAGS="$cf_save2_CPPFLAGS"
1057 test "$cf_cv_ncurses_h2" != no && break
1059 test "$cf_cv_ncurses_h2" = no && AC_ERROR(not found)
1062 CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2)
1063 cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
1064 if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
1065 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
1067 CF_ADD_INCDIR($cf_1st_incdir)
1071 # Set definitions to allow ifdef'ing for ncurses.h
1073 case $cf_cv_ncurses_header in # (vi
1075 AC_DEFINE(HAVE_NCURSES_H)
1079 case $cf_cv_ncurses_header in # (vi
1080 ncurses/curses.h|ncurses/ncurses.h)
1081 AC_DEFINE(HAVE_NCURSES_NCURSES_H)
1083 ncursesw/curses.h|ncursesw/ncurses.h)
1084 AC_DEFINE(HAVE_NCURSESW_NCURSES_H)
1089 dnl ---------------------------------------------------------------------------
1090 dnl CF_NCURSES_LIBS version: 12 updated: 2004/04/27 16:26:05
1092 dnl Look for the ncurses library. This is a little complicated on Linux,
1093 dnl because it may be linked with the gpm (general purpose mouse) library.
1094 dnl Some distributions have gpm linked with (bsd) curses, which makes it
1095 dnl unusable with ncurses. However, we don't want to link with gpm unless
1096 dnl ncurses has a dependency, since gpm is normally set up as a shared library,
1097 dnl and the linker will record a dependency.
1099 dnl The optional parameter gives the root name of the library, in case it is
1100 dnl not installed as the default curses library. That is how the
1101 dnl wide-character version of ncurses is installed.
1102 AC_DEFUN([CF_NCURSES_LIBS],
1103 [AC_REQUIRE([CF_NCURSES_CPPFLAGS])
1105 cf_nculib_root=ifelse($1,,ncurses,$1)
1106 # This works, except for the special case where we find gpm, but
1107 # ncurses is in a nonstandard location via $LIBS, and we really want
1110 cf_ncurses_SAVE="$LIBS"
1111 AC_CHECK_LIB(gpm,Gpm_Open,
1112 [AC_CHECK_LIB(gpm,initscr,
1113 [LIBS="$cf_ncurses_SAVE"],
1114 [cf_ncurses_LIBS="-lgpm"])])
1116 case $host_os in #(vi
1118 # This is only necessary if you are linking against an obsolete
1119 # version of ncurses (but it should do no harm, since it's static).
1120 if test "$cf_nculib_root" = ncurses ; then
1121 AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"])
1126 LIBS="$cf_ncurses_LIBS $LIBS"
1128 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
1130 LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
1132 CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
1133 [#include <${cf_cv_ncurses_header-curses.h}>],
1138 if test -n "$cf_ncurses_LIBS" ; then
1139 AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS)
1140 cf_ncurses_SAVE="$LIBS"
1141 for p in $cf_ncurses_LIBS ; do
1142 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
1143 if test "$q" != "$LIBS" ; then
1147 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
1148 [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);],
1149 [AC_MSG_RESULT(yes)],
1151 LIBS="$cf_ncurses_SAVE"])
1154 CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
1155 AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
1157 dnl ---------------------------------------------------------------------------
1158 dnl CF_NCURSES_VERSION version: 11 updated: 2003/11/06 19:59:57
1159 dnl ------------------
1160 dnl Check for the version of ncurses, to aid in reporting bugs, etc.
1161 dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't use
1162 dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi.
1163 AC_DEFUN([CF_NCURSES_VERSION],
1165 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1166 AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[
1167 cf_cv_ncurses_version=no
1171 #include <${cf_cv_ncurses_header-curses.h}>
1175 FILE *fp = fopen("$cf_tempfile", "w");
1176 #ifdef NCURSES_VERSION
1177 # ifdef NCURSES_VERSION_PATCH
1178 fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
1180 fprintf(fp, "%s\n", NCURSES_VERSION);
1184 fprintf(fp, "old\n");
1191 cf_cv_ncurses_version=`cat $cf_tempfile`],,[
1193 # This will not work if the preprocessor splits the line after the
1194 # Autoconf token. The 'unproto' program does that.
1195 cat > conftest.$ac_ext <<EOF
1196 #include <${cf_cv_ncurses_header-curses.h}>
1198 #ifdef NCURSES_VERSION
1199 Autoconf NCURSES_VERSION
1207 cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out"
1209 if test -f conftest.out ; then
1210 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'`
1211 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
1217 test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES)
1219 dnl ---------------------------------------------------------------------------
1220 dnl CF_PATH_SYNTAX version: 11 updated: 2006/09/02 08:55:46
1222 dnl Check the argument to see that it looks like a pathname. Rewrite it if it
1223 dnl begins with one of the prefix/exec_prefix variables, and then again if the
1224 dnl result begins with 'NONE'. This is necessary to work around autoconf's
1225 dnl delayed evaluation of those symbols.
1226 AC_DEFUN([CF_PATH_SYNTAX],[
1227 if test "x$prefix" != xNONE; then
1228 cf_path_syntax="$prefix"
1230 cf_path_syntax="$ac_default_prefix"
1233 case ".[$]$1" in #(vi
1234 .\[$]\(*\)*|.\'*\'*) #(vi
1238 .[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX
1240 .\[$]{*prefix}*) #(vi
1242 case ".[$]$1" in #(vi
1244 $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
1249 $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
1252 ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2)
1256 dnl ---------------------------------------------------------------------------
1257 dnl CF_PDCURSES_X11 version: 7 updated: 2006/11/12 17:31:59
1259 dnl Configure for PDCurses' X11 library
1260 AC_DEFUN([CF_PDCURSES_X11],[
1261 AC_REQUIRE([CF_X_ATHENA])
1263 AC_PATH_PROGS(XCURSES_CONFIG,xcurses-config,none)
1265 if test "$XCURSES_CONFIG" != none ; then
1267 CPPFLAGS="`$XCURSES_CONFIG --cflags` $CPPFLAGS"
1268 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
1270 cf_cv_lib_XCurses=yes
1274 LDFLAGS="$LDFLAGS $X_LIBS"
1275 CF_CHECK_CFLAGS($X_CFLAGS)
1276 AC_CHECK_LIB(X11,XOpenDisplay,
1277 [LIBS="-lX11 $LIBS"],,
1278 [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])
1279 AC_CACHE_CHECK(for XCurses library,cf_cv_lib_XCurses,[
1280 LIBS="-lXCurses $LIBS"
1282 #include <xcurses.h>
1283 char *XCursesProgramName = "test";
1285 [cf_cv_lib_XCurses=yes],
1286 [cf_cv_lib_XCurses=no])
1291 if test $cf_cv_lib_XCurses = yes ; then
1294 AC_DEFINE(HAVE_XCURSES)
1296 AC_ERROR(Cannot link with XCurses)
1299 dnl ---------------------------------------------------------------------------
1300 dnl CF_POSIX_C_SOURCE version: 6 updated: 2005/07/14 20:25:10
1301 dnl -----------------
1302 dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.
1304 dnl POSIX.1-1990 _POSIX_SOURCE
1305 dnl POSIX.1-1990 and _POSIX_SOURCE and
1306 dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2
1308 dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L
1309 dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L
1310 dnl X/Open 2000 _POSIX_C_SOURCE=200112L
1313 dnl $1 is the nominal value for _POSIX_C_SOURCE
1314 AC_DEFUN([CF_POSIX_C_SOURCE],
1316 cf_POSIX_C_SOURCE=ifelse($1,,199506L,$1)
1318 cf_save_CFLAGS="$CFLAGS"
1319 cf_save_CPPFLAGS="$CPPFLAGS"
1321 CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE)
1322 CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE)
1324 AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[
1325 CF_MSG_LOG(if the symbol is already defined go no further)
1326 AC_TRY_COMPILE([#include <sys/types.h>],[
1327 #ifndef _POSIX_C_SOURCE
1330 [cf_cv_posix_c_source=no],
1331 [cf_want_posix_source=no
1332 case .$cf_POSIX_C_SOURCE in #(vi
1334 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
1337 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
1338 cf_want_posix_source=yes
1341 cf_want_posix_source=yes
1344 if test "$cf_want_posix_source" = yes ; then
1345 AC_TRY_COMPILE([#include <sys/types.h>],[
1346 #ifdef _POSIX_SOURCE
1349 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE")
1351 CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE)
1352 CFLAGS="$cf_trim_CFLAGS"
1353 CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
1354 CF_MSG_LOG(if the second compile does not leave our definition intact error)
1355 AC_TRY_COMPILE([#include <sys/types.h>],[
1356 #ifndef _POSIX_C_SOURCE
1359 [cf_cv_posix_c_source=no])
1360 CFLAGS="$cf_save_CFLAGS"
1361 CPPFLAGS="$cf_save_CPPFLAGS"
1365 if test "$cf_cv_posix_c_source" != no ; then
1366 CFLAGS="$cf_trim_CFLAGS"
1367 CPPFLAGS="$cf_trim_CPPFLAGS"
1368 if test "$cf_cv_cc_u_d_options" = yes ; then
1369 cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
1370 sed -e 's/-D/-U/g' -e 's/=[[^ ]]*//g'`
1371 CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
1373 CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
1377 dnl ---------------------------------------------------------------------------
1378 dnl CF_PRG_RULES version: 1 updated: 2006/06/03 11:45:08
1380 dnl Append definitions and rules for the given programs to the subdirectory
1381 dnl Makefiles, and the recursion rule for the top-level Makefile.
1384 dnl $1 = script to run
1385 dnl $2 = list of subdirectories
1389 AC_DEFUN([CF_PRG_RULES],
1393 if test ! -d $srcdir/$cf_dir; then
1395 elif test -f $srcdir/$cf_dir/programs; then
1396 $AWK -f $1 $srcdir/$cf_dir/programs >>$cf_dir/Makefile
1401 dnl ---------------------------------------------------------------------------
1402 dnl CF_PROG_CC_U_D version: 1 updated: 2005/07/14 16:59:30
1404 dnl Check if C (preprocessor) -U and -D options are processed in the order
1405 dnl given rather than by type of option. Some compilers insist on apply all
1406 dnl of the -U options after all of the -D options. Others allow mixing them,
1407 dnl and may predefine symbols that conflict with those we define.
1408 AC_DEFUN([CF_PROG_CC_U_D],
1410 AC_CACHE_CHECK(if $CC -U and -D options work together,cf_cv_cc_u_d_options,[
1411 cf_save_CPPFLAGS="$CPPFLAGS"
1412 CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
1415 make an undefined-error
1418 make a defined-error
1421 cf_cv_cc_u_d_options=yes],[
1422 cf_cv_cc_u_d_options=no])
1423 CPPFLAGS="$cf_save_CPPFLAGS"
1426 dnl ---------------------------------------------------------------------------
1427 dnl CF_REMOVE_DEFINE version: 2 updated: 2005/07/09 16:12:18
1428 dnl ----------------
1429 dnl Remove all -U and -D options that refer to the given symbol from a list
1430 dnl of C compiler options. This works around the problem that not all
1431 dnl compilers process -U and -D options from left-to-right, so a -U option
1432 dnl cannot be used to cancel the effect of a preceding -D option.
1434 dnl $1 = target (which could be the same as the source variable)
1435 dnl $2 = source (including '$')
1436 dnl $3 = symbol to remove
1437 define([CF_REMOVE_DEFINE],
1439 # remove $3 symbol from $2
1441 sed -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[[ ]]/ /g' \
1442 -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[$]//g'`
1444 dnl ---------------------------------------------------------------------------
1445 dnl CF_SUBDIR_PATH version: 4 updated: 2006/11/18 17:13:19
1447 dnl Construct a search-list for a nonstandard header/lib-file
1448 dnl $1 = the variable to return as result
1449 dnl $2 = the package name
1450 dnl $3 = the subdirectory, e.g., bin, include or lib
1451 AC_DEFUN([CF_SUBDIR_PATH],
1454 test -d "[$]HOME" && {
1455 test -n "$verbose" && echo " ... testing $3-directories under [$]HOME"
1456 test -d "[$]HOME/$3" && $1="[$]$1 [$]HOME/$3"
1457 test -d "[$]HOME/$3/$2" && $1="[$]$1 [$]HOME/$3/$2"
1458 test -d "[$]HOME/$3/$2/$3" && $1="[$]$1 [$]HOME/$3/$2/$3"
1461 # For other stuff under the home directory, it should be sufficient to put
1462 # a symbolic link for $HOME/$2 to the actual package location:
1463 test -d "[$]HOME/$2" && {
1464 test -n "$verbose" && echo " ... testing $3-directories under [$]HOME/$2"
1465 test -d "[$]HOME/$2/$3" && $1="[$]$1 [$]HOME/$2/$3"
1466 test -d "[$]HOME/$2/$3/$2" && $1="[$]$1 [$]HOME/$2/$3/$2"
1469 test "$prefix" != /usr/local && \
1470 test -d /usr/local && {
1471 test -n "$verbose" && echo " ... testing $3-directories under /usr/local"
1472 test -d /usr/local/$3 && $1="[$]$1 /usr/local/$3"
1473 test -d /usr/local/$3/$2 && $1="[$]$1 /usr/local/$3/$2"
1474 test -d /usr/local/$3/$2/$3 && $1="[$]$1 /usr/local/$3/$2/$3"
1475 test -d /usr/local/$2/$3 && $1="[$]$1 /usr/local/$2/$3"
1476 test -d /usr/local/$2/$3/$2 && $1="[$]$1 /usr/local/$2/$3/$2"
1479 test "$prefix" != NONE && \
1480 test -d $prefix && {
1481 test -n "$verbose" && echo " ... testing $3-directories under $prefix"
1482 test -d $prefix/$3 && $1="[$]$1 $prefix/$3"
1483 test -d $prefix/$3/$2 && $1="[$]$1 $prefix/$3/$2"
1484 test -d $prefix/$3/$2/$3 && $1="[$]$1 $prefix/$3/$2/$3"
1485 test -d $prefix/$2/$3 && $1="[$]$1 $prefix/$2/$3"
1486 test -d $prefix/$2/$3/$2 && $1="[$]$1 $prefix/$2/$3/$2"
1489 test "$prefix" != /opt && \
1491 test -n "$verbose" && echo " ... testing $3-directories under /opt"
1492 test -d /opt/$3 && $1="[$]$1 /opt/$3"
1493 test -d /opt/$3/$2 && $1="[$]$1 /opt/$3/$2"
1494 test -d /opt/$3/$2/$3 && $1="[$]$1 /opt/$3/$2/$3"
1495 test -d /opt/$2/$3 && $1="[$]$1 /opt/$2/$3"
1496 test -d /opt/$2/$3/$2 && $1="[$]$1 /opt/$2/$3/$2"
1499 test "$prefix" != /usr && \
1501 test -n "$verbose" && echo " ... testing $3-directories under /usr"
1502 test -d /usr/$3 && $1="[$]$1 /usr/$3"
1503 test -d /usr/$3/$2 && $1="[$]$1 /usr/$3/$2"
1504 test -d /usr/$3/$2/$3 && $1="[$]$1 /usr/$3/$2/$3"
1505 test -d /usr/$2/$3 && $1="[$]$1 /usr/$2/$3"
1508 dnl ---------------------------------------------------------------------------
1509 dnl CF_SYS_TIME_SELECT version: 4 updated: 2000/10/04 09:18:40
1510 dnl ------------------
1511 dnl Check if we can include <sys/time.h> with <sys/select.h>; this breaks on
1512 dnl older SCO configurations.
1513 AC_DEFUN([CF_SYS_TIME_SELECT],
1515 AC_MSG_CHECKING(if sys/time.h works with sys/select.h)
1516 AC_CACHE_VAL(cf_cv_sys_time_select,[
1518 #include <sys/types.h>
1519 #ifdef HAVE_SYS_TIME_H
1520 #include <sys/time.h>
1522 #ifdef HAVE_SYS_SELECT_H
1523 #include <sys/select.h>
1525 ],[],[cf_cv_sys_time_select=yes],
1526 [cf_cv_sys_time_select=no])
1528 AC_MSG_RESULT($cf_cv_sys_time_select)
1529 test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT)
1531 dnl ---------------------------------------------------------------------------
1532 dnl CF_TERM_HEADER version: 1 updated: 2005/12/31 13:26:39
1534 dnl Look for term.h, which is part of X/Open curses. It defines the interface
1535 dnl to terminfo database. Usually it is in the same include-path as curses.h,
1536 dnl but some packagers change this, breaking various applications.
1537 AC_DEFUN([CF_TERM_HEADER],[
1538 AC_CACHE_CHECK(for terminfo header, cf_cv_term_header,[
1539 case ${cf_cv_ncurses_header} in #(vi
1540 */ncurses.h|*/ncursesw.h) #(vi
1541 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[[^.]]*\.h$%term.h%'`
1544 cf_term_header=term.h
1548 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
1550 AC_TRY_COMPILE([#include <stdio.h>
1551 #include <${cf_cv_ncurses_header-curses.h}>
1553 ],[int x = auto_left_margin],[
1554 cf_cv_term_header="$cf_test"],[
1555 cf_cv_term_header=unknown
1557 test "$cf_cv_term_header" != unknown && break
1561 # Set definitions to allow ifdef'ing to accommodate subdirectories
1563 case $cf_cv_term_header in # (vi
1565 AC_DEFINE(HAVE_TERM_H)
1569 case $cf_cv_term_header in # (vi
1570 ncurses/term.h) #(vi
1571 AC_DEFINE(HAVE_NCURSES_TERM_H)
1574 AC_DEFINE(HAVE_NCURSESW_TERM_H)
1578 dnl ---------------------------------------------------------------------------
1579 dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
1581 dnl Make an uppercase version of a variable
1582 dnl $1=uppercase($2)
1583 AC_DEFUN([CF_UPPER],
1585 $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
1587 dnl ---------------------------------------------------------------------------
1588 dnl CF_UTF8_LIB version: 4 updated: 2003/03/01 18:36:42
1590 dnl Check for multibyte support, and if not found, utf8 compatibility library
1591 AC_DEFUN([CF_UTF8_LIB],
1593 AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
1594 cf_save_LIBS="$LIBS"
1596 #include <stdlib.h>],[putwc(0,0);],
1597 [cf_cv_utf8_lib=yes],
1598 [LIBS="-lutf8 $LIBS"
1600 #include <libutf8.h>],[putwc(0,0);],
1601 [cf_cv_utf8_lib=add-on],
1602 [cf_cv_utf8_lib=no])
1603 LIBS="$cf_save_LIBS"
1606 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
1608 if test "$cf_cv_utf8_lib" = "add-on" ; then
1609 AC_DEFINE(HAVE_LIBUTF8_H)
1613 dnl ---------------------------------------------------------------------------
1614 dnl CF_VERBOSE version: 2 updated: 1997/09/05 10:45:14
1616 dnl Use AC_VERBOSE w/o the warnings
1617 AC_DEFUN([CF_VERBOSE],
1618 [test -n "$verbose" && echo " $1" 1>&AC_FD_MSG
1620 dnl ---------------------------------------------------------------------------
1621 dnl CF_WITH_CURSES_DIR version: 2 updated: 2002/11/10 14:46:59
1622 dnl ------------------
1623 dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses
1625 AC_DEFUN([CF_WITH_CURSES_DIR],[
1626 AC_ARG_WITH(curses-dir,
1627 [ --with-curses-dir=DIR directory in which (n)curses is installed],
1628 [CF_PATH_SYNTAX(withval)
1629 cf_cv_curses_dir=$withval],
1630 [cf_cv_curses_dir=no])
1632 dnl ---------------------------------------------------------------------------
1633 dnl CF_XOPEN_SOURCE version: 24 updated: 2006/04/02 16:41:09
1635 dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
1636 dnl or adapt to the vendor's definitions to get equivalent functionality,
1637 dnl without losing the common non-POSIX features.
1640 dnl $1 is the nominal value for _XOPEN_SOURCE
1641 dnl $2 is the nominal value for _POSIX_C_SOURCE
1642 AC_DEFUN([CF_XOPEN_SOURCE],[
1644 AC_REQUIRE([CF_PROG_CC_U_D])
1646 cf_XOPEN_SOURCE=ifelse($1,,500,$1)
1647 cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2)
1649 case $host_os in #(vi
1651 CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
1654 # 5.x headers associate
1655 # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
1656 # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
1657 cf_POSIX_C_SOURCE=200112L
1659 CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1662 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
1665 CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
1671 # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
1674 # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
1677 # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
1680 CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
1683 CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
1686 # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
1689 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
1692 AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
1693 AC_TRY_COMPILE([#include <sys/types.h>],[
1694 #ifndef _XOPEN_SOURCE
1697 [cf_cv_xopen_source=no],
1698 [cf_save="$CPPFLAGS"
1699 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1700 AC_TRY_COMPILE([#include <sys/types.h>],[
1701 #ifdef _XOPEN_SOURCE
1704 [cf_cv_xopen_source=no],
1705 [cf_cv_xopen_source=$cf_XOPEN_SOURCE])
1709 if test "$cf_cv_xopen_source" != no ; then
1710 CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
1711 CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
1712 test "$cf_cv_cc_u_d_options" = yes && \
1713 CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
1714 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
1716 CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
1720 dnl ---------------------------------------------------------------------------
1721 dnl CF_X_ATHENA version: 12 updated: 2004/06/15 21:14:41
1723 dnl Check for Xaw (Athena) libraries
1725 dnl Sets $cf_x_athena according to the flavor of Xaw which is used.
1726 AC_DEFUN([CF_X_ATHENA],
1727 [AC_REQUIRE([CF_X_TOOLKIT])
1728 cf_x_athena=${cf_x_athena-Xaw}
1730 AC_MSG_CHECKING(if you want to link with Xaw 3d library)
1733 [ --with-Xaw3d link with Xaw 3d library])
1734 if test "$withval" = yes ; then
1741 AC_MSG_CHECKING(if you want to link with neXT Athena library)
1744 [ --with-neXtaw link with neXT Athena library])
1745 if test "$withval" = yes ; then
1752 AC_MSG_CHECKING(if you want to link with Athena-Plus library)
1754 AC_ARG_WITH(XawPlus,
1755 [ --with-XawPlus link with Athena-Plus library])
1756 if test "$withval" = yes ; then
1763 AC_CHECK_LIB(Xext,XextCreateExtension,
1764 [LIBS="-lXext $LIBS"])
1768 CF_X_ATHENA_CPPFLAGS($cf_x_athena)
1769 CF_X_ATHENA_LIBS($cf_x_athena)
1771 dnl ---------------------------------------------------------------------------
1772 dnl CF_X_ATHENA_CPPFLAGS version: 2 updated: 2002/10/09 20:00:37
1773 dnl --------------------
1774 dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
1775 dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
1776 AC_DEFUN([CF_X_ATHENA_CPPFLAGS],
1778 cf_x_athena_root=ifelse($1,,Xaw,$1)
1779 cf_x_athena_include=""
1781 for cf_path in default \
1782 /usr/contrib/X11R6 \
1783 /usr/contrib/X11R5 \
1787 if test -z "$cf_x_athena_include" ; then
1789 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
1790 if test $cf_path != default ; then
1791 CPPFLAGS="-I$cf_path/include $cf_save"
1792 AC_MSG_CHECKING(for $cf_test in $cf_path)
1794 AC_MSG_CHECKING(for $cf_test)
1797 #include <X11/Intrinsic.h>
1798 #include <$cf_test>],[],
1801 AC_MSG_RESULT($cf_result)
1802 if test "$cf_result" = yes ; then
1803 cf_x_athena_include=$cf_path
1811 if test -z "$cf_x_athena_include" ; then
1813 [Unable to successfully find Athena header files with test program])
1814 elif test "$cf_x_athena_include" != default ; then
1815 CPPFLAGS="$CPPFLAGS -I$cf_x_athena_include"
1818 dnl ---------------------------------------------------------------------------
1819 dnl CF_X_ATHENA_LIBS version: 6 updated: 2006/11/30 17:57:11
1820 dnl ----------------
1821 dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
1822 dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
1823 AC_DEFUN([CF_X_ATHENA_LIBS],
1824 [AC_REQUIRE([CF_X_TOOLKIT])
1825 cf_x_athena_root=ifelse($1,,Xaw,$1)
1828 for cf_path in default \
1829 /usr/contrib/X11R6 \
1830 /usr/contrib/X11R5 \
1835 "-l$cf_x_athena_root -lXmu" \
1836 "-l$cf_x_athena_root -lXpm -lXmu" \
1837 "-l${cf_x_athena_root}_s -lXmu_s"
1839 if test -z "$cf_x_athena_lib" ; then
1841 cf_test=XawSimpleMenuAddGlobalActions
1842 if test $cf_path != default ; then
1843 LIBS="-L$cf_path/lib $cf_lib $LIBS"
1844 AC_MSG_CHECKING(for $cf_lib in $cf_path)
1846 LIBS="$cf_lib $LIBS"
1847 AC_MSG_CHECKING(for $cf_test in $cf_lib)
1849 AC_TRY_LINK([],[$cf_test()],
1852 AC_MSG_RESULT($cf_result)
1853 if test "$cf_result" = yes ; then
1854 cf_x_athena_lib="$cf_lib"
1862 if test -z "$cf_x_athena_lib" ; then
1864 [Unable to successfully link Athena library (-l$cf_x_athena_root) with test program])
1867 CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
1868 AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
1870 dnl ---------------------------------------------------------------------------
1871 dnl CF_X_TOOLKIT version: 11 updated: 2006/11/29 19:05:14
1873 dnl Check for X Toolkit libraries
1875 AC_DEFUN([CF_X_TOOLKIT],
1877 AC_REQUIRE([AC_PATH_XTRA])
1878 AC_REQUIRE([CF_CHECK_CACHE])
1880 # SYSTEM_NAME=`echo "$cf_cv_system_name"|tr ' ' -`
1884 LDFLAGS="$X_LIBS $LDFLAGS"
1885 CF_CHECK_CFLAGS($X_CFLAGS)
1887 AC_CHECK_FUNC(XOpenDisplay,,[
1888 AC_CHECK_LIB(X11,XOpenDisplay,
1889 [LIBS="-lX11 $LIBS"],,
1890 [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])])
1892 AC_CHECK_FUNC(XtAppInitialize,,[
1893 AC_CHECK_LIB(Xt, XtAppInitialize,
1894 [AC_DEFINE(HAVE_LIBXT)
1896 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"],,
1897 [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])])
1899 if test $cf_have_X_LIBS = no ; then
1901 [Unable to successfully link X Toolkit library (-lXt) with
1902 test program. You will have to check and add the proper libraries by hand