1 dnl***************************************************************************
2 dnl Copyright (c) 1998,1999,2000,2001 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.233 2001/04/07 22:09:57 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.233 $)
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 if test x"$glibc_add_on" = "xyes" ; then
67 rm -f $srcdir/Makefile
68 cp $srcdir/Makefile.glibc $srcdir/Makefile
69 echo "ncurses `grep \"^[[ ]]*ncurses-version[[ ]]*=.*$\" \
70 $srcdir/Makefile | sed -e \
71 's/^[[ ]]*ncurses-version[[ ]]*=[[ ]]*\([[^ ^ ]]*\)[[ ]]*$/\1/'`" > $srcdir/Banner
75 ### Save the given $CFLAGS to allow user-override.
76 cf_user_CFLAGS="$CFLAGS"
78 ### Default install-location
81 ### Checks for programs.
83 if test "$GCC" = yes ; then
84 AC_MSG_CHECKING(version of gcc)
87 if test "$host" != $build; then
88 AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)
94 AC_PROG_GCC_TRADITIONAL
99 case "$cf_cv_system_name" in
101 test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
103 *) LDPATH=$PATH:/sbin:/usr/sbin
104 AC_PATH_PROG(LDCONFIG,ldconfig,,$LDPATH)
109 dnl DEFECT in autoconf 2.12: an attempt to set policy, this breaks the
110 dnl configure script by not letting us test if C++
111 dnl is present, making this option necessary.
112 AC_MSG_CHECKING(if you want to ensure bool is consistent with C++)
114 [ --without-cxx do not adjust ncurses bool to match C++],
115 [cf_with_cxx=$withval],
117 AC_MSG_RESULT($cf_with_cxx)
118 if test "X$cf_with_cxx" = Xno ; then
122 pushdef([AC_MSG_ERROR],
123 [AC_MSG_RESULT([You don't have any C++ compiler, too bad]); dnl
124 cf_with_cxx=no; CXX=""; GXX="";])dnl
126 popdef([AC_MSG_ERROR])dnl
129 if test "$GXX" = yes; then
130 case "`${CXX-g++} --version`" in
132 GXX=""; CXX=""; ac_cv_prog_gxx=no
134 echo No: templates do not work
139 AC_MSG_CHECKING(if you want to build C++ binding and demo)
140 AC_ARG_WITH(cxx-binding,
141 [ --without-cxx-binding do not build C++ binding and demo],
142 [cf_with_cxx_binding=$withval],
143 [cf_with_cxx_binding=$cf_with_cxx])
144 AC_MSG_RESULT($cf_with_cxx_binding)
146 AC_MSG_CHECKING(if you want to build with Ada95)
148 [ --without-ada suppress check for Ada95, don't build demo],
149 [cf_with_ada=$withval],
151 AC_MSG_RESULT($cf_with_ada)
153 AC_MSG_CHECKING(if you want to build programs such as tic)
155 [ --without-progs suppress build with programs (e.g., tic)],
156 [cf_with_progs=$withval],
158 AC_MSG_RESULT($cf_with_progs)
160 AC_MSG_CHECKING(if you wish to install curses.h)
161 AC_ARG_WITH(curses-h,
162 [ --without-curses-h install curses.h as ncurses.h only],
163 [with_curses_h=$withval],
165 AC_MSG_RESULT($with_curses_h)
167 modules_to_build="ncurses"
168 if test "X$cf_with_progs" != Xno ; then
169 modules_to_build="$modules_to_build progs tack"
171 modules_to_build="$modules_to_build panel menu form"
177 AC_SYS_LONG_FILE_NAMES
178 CF_MIXEDCASE_FILENAMES
182 AC_CHECK_PROGS(LINT, tdlint lint alint)
183 AC_CHECK_PROGS(MAN, man man_db)
186 dnl These are standard among *NIX systems, but not when cross-compiling
187 CF_SUBST(loader,LD,ld)
188 CF_SUBST(archiver,AR,ar)
189 CF_SUBST(archiver options,AR_OPTS,rv)
193 dnl Special option for use by system-builders: the install-prefix is used to
194 dnl adjust the location into which the actual install is done, so that an
195 dnl archive can be built without modifying the host system's configuration.
196 AC_MSG_CHECKING(if you have specified an install-prefix)
197 AC_ARG_WITH(install-prefix,
198 [ --with-install-prefix prefixes actual install-location],
199 [case "$withval" in #(vi
202 *) DESTDIR="$withval"
205 AC_MSG_RESULT($DESTDIR)
208 ###############################################################################
209 CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
211 ### Options to allow the user to specify the set of libraries which are used.
212 ### Use "--without-normal --with-shared" to allow the default model to be
213 ### shared, for example.
215 AC_SUBST(cf_list_models)dnl the complete list of models ("normal debug")
217 AC_MSG_CHECKING(if you want to build libraries with libtool)
219 [ --with-libtool generate libraries with libtool],
220 [with_libtool=$withval],
222 AC_MSG_RESULT($with_libtool)
223 if test "$with_libtool" = "yes"; then
224 cf_list_models="$cf_list_models libtool"
225 test -z "$LIBTOOL" && LIBTOOL=libtool
231 AC_MSG_CHECKING(if you want to build shared libraries)
233 [ --with-shared generate shared-libraries],
234 [with_shared=$withval],
236 AC_MSG_RESULT($with_shared)
237 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
239 AC_MSG_CHECKING(if you want to build static libraries)
241 [ --with-normal generate normal-libraries (default)],
242 [with_normal=$withval],
244 AC_MSG_RESULT($with_normal)
245 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
247 AC_MSG_CHECKING(if you want to build debug libraries)
249 [ --with-debug generate debug-libraries (default)],
250 [with_debug=$withval],
252 AC_MSG_RESULT($with_debug)
253 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
255 AC_MSG_CHECKING(if you want to build profiling libraries)
257 [ --with-profile generate profile-libraries],
258 [with_profile=$withval],
260 AC_MSG_RESULT($with_profile)
261 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
263 ###############################################################################
265 AC_MSG_CHECKING(for specified models)
266 test -z "$cf_list_models" && cf_list_models=normal
267 dnl If we use libtool to generate libraries, then it must be the only
269 test "$with_libtool" = "yes" && cf_list_models=libtool
270 AC_MSG_RESULT($cf_list_models)
272 ### Use the first model as the default, and save its suffix for use in building
273 ### up test-applications.
274 AC_MSG_CHECKING(for default model)
275 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'`
276 AC_MSG_RESULT($DFT_LWR_MODEL)
278 CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
280 AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal")
281 AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL")
290 CF_LIB_PREFIX(cf_prefix)
291 LIB_PREFIX=$cf_prefix
297 ###############################################################################
299 AC_MSG_CHECKING(if you want to build a separate terminfo library)
301 [ --with-termlib generate separate terminfo library],
302 [with_termlib=$withval],
304 AC_MSG_RESULT($with_termlib)
306 ### Checks for special libraries, must be done up-front.
307 AC_MSG_CHECKING(if you want to link with dbmalloc for testing)
308 AC_ARG_WITH(dbmalloc,
309 [ --with-dbmalloc test: use Conor Cahill's dbmalloc library],
310 [with_dbmalloc=$withval],
312 AC_MSG_RESULT($with_dbmalloc)
313 if test "$with_dbmalloc" = yes ; then
314 AC_CHECK_LIB(dbmalloc,debug_malloc)
317 AC_MSG_CHECKING(if you want to link with dmalloc for testing)
319 [ --with-dmalloc test: use Gray Watson's dmalloc library],
320 [with_dmalloc=$withval],
322 AC_MSG_RESULT($with_dmalloc)
323 if test "$with_dmalloc" = yes ; then
324 AC_CHECK_LIB(dmalloc,dmalloc_debug)
328 AC_MSG_CHECKING(if you want to link with the gpm mouse library)
330 [ --with-gpm use Alessandro Rubini's GPM library],
333 AC_MSG_RESULT($with_gpm)
334 if test "$with_gpm" = yes ; then
335 AC_CHECK_LIB(gpm,Gpm_Open,[
336 EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS"
337 SHLIB_LIST="-lgpm $SHLIB_LIST"
338 AC_DEFINE(HAVE_LIBGPM)
339 AC_CHECK_HEADERS(gpm.h)
340 ],AC_MSG_WARN(Cannot link with gpm library - read the FAQ))
343 dnl Not all ports of gcc support the -g option
345 if test X"$CC_G_OPT" = X"" ; then
347 test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
351 if test X"$CXX_G_OPT" = X"" ; then
353 test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
357 AC_MSG_CHECKING(for default loader flags)
358 case $DFT_LWR_MODEL in
359 libtool) LD_MODEL='' ;;
360 normal) LD_MODEL='' ;;
361 debug) LD_MODEL=$CC_G_OPT ;;
362 profile) LD_MODEL='-pg';;
363 shared) LD_MODEL='' ;;
365 AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
366 AC_MSG_RESULT($LD_MODEL)
368 AC_MSG_CHECKING(if rpath option should be used)
370 [ --enable-rpath use rpath option when generating shared libraries],
371 [cf_cv_ld_rpath=$enableval],
373 AC_MSG_RESULT($cf_cv_ld_rpath)
376 if test "$CC_SHARED_OPTS" = "unknown"; then
377 for model in $cf_list_models; do
378 if test "$model" = "shared"; then
379 AC_ERROR(Shared libraries are not supported in this version)
384 ###############################################################################
385 CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
387 ### use option --disable-overwrite to leave out the link to -lcurses
388 AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
389 AC_ARG_ENABLE(overwrite,
390 [ --disable-overwrite leave out the link to -lcurses],
391 [with_overwrite=$enableval],
392 [if test "$prefix" != "/usr/local" ; then with_overwrite=yes; else with_overwrite=no; fi])
393 AC_MSG_RESULT($with_overwrite)
395 AC_MSG_CHECKING(if external terminfo-database is used)
396 AC_ARG_ENABLE(database,
397 [ --disable-database use only built-in data],
398 [use_database=$enableval],
400 AC_MSG_RESULT($use_database)
402 case $host_os in #(vi
404 TERMINFO_SRC='${top_srcdir}/misc/emx.src'
407 TERMINFO_SRC='${top_srcdir}/misc/terminfo.src'
410 AC_SUBST(TERMINFO_SRC)
412 if test "$use_database" != no ; then
413 AC_DEFINE(USE_DATABASE)
414 AC_MSG_CHECKING(which terminfo source-file will be installed)
415 AC_ARG_ENABLE(database,
416 [ --with-database=XXX specify terminfo source to install],
417 [TERMINFO_SRC=$withval])
418 AC_MSG_RESULT($TERMINFO_SRC)
421 AC_MSG_CHECKING(for list of fallback descriptions)
422 AC_ARG_WITH(fallbacks,
423 [ --with-fallbacks=XXX specify list of fallback terminal descriptions],
424 [with_fallback=$withval],
426 AC_MSG_RESULT($with_fallback)
427 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'`
428 AC_SUBST(FALLBACK_LIST)
430 if test "$use_database" = no ; then
431 if test -z $with_fallback ; then
432 AC_ERROR(You have disabled the database w/o specifying fallbacks)
434 TERMINFO="${datadir}/terminfo"
437 AC_MSG_CHECKING(for list of terminfo directories)
438 CF_WITH_PATHLIST(terminfo-dirs,
439 [ --with-terminfo-dirs=XXX specify list of terminfo directories],
443 AC_MSG_RESULT($TERMINFO_DIRS)
444 test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS")
446 AC_MSG_CHECKING(for default terminfo directory)
447 CF_WITH_PATH(default-terminfo-dir,
448 [ --with-default-terminfo-dir=DIR default terminfo directory],
452 AC_MSG_RESULT($TERMINFO)
453 AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO")
459 ### use option --disable-big-core to make tic run on small machines
460 ### We need 4Mb, check if we can allocate 50% more than that.
461 AC_MSG_CHECKING(if big-core option selected)
462 AC_ARG_ENABLE(big-core,
463 [ --disable-big-core assume machine has little memory],
464 [with_big_core=$enableval],
469 unsigned long n = 6000000L;
477 [with_big_core=no])])
478 AC_MSG_RESULT($with_big_core)
479 test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
481 ### use option --enable-termcap to compile in the termcap fallback support
482 AC_MSG_CHECKING(if you want termcap-fallback support)
483 AC_ARG_ENABLE(termcap,
484 [ --enable-termcap compile in termcap fallback support],
485 [with_termcap=$enableval],
487 AC_MSG_RESULT($with_termcap)
489 if test "$with_termcap" != "yes" ; then
490 AC_DEFINE(PURE_TERMINFO)
493 ### use option --enable-getcap to use a hacked getcap for reading termcaps
494 AC_MSG_CHECKING(if fast termcap-loader is needed)
495 AC_ARG_ENABLE(getcap,
496 [ --enable-getcap fast termcap load, no xrefs to terminfo],
497 [with_getcap=$enableval],
499 AC_MSG_RESULT($with_getcap)
500 test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP)
502 AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
503 AC_ARG_ENABLE(getcap-cache,
504 [ --enable-getcap-cache cache translated termcaps in ~/.terminfo],
505 [with_getcap_cache=$enableval],
506 [with_getcap_cache=no])
507 AC_MSG_RESULT($with_getcap_cache)
508 test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE)
512 ### Use option --enable-symlinks to make tic use symlinks, not hard links
513 ### to reduce storage requirements for the terminfo database.
519 if test "$ac_cv_func_link" != yes ; then
520 AC_MSG_CHECKING(if tic should use symbolic links)
521 if test "$ac_cv_func_symlink" = yes ; then
526 AC_MSG_RESULT($with_symlinks)
527 elif test "$ac_cv_func_symlink" != yes ; then
528 AC_MSG_CHECKING(if tic should use hard links)
529 if test "$ac_cv_func_link" = yes ; then
534 AC_MSG_RESULT($with_links)
536 AC_MSG_CHECKING(if tic should use symbolic links)
537 AC_ARG_ENABLE(symlinks,
538 [ --enable-symlinks make tic use symbolic links not hard links],
539 [with_symlinks=$enableval],
541 AC_MSG_RESULT($with_symlinks)
544 test "$with_links" = yes && AC_DEFINE(USE_LINKS)
545 test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS)
547 ### use option --enable-broken-linker to force on use of broken-linker support
548 AC_MSG_CHECKING(if you want broken-linker support code)
549 AC_ARG_ENABLE(broken_linker,
550 [ --enable-broken_linker compile with broken-linker support code],
551 [with_broken_linker=$enableval],
552 [with_broken_linker=$BROKEN_LINKER])
553 AC_MSG_RESULT($with_broken_linker)
554 test "$with_broken_linker" = yes && AC_DEFINE(BROKEN_LINKER)
556 ### use option --with-ospeed to override ospeed's type
557 AC_MSG_CHECKING(for type of ospeed)
559 [ --with-ospeed=TYPE override type of ospeed variable],
560 [NCURSES_OSPEED=$withval],
561 [NCURSES_OSPEED=short])
562 AC_MSG_RESULT($NCURSES_OSPEED)
563 AC_SUBST(NCURSES_OSPEED)
565 ### use option --enable-bsdpad to have tputs process BSD-style prefix padding
566 AC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
567 AC_ARG_ENABLE(bsdpad,
568 [ --enable-bsdpad recognize BSD-style prefix padding],
569 [with_bsdpad=$enableval],
571 AC_MSG_RESULT($with_bsdpad)
572 test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS)
574 ### Enable compiling-in rcs id's
575 AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
577 [ --with-rcs-ids compile-in RCS identifiers],
578 [with_rcs_ids=$withval],
580 AC_MSG_RESULT($with_rcs_ids)
581 test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
583 ###############################################################################
584 CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ])
586 ###############################################################################
587 CF_HELP_MESSAGE(Extensions:)
589 ### Note that some functions (such as const) are normally disabled anyway.
590 AC_MSG_CHECKING(if you want to build with function extensions)
591 AC_ARG_ENABLE(ext-funcs,
592 [ --disable-ext-funcs disable function-extensions],
593 [with_ext_funcs=$enableval],
594 [with_ext_funcs=yes])
595 AC_MSG_RESULT($with_ext_funcs)
596 if test "$with_ext_funcs" = yes ; then
597 AC_DEFINE(HAVE_CURSES_VERSION)
598 AC_DEFINE(HAVE_HAS_KEY)
599 AC_DEFINE(HAVE_RESIZETERM)
600 AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
601 AC_DEFINE(HAVE_WRESIZE)
602 AC_DEFINE(NCURSES_EXT_FUNCS)
605 ### use option --enable-const to turn on use of const beyond that in XSI.
606 AC_MSG_CHECKING(for extended use of const keyword)
608 [ --enable-const compile with extra/non-standard const],
609 [with_ext_const=$enableval],
611 AC_MSG_RESULT($with_ext_const)
612 NCURSES_CONST='/*nothing*/'
613 if test "$with_ext_const" = yes ; then
616 AC_SUBST(NCURSES_CONST)
618 AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code)
619 AC_ARG_ENABLE(no-padding,
620 [ --enable-no-padding compile with \$NCURSES_NO_PADDING code],
621 [with_no_padding=$enableval],
622 [with_no_padding=$with_ext_funcs])
623 AC_MSG_RESULT($with_no_padding)
624 test "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING)
626 ### use option --enable-sigwinch to turn on use of SIGWINCH logic
627 AC_MSG_CHECKING(if you want SIGWINCH handler)
628 AC_ARG_ENABLE(sigwinch,
629 [ --enable-sigwinch compile with SIGWINCH handler],
630 [with_sigwinch=$enableval],
631 [with_sigwinch=$with_ext_funcs])
632 AC_MSG_RESULT($with_sigwinch)
633 test "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH)
635 ### use option --enable-tcap-names to allow user to define new capabilities
636 AC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap)
637 AC_ARG_ENABLE(tcap-names,
638 [ --enable-tcap-names compile with user-definable terminal capabilities],
639 [with_tcap_names=$enableval],
640 [with_tcap_names=$with_ext_funcs])
641 AC_MSG_RESULT($with_tcap_names)
643 test "$with_tcap_names" = yes && NCURSES_XNAMES=1
644 AC_SUBST(NCURSES_XNAMES)
646 ###############################################################################
647 # These options are relatively safe to experiment with.
648 CF_HELP_MESSAGE(Development Code:)
649 AC_MSG_CHECKING(if you want all development code)
651 [ --with-develop enable all development options],
652 [with_develop=$withval],
654 AC_MSG_RESULT($with_develop)
656 ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment
657 AC_MSG_CHECKING(if you want colorfgbg code)
658 AC_ARG_ENABLE(hard-tabs,
659 [ --enable-colorfgbg compile with \$COLORFGBG code],
660 [with_colorfgbg=$enableval],
661 [with_colorfgbg=$with_develop])
662 AC_MSG_RESULT($with_colorfgbg)
663 test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
665 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize
666 AC_MSG_CHECKING(if you want hard-tabs code)
667 AC_ARG_ENABLE(hard-tabs,
668 [ --enable-hard-tabs compile with hard-tabs code],
669 [with_hardtabs=$enableval],
670 [with_hardtabs=$with_develop])
671 AC_MSG_RESULT($with_hardtabs)
672 test "$with_hardtabs" = yes && AC_DEFINE(USE_HARD_TABS)
674 AC_MSG_CHECKING(if you want to use restrict environment when running as root)
675 AC_ARG_ENABLE(root-environ,
676 [ --disable-root-environ limit environment when running as root],
677 [with_root_environ=$enableval],
678 [with_root_environ=yes])
679 AC_MSG_RESULT($with_root_environ)
680 test "$with_root_environ" = yes && AC_DEFINE(USE_ROOT_ENVIRON)
682 ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize
683 AC_MSG_CHECKING(if you want limited support for xmc)
684 AC_ARG_ENABLE(xmc-glitch,
685 [ --enable-xmc-glitch compile with limited support for xmc],
686 [with_xmc_glitch=$enableval],
687 [with_xmc_glitch=$with_develop])
688 AC_MSG_RESULT($with_xmc_glitch)
689 test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT)
691 ###############################################################################
692 # These are just experimental, probably should not be in a package:
693 CF_HELP_MESSAGE(Experimental Code:)
695 AC_MSG_CHECKING(if you do not want to assume colors are white-on-black)
696 AC_ARG_ENABLE(assumed-color,
697 [ --disable-assumed-color do not assume anything about default-colors],
698 [with_assumed_color=$enableval],
699 [with_assumed_color=yes])
700 AC_MSG_RESULT($with_assumed_color)
701 test "$with_assumed_color" = yes && AC_DEFINE(USE_ASSUMED_COLOR)
703 ### use option --enable-hashmap to turn on use of hashmap scrolling logic
704 AC_MSG_CHECKING(if you want hashmap scrolling-optimization code)
705 AC_ARG_ENABLE(hashmap,
706 [ --disable-hashmap compile without hashmap scrolling-optimization],
707 [with_hashmap=$enableval],
709 AC_MSG_RESULT($with_hashmap)
710 test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP)
712 AC_MSG_CHECKING(if you want experimental safe-sprintf code)
713 AC_ARG_ENABLE(safe-sprintf,
714 [ --enable-safe-sprintf compile with experimental safe-sprintf code],
715 [with_safe_sprintf=$enableval],
716 [with_safe_sprintf=no])
717 AC_MSG_RESULT($with_safe_sprintf)
718 test "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF)
720 ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
721 # when hashmap is used scroll hints are useless
722 if test "$with_hashmap" = no ; then
723 AC_MSG_CHECKING(if you want to experiment without scrolling-hints code)
724 AC_ARG_ENABLE(scroll-hints,
725 [ --disable-scroll-hints compile without scroll-hints code],
726 [with_scroll_hints=$enableval],
727 [with_scroll_hints=yes])
728 AC_MSG_RESULT($with_scroll_hints)
729 test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS)
732 ### use option --enable-widec to turn on use of wide-character support
733 AC_MSG_CHECKING(if you want experimental wide-character code)
735 [ --enable-widec compile with experimental wide-char/UTF-8 code],
736 [with_widec=$enableval],
738 AC_MSG_RESULT($with_widec)
739 if test "$with_widec" = yes ; then
740 LIB_SUFFIX="w${LIB_SUFFIX}"
741 AC_DEFINE(USE_WIDEC_SUPPORT)
744 ###############################################################################
745 CF_HELP_MESSAGE(Testing/development Options:)
747 ### use option --disable-echo to suppress full display compiling commands
748 AC_MSG_CHECKING(if you want to display full commands during build)
750 [ --enable-echo build: display "compiling" commands (default)],
751 [with_echo=$enableval],
753 if test "$with_echo" = yes; then
756 ECHO_LINK='@ echo linking $@ ... ;'
757 test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent"
759 AC_MSG_RESULT($with_echo)
762 ### use option --enable-warnings to turn on all gcc warnings
763 AC_MSG_CHECKING(if you want to see compiler warnings)
764 AC_ARG_ENABLE(warnings,
765 [ --enable-warnings build: turn on GCC compiler warnings],
766 [with_warnings=$enableval])
767 AC_MSG_RESULT($with_warnings)
769 if test -n "$with_warnings"; then
770 ADAFLAGS="$ADAFLAGS -gnatg"
775 ### use option --enable-assertions to turn on generation of assertion code
776 AC_MSG_CHECKING(if you want to enable runtime assertions)
777 AC_ARG_ENABLE(assertions,
778 [ --enable-assertions test: turn on generation of assertion code],
779 [with_assertions=$enableval],
780 [with_assertions=no])
781 AC_MSG_RESULT($with_assertions)
784 if test "$with_assertions" = no
787 CPPFLAGS="$CPPFLAGS -DNDEBUG"
789 ADAFLAGS="$ADAFLAGS -gnata"
793 ### use option --disable-leaks to suppress "permanent" leaks, for testing
795 [ --disable-leaks test: suppress permanent memory-leaks],
796 [test "$enableval" = no && AC_DEFINE(NO_LEAKS)])
797 AC_DEFINE(HAVE_NC_ALLOC_H)
799 ### use option --enable-expanded to generate certain macros as functions
800 AC_ARG_ENABLE(expanded,
801 [ --enable-expanded test: generate functions for certain macros],
802 [test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)])
804 ### use option --disable-macros to suppress macros in favor of functions
805 AC_ARG_ENABLE(macros,
806 [ --disable-macros test: use functions rather than macros],
807 [test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)])
809 ### Checks for libraries.
810 AC_CHECK_FUNC(gettimeofday,
811 AC_DEFINE(HAVE_GETTIMEOFDAY),[
813 AC_CHECK_LIB(bsd, gettimeofday,
814 AC_DEFINE(HAVE_GETTIMEOFDAY)
815 LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
817 CF_MATH_LIB(MATH_LIB,sin(x))
820 ### Checks for header files.
825 dnl These are some other potentially nonportable headers.
844 # check for ISC (this may also define _POSIX_SOURCE)
845 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
846 if test "$ISC" = yes ; then
847 AC_CHECK_LIB(cposix,main)
848 AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
853 ### checks for compiler characteristics
857 test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS)
862 ### Checks for external-data
866 ### Checks for library functions.
892 if test "$with_getcap" = "yes" ; then
900 dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
901 if test "$cross_compiling" = yes ; then
902 AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
904 AC_FUNC_SETVBUF_REVERSED
912 dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
913 if test -z "$cf_user_CFLAGS" ; then
914 CF_STRIP_G_OPT(CFLAGS)
915 CF_STRIP_G_OPT(CXXFLAGS)
918 dnl Check for C++ compiler characteristics (and ensure that it's there!)
919 CF_BOOL_DECL(cf_cv_cc_bool_type)
920 if test -n "$CXX" ; then
924 if test "$GXX" = yes; then
925 AC_MSG_CHECKING(version of ${CXX-g++})
926 eval "${CXX-g++} --version"
927 case "`${CXX-g++} --version`" in
942 AC_CHECK_HEADERS(typeinfo)
950 case $cf_cv_system_name in #(vi
960 # Just because we are not configuring against C++ right now does not
961 # mean that a user will not want to use C++. Some distributors disable
962 # the C++ portion of this configuration as a shortcut (or just to avoid
963 # compiling the demo in the c++ directory). So we need a reasonable
964 # default for the 'bool' type.
966 # Caveat: since the storage of the bool type is not standardized, it
969 AC_MSG_CHECKING(for fallback type of bool)
970 case "$host_cpu" in #(vi
971 i?86) cf_cv_type_of_bool=char ;; #(vi
972 *) cf_cv_type_of_bool=int ;;
974 AC_MSG_RESULT($cf_cv_type_of_bool)
978 CF_HELP_MESSAGE(Ada95 Binding Options:)
980 dnl Check for availability of GNU Ada Translator (GNAT).
981 dnl At the moment we support no other Ada95 compiler.
982 if test "$cf_with_ada" != "no" ; then
984 AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
985 if test "$ac_cv_prog_gnat_exists" = no; then
989 AC_CHECK_PROG(M4_exists, m4, yes, no)
990 if test "$ac_cv_prog_M4_exists" = no; then
991 cf_cv_prog_gnat_correct=no
992 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
994 if test "$cf_cv_prog_gnat_correct" = yes; then
995 AC_MSG_CHECKING(if GNAT works)
996 CF_GNAT_TRY_RUN([procedure conftest;],
999 procedure conftest is
1001 Text_IO.Put ("Hello World");
1003 GNAT.OS_Lib.OS_Exit (0);
1004 end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
1005 AC_MSG_RESULT($cf_cv_prog_gnat_correct)
1008 if test "$cf_cv_prog_gnat_correct" = yes; then
1009 ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
1011 AC_ARG_WITH(ada-compiler,
1012 [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
1013 [cf_ada_compiler=$withval],
1014 [cf_ada_compiler=gnatmake])
1016 cf_ada_package=terminal_interface
1018 AC_SUBST(cf_ada_make)
1019 AC_SUBST(cf_ada_compiler)
1020 AC_SUBST(cf_ada_package)
1022 AC_SUBST(cf_compile_generics)
1023 AC_SUBST(cf_generic_objects)
1025 CF_WITH_PATH(ada-include,
1026 [ --with-ada-include=DIR Ada includes are in DIR],
1028 PREFIX/lib/ada/adainclude,
1029 [$]prefix/lib/ada/adainclude)
1030 AC_SUBST(ADA_INCLUDE)
1032 CF_WITH_PATH(ada-objects,
1033 [ --with-ada-objects=DIR Ada objects are in DIR],
1035 PREFIX/lib/ada/adalib,
1036 [$]prefix/lib/ada/adalib)
1037 AC_SUBST(ADA_OBJECTS)
1042 ### It's not possible to appease gcc 2.6.3's conversion-warnings if we're
1043 ### using a 'char' for bools. gcc 2.7.0's conversion-warnings are broken too
1044 ### badly to consider using for development purposes, but 2.5.8 is okay.
1045 if test -n "$with_warnings"; then
1046 if test "$GCC" = yes; then
1047 case "`$CC --version`" in
1049 if test "$cf_cv_type_of_bool" != "char"; then
1050 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
1054 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
1060 ### Construct the library-subsets, if any, from this set of keywords:
1061 ### none, base, ext_funcs, termlib.
1062 AC_MSG_CHECKING(for library subsets)
1063 if test "$with_termlib" = yes ; then
1064 LIB_SUBSETS="termlib "
1066 LIB_SUBSETS="termlib+"
1068 LIB_SUBSETS="${LIB_SUBSETS}base"
1069 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
1070 AC_MSG_RESULT($LIB_SUBSETS)
1074 case "$CFLAGS $CPPFLAGS" in
1082 ### Construct the list of include-directories to be generated
1086 ### Build up pieces for makefile rules
1087 AC_MSG_CHECKING(default library suffix)
1088 CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
1089 AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
1090 AC_MSG_RESULT($DFT_ARG_SUFFIX)
1092 AC_MSG_CHECKING(default library-dependency suffix)
1093 CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_DEP_SUFFIX)dnl
1094 AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
1095 AC_MSG_RESULT($DFT_DEP_SUFFIX)
1097 AC_MSG_CHECKING(default object directory)
1098 CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
1099 AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
1100 AC_MSG_RESULT($DFT_OBJ_SUBDIR)
1102 # libtool thinks it can make c++ shared libraries (perhaps only g++)
1103 AC_MSG_CHECKING(c++ library-dependency suffix)
1104 if test "$with_libtool" = "yes"; then
1105 CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
1107 CF_LIB_SUFFIX(normal,CXX_LIB_SUFFIX)dnl we normally make a static library
1109 AC_MSG_RESULT($CXX_LIB_SUFFIX)
1110 AC_SUBST(CXX_LIB_SUFFIX)
1112 TINFO_LIST="$SHLIB_LIST"
1113 test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}"
1115 AC_MSG_CHECKING(where we will install curses.h)
1116 test "$with_overwrite" = no && \
1117 test "x$includedir" = 'x${prefix}/include' && \
1118 includedir='$(prefix)/include/ncurses'${LIB_SUFFIX}
1119 AC_MSG_RESULT($includedir)
1121 AC_SUBST(EXTRA_LIBS)
1122 AC_SUBST(TINFO_LIST)
1123 AC_SUBST(SHLIB_LIST)
1125 ### Set up low-level terminfo dependencies for makefiles. Note that we
1126 ### could override this.
1127 if test "$with_termlib" = yes ; then
1128 TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}"
1129 if test "$DFT_LWR_MODEL" = "libtool"; then
1130 TEST_ARGS="${TEST_DEPS}"
1132 TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}"
1135 PROG_DEPS="$TEST_DEPS"
1136 PROG_ARGS="$TEST_ARGS"
1138 ### Construct the list of subdirectories for which we'll customize makefiles
1139 ### with the appropriate compile-rules.
1141 CF_SRC_MODULES($modules_to_build)
1144 AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP')
1146 ### Now that we're done running tests, add the compiler-warnings, if any
1147 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
1149 ################################################################################
1151 include/MKterm.h.awk \
1155 misc/run_tic.sh:misc/run_tic.in \
1160 ### Special initialization commands, used to pass information from the
1161 ### configuration-run into config.status
1164 CF_LIST_MODELS="$cf_list_models"
1165 DFT_LWR_MODEL="$DFT_LWR_MODEL"
1166 LDCONFIG="$LDCONFIG"
1167 LIB_NAME="$LIB_NAME"
1168 LIB_SUFFIX="$LIB_SUFFIX"
1169 LIB_SUBSETS="$LIB_SUBSETS"
1170 LIB_TRACING="$LIB_TRACING"
1171 SRC_SUBDIRS="$SRC_SUBDIRS"
1172 TERMINFO="$TERMINFO"
1173 TINFO_NAME="$TINFO_NAME"
1174 WITH_ECHO="$with_echo"
1175 WITH_OVERWRITE="$with_overwrite"
1176 WITH_CURSES_H="$with_curses_h"
1177 cf_cv_abi_version="$cf_cv_abi_version"
1178 cf_cv_do_symlinks="$cf_cv_do_symlinks"
1179 cf_cv_rel_version="$cf_cv_rel_version"
1180 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
1181 cf_cv_system_name="$cf_cv_system_name"
1182 cf_with_cxx_binding="$cf_with_cxx_binding"
1183 cf_cv_shlib_version="$cf_cv_shlib_version"
1187 ${MAKE-make} preinstall