1 dnl***************************************************************************
2 dnl Copyright (c) 1998,1999 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 Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
31 dnl $Id: configure.in,v 1.179 1999/10/24 00:32:42 tom Exp $
32 dnl Process this file with autoconf to produce a configure script.
33 AC_PREREQ(2.12.971222)
34 AC_REVISION($Revision: 1.179 $)
35 AC_INIT(ncurses/base/lib_initscr.c)
36 AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
38 CF_SUBST_NCURSES_VERSION
40 AC_ARG_WITH(system-type,
41 [ --with-system-type=XXX test: override derived host system-type],
42 [AC_MSG_WARN(overriding system type to $withval)
43 cf_cv_system_name=$withval])
45 # We need a configure script only when compiling as part of GNU C library.
46 # Here we have to generate one of the files we need while compiling.
48 # The only problem is that users of the package might think they have to
49 # run configure themself and find it irritating when nothing happens.
51 # So we try here to find out whether we are called from the glibc configure
54 dnl Check if we are a drop-in addition to glibc.
55 AC_ARG_ENABLE(add-ons, dnl
56 [ --enable-add-ons=DIR... used to check if we are a glibc add-on.],
60 dnl We need to use [ and ] for other purposes for a while now.
62 if test x"$glibc_add_on" = "xyes" ; then
65 rm -f $srcdir/Makefile
66 cp $srcdir/Makefile.glibc $srcdir/Makefile
67 echo "ncurses `grep \"^[ ]*ncurses-version[ ]*=.*$\" \
68 $srcdir/Makefile | sed -e \
69 's/^[ ]*ncurses-version[ ]*=[ ]*\([^ ^ ]*\)[ ]*$/\1/'`" > $srcdir/Banner
74 ### Save the given $CFLAGS to allow user-override.
75 cf_user_CFLAGS="$CFLAGS"
77 ### Default install-location
80 ### Checks for programs.
82 if test -n "$GCC" ; then
83 AC_MSG_CHECKING(version of gcc)
86 if test $host != $build; then
87 AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)
90 AC_PROG_GCC_TRADITIONAL
95 case "$cf_cv_system_name" in
97 test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
99 *) LDPATH=$PATH:/sbin:/usr/sbin
100 AC_PATH_PROG(LDCONFIG,ldconfig,,$LDPATH)
105 dnl DEFECT in autoconf 2.12: an attempt to set policy, this breaks the
106 dnl configure script by not letting us test if C++
107 dnl is present, making this option necessary.
108 AC_MSG_CHECKING(if you want to ensure bool is consistent with C++)
110 [ --without-cxx do not adjust ncurses bool to match C++],
111 [cf_with_cxx=$withval],
113 AC_MSG_RESULT($cf_with_cxx)
114 if test "X$cf_with_cxx" = Xno ; then
121 if test -n "$GXX" ; then case "`${CXX-g++} --version`" in 1*|2.[0-6]*) GXX=""; CXX=""; ac_cv_prog_gxx=no; cf_cxx_library=no ; echo No: templates do not work;; esac; fi
124 AC_MSG_CHECKING(if you want to build C++ binding and demo)
125 AC_ARG_WITH(cxx-binding,
126 [ --without-cxx-binding do not build C++ binding and demo],
127 [cf_with_cxx_binding=$withval],
128 [cf_with_cxx_binding=$cf_with_cxx])
129 AC_MSG_RESULT($cf_with_cxx_binding)
131 AC_MSG_CHECKING(if you want to build with Ada95)
133 [ --without-ada suppress check for Ada95, don't build demo],
134 [cf_with_ada=$withval],
136 AC_MSG_RESULT($cf_with_ada)
138 AC_MSG_CHECKING(if you want to build programs such as tic)
140 [ --without-progs suppress build with programs (e.g., tic)],
141 [cf_with_progs=$withval],
143 AC_MSG_RESULT($cf_with_progs)
145 modules_to_build="ncurses"
146 if test "X$cf_with_progs" != Xno ; then
147 modules_to_build="$modules_to_build progs tack"
149 modules_to_build="$modules_to_build panel menu form"
154 AC_SYS_LONG_FILE_NAMES
157 AC_CHECK_PROGS(LINT, tdlint lint alint)
158 AC_CHECK_PROGS(MAN, man man_db)
161 dnl These are standard among *NIX systems, but not when cross-compiling
162 CF_SUBST(loader,LD,ld)
163 CF_SUBST(archiver,AR,ar)
164 CF_SUBST(archiver options,AR_OPTS,rv)
168 dnl Special option for use by system-builders: the install-prefix is used to
169 dnl adjust the location into which the actual install is done, so that an
170 dnl archive can be built without modifying the host system's configuration.
171 AC_MSG_CHECKING(if you have specified an install-prefix)
172 AC_ARG_WITH(install-prefix,
173 [ --with-install-prefix prefixes actual install-location],
174 [case "$withval" in #(vi
177 *) INSTALL_PREFIX="$withval"
180 AC_MSG_RESULT($INSTALL_PREFIX)
181 AC_SUBST(INSTALL_PREFIX)
183 ###############################################################################
186 ###############################################################################
187 CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
189 ### Options to allow the user to specify the set of libraries which are used.
190 ### Use "--without-normal --with-shared" to allow the default model to be
191 ### shared, for example.
194 AC_MSG_CHECKING(if you want to build shared libraries)
196 [ --with-shared generate shared-libraries],
197 [with_shared=$withval],
199 AC_MSG_RESULT($with_shared)
200 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
202 AC_MSG_CHECKING(if you want to build static libraries)
204 [ --with-normal generate normal-libraries (default)],
205 [with_normal=$withval],
207 AC_MSG_RESULT($with_normal)
208 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
210 AC_MSG_CHECKING(if you want to build debug libraries)
212 [ --with-debug generate debug-libraries (default)],
213 [with_debug=$withval],
215 AC_MSG_RESULT($with_debug)
216 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
218 AC_MSG_CHECKING(if you want to build profiling libraries)
220 [ --with-profile generate profile-libraries],
221 [with_profile=$withval],
223 AC_MSG_RESULT($with_profile)
224 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
226 AC_MSG_CHECKING(if you want to build a separate terminfo library)
228 [ --with-termlib generate separate terminfo library],
229 [with_termlib=$withval],
231 AC_MSG_RESULT($with_termlib)
233 ### Checks for special libraries, must be done up-front.
234 AC_MSG_CHECKING(if you want to link with dbmalloc for testing)
235 AC_ARG_WITH(dbmalloc,
236 [ --with-dbmalloc test: use Conor Cahill's dbmalloc library],
237 [with_dbmalloc=$withval],
239 AC_MSG_RESULT($with_dbmalloc)
240 if test $with_dbmalloc = yes ; then
241 AC_CHECK_LIB(dbmalloc,debug_malloc)
244 AC_MSG_CHECKING(if you want to link with dmalloc for testing)
246 [ --with-dmalloc test: use Gray Watson's dmalloc library],
247 [with_dmalloc=$withval],
249 AC_MSG_RESULT($with_dmalloc)
250 if test $with_dmalloc = yes ; then
251 AC_CHECK_LIB(dmalloc,dmalloc_debug)
255 AC_MSG_CHECKING(if you want to link with the gpm mouse library)
257 [ --with-gpm use Alessandro Rubini's GPM library],
260 AC_MSG_RESULT($with_gpm)
261 if test $with_gpm = yes ; then
262 AC_CHECK_LIB(gpm,Gpm_Open,[
263 EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS"
264 SHLIB_LIST="-lgpm $SHLIB_LIST"
265 AC_DEFINE(HAVE_LIBGPM)
266 AC_CHECK_HEADERS(gpm.h)
267 ],AC_MSG_WARN(Cannot link with gpm library - read the FAQ))
270 TINFO_LIST="$SHLIB_LIST"
271 test $with_termlib = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo"
277 AC_MSG_CHECKING(for specified models)
278 test -z "$cf_list_models" && cf_list_models=normal
279 AC_MSG_RESULT($cf_list_models)
281 ### Use the first model as the default, and save its suffix for use in building
282 ### up test-applications.
283 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'`
284 CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
285 CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_DEP_SUFFIX)dnl
286 CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
287 CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
288 AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
289 AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal")
290 AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL")
291 AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
292 AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
293 AC_SUBST(cf_list_models)dnl the complete list of models ("normal debug")
302 CF_LIB_PREFIX(cf_prefix)
303 LIB_PREFIX=$LIB_DIR/$cf_prefix
306 dnl Not all ports of gcc support the -g option
308 if test X"$CC_G_OPT" = X"" ; then
310 test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
314 if test X"$CXX_G_OPT" = X"" ; then
316 test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
320 case $DFT_LWR_MODEL in
321 normal) LD_MODEL='' ;;
322 debug) LD_MODEL=$CC_G_OPT ;;
323 profile) LD_MODEL='-pg';;
324 shared) LD_MODEL='' ;;
326 AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
328 AC_MSG_CHECKING(if rpath option should be used)
330 [ --enable-rpath use rpath option when generating shared libraries],
331 [cf_cv_ld_rpath=$enableval],
333 AC_MSG_RESULT($cf_cv_ld_rpath)
336 if test "$CC_SHARED_OPTS" = "unknown"; then
337 for model in $cf_list_models; do
338 if test "$model" = "shared"; then
339 AC_ERROR(Shared libraries are not supported in this version)
344 ###############################################################################
345 CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
347 ### use option --disable-overwrite to leave out the link to -lcurses
348 AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
349 AC_ARG_ENABLE(overwrite,
350 [ --disable-overwrite leave out the link to -lcurses],
351 [with_overwrite=$enableval
352 test "$with_overwrite" = no && \
353 test "x$includedir" = 'x${prefix}/include' && \
354 includedir='$(prefix)/include/ncurses'
356 [with_overwrite=yes])
357 AC_MSG_RESULT($with_overwrite)
358 AC_MSG_CHECKING(where we will install curses.h)
359 AC_MSG_RESULT($includedir)
361 AC_MSG_CHECKING(if external terminfo-database is used)
362 AC_ARG_ENABLE(database,
363 [ --disable-database use only built-in data],
364 [with_database=$enableval],
366 AC_MSG_RESULT($with_database)
367 test $with_database != no && AC_DEFINE(USE_DATABASE)
369 AC_MSG_CHECKING(if you want to build with function extensions)
370 AC_ARG_ENABLE(ext-funcs,
371 [ --disable-ext-funcs disable function-extensions],
372 [with_ext_funcs=$enableval],
373 [with_ext_funcs=yes])
374 AC_MSG_RESULT($with_ext_funcs)
375 test "$with_ext_funcs" = yes && AC_DEFINE(NCURSES_EXT_FUNCS)
377 AC_MSG_CHECKING(for list of fallback descriptions)
378 AC_ARG_WITH(fallbacks,
379 [ --with-fallbacks=XXX specify list of fallback terminal descriptions],
380 [with_fallback=$withval],
382 AC_MSG_RESULT($with_fallback)
383 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'`
384 AC_SUBST(FALLBACK_LIST)
386 AC_MSG_CHECKING(for list of terminfo directories)
387 CF_WITH_PATHLIST(terminfo-dirs,
388 [ --with-terminfo-dirs=XXX specify list of terminfo directories],
392 AC_MSG_RESULT($TERMINFO_DIRS)
393 test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS")
395 if test $with_database = no ; then
396 if test -z $with_fallback ; then
397 AC_ERROR(You have disabled the database w/o specifying fallbacks)
401 ### use option --disable-big-core to make tic run on small machines
402 ### We need 4Mb, check if we can allocate 50% more than that.
403 AC_MSG_CHECKING(if big-core option selected)
404 AC_ARG_ENABLE(big-core,
405 [ --disable-big-core assume machine has little memory],
406 [with_big_core=$enableval],
410 int main() { exit(malloc(6000000L) == 0); }],
413 [with_big_core=no])])
414 AC_MSG_RESULT($with_big_core)
415 test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
417 ### use option --enable-termcap to compile in the termcap fallback support
418 AC_MSG_CHECKING(if you want termcap-fallback support)
419 AC_ARG_ENABLE(termcap,
420 [ --enable-termcap compile in termcap fallback support],
421 [with_termcap=$enableval],
423 AC_MSG_RESULT($with_termcap)
425 if test "$with_termcap" != "yes" ; then
426 AC_DEFINE(PURE_TERMINFO)
429 ### use option --enable-getcap to use a hacked getcap for reading termcaps
430 AC_MSG_CHECKING(if fast termcap-loader is needed)
431 AC_ARG_ENABLE(getcap,
432 [ --enable-getcap fast termcap load, no xrefs to terminfo],
433 [with_getcap=$enableval],
435 AC_MSG_RESULT($with_getcap)
436 test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP)
438 AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
439 AC_ARG_ENABLE(getcap-cache,
440 [ --enable-getcap-cache cache translated termcaps in ~/.terminfo],
441 [with_getcap_cache=$enableval],
442 [with_getcap_cache=no])
443 AC_MSG_RESULT($with_getcap_cache)
444 test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE)
448 ### Use option --enable-symlinks to make tic use symlinks, not hard links
449 ### to reduce storage requirements for the terminfo database.
455 if test "$ac_cv_func_link" != yes ; then
456 AC_MSG_CHECKING(if tic should use symbolic links)
457 if test "$ac_cv_func_symlink" = yes ; then
462 AC_MSG_RESULT($with_symlinks)
463 elif test "$ac_cv_func_symlink" != yes ; then
464 AC_MSG_CHECKING(if tic should use hard links)
465 if test "$ac_cv_func_link" = yes ; then
470 AC_MSG_RESULT($with_links)
472 AC_MSG_CHECKING(if tic should use symbolic links)
473 AC_ARG_ENABLE(symlinks,
474 [ --enable-symlinks make tic use symbolic links not hard links],
475 [with_symlinks=$enableval],
477 AC_MSG_RESULT($with_symlinks)
480 test "$with_links" = yes && AC_DEFINE(USE_LINKS)
481 test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS)
483 ### use option --enable-bsdpad to have tputs process BSD-style prefix padding
484 AC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
485 AC_ARG_ENABLE(bsdpad,
486 [ --enable-bsdpad recognize BSD-style prefix padding],
487 [with_bsdpad=$enableval],
489 AC_MSG_RESULT($with_bsdpad)
490 test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS)
492 ### use option --enable-const to turn on use of const beyond that in XSI.
493 AC_MSG_CHECKING(for extended use of const keyword)
495 [ --enable-const compile with extra/non-standard const],
496 [with_ext_const=$enableval],
498 AC_MSG_RESULT($with_ext_const)
500 if test "$with_ext_const" = yes ; then
501 AC_DEFINE(NCURSES_CONST,const)
504 AC_SUBST(NCURSES_CONST)
506 ### Enable compiling-in rcs id's
507 AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
509 [ --with-rcs-ids compile-in RCS identifiers],
510 [with_rcs_ids=$withval],
512 AC_MSG_RESULT($with_rcs_ids)
513 test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
515 ###############################################################################
516 CF_HELP_MESSAGE(Experimental Code:)
517 AC_MSG_CHECKING(if you want all experimental code)
519 [ --with-develop enable all experimental options for testing],
520 [with_develop=$withval],
522 AC_MSG_RESULT($with_develop)
524 ### use option --enable-broken-linker to force on use of broken-linker support
525 AC_MSG_CHECKING(if you want broken-linker support code)
526 AC_ARG_ENABLE(broken_linker,
527 [ --enable-broken_linker compile with broken-linker support code],
528 [with_broken_linker=$enableval],
529 [with_broken_linker=$BROKEN_LINKER])
530 AC_MSG_RESULT($with_broken_linker)
531 test "$with_broken_linker" = yes && AC_DEFINE(BROKEN_LINKER)
533 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize
534 AC_MSG_CHECKING(if you want experimental hard-tabs code)
535 AC_ARG_ENABLE(hard-tabs,
536 [ --enable-hard-tabs compile with experimental hard-tabs code],
537 [with_hardtabs=$enableval],
538 [with_hardtabs=$with_develop])
539 AC_MSG_RESULT($with_hardtabs)
540 test "$with_hardtabs" = yes && AC_DEFINE(USE_HARD_TABS)
542 ### use option --enable-hashmap to turn on use of hashmap scrolling logic
543 AC_MSG_CHECKING(if you want experimental hashmap code)
544 AC_ARG_ENABLE(hashmap,
545 [ --enable-hashmap compile with experimental hashmap code],
546 [with_hashmap=$enableval],
548 AC_MSG_RESULT($with_hashmap)
549 test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP)
551 AC_MSG_CHECKING(if you want experimental no-padding code)
552 AC_ARG_ENABLE(no-padding,
553 [ --enable-no-padding compile with experimental no-padding code],
554 [with_no_padding=$enableval],
555 [with_no_padding=yes])
556 AC_MSG_RESULT($with_no_padding)
557 test "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING)
559 AC_MSG_CHECKING(if you want experimental safe-sprintf code)
560 AC_ARG_ENABLE(safe-sprintf,
561 [ --enable-safe-sprintf compile with experimental safe-sprintf code],
562 [with_safe_sprintf=$enableval],
563 [with_safe_sprintf=no])
564 AC_MSG_RESULT($with_safe_sprintf)
565 test "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF)
567 ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
568 AC_MSG_CHECKING(if you want to experiment without scrolling-hints code)
569 AC_ARG_ENABLE(scroll-hints,
570 [ --disable-scroll-hints compile hashmap without scroll-hints code],
571 [with_scroll_hints=$enableval],
572 [with_scroll_hints=yes;
573 # when hashmap is used scroll hints are useless
574 test $with_hashmap = yes && with_scroll_hints=no])
575 AC_MSG_RESULT($with_scroll_hints)
576 test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS)
578 ### use option --enable-tcap-names to allow user to define new capabilities
579 AC_MSG_CHECKING(if you want experimental definable names like termcap)
580 AC_ARG_ENABLE(tcap-names,
581 [ --enable-tcap-names compile with experimental definable-name code],
582 [with_tcap_names=$enableval],
583 [with_tcap_names=$with_develop])
584 AC_MSG_RESULT($with_tcap_names)
586 test "$with_tcap_names" = yes && NCURSES_XNAMES=1
587 AC_SUBST(NCURSES_XNAMES)
589 ### use option --enable-sigwinch to turn on use of SIGWINCH logic
590 AC_MSG_CHECKING(if you want experimental SIGWINCH handler)
591 AC_ARG_ENABLE(sigwinch,
592 [ --enable-sigwinch compile with experimental SIGWINCH handler],
593 [with_sigwinch=$enableval],
595 AC_MSG_RESULT($with_sigwinch)
596 test "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH)
598 ### use option --enable-widec to turn on use of wide-character support
599 AC_MSG_CHECKING(if you want experimental wide-character code)
601 [ --enable-widec compile with experimental wide-char code],
602 [with_widec=$enableval],
604 AC_MSG_RESULT($with_widec)
605 test "$with_widec" = yes && AC_DEFINE(USE_WIDEC_SUPPORT)
607 ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize
608 AC_MSG_CHECKING(if you want experimental xmc code)
609 AC_ARG_ENABLE(xmc-glitch,
610 [ --enable-xmc-glitch compile with experimental xmc code],
611 [with_xmc_glitch=$enableval],
612 [with_xmc_glitch=$with_develop])
613 AC_MSG_RESULT($with_xmc_glitch)
614 test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT)
616 ###############################################################################
617 CF_HELP_MESSAGE(Testing/development Options:)
619 ### use option --disable-echo to suppress full display compiling commands
621 [ --enable-echo build: display "compiling" commands (default)],
622 [with_echo=$enableval],
624 if test "$with_echo" = yes; then
627 ECHO_LINK='@ echo linking $@ ... ;'
631 ### use option --enable-warnings to turn on all gcc warnings
632 AC_ARG_ENABLE(warnings,
633 [ --enable-warnings build: turn on GCC compiler warnings],
634 [with_warnings=$enableval])
635 if test -n "$with_warnings"; then
636 ADAFLAGS="$ADAFLAGS -gnatg"
641 ### use option --enable-assertions to turn on generation of assertion code
642 AC_ARG_ENABLE(assertions,
643 [ --enable-assertions test: turn on generation of assertion code],
644 [with_assertions=$enableval],
645 [with_assertions=no])
648 if test $with_assertions = no
651 CPPFLAGS="$CPPFLAGS -DNDEBUG"
653 ADAFLAGS="$ADAFLAGS -gnata"
657 ### use option --disable-leaks to suppress "permanent" leaks, for testing
659 [ --disable-leaks test: suppress permanent memory-leaks],
660 [test $enableval = no && AC_DEFINE(NO_LEAKS)])
661 AC_DEFINE(HAVE_NC_ALLOC_H)
663 ### use option --enable-expanded to generate certain macros as functions
664 AC_ARG_ENABLE(expanded,
665 [ --enable-expanded test: generate functions for certain macros],
666 [test $enableval = yes && AC_DEFINE(NCURSES_EXPANDED)])
668 ### use option --disable-macros to suppress macros in favor of functions
669 AC_ARG_ENABLE(macros,
670 [ --disable-macros test: use functions rather than macros],
671 [test $enableval = no && AC_DEFINE(NCURSES_NOMACROS)])
673 ### Checks for libraries.
674 AC_CHECK_FUNC(gettimeofday,
675 AC_DEFINE(HAVE_GETTIMEOFDAY),[
677 AC_CHECK_LIB(bsd, gettimeofday,
678 AC_DEFINE(HAVE_GETTIMEOFDAY)
679 LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
683 AC_CHECK_LIB(m, sin,[MATH_LIB="-lm"]))
686 ### Checks for header files.
691 dnl These are some other potentially nonportable headers.
713 # check for ISC (this may also define _POSIX_SOURCE)
714 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
715 if test "$ISC" = yes ; then
716 AC_CHECK_LIB(cposix,main)
717 AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
718 AC_CHECK_HEADERS( sys/termio.h )
723 ### checks for compiler characteristics
727 test $ac_cv_c_inline != no && AC_DEFINE(CC_HAS_INLINE_FUNCS)
732 ### Checks for external-data
737 ### Checks for library functions.
738 AC_CHECK_FUNCS( getcwd \
761 if test "$with_getcap" = "yes" ; then
769 dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
770 if test "$cross_compiling" = yes ; then
771 AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
773 AC_FUNC_SETVBUF_REVERSED
780 dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
781 if test -z "$cf_user_CFLAGS" ; then
782 CF_STRIP_G_OPT(CFLAGS)
783 CF_STRIP_G_OPT(CXXFLAGS)
786 dnl Check for C++ compiler characteristics (and ensure that it's there!)
787 CF_BOOL_DECL(cf_cv_cc_bool_type)
788 if test -n "$CXX" ; then
791 case "`${CXX-g++} --version`" in
802 AC_CHECK_HEADERS(typeinfo)
807 case $cf_cv_system_name in #(vi
817 # Just because we are not configuring against C++ right now does not
818 # mean that a user will not want to use C++. Some distributors disable
819 # the C++ portion of this configuration as a shortcut (or just to avoid
820 # compiling the demo in the c++ directory). So we need a reasonable
821 # default for the 'bool' type.
823 # Caveat: since the storage of the bool type is not standardized, it
826 AC_MSG_CHECKING(for fallback type of bool)
827 case "$host_cpu" in #(vi
828 i?86) cf_cv_type_of_bool=char ;; #(vi
829 *) cf_cv_type_of_bool=int ;;
831 AC_MSG_RESULT($cf_cv_type_of_bool)
835 CF_HELP_MESSAGE(Ada95 Binding Options:)
837 dnl Check for availability of GNU Ada Translator (GNAT).
838 dnl At the moment we support no other Ada95 compiler.
839 if test "$cf_with_ada" != "no" ; then
841 AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
842 if test "$ac_cv_prog_gnat_exists" = no; then
846 AC_CHECK_PROG(m4_exists, m4, yes, no)
847 if test "$ac_cv_prog_m4_exists" = no; then
848 cf_cv_prog_gnat_correct=no
849 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
851 if test "$cf_cv_prog_gnat_correct" = yes; then
852 AC_MSG_CHECKING(if GNAT works)
853 CF_GNAT_TRY_RUN([procedure conftest;],
856 procedure conftest is
858 Text_IO.Put ("Hello World");
860 GNAT.OS_Lib.OS_Exit (0);
861 end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
862 AC_MSG_RESULT($cf_cv_prog_gnat_correct)
865 if test "$cf_cv_prog_gnat_correct" = yes; then
866 ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
868 AC_ARG_WITH(ada-compiler,
869 [ --with-ada-compiler=CMD Specify Ada95 compiler command (default gnatmake)],
870 [cf_ada_compiler=$withval],
871 [cf_ada_compiler=gnatmake])
873 cf_ada_package=terminal_interface
875 AC_SUBST(cf_ada_make)
876 AC_SUBST(cf_ada_compiler)
877 AC_SUBST(cf_ada_package)
879 AC_SUBST(cf_compile_generics)
880 AC_SUBST(cf_generic_objects)
882 CF_WITH_PATH(ada-include,
883 [ --with-ada-include=DIR Ada includes are in DIR],
885 PREFIX/lib/gnu-Ada/adainclude,
886 [$]prefix/lib/gnu-Ada/adainclude)
887 AC_SUBST(ADA_INCLUDE)
889 CF_WITH_PATH(ada-objects,
890 [ --with-ada-objects=DIR Ada objects are in DIR],
892 PREFIX/lib/gnu-Ada/adalib,
893 [$]prefix/lib/gnu-Ada/adalib)
894 AC_SUBST(ADA_OBJECTS)
896 if test $with_shared = no
898 AC_MSG_WARN(Ada95 applications will not link properly with static libraries)
903 ### It's not possible to appease gcc 2.6.3's conversion-warnings if we're
904 ### using a 'char' for bools. gcc 2.7.0's conversion-warnings are broken too
905 ### badly to consider using for development purposes, but 2.5.8 is okay.
906 if test -n "$with_warnings"; then
907 if test -n "$GCC"; then
908 case "`$CC --version`" in
910 if test "$cf_cv_type_of_bool" != "char"; then
911 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
915 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
921 ### Construct the library-subsets, if any, from this set of keywords:
922 ### none, base, ext_funcs, termlib.
923 AC_MSG_CHECKING(for library subsets)
924 if test "$with_termlib" = yes ; then
925 LIB_SUBSETS="termlib "
927 LIB_SUBSETS="termlib+"
929 LIB_SUBSETS="${LIB_SUBSETS}base"
930 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
931 AC_MSG_RESULT($LIB_SUBSETS)
933 ### Construct the list of include-directories to be generated
937 ### Set up low-level terminfo dependencies for makefiles. Note that we
938 ### could override this.
939 if test "$with_termlib" = yes ; then
940 TEST_DEPS="${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}"
941 TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}"
943 PROG_DEPS="$TEST_DEPS"
944 PROG_ARGS="$TEST_ARGS"
946 ### Construct the list of subdirectories for which we'll customize makefiles
947 ### with the appropriate compile-rules.
949 CF_SRC_MODULES($modules_to_build)
952 ### Now that we're done running tests, add the compiler-warnings, if any
953 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
955 ################################################################################
957 include/MKterm.h.awk \
965 ### Special initialization commands, used to pass information from the
966 ### configuration-run into config.status
969 CF_LIST_MODELS="$cf_list_models"
970 DFT_LWR_MODEL="$DFT_LWR_MODEL"
973 LIB_SUBSETS="$LIB_SUBSETS"
974 SRC_SUBDIRS="$SRC_SUBDIRS"
975 TINFO_NAME="$TINFO_NAME"
976 WITH_ECHO="$with_echo"
977 WITH_OVERWRITE="$with_overwrite"
978 cf_cv_abi_version="$cf_cv_abi_version"
979 cf_cv_do_symlinks="$cf_cv_do_symlinks"
980 cf_cv_rel_version="$cf_cv_rel_version"
981 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
982 cf_cv_system_name="$cf_cv_system_name"
983 cf_with_cxx_binding="$cf_with_cxx_binding"
987 ${MAKE-make} preinstall