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.217 2000/10/08 01:02:43 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.217 $)
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 modules_to_build="ncurses"
166 if test "X$cf_with_progs" != Xno ; then
167 modules_to_build="$modules_to_build progs tack"
169 modules_to_build="$modules_to_build panel menu form"
175 AC_SYS_LONG_FILE_NAMES
176 CF_MIXEDCASE_FILENAMES
180 AC_CHECK_PROGS(LINT, tdlint lint alint)
181 AC_CHECK_PROGS(MAN, man man_db)
184 dnl These are standard among *NIX systems, but not when cross-compiling
185 CF_SUBST(loader,LD,ld)
186 CF_SUBST(archiver,AR,ar)
187 CF_SUBST(archiver options,AR_OPTS,rv)
191 dnl Special option for use by system-builders: the install-prefix is used to
192 dnl adjust the location into which the actual install is done, so that an
193 dnl archive can be built without modifying the host system's configuration.
194 AC_MSG_CHECKING(if you have specified an install-prefix)
195 AC_ARG_WITH(install-prefix,
196 [ --with-install-prefix prefixes actual install-location],
197 [case "$withval" in #(vi
200 *) DESTDIR="$withval"
203 AC_MSG_RESULT($DESTDIR)
206 ###############################################################################
207 CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
209 ### Options to allow the user to specify the set of libraries which are used.
210 ### Use "--without-normal --with-shared" to allow the default model to be
211 ### shared, for example.
213 AC_SUBST(cf_list_models)dnl the complete list of models ("normal debug")
215 AC_MSG_CHECKING(if you want to build shared libraries)
217 [ --with-shared generate shared-libraries],
218 [with_shared=$withval],
220 AC_MSG_RESULT($with_shared)
221 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
223 AC_MSG_CHECKING(if you want to build static libraries)
225 [ --with-normal generate normal-libraries (default)],
226 [with_normal=$withval],
228 AC_MSG_RESULT($with_normal)
229 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
231 AC_MSG_CHECKING(if you want to build debug libraries)
233 [ --with-debug generate debug-libraries (default)],
234 [with_debug=$withval],
236 AC_MSG_RESULT($with_debug)
237 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
239 AC_MSG_CHECKING(if you want to build profiling libraries)
241 [ --with-profile generate profile-libraries],
242 [with_profile=$withval],
244 AC_MSG_RESULT($with_profile)
245 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
247 ###############################################################################
249 AC_MSG_CHECKING(for specified models)
250 test -z "$cf_list_models" && cf_list_models=normal
251 AC_MSG_RESULT($cf_list_models)
253 ### Use the first model as the default, and save its suffix for use in building
254 ### up test-applications.
255 AC_MSG_CHECKING(for default model)
256 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'`
257 AC_MSG_RESULT($DFT_LWR_MODEL)
259 CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
261 AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal")
262 AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL")
271 CF_LIB_PREFIX(cf_prefix)
272 LIB_PREFIX=$cf_prefix
278 ###############################################################################
280 AC_MSG_CHECKING(if you want to build a separate terminfo library)
282 [ --with-termlib generate separate terminfo library],
283 [with_termlib=$withval],
285 AC_MSG_RESULT($with_termlib)
287 ### Checks for special libraries, must be done up-front.
288 AC_MSG_CHECKING(if you want to link with dbmalloc for testing)
289 AC_ARG_WITH(dbmalloc,
290 [ --with-dbmalloc test: use Conor Cahill's dbmalloc library],
291 [with_dbmalloc=$withval],
293 AC_MSG_RESULT($with_dbmalloc)
294 if test "$with_dbmalloc" = yes ; then
295 AC_CHECK_LIB(dbmalloc,debug_malloc)
298 AC_MSG_CHECKING(if you want to link with dmalloc for testing)
300 [ --with-dmalloc test: use Gray Watson's dmalloc library],
301 [with_dmalloc=$withval],
303 AC_MSG_RESULT($with_dmalloc)
304 if test "$with_dmalloc" = yes ; then
305 AC_CHECK_LIB(dmalloc,dmalloc_debug)
309 AC_MSG_CHECKING(if you want to link with the gpm mouse library)
311 [ --with-gpm use Alessandro Rubini's GPM library],
314 AC_MSG_RESULT($with_gpm)
315 if test "$with_gpm" = yes ; then
316 AC_CHECK_LIB(gpm,Gpm_Open,[
317 EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS"
318 SHLIB_LIST="-lgpm $SHLIB_LIST"
319 AC_DEFINE(HAVE_LIBGPM)
320 AC_CHECK_HEADERS(gpm.h)
321 ],AC_MSG_WARN(Cannot link with gpm library - read the FAQ))
324 dnl Not all ports of gcc support the -g option
326 if test X"$CC_G_OPT" = X"" ; then
328 test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
332 if test X"$CXX_G_OPT" = X"" ; then
334 test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
338 AC_MSG_CHECKING(for default loader flags)
339 case $DFT_LWR_MODEL in
340 normal) LD_MODEL='' ;;
341 debug) LD_MODEL=$CC_G_OPT ;;
342 profile) LD_MODEL='-pg';;
343 shared) LD_MODEL='' ;;
345 AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
346 AC_MSG_RESULT($LD_MODEL)
348 AC_MSG_CHECKING(if rpath option should be used)
350 [ --enable-rpath use rpath option when generating shared libraries],
351 [cf_cv_ld_rpath=$enableval],
353 AC_MSG_RESULT($cf_cv_ld_rpath)
356 if test "$CC_SHARED_OPTS" = "unknown"; then
357 for model in $cf_list_models; do
358 if test "$model" = "shared"; then
359 AC_ERROR(Shared libraries are not supported in this version)
364 ###############################################################################
365 CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
367 ### use option --disable-overwrite to leave out the link to -lcurses
368 AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
369 AC_ARG_ENABLE(overwrite,
370 [ --disable-overwrite leave out the link to -lcurses],
371 [with_overwrite=$enableval],
372 [with_overwrite=yes])
373 AC_MSG_RESULT($with_overwrite)
375 AC_MSG_CHECKING(if external terminfo-database is used)
376 AC_ARG_ENABLE(database,
377 [ --disable-database use only built-in data],
378 [use_database=$enableval],
380 AC_MSG_RESULT($use_database)
382 case $host_os in #(vi
384 TERMINFO_SRC='${top_srcdir}/misc/emx.src'
387 TERMINFO_SRC='${top_srcdir}/misc/terminfo.src'
390 AC_SUBST(TERMINFO_SRC)
392 if test "$use_database" != no ; then
393 AC_DEFINE(USE_DATABASE)
394 AC_MSG_CHECKING(which terminfo source-file will be installed)
395 AC_ARG_ENABLE(database,
396 [ --with-database=XXX specify terminfo source to install],
397 [TERMINFO_SRC=$withval])
398 AC_MSG_RESULT($TERMINFO_SRC)
401 AC_MSG_CHECKING(for list of fallback descriptions)
402 AC_ARG_WITH(fallbacks,
403 [ --with-fallbacks=XXX specify list of fallback terminal descriptions],
404 [with_fallback=$withval],
406 AC_MSG_RESULT($with_fallback)
407 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'`
408 AC_SUBST(FALLBACK_LIST)
410 if test "$use_database" = no ; then
411 if test -z $with_fallback ; then
412 AC_ERROR(You have disabled the database w/o specifying fallbacks)
414 TERMINFO="${datadir}/terminfo"
417 AC_MSG_CHECKING(for list of terminfo directories)
418 CF_WITH_PATHLIST(terminfo-dirs,
419 [ --with-terminfo-dirs=XXX specify list of terminfo directories],
423 AC_MSG_RESULT($TERMINFO_DIRS)
424 test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS")
426 AC_MSG_CHECKING(for default terminfo directory)
427 CF_WITH_PATH(default-terminfo-dir,
428 [ --with-default-terminfo-dir=DIR default terminfo directory],
432 AC_MSG_RESULT($TERMINFO)
433 AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO")
439 ### use option --disable-big-core to make tic run on small machines
440 ### We need 4Mb, check if we can allocate 50% more than that.
441 AC_MSG_CHECKING(if big-core option selected)
442 AC_ARG_ENABLE(big-core,
443 [ --disable-big-core assume machine has little memory],
444 [with_big_core=$enableval],
449 unsigned long n = 6000000L;
457 [with_big_core=no])])
458 AC_MSG_RESULT($with_big_core)
459 test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
461 ### use option --enable-termcap to compile in the termcap fallback support
462 AC_MSG_CHECKING(if you want termcap-fallback support)
463 AC_ARG_ENABLE(termcap,
464 [ --enable-termcap compile in termcap fallback support],
465 [with_termcap=$enableval],
467 AC_MSG_RESULT($with_termcap)
469 if test "$with_termcap" != "yes" ; then
470 AC_DEFINE(PURE_TERMINFO)
473 ### use option --enable-getcap to use a hacked getcap for reading termcaps
474 AC_MSG_CHECKING(if fast termcap-loader is needed)
475 AC_ARG_ENABLE(getcap,
476 [ --enable-getcap fast termcap load, no xrefs to terminfo],
477 [with_getcap=$enableval],
479 AC_MSG_RESULT($with_getcap)
480 test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP)
482 AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
483 AC_ARG_ENABLE(getcap-cache,
484 [ --enable-getcap-cache cache translated termcaps in ~/.terminfo],
485 [with_getcap_cache=$enableval],
486 [with_getcap_cache=no])
487 AC_MSG_RESULT($with_getcap_cache)
488 test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE)
492 ### Use option --enable-symlinks to make tic use symlinks, not hard links
493 ### to reduce storage requirements for the terminfo database.
499 if test "$ac_cv_func_link" != yes ; then
500 AC_MSG_CHECKING(if tic should use symbolic links)
501 if test "$ac_cv_func_symlink" = yes ; then
506 AC_MSG_RESULT($with_symlinks)
507 elif test "$ac_cv_func_symlink" != yes ; then
508 AC_MSG_CHECKING(if tic should use hard links)
509 if test "$ac_cv_func_link" = yes ; then
514 AC_MSG_RESULT($with_links)
516 AC_MSG_CHECKING(if tic should use symbolic links)
517 AC_ARG_ENABLE(symlinks,
518 [ --enable-symlinks make tic use symbolic links not hard links],
519 [with_symlinks=$enableval],
521 AC_MSG_RESULT($with_symlinks)
524 test "$with_links" = yes && AC_DEFINE(USE_LINKS)
525 test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS)
527 ### use option --enable-broken-linker to force on use of broken-linker support
528 AC_MSG_CHECKING(if you want broken-linker support code)
529 AC_ARG_ENABLE(broken_linker,
530 [ --enable-broken_linker compile with broken-linker support code],
531 [with_broken_linker=$enableval],
532 [with_broken_linker=$BROKEN_LINKER])
533 AC_MSG_RESULT($with_broken_linker)
534 test "$with_broken_linker" = yes && AC_DEFINE(BROKEN_LINKER)
536 ### use option --enable-bsdpad to have tputs process BSD-style prefix padding
537 AC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
538 AC_ARG_ENABLE(bsdpad,
539 [ --enable-bsdpad recognize BSD-style prefix padding],
540 [with_bsdpad=$enableval],
542 AC_MSG_RESULT($with_bsdpad)
543 test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS)
545 ### Enable compiling-in rcs id's
546 AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
548 [ --with-rcs-ids compile-in RCS identifiers],
549 [with_rcs_ids=$withval],
551 AC_MSG_RESULT($with_rcs_ids)
552 test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
554 ###############################################################################
555 CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ])
557 ###############################################################################
558 CF_HELP_MESSAGE(Extensions:)
560 ### Note that some functions (such as const) are normally disabled anyway.
561 AC_MSG_CHECKING(if you want to build with function extensions)
562 AC_ARG_ENABLE(ext-funcs,
563 [ --disable-ext-funcs disable function-extensions],
564 [with_ext_funcs=$enableval],
565 [with_ext_funcs=yes])
566 AC_MSG_RESULT($with_ext_funcs)
567 if test "$with_ext_funcs" = yes ; then
568 AC_DEFINE(HAVE_CURSES_VERSION)
569 AC_DEFINE(HAVE_HAS_KEY)
570 AC_DEFINE(HAVE_RESIZETERM)
571 AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
572 AC_DEFINE(HAVE_WRESIZE)
573 AC_DEFINE(NCURSES_EXT_FUNCS)
576 ### use option --enable-const to turn on use of const beyond that in XSI.
577 AC_MSG_CHECKING(for extended use of const keyword)
579 [ --enable-const compile with extra/non-standard const],
580 [with_ext_const=$enableval],
582 AC_MSG_RESULT($with_ext_const)
583 NCURSES_CONST='/*nothing*/'
584 if test "$with_ext_const" = yes ; then
587 AC_SUBST(NCURSES_CONST)
589 AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code)
590 AC_ARG_ENABLE(no-padding,
591 [ --enable-no-padding compile with \$NCURSES_NO_PADDING code],
592 [with_no_padding=$enableval],
593 [with_no_padding=$with_ext_funcs])
594 AC_MSG_RESULT($with_no_padding)
595 test "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING)
597 ### use option --enable-sigwinch to turn on use of SIGWINCH logic
598 AC_MSG_CHECKING(if you want SIGWINCH handler)
599 AC_ARG_ENABLE(sigwinch,
600 [ --enable-sigwinch compile with SIGWINCH handler],
601 [with_sigwinch=$enableval],
602 [with_sigwinch=$with_ext_funcs])
603 AC_MSG_RESULT($with_sigwinch)
604 test "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH)
606 ### use option --enable-tcap-names to allow user to define new capabilities
607 AC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap)
608 AC_ARG_ENABLE(tcap-names,
609 [ --enable-tcap-names compile with user-definable terminal capabilities],
610 [with_tcap_names=$enableval],
611 [with_tcap_names=$with_ext_funcs])
612 AC_MSG_RESULT($with_tcap_names)
614 test "$with_tcap_names" = yes && NCURSES_XNAMES=1
615 AC_SUBST(NCURSES_XNAMES)
617 ###############################################################################
618 # These options are relatively safe to experiment with.
619 CF_HELP_MESSAGE(Development Code:)
620 AC_MSG_CHECKING(if you want all development code)
622 [ --with-develop enable all development options],
623 [with_develop=$withval],
625 AC_MSG_RESULT($with_develop)
627 ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment
628 AC_MSG_CHECKING(if you want colorfgbg code)
629 AC_ARG_ENABLE(hard-tabs,
630 [ --enable-colorfgbg compile with \$COLORFGBG code],
631 [with_colorfgbg=$enableval],
632 [with_colorfgbg=$with_develop])
633 AC_MSG_RESULT($with_colorfgbg)
634 test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
636 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize
637 AC_MSG_CHECKING(if you want hard-tabs code)
638 AC_ARG_ENABLE(hard-tabs,
639 [ --enable-hard-tabs compile with hard-tabs code],
640 [with_hardtabs=$enableval],
641 [with_hardtabs=$with_develop])
642 AC_MSG_RESULT($with_hardtabs)
643 test "$with_hardtabs" = yes && AC_DEFINE(USE_HARD_TABS)
645 AC_MSG_CHECKING(if you want to use restrict environment when running as root)
646 AC_ARG_ENABLE(root-environ,
647 [ --disable-root-environ limit environment when running as root],
648 [with_root_environ=$enableval],
649 [with_root_environ=yes])
650 AC_MSG_RESULT($with_root_environ)
651 test "$with_root_environ" = yes && AC_DEFINE(USE_ROOT_ENVIRON)
653 ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize
654 AC_MSG_CHECKING(if you want limited support for xmc)
655 AC_ARG_ENABLE(xmc-glitch,
656 [ --enable-xmc-glitch compile with limited support for xmc],
657 [with_xmc_glitch=$enableval],
658 [with_xmc_glitch=$with_develop])
659 AC_MSG_RESULT($with_xmc_glitch)
660 test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT)
662 ###############################################################################
663 # These are just experimental, probably should not be in a package:
664 CF_HELP_MESSAGE(Experimental Code:)
666 AC_MSG_CHECKING(if you do not want to assume colors are white-on-black)
667 AC_ARG_ENABLE(assumed-color,
668 [ --disable-assumed-color do not assume anything about default-colors],
669 [with_assumed_color=$enableval],
670 [with_assumed_color=yes])
671 AC_MSG_RESULT($with_assumed_color)
672 test "$with_assumed_color" = yes && AC_DEFINE(USE_ASSUMED_COLOR)
674 ### use option --enable-hashmap to turn on use of hashmap scrolling logic
675 AC_MSG_CHECKING(if you want hashmap scrolling-optimization code)
676 AC_ARG_ENABLE(hashmap,
677 [ --disable-hashmap compile without hashmap scrolling-optimization],
678 [with_hashmap=$enableval],
680 AC_MSG_RESULT($with_hashmap)
681 test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP)
683 AC_MSG_CHECKING(if you want experimental safe-sprintf code)
684 AC_ARG_ENABLE(safe-sprintf,
685 [ --enable-safe-sprintf compile with experimental safe-sprintf code],
686 [with_safe_sprintf=$enableval],
687 [with_safe_sprintf=no])
688 AC_MSG_RESULT($with_safe_sprintf)
689 test "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF)
691 ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
692 # when hashmap is used scroll hints are useless
693 if test "$with_hashmap" = no ; then
694 AC_MSG_CHECKING(if you want to experiment without scrolling-hints code)
695 AC_ARG_ENABLE(scroll-hints,
696 [ --disable-scroll-hints compile without scroll-hints code],
697 [with_scroll_hints=$enableval],
698 [with_scroll_hints=yes])
699 AC_MSG_RESULT($with_scroll_hints)
700 test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS)
703 ### use option --enable-widec to turn on use of wide-character support
704 AC_MSG_CHECKING(if you want experimental wide-character code)
706 [ --enable-widec compile with experimental wide-char/UTF-8 code],
707 [with_widec=$enableval],
709 AC_MSG_RESULT($with_widec)
710 if test "$with_widec" = yes ; then
711 LIB_SUFFIX="w${LIB_SUFFIX}"
712 AC_DEFINE(USE_WIDEC_SUPPORT)
715 ###############################################################################
716 CF_HELP_MESSAGE(Testing/development Options:)
718 ### use option --disable-echo to suppress full display compiling commands
719 AC_MSG_CHECKING(if you want to display full commands during build)
721 [ --enable-echo build: display "compiling" commands (default)],
722 [with_echo=$enableval],
724 if test "$with_echo" = yes; then
727 ECHO_LINK='@ echo linking $@ ... ;'
729 AC_MSG_RESULT($with_echo)
732 ### use option --enable-warnings to turn on all gcc warnings
733 AC_MSG_CHECKING(if you want to see compiler warnings)
734 AC_ARG_ENABLE(warnings,
735 [ --enable-warnings build: turn on GCC compiler warnings],
736 [with_warnings=$enableval])
737 if test -n "$with_warnings"; then
738 ADAFLAGS="$ADAFLAGS -gnatg"
741 AC_MSG_RESULT($with_warnings)
744 ### use option --enable-assertions to turn on generation of assertion code
745 AC_MSG_CHECKING(if you want to enable runtime assertions)
746 AC_ARG_ENABLE(assertions,
747 [ --enable-assertions test: turn on generation of assertion code],
748 [with_assertions=$enableval],
749 [with_assertions=no])
750 AC_MSG_RESULT($with_assertions)
753 if test "$with_assertions" = no
756 CPPFLAGS="$CPPFLAGS -DNDEBUG"
758 ADAFLAGS="$ADAFLAGS -gnata"
762 ### use option --disable-leaks to suppress "permanent" leaks, for testing
764 [ --disable-leaks test: suppress permanent memory-leaks],
765 [test "$enableval" = no && AC_DEFINE(NO_LEAKS)])
766 AC_DEFINE(HAVE_NC_ALLOC_H)
768 ### use option --enable-expanded to generate certain macros as functions
769 AC_ARG_ENABLE(expanded,
770 [ --enable-expanded test: generate functions for certain macros],
771 [test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)])
773 ### use option --disable-macros to suppress macros in favor of functions
774 AC_ARG_ENABLE(macros,
775 [ --disable-macros test: use functions rather than macros],
776 [test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)])
778 ### Checks for libraries.
779 AC_CHECK_FUNC(gettimeofday,
780 AC_DEFINE(HAVE_GETTIMEOFDAY),[
782 AC_CHECK_LIB(bsd, gettimeofday,
783 AC_DEFINE(HAVE_GETTIMEOFDAY)
784 LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
786 CF_MATH_LIB(MATH_LIB,sin(x))
789 ### Checks for header files.
794 dnl These are some other potentially nonportable headers.
813 # check for ISC (this may also define _POSIX_SOURCE)
814 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
815 if test "$ISC" = yes ; then
816 AC_CHECK_LIB(cposix,main)
817 AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
822 ### checks for compiler characteristics
826 test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS)
831 ### Checks for external-data
835 ### Checks for library functions.
861 if test "$with_getcap" = "yes" ; then
869 dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
870 if test "$cross_compiling" = yes ; then
871 AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
873 AC_FUNC_SETVBUF_REVERSED
881 dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
882 if test -z "$cf_user_CFLAGS" ; then
883 CF_STRIP_G_OPT(CFLAGS)
884 CF_STRIP_G_OPT(CXXFLAGS)
887 dnl Check for C++ compiler characteristics (and ensure that it's there!)
888 CF_BOOL_DECL(cf_cv_cc_bool_type)
889 if test -n "$CXX" ; then
892 if test "$GXX" = yes; then
893 case "`${CXX-g++} --version`" in
907 AC_CHECK_HEADERS(typeinfo)
912 case $cf_cv_system_name in #(vi
922 # Just because we are not configuring against C++ right now does not
923 # mean that a user will not want to use C++. Some distributors disable
924 # the C++ portion of this configuration as a shortcut (or just to avoid
925 # compiling the demo in the c++ directory). So we need a reasonable
926 # default for the 'bool' type.
928 # Caveat: since the storage of the bool type is not standardized, it
931 AC_MSG_CHECKING(for fallback type of bool)
932 case "$host_cpu" in #(vi
933 i?86) cf_cv_type_of_bool=char ;; #(vi
934 *) cf_cv_type_of_bool=int ;;
936 AC_MSG_RESULT($cf_cv_type_of_bool)
940 CF_HELP_MESSAGE(Ada95 Binding Options:)
942 dnl Check for availability of GNU Ada Translator (GNAT).
943 dnl At the moment we support no other Ada95 compiler.
944 if test "$cf_with_ada" != "no" ; then
946 AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
947 if test "$ac_cv_prog_gnat_exists" = no; then
951 AC_CHECK_PROG(M4_exists, m4, yes, no)
952 if test "$ac_cv_prog_M4_exists" = no; then
953 cf_cv_prog_gnat_correct=no
954 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
956 if test "$cf_cv_prog_gnat_correct" = yes; then
957 AC_MSG_CHECKING(if GNAT works)
958 CF_GNAT_TRY_RUN([procedure conftest;],
961 procedure conftest is
963 Text_IO.Put ("Hello World");
965 GNAT.OS_Lib.OS_Exit (0);
966 end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
967 AC_MSG_RESULT($cf_cv_prog_gnat_correct)
970 if test "$cf_cv_prog_gnat_correct" = yes; then
971 ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
973 AC_ARG_WITH(ada-compiler,
974 [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
975 [cf_ada_compiler=$withval],
976 [cf_ada_compiler=gnatmake])
978 cf_ada_package=terminal_interface
980 AC_SUBST(cf_ada_make)
981 AC_SUBST(cf_ada_compiler)
982 AC_SUBST(cf_ada_package)
984 AC_SUBST(cf_compile_generics)
985 AC_SUBST(cf_generic_objects)
987 CF_WITH_PATH(ada-include,
988 [ --with-ada-include=DIR Ada includes are in DIR],
990 PREFIX/lib/ada/adainclude,
991 [$]prefix/lib/ada/adainclude)
992 AC_SUBST(ADA_INCLUDE)
994 CF_WITH_PATH(ada-objects,
995 [ --with-ada-objects=DIR Ada objects are in DIR],
997 PREFIX/lib/ada/adalib,
998 [$]prefix/lib/ada/adalib)
999 AC_SUBST(ADA_OBJECTS)
1004 ### It's not possible to appease gcc 2.6.3's conversion-warnings if we're
1005 ### using a 'char' for bools. gcc 2.7.0's conversion-warnings are broken too
1006 ### badly to consider using for development purposes, but 2.5.8 is okay.
1007 if test -n "$with_warnings"; then
1008 if test "$GCC" = yes; then
1009 case "`$CC --version`" in
1011 if test "$cf_cv_type_of_bool" != "char"; then
1012 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
1016 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
1022 ### Construct the library-subsets, if any, from this set of keywords:
1023 ### none, base, ext_funcs, termlib.
1024 AC_MSG_CHECKING(for library subsets)
1025 if test "$with_termlib" = yes ; then
1026 LIB_SUBSETS="termlib "
1028 LIB_SUBSETS="termlib+"
1030 LIB_SUBSETS="${LIB_SUBSETS}base"
1031 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
1032 AC_MSG_RESULT($LIB_SUBSETS)
1041 ### Construct the list of include-directories to be generated
1045 ### Build up pieces for makefile rules
1046 AC_MSG_CHECKING(default library suffix)
1047 CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
1048 AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
1049 AC_MSG_RESULT($DFT_ARG_SUFFIX)
1051 AC_MSG_CHECKING(default library-dependency suffix)
1052 CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_DEP_SUFFIX)dnl
1053 AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
1054 AC_MSG_RESULT($DFT_DEP_SUFFIX)
1056 AC_MSG_CHECKING(default object directory)
1057 CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
1058 AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
1059 AC_MSG_RESULT($DFT_OBJ_SUBDIR)
1061 TINFO_LIST="$SHLIB_LIST"
1062 test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}"
1064 AC_MSG_CHECKING(where we will install curses.h)
1065 test "$with_overwrite" = no && \
1066 test "x$includedir" = 'x${prefix}/include' && \
1067 includedir='$(prefix)/include/ncurses'${LIB_SUFFIX}
1068 AC_MSG_RESULT($includedir)
1070 AC_SUBST(EXTRA_LIBS)
1071 AC_SUBST(TINFO_LIST)
1072 AC_SUBST(SHLIB_LIST)
1074 ### Set up low-level terminfo dependencies for makefiles. Note that we
1075 ### could override this.
1076 if test "$with_termlib" = yes ; then
1077 TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}"
1078 TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}"
1080 PROG_DEPS="$TEST_DEPS"
1081 PROG_ARGS="$TEST_ARGS"
1083 ### Construct the list of subdirectories for which we'll customize makefiles
1084 ### with the appropriate compile-rules.
1086 CF_SRC_MODULES($modules_to_build)
1089 ### Now that we're done running tests, add the compiler-warnings, if any
1090 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
1092 ################################################################################
1094 include/MKterm.h.awk \
1098 misc/run_tic.sh:misc/run_tic.in \
1103 ### Special initialization commands, used to pass information from the
1104 ### configuration-run into config.status
1107 CF_LIST_MODELS="$cf_list_models"
1108 DFT_LWR_MODEL="$DFT_LWR_MODEL"
1109 LDCONFIG="$LDCONFIG"
1110 LIB_NAME="$LIB_NAME"
1111 LIB_SUFFIX="$LIB_SUFFIX"
1112 LIB_SUBSETS="$LIB_SUBSETS"
1113 LIB_TRACING="$LIB_TRACING"
1114 SRC_SUBDIRS="$SRC_SUBDIRS"
1115 TERMINFO="$TERMINFO"
1116 TINFO_NAME="$TINFO_NAME"
1117 WITH_ECHO="$with_echo"
1118 WITH_OVERWRITE="$with_overwrite"
1119 cf_cv_abi_version="$cf_cv_abi_version"
1120 cf_cv_do_symlinks="$cf_cv_do_symlinks"
1121 cf_cv_rel_version="$cf_cv_rel_version"
1122 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
1123 cf_cv_system_name="$cf_cv_system_name"
1124 cf_with_cxx_binding="$cf_with_cxx_binding"
1125 cf_cv_shlib_version="$cf_cv_shlib_version"
1129 ${MAKE-make} preinstall