1 dnl***************************************************************************
2 dnl Copyright (c) 1998,1999,2000 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.220 2000/10/15 00:54:36 tom Exp $
32 dnl Process this file with autoconf to produce a configure script.
34 dnl See http://dickey.his.com/autoconf/ for additional information.
36 dnl ---------------------------------------------------------------------------
37 AC_PREREQ(2.13.20000819)
38 AC_REVISION($Revision: 1.220 $)
39 AC_INIT(ncurses/base/lib_initscr.c)
40 AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
42 CF_SUBST_NCURSES_VERSION
43 CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
44 AC_ARG_WITH(system-type,
45 [ --with-system-type=XXX test: override derived host system-type],
46 [AC_MSG_WARN(overriding system type to $withval)
47 cf_cv_system_name=$withval])
49 # We need a configure script only when compiling as part of GNU C library.
50 # Here we have to generate one of the files we need while compiling.
52 # The only problem is that users of the package might think they have to
53 # run configure themself and find it irritating when nothing happens.
55 # So we try here to find out whether we are called from the glibc configure
58 dnl Check if we are a drop-in addition to glibc.
59 AC_ARG_ENABLE(add-ons, dnl
60 [ --enable-add-ons=DIR... used to check if we are a glibc add-on.],
64 dnl We need to use [ and ] for other purposes for a while now.
66 if test x"$glibc_add_on" = "xyes" ; then
69 rm -f $srcdir/Makefile
70 cp $srcdir/Makefile.glibc $srcdir/Makefile
71 echo "ncurses `grep \"^[ ]*ncurses-version[ ]*=.*$\" \
72 $srcdir/Makefile | sed -e \
73 's/^[ ]*ncurses-version[ ]*=[ ]*\([^ ^ ]*\)[ ]*$/\1/'`" > $srcdir/Banner
78 ### Save the given $CFLAGS to allow user-override.
79 cf_user_CFLAGS="$CFLAGS"
81 ### Default install-location
84 ### Checks for programs.
86 if test "$GCC" = yes ; then
87 AC_MSG_CHECKING(version of gcc)
90 if test "$host" != $build; then
91 AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)
97 AC_PROG_GCC_TRADITIONAL
102 case "$cf_cv_system_name" in
104 test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
106 *) LDPATH=$PATH:/sbin:/usr/sbin
107 AC_PATH_PROG(LDCONFIG,ldconfig,,$LDPATH)
112 dnl DEFECT in autoconf 2.12: an attempt to set policy, this breaks the
113 dnl configure script by not letting us test if C++
114 dnl is present, making this option necessary.
115 AC_MSG_CHECKING(if you want to ensure bool is consistent with C++)
117 [ --without-cxx do not adjust ncurses bool to match C++],
118 [cf_with_cxx=$withval],
120 AC_MSG_RESULT($cf_with_cxx)
121 if test "X$cf_with_cxx" = Xno ; then
125 pushdef([AC_MSG_ERROR],
126 [AC_MSG_RESULT([You don't have any C++ compiler, too bad]); dnl
127 cf_with_cxx=no; CXX=""; GXX="";])dnl
129 popdef([AC_MSG_ERROR])dnl
133 if test "$GXX" = yes; then
134 case "`${CXX-g++} --version`" in
136 GXX=""; CXX=""; ac_cv_prog_gxx=no
138 echo No: templates do not work
144 AC_MSG_CHECKING(if you want to build C++ binding and demo)
145 AC_ARG_WITH(cxx-binding,
146 [ --without-cxx-binding do not build C++ binding and demo],
147 [cf_with_cxx_binding=$withval],
148 [cf_with_cxx_binding=$cf_with_cxx])
149 AC_MSG_RESULT($cf_with_cxx_binding)
151 AC_MSG_CHECKING(if you want to build with Ada95)
153 [ --without-ada suppress check for Ada95, don't build demo],
154 [cf_with_ada=$withval],
156 AC_MSG_RESULT($cf_with_ada)
158 AC_MSG_CHECKING(if you want to build programs such as tic)
160 [ --without-progs suppress build with programs (e.g., tic)],
161 [cf_with_progs=$withval],
163 AC_MSG_RESULT($cf_with_progs)
165 AC_MSG_CHECKING(if you wish to install curses.h)
166 AC_ARG_WITH(curses-h,
167 [ --without-curses-h install curses.h as ncurses.h only],
168 [with_curses_h=$withval],
170 AC_MSG_RESULT($with_curses_h)
172 modules_to_build="ncurses"
173 if test "X$cf_with_progs" != Xno ; then
174 modules_to_build="$modules_to_build progs tack"
176 modules_to_build="$modules_to_build panel menu form"
182 AC_SYS_LONG_FILE_NAMES
183 CF_MIXEDCASE_FILENAMES
187 AC_CHECK_PROGS(LINT, tdlint lint alint)
188 AC_CHECK_PROGS(MAN, man man_db)
191 dnl These are standard among *NIX systems, but not when cross-compiling
192 CF_SUBST(loader,LD,ld)
193 CF_SUBST(archiver,AR,ar)
194 CF_SUBST(archiver options,AR_OPTS,rv)
198 dnl Special option for use by system-builders: the install-prefix is used to
199 dnl adjust the location into which the actual install is done, so that an
200 dnl archive can be built without modifying the host system's configuration.
201 AC_MSG_CHECKING(if you have specified an install-prefix)
202 AC_ARG_WITH(install-prefix,
203 [ --with-install-prefix prefixes actual install-location],
204 [case "$withval" in #(vi
207 *) DESTDIR="$withval"
210 AC_MSG_RESULT($DESTDIR)
213 ###############################################################################
214 CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
216 ### Options to allow the user to specify the set of libraries which are used.
217 ### Use "--without-normal --with-shared" to allow the default model to be
218 ### shared, for example.
220 AC_SUBST(cf_list_models)dnl the complete list of models ("normal debug")
222 AC_MSG_CHECKING(if you want to build libraries with libtool)
224 [ --with-libtool generate libraries with libtool],
225 [with_libtool=$withval],
227 AC_MSG_RESULT($with_libtool)
228 if test "$with_libtool" = "yes"; then
229 cf_list_models="$cf_list_models libtool"
230 test -z "$LIBTOOL" && LIBTOOL=libtool
236 AC_MSG_CHECKING(if you want to build shared libraries)
238 [ --with-shared generate shared-libraries],
239 [with_shared=$withval],
241 AC_MSG_RESULT($with_shared)
242 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
244 AC_MSG_CHECKING(if you want to build static libraries)
246 [ --with-normal generate normal-libraries (default)],
247 [with_normal=$withval],
249 AC_MSG_RESULT($with_normal)
250 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
252 AC_MSG_CHECKING(if you want to build debug libraries)
254 [ --with-debug generate debug-libraries (default)],
255 [with_debug=$withval],
257 AC_MSG_RESULT($with_debug)
258 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
260 AC_MSG_CHECKING(if you want to build profiling libraries)
262 [ --with-profile generate profile-libraries],
263 [with_profile=$withval],
265 AC_MSG_RESULT($with_profile)
266 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
268 ###############################################################################
270 AC_MSG_CHECKING(for specified models)
271 test -z "$cf_list_models" && cf_list_models=normal
272 dnl If we use libtool to generate libraries, then it must be the only
274 test "$with_libtool" = "yes" && cf_list_models=libtool
275 AC_MSG_RESULT($cf_list_models)
277 ### Use the first model as the default, and save its suffix for use in building
278 ### up test-applications.
279 AC_MSG_CHECKING(for default model)
280 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'`
281 AC_MSG_RESULT($DFT_LWR_MODEL)
283 CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
285 AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal")
286 AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL")
295 CF_LIB_PREFIX(cf_prefix)
296 LIB_PREFIX=$cf_prefix
302 ###############################################################################
304 AC_MSG_CHECKING(if you want to build a separate terminfo library)
306 [ --with-termlib generate separate terminfo library],
307 [with_termlib=$withval],
309 AC_MSG_RESULT($with_termlib)
311 ### Checks for special libraries, must be done up-front.
312 AC_MSG_CHECKING(if you want to link with dbmalloc for testing)
313 AC_ARG_WITH(dbmalloc,
314 [ --with-dbmalloc test: use Conor Cahill's dbmalloc library],
315 [with_dbmalloc=$withval],
317 AC_MSG_RESULT($with_dbmalloc)
318 if test "$with_dbmalloc" = yes ; then
319 AC_CHECK_LIB(dbmalloc,debug_malloc)
322 AC_MSG_CHECKING(if you want to link with dmalloc for testing)
324 [ --with-dmalloc test: use Gray Watson's dmalloc library],
325 [with_dmalloc=$withval],
327 AC_MSG_RESULT($with_dmalloc)
328 if test "$with_dmalloc" = yes ; then
329 AC_CHECK_LIB(dmalloc,dmalloc_debug)
333 AC_MSG_CHECKING(if you want to link with the gpm mouse library)
335 [ --with-gpm use Alessandro Rubini's GPM library],
338 AC_MSG_RESULT($with_gpm)
339 if test "$with_gpm" = yes ; then
340 AC_CHECK_LIB(gpm,Gpm_Open,[
341 EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS"
342 SHLIB_LIST="-lgpm $SHLIB_LIST"
343 AC_DEFINE(HAVE_LIBGPM)
344 AC_CHECK_HEADERS(gpm.h)
345 ],AC_MSG_WARN(Cannot link with gpm library - read the FAQ))
348 dnl Not all ports of gcc support the -g option
350 if test X"$CC_G_OPT" = X"" ; then
352 test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
356 if test X"$CXX_G_OPT" = X"" ; then
358 test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
362 AC_MSG_CHECKING(for default loader flags)
363 case $DFT_LWR_MODEL in
364 libtool) LD_MODEL='' ;;
365 normal) LD_MODEL='' ;;
366 debug) LD_MODEL=$CC_G_OPT ;;
367 profile) LD_MODEL='-pg';;
368 shared) LD_MODEL='' ;;
370 AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
371 AC_MSG_RESULT($LD_MODEL)
373 AC_MSG_CHECKING(if rpath option should be used)
375 [ --enable-rpath use rpath option when generating shared libraries],
376 [cf_cv_ld_rpath=$enableval],
378 AC_MSG_RESULT($cf_cv_ld_rpath)
381 if test "$CC_SHARED_OPTS" = "unknown"; then
382 for model in $cf_list_models; do
383 if test "$model" = "shared"; then
384 AC_ERROR(Shared libraries are not supported in this version)
389 ###############################################################################
390 CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
392 ### use option --disable-overwrite to leave out the link to -lcurses
393 AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
394 AC_ARG_ENABLE(overwrite,
395 [ --disable-overwrite leave out the link to -lcurses],
396 [with_overwrite=$enableval],
397 [with_overwrite=yes])
398 AC_MSG_RESULT($with_overwrite)
400 AC_MSG_CHECKING(if external terminfo-database is used)
401 AC_ARG_ENABLE(database,
402 [ --disable-database use only built-in data],
403 [use_database=$enableval],
405 AC_MSG_RESULT($use_database)
407 case $host_os in #(vi
409 TERMINFO_SRC='${top_srcdir}/misc/emx.src'
412 TERMINFO_SRC='${top_srcdir}/misc/terminfo.src'
415 AC_SUBST(TERMINFO_SRC)
417 if test "$use_database" != no ; then
418 AC_DEFINE(USE_DATABASE)
419 AC_MSG_CHECKING(which terminfo source-file will be installed)
420 AC_ARG_ENABLE(database,
421 [ --with-database=XXX specify terminfo source to install],
422 [TERMINFO_SRC=$withval])
423 AC_MSG_RESULT($TERMINFO_SRC)
426 AC_MSG_CHECKING(for list of fallback descriptions)
427 AC_ARG_WITH(fallbacks,
428 [ --with-fallbacks=XXX specify list of fallback terminal descriptions],
429 [with_fallback=$withval],
431 AC_MSG_RESULT($with_fallback)
432 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'`
433 AC_SUBST(FALLBACK_LIST)
435 if test "$use_database" = no ; then
436 if test -z $with_fallback ; then
437 AC_ERROR(You have disabled the database w/o specifying fallbacks)
439 TERMINFO="${datadir}/terminfo"
442 AC_MSG_CHECKING(for list of terminfo directories)
443 CF_WITH_PATHLIST(terminfo-dirs,
444 [ --with-terminfo-dirs=XXX specify list of terminfo directories],
448 AC_MSG_RESULT($TERMINFO_DIRS)
449 test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS")
451 AC_MSG_CHECKING(for default terminfo directory)
452 CF_WITH_PATH(default-terminfo-dir,
453 [ --with-default-terminfo-dir=DIR default terminfo directory],
457 AC_MSG_RESULT($TERMINFO)
458 AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO")
464 ### use option --disable-big-core to make tic run on small machines
465 ### We need 4Mb, check if we can allocate 50% more than that.
466 AC_MSG_CHECKING(if big-core option selected)
467 AC_ARG_ENABLE(big-core,
468 [ --disable-big-core assume machine has little memory],
469 [with_big_core=$enableval],
474 unsigned long n = 6000000L;
482 [with_big_core=no])])
483 AC_MSG_RESULT($with_big_core)
484 test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
486 ### use option --enable-termcap to compile in the termcap fallback support
487 AC_MSG_CHECKING(if you want termcap-fallback support)
488 AC_ARG_ENABLE(termcap,
489 [ --enable-termcap compile in termcap fallback support],
490 [with_termcap=$enableval],
492 AC_MSG_RESULT($with_termcap)
494 if test "$with_termcap" != "yes" ; then
495 AC_DEFINE(PURE_TERMINFO)
498 ### use option --enable-getcap to use a hacked getcap for reading termcaps
499 AC_MSG_CHECKING(if fast termcap-loader is needed)
500 AC_ARG_ENABLE(getcap,
501 [ --enable-getcap fast termcap load, no xrefs to terminfo],
502 [with_getcap=$enableval],
504 AC_MSG_RESULT($with_getcap)
505 test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP)
507 AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
508 AC_ARG_ENABLE(getcap-cache,
509 [ --enable-getcap-cache cache translated termcaps in ~/.terminfo],
510 [with_getcap_cache=$enableval],
511 [with_getcap_cache=no])
512 AC_MSG_RESULT($with_getcap_cache)
513 test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE)
517 ### Use option --enable-symlinks to make tic use symlinks, not hard links
518 ### to reduce storage requirements for the terminfo database.
524 if test "$ac_cv_func_link" != yes ; then
525 AC_MSG_CHECKING(if tic should use symbolic links)
526 if test "$ac_cv_func_symlink" = yes ; then
531 AC_MSG_RESULT($with_symlinks)
532 elif test "$ac_cv_func_symlink" != yes ; then
533 AC_MSG_CHECKING(if tic should use hard links)
534 if test "$ac_cv_func_link" = yes ; then
539 AC_MSG_RESULT($with_links)
541 AC_MSG_CHECKING(if tic should use symbolic links)
542 AC_ARG_ENABLE(symlinks,
543 [ --enable-symlinks make tic use symbolic links not hard links],
544 [with_symlinks=$enableval],
546 AC_MSG_RESULT($with_symlinks)
549 test "$with_links" = yes && AC_DEFINE(USE_LINKS)
550 test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS)
552 ### use option --enable-broken-linker to force on use of broken-linker support
553 AC_MSG_CHECKING(if you want broken-linker support code)
554 AC_ARG_ENABLE(broken_linker,
555 [ --enable-broken_linker compile with broken-linker support code],
556 [with_broken_linker=$enableval],
557 [with_broken_linker=$BROKEN_LINKER])
558 AC_MSG_RESULT($with_broken_linker)
559 test "$with_broken_linker" = yes && AC_DEFINE(BROKEN_LINKER)
561 ### use option --enable-bsdpad to have tputs process BSD-style prefix padding
562 AC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
563 AC_ARG_ENABLE(bsdpad,
564 [ --enable-bsdpad recognize BSD-style prefix padding],
565 [with_bsdpad=$enableval],
567 AC_MSG_RESULT($with_bsdpad)
568 test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS)
570 ### Enable compiling-in rcs id's
571 AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
573 [ --with-rcs-ids compile-in RCS identifiers],
574 [with_rcs_ids=$withval],
576 AC_MSG_RESULT($with_rcs_ids)
577 test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
579 ###############################################################################
580 CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ])
582 ###############################################################################
583 CF_HELP_MESSAGE(Extensions:)
585 ### Note that some functions (such as const) are normally disabled anyway.
586 AC_MSG_CHECKING(if you want to build with function extensions)
587 AC_ARG_ENABLE(ext-funcs,
588 [ --disable-ext-funcs disable function-extensions],
589 [with_ext_funcs=$enableval],
590 [with_ext_funcs=yes])
591 AC_MSG_RESULT($with_ext_funcs)
592 if test "$with_ext_funcs" = yes ; then
593 AC_DEFINE(HAVE_CURSES_VERSION)
594 AC_DEFINE(HAVE_HAS_KEY)
595 AC_DEFINE(HAVE_RESIZETERM)
596 AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
597 AC_DEFINE(HAVE_WRESIZE)
598 AC_DEFINE(NCURSES_EXT_FUNCS)
601 ### use option --enable-const to turn on use of const beyond that in XSI.
602 AC_MSG_CHECKING(for extended use of const keyword)
604 [ --enable-const compile with extra/non-standard const],
605 [with_ext_const=$enableval],
607 AC_MSG_RESULT($with_ext_const)
608 NCURSES_CONST='/*nothing*/'
609 if test "$with_ext_const" = yes ; then
612 AC_SUBST(NCURSES_CONST)
614 AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code)
615 AC_ARG_ENABLE(no-padding,
616 [ --enable-no-padding compile with \$NCURSES_NO_PADDING code],
617 [with_no_padding=$enableval],
618 [with_no_padding=$with_ext_funcs])
619 AC_MSG_RESULT($with_no_padding)
620 test "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING)
622 ### use option --enable-sigwinch to turn on use of SIGWINCH logic
623 AC_MSG_CHECKING(if you want SIGWINCH handler)
624 AC_ARG_ENABLE(sigwinch,
625 [ --enable-sigwinch compile with SIGWINCH handler],
626 [with_sigwinch=$enableval],
627 [with_sigwinch=$with_ext_funcs])
628 AC_MSG_RESULT($with_sigwinch)
629 test "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH)
631 ### use option --enable-tcap-names to allow user to define new capabilities
632 AC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap)
633 AC_ARG_ENABLE(tcap-names,
634 [ --enable-tcap-names compile with user-definable terminal capabilities],
635 [with_tcap_names=$enableval],
636 [with_tcap_names=$with_ext_funcs])
637 AC_MSG_RESULT($with_tcap_names)
639 test "$with_tcap_names" = yes && NCURSES_XNAMES=1
640 AC_SUBST(NCURSES_XNAMES)
642 ###############################################################################
643 # These options are relatively safe to experiment with.
644 CF_HELP_MESSAGE(Development Code:)
645 AC_MSG_CHECKING(if you want all development code)
647 [ --with-develop enable all development options],
648 [with_develop=$withval],
650 AC_MSG_RESULT($with_develop)
652 ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment
653 AC_MSG_CHECKING(if you want colorfgbg code)
654 AC_ARG_ENABLE(hard-tabs,
655 [ --enable-colorfgbg compile with \$COLORFGBG code],
656 [with_colorfgbg=$enableval],
657 [with_colorfgbg=$with_develop])
658 AC_MSG_RESULT($with_colorfgbg)
659 test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
661 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize
662 AC_MSG_CHECKING(if you want hard-tabs code)
663 AC_ARG_ENABLE(hard-tabs,
664 [ --enable-hard-tabs compile with hard-tabs code],
665 [with_hardtabs=$enableval],
666 [with_hardtabs=$with_develop])
667 AC_MSG_RESULT($with_hardtabs)
668 test "$with_hardtabs" = yes && AC_DEFINE(USE_HARD_TABS)
670 AC_MSG_CHECKING(if you want to use restrict environment when running as root)
671 AC_ARG_ENABLE(root-environ,
672 [ --disable-root-environ limit environment when running as root],
673 [with_root_environ=$enableval],
674 [with_root_environ=yes])
675 AC_MSG_RESULT($with_root_environ)
676 test "$with_root_environ" = yes && AC_DEFINE(USE_ROOT_ENVIRON)
678 ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize
679 AC_MSG_CHECKING(if you want limited support for xmc)
680 AC_ARG_ENABLE(xmc-glitch,
681 [ --enable-xmc-glitch compile with limited support for xmc],
682 [with_xmc_glitch=$enableval],
683 [with_xmc_glitch=$with_develop])
684 AC_MSG_RESULT($with_xmc_glitch)
685 test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT)
687 ###############################################################################
688 # These are just experimental, probably should not be in a package:
689 CF_HELP_MESSAGE(Experimental Code:)
691 AC_MSG_CHECKING(if you do not want to assume colors are white-on-black)
692 AC_ARG_ENABLE(assumed-color,
693 [ --disable-assumed-color do not assume anything about default-colors],
694 [with_assumed_color=$enableval],
695 [with_assumed_color=yes])
696 AC_MSG_RESULT($with_assumed_color)
697 test "$with_assumed_color" = yes && AC_DEFINE(USE_ASSUMED_COLOR)
699 ### use option --enable-hashmap to turn on use of hashmap scrolling logic
700 AC_MSG_CHECKING(if you want hashmap scrolling-optimization code)
701 AC_ARG_ENABLE(hashmap,
702 [ --disable-hashmap compile without hashmap scrolling-optimization],
703 [with_hashmap=$enableval],
705 AC_MSG_RESULT($with_hashmap)
706 test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP)
708 AC_MSG_CHECKING(if you want experimental safe-sprintf code)
709 AC_ARG_ENABLE(safe-sprintf,
710 [ --enable-safe-sprintf compile with experimental safe-sprintf code],
711 [with_safe_sprintf=$enableval],
712 [with_safe_sprintf=no])
713 AC_MSG_RESULT($with_safe_sprintf)
714 test "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF)
716 ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
717 # when hashmap is used scroll hints are useless
718 if test "$with_hashmap" = no ; then
719 AC_MSG_CHECKING(if you want to experiment without scrolling-hints code)
720 AC_ARG_ENABLE(scroll-hints,
721 [ --disable-scroll-hints compile without scroll-hints code],
722 [with_scroll_hints=$enableval],
723 [with_scroll_hints=yes])
724 AC_MSG_RESULT($with_scroll_hints)
725 test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS)
728 ### use option --enable-widec to turn on use of wide-character support
729 AC_MSG_CHECKING(if you want experimental wide-character code)
731 [ --enable-widec compile with experimental wide-char/UTF-8 code],
732 [with_widec=$enableval],
734 AC_MSG_RESULT($with_widec)
735 if test "$with_widec" = yes ; then
736 LIB_SUFFIX="w${LIB_SUFFIX}"
737 AC_DEFINE(USE_WIDEC_SUPPORT)
740 ###############################################################################
741 CF_HELP_MESSAGE(Testing/development Options:)
743 ### use option --disable-echo to suppress full display compiling commands
744 AC_MSG_CHECKING(if you want to display full commands during build)
746 [ --enable-echo build: display "compiling" commands (default)],
747 [with_echo=$enableval],
749 if test "$with_echo" = yes; then
752 ECHO_LINK='@ echo linking $@ ... ;'
753 test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent"
755 AC_MSG_RESULT($with_echo)
758 ### use option --enable-warnings to turn on all gcc warnings
759 AC_MSG_CHECKING(if you want to see compiler warnings)
760 AC_ARG_ENABLE(warnings,
761 [ --enable-warnings build: turn on GCC compiler warnings],
762 [with_warnings=$enableval])
763 AC_MSG_RESULT($with_warnings)
765 if test -n "$with_warnings"; then
766 ADAFLAGS="$ADAFLAGS -gnatg"
771 ### use option --enable-assertions to turn on generation of assertion code
772 AC_MSG_CHECKING(if you want to enable runtime assertions)
773 AC_ARG_ENABLE(assertions,
774 [ --enable-assertions test: turn on generation of assertion code],
775 [with_assertions=$enableval],
776 [with_assertions=no])
777 AC_MSG_RESULT($with_assertions)
780 if test "$with_assertions" = no
783 CPPFLAGS="$CPPFLAGS -DNDEBUG"
785 ADAFLAGS="$ADAFLAGS -gnata"
789 ### use option --disable-leaks to suppress "permanent" leaks, for testing
791 [ --disable-leaks test: suppress permanent memory-leaks],
792 [test "$enableval" = no && AC_DEFINE(NO_LEAKS)])
793 AC_DEFINE(HAVE_NC_ALLOC_H)
795 ### use option --enable-expanded to generate certain macros as functions
796 AC_ARG_ENABLE(expanded,
797 [ --enable-expanded test: generate functions for certain macros],
798 [test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)])
800 ### use option --disable-macros to suppress macros in favor of functions
801 AC_ARG_ENABLE(macros,
802 [ --disable-macros test: use functions rather than macros],
803 [test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)])
805 ### Checks for libraries.
806 AC_CHECK_FUNC(gettimeofday,
807 AC_DEFINE(HAVE_GETTIMEOFDAY),[
809 AC_CHECK_LIB(bsd, gettimeofday,
810 AC_DEFINE(HAVE_GETTIMEOFDAY)
811 LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
813 CF_MATH_LIB(MATH_LIB,sin(x))
816 ### Checks for header files.
821 dnl These are some other potentially nonportable headers.
840 # check for ISC (this may also define _POSIX_SOURCE)
841 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
842 if test "$ISC" = yes ; then
843 AC_CHECK_LIB(cposix,main)
844 AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
849 ### checks for compiler characteristics
853 test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS)
858 ### Checks for external-data
862 ### Checks for library functions.
888 if test "$with_getcap" = "yes" ; then
896 dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
897 if test "$cross_compiling" = yes ; then
898 AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
900 AC_FUNC_SETVBUF_REVERSED
908 dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
909 if test -z "$cf_user_CFLAGS" ; then
910 CF_STRIP_G_OPT(CFLAGS)
911 CF_STRIP_G_OPT(CXXFLAGS)
914 dnl Check for C++ compiler characteristics (and ensure that it's there!)
915 CF_BOOL_DECL(cf_cv_cc_bool_type)
916 if test -n "$CXX" ; then
919 if test "$GXX" = yes; then
920 case "`${CXX-g++} --version`" in
934 AC_CHECK_HEADERS(typeinfo)
939 case $cf_cv_system_name in #(vi
949 # Just because we are not configuring against C++ right now does not
950 # mean that a user will not want to use C++. Some distributors disable
951 # the C++ portion of this configuration as a shortcut (or just to avoid
952 # compiling the demo in the c++ directory). So we need a reasonable
953 # default for the 'bool' type.
955 # Caveat: since the storage of the bool type is not standardized, it
958 AC_MSG_CHECKING(for fallback type of bool)
959 case "$host_cpu" in #(vi
960 i?86) cf_cv_type_of_bool=char ;; #(vi
961 *) cf_cv_type_of_bool=int ;;
963 AC_MSG_RESULT($cf_cv_type_of_bool)
967 CF_HELP_MESSAGE(Ada95 Binding Options:)
969 dnl Check for availability of GNU Ada Translator (GNAT).
970 dnl At the moment we support no other Ada95 compiler.
971 if test "$cf_with_ada" != "no" ; then
973 AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
974 if test "$ac_cv_prog_gnat_exists" = no; then
978 AC_CHECK_PROG(M4_exists, m4, yes, no)
979 if test "$ac_cv_prog_M4_exists" = no; then
980 cf_cv_prog_gnat_correct=no
981 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
983 if test "$cf_cv_prog_gnat_correct" = yes; then
984 AC_MSG_CHECKING(if GNAT works)
985 CF_GNAT_TRY_RUN([procedure conftest;],
988 procedure conftest is
990 Text_IO.Put ("Hello World");
992 GNAT.OS_Lib.OS_Exit (0);
993 end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
994 AC_MSG_RESULT($cf_cv_prog_gnat_correct)
997 if test "$cf_cv_prog_gnat_correct" = yes; then
998 ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
1000 AC_ARG_WITH(ada-compiler,
1001 [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
1002 [cf_ada_compiler=$withval],
1003 [cf_ada_compiler=gnatmake])
1005 cf_ada_package=terminal_interface
1007 AC_SUBST(cf_ada_make)
1008 AC_SUBST(cf_ada_compiler)
1009 AC_SUBST(cf_ada_package)
1011 AC_SUBST(cf_compile_generics)
1012 AC_SUBST(cf_generic_objects)
1014 CF_WITH_PATH(ada-include,
1015 [ --with-ada-include=DIR Ada includes are in DIR],
1017 PREFIX/lib/ada/adainclude,
1018 [$]prefix/lib/ada/adainclude)
1019 AC_SUBST(ADA_INCLUDE)
1021 CF_WITH_PATH(ada-objects,
1022 [ --with-ada-objects=DIR Ada objects are in DIR],
1024 PREFIX/lib/ada/adalib,
1025 [$]prefix/lib/ada/adalib)
1026 AC_SUBST(ADA_OBJECTS)
1031 ### It's not possible to appease gcc 2.6.3's conversion-warnings if we're
1032 ### using a 'char' for bools. gcc 2.7.0's conversion-warnings are broken too
1033 ### badly to consider using for development purposes, but 2.5.8 is okay.
1034 if test -n "$with_warnings"; then
1035 if test "$GCC" = yes; then
1036 case "`$CC --version`" in
1038 if test "$cf_cv_type_of_bool" != "char"; then
1039 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
1043 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
1049 ### Construct the library-subsets, if any, from this set of keywords:
1050 ### none, base, ext_funcs, termlib.
1051 AC_MSG_CHECKING(for library subsets)
1052 if test "$with_termlib" = yes ; then
1053 LIB_SUBSETS="termlib "
1055 LIB_SUBSETS="termlib+"
1057 LIB_SUBSETS="${LIB_SUBSETS}base"
1058 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
1059 AC_MSG_RESULT($LIB_SUBSETS)
1068 ### Construct the list of include-directories to be generated
1072 ### Build up pieces for makefile rules
1073 AC_MSG_CHECKING(default library suffix)
1074 CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
1075 AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
1076 AC_MSG_RESULT($DFT_ARG_SUFFIX)
1078 AC_MSG_CHECKING(default library-dependency suffix)
1079 CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_DEP_SUFFIX)dnl
1080 AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
1081 AC_MSG_RESULT($DFT_DEP_SUFFIX)
1083 AC_MSG_CHECKING(default object directory)
1084 CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
1085 AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
1086 AC_MSG_RESULT($DFT_OBJ_SUBDIR)
1088 # libtool thinks it can make c++ shared libraries (perhaps only g++)
1089 AC_MSG_CHECKING(c++ library-dependency suffux)
1090 if test "$with_libtool" = "yes"; then
1091 CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
1093 CF_LIB_SUFFIX(normal,CXX_LIB_SUFFIX)dnl we normally make a static library
1095 AC_MSG_RESULT($CXX_LIB_SUFFIX)
1096 AC_SUBST(CXX_LIB_SUFFIX)
1098 TINFO_LIST="$SHLIB_LIST"
1099 test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}"
1101 AC_MSG_CHECKING(where we will install curses.h)
1102 test "$with_overwrite" = no && \
1103 test "x$includedir" = 'x${prefix}/include' && \
1104 includedir='$(prefix)/include/ncurses'${LIB_SUFFIX}
1105 AC_MSG_RESULT($includedir)
1107 AC_SUBST(EXTRA_LIBS)
1108 AC_SUBST(TINFO_LIST)
1109 AC_SUBST(SHLIB_LIST)
1111 ### Set up low-level terminfo dependencies for makefiles. Note that we
1112 ### could override this.
1113 if test "$with_termlib" = yes ; then
1114 TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}"
1115 if test "$DFT_LWR_MODEL" = "libtool"; then
1116 TEST_ARGS="${TEST_DEPS}"
1118 TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}"
1121 PROG_DEPS="$TEST_DEPS"
1122 PROG_ARGS="$TEST_ARGS"
1124 ### Construct the list of subdirectories for which we'll customize makefiles
1125 ### with the appropriate compile-rules.
1127 CF_SRC_MODULES($modules_to_build)
1130 ### Now that we're done running tests, add the compiler-warnings, if any
1131 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
1133 ################################################################################
1135 include/MKterm.h.awk \
1139 misc/run_tic.sh:misc/run_tic.in \
1144 ### Special initialization commands, used to pass information from the
1145 ### configuration-run into config.status
1148 CF_LIST_MODELS="$cf_list_models"
1149 DFT_LWR_MODEL="$DFT_LWR_MODEL"
1150 LDCONFIG="$LDCONFIG"
1151 LIB_NAME="$LIB_NAME"
1152 LIB_SUFFIX="$LIB_SUFFIX"
1153 LIB_SUBSETS="$LIB_SUBSETS"
1154 LIB_TRACING="$LIB_TRACING"
1155 SRC_SUBDIRS="$SRC_SUBDIRS"
1156 TERMINFO="$TERMINFO"
1157 TINFO_NAME="$TINFO_NAME"
1158 WITH_ECHO="$with_echo"
1159 WITH_OVERWRITE="$with_overwrite"
1160 WITH_CURSES_H="$with_curses_h"
1161 cf_cv_abi_version="$cf_cv_abi_version"
1162 cf_cv_do_symlinks="$cf_cv_do_symlinks"
1163 cf_cv_rel_version="$cf_cv_rel_version"
1164 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
1165 cf_cv_system_name="$cf_cv_system_name"
1166 cf_with_cxx_binding="$cf_with_cxx_binding"
1167 cf_cv_shlib_version="$cf_cv_shlib_version"
1171 ${MAKE-make} preinstall