1 dnl***************************************************************************
2 dnl Copyright (c) 1998-2003,2004 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 1995-on
31 dnl $Id: configure.in,v 1.312 2004/01/24 19:29:13 tom Exp $
32 dnl Process this file with autoconf to produce a configure script.
34 dnl See http://invisible-island.net/autoconf/ for additional information.
36 dnl ---------------------------------------------------------------------------
37 AC_PREREQ(2.13.20020210)
38 AC_REVISION($Revision: 1.312 $)
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
44 CF_WITH_REL_VERSION(NCURSES)
47 CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
48 AC_ARG_WITH(system-type,
49 [ --with-system-type=XXX test: override derived host system-type],
50 [AC_MSG_WARN(overriding system type to $withval)
51 cf_cv_system_name=$withval])
53 ### Save the given $CFLAGS to allow user-override.
54 cf_user_CFLAGS="$CFLAGS"
56 ### Default install-location
59 ### Checks for programs.
64 AC_PROG_GCC_TRADITIONAL
70 dnl DEFECT in autoconf 2.12: an attempt to set policy, this breaks the
71 dnl configure script by not letting us test if C++
72 dnl is present, making this option necessary.
73 AC_MSG_CHECKING(if you want to ensure bool is consistent with C++)
75 [ --without-cxx do not adjust ncurses bool to match C++],
76 [cf_with_cxx=$withval],
78 AC_MSG_RESULT($cf_with_cxx)
79 if test "X$cf_with_cxx" = Xno ; then
83 # with autoconf 2.13, we can change the error to a warning:
84 pushdef([AC_MSG_ERROR],
86 AC_MSG_WARN([You don't have any C++ compiler, too bad])
87 cf_with_cxx=no; CXX=""; GXX="";])dnl
89 popdef([AC_MSG_ERROR])dnl
90 # autoconf 2.5x removed the error - by hardcoding it to g++.
91 if test "$CXX" = "g++" ; then
94 if test "$CXX" = "g++" ; then
95 AC_MSG_WARN(ignoring hardcoded g++)
96 cf_with_cxx=no; CXX=""; GXX="";
103 GXX=""; CXX=""; ac_cv_prog_gxx=no
105 AC_MSG_WARN(templates do not work)
109 AC_MSG_CHECKING(if you want to build C++ binding and demo)
110 AC_ARG_WITH(cxx-binding,
111 [ --without-cxx-binding do not build C++ binding and demo],
112 [cf_with_cxx_binding=$withval],
113 [cf_with_cxx_binding=$cf_with_cxx])
114 AC_MSG_RESULT($cf_with_cxx_binding)
116 AC_MSG_CHECKING(if you want to build with Ada95)
118 [ --without-ada suppress check for Ada95, don't build demo],
119 [cf_with_ada=$withval],
121 AC_MSG_RESULT($cf_with_ada)
123 AC_MSG_CHECKING(if you want to build programs such as tic)
125 [ --without-progs suppress build with programs (e.g., tic)],
126 [cf_with_progs=$withval],
128 AC_MSG_RESULT($cf_with_progs)
130 AC_MSG_CHECKING(if you wish to install curses.h)
131 AC_ARG_WITH(curses-h,
132 [ --without-curses-h install curses.h as ncurses.h only],
133 [with_curses_h=$withval],
135 AC_MSG_RESULT($with_curses_h)
137 modules_to_build="ncurses"
138 if test "X$cf_with_progs" != Xno ; then
139 modules_to_build="$modules_to_build progs tack"
141 modules_to_build="$modules_to_build panel menu form"
147 AC_SYS_LONG_FILE_NAMES
148 CF_MIXEDCASE_FILENAMES
151 AC_CHECK_PROGS(LINT, tdlint lint alint)
152 AC_CHECK_PROGS(MAN, man man_db)
155 dnl These are standard among *NIX systems, but not when cross-compiling
156 AC_CHECK_TOOL(RANLIB, ranlib, ':')
157 AC_CHECK_TOOL(LD, ld, ld)
158 AC_CHECK_TOOL(AR, ar, ar)
159 CF_SUBST(archiver options,AR_OPTS,rv)
163 dnl Special option for use by system-builders: the install-prefix is used to
164 dnl adjust the location into which the actual install is done, so that an
165 dnl archive can be built without modifying the host system's configuration.
166 AC_MSG_CHECKING(if you have specified an install-prefix)
167 AC_ARG_WITH(install-prefix,
168 [ --with-install-prefix prefixes actual install-location ($DESTDIR)],
169 [case "$withval" in #(vi
172 *) DESTDIR="$withval"
175 AC_MSG_RESULT($DESTDIR)
178 ###############################################################################
179 CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:)
180 # If we're cross-compiling, allow the user to override the tools and their
181 # options. The configure script is oriented toward identifying the host
182 # compiler, etc., but we need a build compiler to generate parts of the source.
183 : ${BUILD_CC:='$(CC)'}
184 : ${BUILD_CFLAGS:='$(CFLAGS)'}
185 : ${BUILD_CPPFLAGS:='$(CPPFLAGS)'}
186 : ${BUILD_LDFLAGS:='$(LDFLAGS)'}
187 : ${BUILD_LIBS:='$(LIBS)'}
188 : ${BUILD_EXEEXT:='$x'}
189 if test "$cross_compiling" = yes ; then
190 AC_ARG_WITH(build-cc,
191 [ --with-build-cc=XXX the build C compiler ($BUILD_CC)],
192 [BUILD_CC="$withval"],
193 [AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)])
194 AC_ARG_WITH(build-cflags,
195 [ --with-build-cflags=XXX the build C compiler-flags],
196 [BUILD_CFLAGS="$withval"])
197 AC_ARG_WITH(build-cppflags,
198 [ --with-build-cppflags=XXX the build C preprocessor-flags],
199 [BUILD_CPPFLAGS="$withval"])
200 AC_ARG_WITH(build-ldflags,
201 [ --with-build-ldflags=XXX the build linker-flags],
202 [BUILD_LDFLAGS="$withval"])
203 AC_ARG_WITH(build-libs,
204 [ --with-build-libs=XXX the build libraries],
205 [BUILD_LIBS="$withval"])
209 AC_SUBST(BUILD_CFLAGS)
210 AC_SUBST(BUILD_CPPFLAGS)
211 AC_SUBST(BUILD_LDFLAGS)
213 AC_SUBST(BUILD_EXEEXT)
215 ###############################################################################
216 CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
218 ### Options to allow the user to specify the set of libraries which are used.
219 ### Use "--without-normal --with-shared" to allow the default model to be
220 ### shared, for example.
222 AC_SUBST(cf_list_models)dnl the complete list of models ("normal debug")
225 if test "$with_libtool" != "no" ; then
227 cf_list_models="$cf_list_models 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"
265 ###############################################################################
267 AC_MSG_CHECKING(for specified models)
268 test -z "$cf_list_models" && cf_list_models=normal
269 dnl If we use libtool to generate libraries, then it must be the only
271 test "$with_libtool" != "no" && cf_list_models=libtool
272 AC_MSG_RESULT($cf_list_models)
274 ### Use the first model as the default, and save its suffix for use in building
275 ### up test-applications.
276 AC_MSG_CHECKING(for default model)
277 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
278 AC_MSG_RESULT($DFT_LWR_MODEL)
280 CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
282 AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal")
283 AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL")
292 CF_LIB_PREFIX(cf_prefix)
293 LIB_PREFIX=$cf_prefix
299 ###############################################################################
301 AC_MSG_CHECKING(if you want to build a separate terminfo library)
303 [ --with-termlib generate separate terminfo library],
304 [with_termlib=$withval],
306 AC_MSG_RESULT($with_termlib)
308 ### Checks for special libraries, must be done up-front.
313 AC_MSG_CHECKING(if you want to link with the gpm mouse library)
315 [ --with-gpm use Alessandro Rubini's GPM library],
318 AC_MSG_RESULT($with_gpm)
319 if test "$with_gpm" = yes ; then
320 AC_CHECK_LIB(gpm,Gpm_Open,[
321 EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS"
322 SHLIB_LIST="-lgpm $SHLIB_LIST"
323 AC_DEFINE(HAVE_LIBGPM)
324 AC_CHECK_HEADERS(gpm.h)
325 ],AC_MSG_WARN(Cannot link with gpm library - read the FAQ))
330 dnl Not all ports of gcc support the -g option
332 if test X"$CC_G_OPT" = X"" ; then
334 test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
338 if test X"$CXX_G_OPT" = X"" ; then
340 test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
344 AC_MSG_CHECKING(for default loader flags)
345 case $DFT_LWR_MODEL in
346 libtool) LD_MODEL='' ;;
347 normal) LD_MODEL='' ;;
348 debug) LD_MODEL=$CC_G_OPT ;;
349 profile) LD_MODEL='-pg';;
350 shared) LD_MODEL='' ;;
352 AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
353 AC_MSG_RESULT($LD_MODEL)
355 AC_MSG_CHECKING(if rpath option should be used)
357 [ --enable-rpath use rpath option when generating shared libraries],
358 [cf_cv_ld_rpath=$enableval],
360 AC_MSG_RESULT($cf_cv_ld_rpath)
363 if test "$CC_SHARED_OPTS" = "unknown"; then
364 for model in $cf_list_models; do
365 if test "$model" = "shared"; then
366 AC_ERROR(Shared libraries are not supported in this version)
371 ###############################################################################
372 CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
374 ### use option --disable-overwrite to leave out the link to -lcurses
375 AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
376 AC_ARG_ENABLE(overwrite,
377 [ --disable-overwrite leave out the link to -lcurses],
378 [with_overwrite=$enableval],
379 [if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi])
380 AC_MSG_RESULT($with_overwrite)
382 AC_MSG_CHECKING(if external terminfo-database is used)
383 AC_ARG_ENABLE(database,
384 [ --disable-database do not use terminfo, only fallbacks/termcap],
385 [use_database=$enableval],
387 AC_MSG_RESULT($use_database)
389 case $host_os in #(vi
391 TERMINFO_SRC='${top_srcdir}/misc/emx.src'
394 TERMINFO_SRC='${top_srcdir}/misc/terminfo.src'
397 AC_SUBST(TERMINFO_SRC)
400 if test "$use_database" != no ; then
401 AC_DEFINE(USE_DATABASE)
402 AC_MSG_CHECKING(which terminfo source-file will be installed)
403 AC_ARG_ENABLE(database,
404 [ --with-database=XXX specify terminfo source to install],
405 [TERMINFO_SRC=$withval])
406 AC_MSG_RESULT($TERMINFO_SRC)
409 AC_MSG_CHECKING(for list of fallback descriptions)
410 AC_ARG_WITH(fallbacks,
411 [ --with-fallbacks=XXX specify list of fallback terminal descriptions],
412 [with_fallback=$withval],
414 AC_MSG_RESULT($with_fallback)
415 FALLBACK_LIST=`echo "$with_fallback" | sed -e 's/,/ /g'`
416 AC_SUBST(FALLBACK_LIST)
419 if test "$use_database" = no ; then
420 TERMINFO="${datadir}/terminfo"
424 AC_MSG_CHECKING(for list of terminfo directories)
425 CF_WITH_PATHLIST(terminfo-dirs,
426 [ --with-terminfo-dirs=XXX specify list of terminfo directories],
430 AC_MSG_RESULT($TERMINFO_DIRS)
431 test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS")
433 AC_MSG_CHECKING(for default terminfo directory)
434 CF_WITH_PATH(default-terminfo-dir,
435 [ --with-default-terminfo-dir=DIR default terminfo directory],
439 AC_MSG_RESULT($TERMINFO)
440 AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO")
445 AC_SUBST(MAKE_TERMINFO)
447 ### use option --disable-big-core to make tic run on small machines
448 ### We need 4Mb, check if we can allocate 50% more than that.
449 AC_MSG_CHECKING(if big-core option selected)
450 AC_ARG_ENABLE(big-core,
451 [ --disable-big-core assume machine has little memory],
452 [with_big_core=$enableval],
457 unsigned long n = 6000000L;
465 [with_big_core=no])])
466 AC_MSG_RESULT($with_big_core)
467 test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
469 ### use option --enable-termcap to compile in the termcap fallback support
470 AC_MSG_CHECKING(if you want termcap-fallback support)
471 AC_ARG_ENABLE(termcap,
472 [ --enable-termcap compile in termcap fallback support],
473 [with_termcap=$enableval],
475 AC_MSG_RESULT($with_termcap)
477 if test "$with_termcap" != "yes" ; then
478 if test "$use_database" = no ; then
479 if test -z "$with_fallback" ; then
480 AC_ERROR(You have disabled the database w/o specifying fallbacks)
483 AC_DEFINE(PURE_TERMINFO)
486 AC_DEFINE(USE_TERMCAP)
487 AC_MSG_CHECKING(for list of termcap files)
488 CF_WITH_PATHLIST(termpath,
489 [ --with-termpath=XXX specify list of termcap files],
491 /etc/termcap:/usr/share/misc/termcap)
492 AC_MSG_RESULT($TERMPATH)
493 test -n "$TERMPATH" && AC_DEFINE_UNQUOTED(TERMPATH,"$TERMPATH")
495 ### use option --enable-getcap to use a hacked getcap for reading termcaps
496 AC_MSG_CHECKING(if fast termcap-loader is needed)
497 AC_ARG_ENABLE(getcap,
498 [ --enable-getcap fast termcap load, no xrefs to terminfo],
499 [with_getcap=$enableval],
501 AC_MSG_RESULT($with_getcap)
502 test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP)
504 AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
505 AC_ARG_ENABLE(getcap-cache,
506 [ --enable-getcap-cache cache translated termcaps in ~/.terminfo],
507 [with_getcap_cache=$enableval],
508 [with_getcap_cache=no])
509 AC_MSG_RESULT($with_getcap_cache)
510 test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE)
514 ### Use option --disable-home-terminfo to completely remove ~/.terminfo
515 AC_MSG_CHECKING(if ~/.terminfo is wanted)
516 AC_ARG_ENABLE(home-terminfo,
517 [ --disable-home-terminfo drop ~/.terminfo from terminfo search-path],
518 [with_home_terminfo=$enableval],
519 [with_home_terminfo=yes])
520 test "$with_home_terminfo" = "yes" && AC_DEFINE(USE_HOME_TERMINFO)
522 ### Use option --enable-symlinks to make tic use symlinks, not hard links
523 ### to reduce storage requirements for the terminfo database.
529 if test "$ac_cv_func_link" != yes ; then
530 AC_MSG_CHECKING(if tic should use symbolic links)
531 if test "$ac_cv_func_symlink" = yes ; then
536 AC_MSG_RESULT($with_symlinks)
537 elif test "$ac_cv_func_symlink" != yes ; then
538 AC_MSG_CHECKING(if tic should use hard links)
539 if test "$ac_cv_func_link" = yes ; then
544 AC_MSG_RESULT($with_links)
546 AC_MSG_CHECKING(if tic should use symbolic links)
547 AC_ARG_ENABLE(symlinks,
548 [ --enable-symlinks make tic use symbolic links not hard links],
549 [with_symlinks=$enableval],
551 AC_MSG_RESULT($with_symlinks)
554 test "$with_links" = yes && AC_DEFINE(USE_LINKS)
555 test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS)
557 ### use option --enable-broken-linker to force on use of broken-linker support
558 AC_MSG_CHECKING(if you want broken-linker support code)
559 AC_ARG_ENABLE(broken_linker,
560 [ --enable-broken_linker compile with broken-linker support code],
561 [with_broken_linker=$enableval],
562 [with_broken_linker=${BROKEN_LINKER-no}])
563 AC_MSG_RESULT($with_broken_linker)
566 if test "$with_broken_linker" = yes ; then
567 AC_DEFINE(BROKEN_LINKER)
569 elif test "$DFT_LWR_MODEL" = shared ; then
570 case $cf_cv_system_name in #(vi
572 AC_DEFINE(BROKEN_LINKER)
574 CF_VERBOSE(cygwin linker is broken anyway)
578 AC_SUBST(BROKEN_LINKER)
580 ### use option --with-bool to override bool's type
581 AC_MSG_CHECKING(for type of bool)
583 [ --with-bool=TYPE override fallback type of bool variable],
584 [NCURSES_BOOL="$withval"],
586 AC_MSG_RESULT($NCURSES_BOOL)
587 AC_SUBST(NCURSES_BOOL)
589 ### use option --with-ospeed to override ospeed's type
590 AC_MSG_CHECKING(for type of ospeed)
592 [ --with-ospeed=TYPE override type of ospeed variable],
593 [NCURSES_OSPEED="$withval"],
594 [NCURSES_OSPEED=short])
595 AC_MSG_RESULT($NCURSES_OSPEED)
596 AC_SUBST(NCURSES_OSPEED)
598 ### use option --enable-bsdpad to have tputs process BSD-style prefix padding
599 AC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
600 AC_ARG_ENABLE(bsdpad,
601 [ --enable-bsdpad recognize BSD-style prefix padding],
602 [with_bsdpad=$enableval],
604 AC_MSG_RESULT($with_bsdpad)
605 test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS)
607 ### Enable compiling-in rcs id's
608 AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
610 [ --with-rcs-ids compile-in RCS identifiers],
611 [with_rcs_ids=$withval],
613 AC_MSG_RESULT($with_rcs_ids)
614 test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
616 ###############################################################################
617 CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ])
619 ###############################################################################
620 CF_HELP_MESSAGE(Extensions:)
622 ### Note that some functions (such as const) are normally disabled anyway.
623 AC_MSG_CHECKING(if you want to build with function extensions)
624 AC_ARG_ENABLE(ext-funcs,
625 [ --disable-ext-funcs disable function-extensions],
626 [with_ext_funcs=$enableval],
627 [with_ext_funcs=yes])
628 AC_MSG_RESULT($with_ext_funcs)
629 if test "$with_ext_funcs" = yes ; then
631 AC_DEFINE(HAVE_CURSES_VERSION)
632 AC_DEFINE(HAVE_HAS_KEY)
633 AC_DEFINE(HAVE_RESIZETERM)
634 AC_DEFINE(HAVE_RESIZE_TERM)
635 AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
636 AC_DEFINE(HAVE_WRESIZE)
637 AC_DEFINE(NCURSES_EXT_FUNCS)
641 AC_SUBST(NCURSES_EXT_FUNCS)
643 ### use option --enable-const to turn on use of const beyond that in XSI.
644 AC_MSG_CHECKING(for extended use of const keyword)
646 [ --enable-const compile with extra/non-standard const],
647 [with_ext_const=$enableval],
649 AC_MSG_RESULT($with_ext_const)
650 NCURSES_CONST='/*nothing*/'
651 if test "$with_ext_const" = yes ; then
654 AC_SUBST(NCURSES_CONST)
656 AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code)
657 AC_ARG_ENABLE(no-padding,
658 [ --enable-no-padding compile with $NCURSES_NO_PADDING code],
659 [with_no_padding=$enableval],
660 [with_no_padding=$with_ext_funcs])
661 AC_MSG_RESULT($with_no_padding)
662 test "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING)
664 ### use option --enable-sigwinch to turn on use of SIGWINCH logic
665 AC_MSG_CHECKING(if you want SIGWINCH handler)
666 AC_ARG_ENABLE(sigwinch,
667 [ --enable-sigwinch compile with SIGWINCH handler],
668 [with_sigwinch=$enableval],
669 [with_sigwinch=$with_ext_funcs])
670 AC_MSG_RESULT($with_sigwinch)
671 test "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH)
673 ### use option --enable-tcap-names to allow user to define new capabilities
674 AC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap)
675 AC_ARG_ENABLE(tcap-names,
676 [ --enable-tcap-names compile with user-definable terminal capabilities],
677 [with_tcap_names=$enableval],
678 [with_tcap_names=$with_ext_funcs])
679 AC_MSG_RESULT($with_tcap_names)
681 test "$with_tcap_names" = yes && NCURSES_XNAMES=1
682 AC_SUBST(NCURSES_XNAMES)
684 ###############################################################################
685 # These options are relatively safe to experiment with.
686 CF_HELP_MESSAGE(Development Code:)
687 AC_MSG_CHECKING(if you want all development code)
689 [ --with-develop enable all development options],
690 [with_develop=$withval],
692 AC_MSG_RESULT($with_develop)
694 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize
695 AC_MSG_CHECKING(if you want hard-tabs code)
696 AC_ARG_ENABLE(hard-tabs,
697 [ --enable-hard-tabs compile with hard-tabs code],
698 [with_hardtabs=$enableval],
699 [with_hardtabs=$with_develop])
700 AC_MSG_RESULT($with_hardtabs)
701 test "$with_hardtabs" = yes && AC_DEFINE(USE_HARD_TABS)
703 AC_MSG_CHECKING(if you want to use restrict environment when running as root)
704 AC_ARG_ENABLE(root-environ,
705 [ --disable-root-environ limit environment when running as root],
706 [with_root_environ=$enableval],
707 [with_root_environ=yes])
708 AC_MSG_RESULT($with_root_environ)
709 test "$with_root_environ" = yes && AC_DEFINE(USE_ROOT_ENVIRON)
711 ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize
712 AC_MSG_CHECKING(if you want limited support for xmc)
713 AC_ARG_ENABLE(xmc-glitch,
714 [ --enable-xmc-glitch compile with limited support for xmc],
715 [with_xmc_glitch=$enableval],
716 [with_xmc_glitch=$with_develop])
717 AC_MSG_RESULT($with_xmc_glitch)
718 test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT)
720 ###############################################################################
721 # These are just experimental, probably should not be in a package:
722 CF_HELP_MESSAGE(Experimental Code:)
724 AC_MSG_CHECKING(if you do not want to assume colors are white-on-black)
725 AC_ARG_ENABLE(assumed-color,
726 [ --disable-assumed-color do not assume anything about default-colors],
727 [with_assumed_color=$enableval],
728 [with_assumed_color=yes])
729 AC_MSG_RESULT($with_assumed_color)
730 test "$with_assumed_color" = yes && AC_DEFINE(USE_ASSUMED_COLOR)
732 ### use option --enable-hashmap to turn on use of hashmap scrolling logic
733 AC_MSG_CHECKING(if you want hashmap scrolling-optimization code)
734 AC_ARG_ENABLE(hashmap,
735 [ --disable-hashmap compile without hashmap scrolling-optimization],
736 [with_hashmap=$enableval],
738 AC_MSG_RESULT($with_hashmap)
739 test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP)
741 ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment
742 AC_MSG_CHECKING(if you want colorfgbg code)
743 AC_ARG_ENABLE(colorfgbg,
744 [ --enable-colorfgbg compile with $COLORFGBG code],
745 [with_colorfgbg=$enableval],
747 AC_MSG_RESULT($with_colorfgbg)
748 test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
750 AC_MSG_CHECKING(if you want experimental safe-sprintf code)
751 AC_ARG_ENABLE(safe-sprintf,
752 [ --enable-safe-sprintf compile with experimental safe-sprintf code],
753 [with_safe_sprintf=$enableval],
754 [with_safe_sprintf=no])
755 AC_MSG_RESULT($with_safe_sprintf)
756 test "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF)
758 ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
759 # when hashmap is used scroll hints are useless
760 if test "$with_hashmap" = no ; then
761 AC_MSG_CHECKING(if you want to experiment without scrolling-hints code)
762 AC_ARG_ENABLE(scroll-hints,
763 [ --disable-scroll-hints compile without scroll-hints code],
764 [with_scroll_hints=$enableval],
765 [with_scroll_hints=yes])
766 AC_MSG_RESULT($with_scroll_hints)
767 test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS)
770 ### use option --enable-widec to turn on use of wide-character support
779 # Check to define _XOPEN_SOURCE "automatically"
782 # use these variables to work around a defect in gcc's fixincludes.
786 AC_MSG_CHECKING(if you want experimental wide-character code)
788 [ --enable-widec compile with experimental wide-char/UTF-8 code],
789 [with_widec=$enableval],
791 AC_MSG_RESULT($with_widec)
792 if test "$with_widec" = yes ; then
793 LIB_SUFFIX="w${LIB_SUFFIX}"
794 AC_DEFINE(USE_WIDEC_SUPPORT)
795 CF_PREDEFINE(_XOPEN_SOURCE,500)
796 CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED)
799 AC_CHECK_FUNCS(putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc)
800 if test "$ac_cv_func_putwc" != yes ; then
802 if test "$cf_cv_libutf8" = yes ; then
806 CF_WCHAR_TYPE(mbstate_t, NCURSES_MBSTATE_T)
807 CF_WCHAR_TYPE(wchar_t, NCURSES_WCHAR_T, NCURSES_OK_WCHAR_T)
808 CF_WCHAR_TYPE(wint_t, NCURSES_WINT_T, NCURSES_OK_WINT_T)
810 AC_SUBST(NCURSES_CH_T)
811 AC_SUBST(NCURSES_LIBUTF8)
813 AC_SUBST(NEED_WCHAR_H)
814 AC_SUBST(NCURSES_MBSTATE_T)
815 AC_SUBST(NCURSES_WCHAR_T)
816 AC_SUBST(NCURSES_WINT_T)
818 AC_SUBST(NCURSES_OK_WCHAR_T)
819 AC_SUBST(NCURSES_OK_WINT_T)
821 AC_MSG_CHECKING(for terminal capabilities file)
823 [ --with-caps=alt compile with experimental alternate Caps file],
824 [TERMINFO_CAPS=Caps.$withval],
825 [TERMINFO_CAPS=Caps])
826 test -f ${srcdir}/include/${TERMINFO_CAPS} || TERMINFO_CAPS=Caps
827 AC_MSG_RESULT($TERMINFO_CAPS)
828 AC_SUBST(TERMINFO_CAPS)
830 ###############################################################################
831 CF_HELP_MESSAGE(Testing/development Options:)
833 ### use option --disable-echo to suppress full display compiling commands
834 AC_MSG_CHECKING(if you want to display full commands during build)
836 [ --enable-echo build: display "compiling" commands (default)],
837 [with_echo=$enableval],
839 if test "$with_echo" = yes; then
842 ECHO_LINK='@ echo linking $@ ... ;'
843 test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent"
845 AC_MSG_RESULT($with_echo)
848 ### use option --enable-warnings to turn on all gcc warnings
849 AC_MSG_CHECKING(if you want to see compiler warnings)
850 AC_ARG_ENABLE(warnings,
851 [ --enable-warnings build: turn on GCC compiler warnings],
852 [with_warnings=$enableval])
853 AC_MSG_RESULT($with_warnings)
855 if test -n "$with_warnings"; then
856 ADAFLAGS="$ADAFLAGS -gnatg"
861 ### use option --enable-assertions to turn on generation of assertion code
862 AC_MSG_CHECKING(if you want to enable runtime assertions)
863 AC_ARG_ENABLE(assertions,
864 [ --enable-assertions test: turn on generation of assertion code],
865 [with_assertions=$enableval],
866 [with_assertions=no])
867 AC_MSG_RESULT($with_assertions)
870 if test "$with_assertions" = no
873 CPPFLAGS="$CPPFLAGS -DNDEBUG"
875 ADAFLAGS="$ADAFLAGS -gnata"
879 ### use option --disable-leaks to suppress "permanent" leaks, for testing
881 [ --disable-leaks test: suppress permanent memory-leaks],
882 [test "$enableval" = no && AC_DEFINE(NO_LEAKS)])
883 AC_DEFINE(HAVE_NC_ALLOC_H)
885 ### use option --enable-expanded to generate certain macros as functions
886 AC_ARG_ENABLE(expanded,
887 [ --enable-expanded test: generate functions for certain macros],
888 [test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)])
890 ### use option --disable-macros to suppress macros in favor of functions
891 AC_ARG_ENABLE(macros,
892 [ --disable-macros test: use functions rather than macros],
893 [test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)])
895 # Normally we only add trace() to the debug-library. Allow this to be
896 # extended to all models of the ncurses library:
898 case "$CFLAGS $CPPFLAGS" in
904 AC_MSG_CHECKING(whether to add trace feature to all models)
906 [ --with-trace test: add trace() function to all models of ncurses],
907 [cf_with_trace=$withval],
908 [cf_with_trace=$cf_all_traces])
909 AC_MSG_RESULT($with_trace)
911 if test "$cf_with_trace" = yes ; then
914 CF_ADD_CFLAGS(-DTRACE)
922 ### Checks for libraries.
923 AC_CHECK_FUNC(gettimeofday,
924 AC_DEFINE(HAVE_GETTIMEOFDAY),[
926 AC_CHECK_LIB(bsd, gettimeofday,
927 AC_DEFINE(HAVE_GETTIMEOFDAY)
928 LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
930 CF_MATH_LIB(MATH_LIB,sin(x))
933 ### Checks for header files.
939 dnl These are some other potentially nonportable headers.
958 # check for ISC (this may also define _POSIX_SOURCE)
959 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
960 if test "$ISC" = yes ; then
961 AC_CHECK_LIB(cposix,main)
962 AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
967 ### checks for compiler characteristics
971 test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS)
975 ### Checks for external-data
979 ### Checks for library functions.
1002 if test "$with_getcap" = "yes" ; then
1012 # setup for prototype of fallback for vsscanf()
1013 if test "$cf_cv_func_vsscanf" = vsscanf ; then
1018 AC_SUBST(HAVE_VSSCANF)
1020 dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
1021 if test "$cross_compiling" = yes ; then
1022 AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
1024 AC_FUNC_SETVBUF_REVERSED
1032 dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
1033 if test -z "$cf_user_CFLAGS" ; then
1034 CF_STRIP_G_OPT(CFLAGS)
1035 CF_STRIP_G_OPT(CXXFLAGS)
1038 # Just in case, check if the C compiler has a bool type.
1039 CF_BOOL_DECL(cf_cv_cc_bool_type)
1041 # Check for C++ compiler characteristics (and ensure that it's there!)
1042 if test -n "$CXX" ; then
1046 case $GXX_VERSION in
1058 AC_CHECK_HEADERS(typeinfo)
1067 CXX_AR_OPTS='$(AR_OPTS)'
1068 case $cf_cv_system_name in #(vi
1070 if test "$GXX" != yes ; then
1072 CXX_AR_OPTS='-ar -o'
1076 CXXLDFLAGS="-u main"
1079 if test "$GXX" != yes ; then
1081 CXX_AR_OPTS='-xar -o'
1085 AC_SUBST(CXXLDFLAGS)
1087 AC_SUBST(CXX_AR_OPTS)
1090 cf_cv_builtin_bool=1
1092 # Just because we are not configuring against C++ right now does not
1093 # mean that a user will not want to use C++. Some distributors disable
1094 # the C++ portion of this configuration as a shortcut (or just to avoid
1095 # compiling the demo in the c++ directory). So we need a reasonable
1096 # default for the 'bool' type.
1098 # Caveat: since the storage of the bool type is not standardized, it
1101 if test "$NCURSES_BOOL" != auto ; then
1102 cf_cv_type_of_bool=$NCURSES_AUTO
1104 if test "$cf_cv_header_stdbool_h" = 1 ; then
1107 AC_MSG_CHECKING(for fallback type of bool)
1108 case "$host_cpu" in #(vi
1109 i?86) cf_cv_type_of_bool=char ;; #(vi
1110 *) cf_cv_type_of_bool=int ;;
1112 AC_MSG_RESULT($cf_cv_type_of_bool)
1118 # If the C compiler did not declare bool, and we did not determine that the C++
1119 # compiler does not declare bool, turn on an ifdef in curses.h that makes the
1120 # ncurses library use the same type as C++ bool. Note that this allows one to
1121 # specify the type of bool in a configure-script option and postpone
1122 # integration with the C++ compiler provided that the types are compatible.
1124 if test $cf_cv_cc_bool_type = 1
1126 # oops: C has a bool. Unlikely, but C++ could differ.
1128 elif test $cf_cv_builtin_bool = 0
1133 # this is the normal case
1134 USE_CXX_BOOL='defined(__cplusplus)'
1136 AC_SUBST(USE_CXX_BOOL)
1138 CF_HELP_MESSAGE(Ada95 Binding Options:)
1140 dnl Check for availability of GNU Ada Translator (GNAT).
1141 dnl At the moment we support no other Ada95 compiler.
1142 if test "$cf_with_ada" != "no" ; then
1143 cf_ada_make=gnatmake
1144 AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
1145 if test "$ac_cv_prog_gnat_exists" = no; then
1149 AC_CHECK_PROG(M4_exists, m4, yes, no)
1150 if test "$ac_cv_prog_M4_exists" = no; then
1151 cf_cv_prog_gnat_correct=no
1152 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
1154 if test "$cf_cv_prog_gnat_correct" = yes; then
1155 AC_MSG_CHECKING(if GNAT works)
1156 CF_GNAT_TRY_RUN([procedure conftest;],
1159 procedure conftest is
1161 Text_IO.Put ("Hello World");
1163 GNAT.OS_Lib.OS_Exit (0);
1164 end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
1165 AC_MSG_RESULT($cf_cv_prog_gnat_correct)
1168 if test "$cf_cv_prog_gnat_correct" = yes; then
1169 ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
1171 AC_ARG_WITH(ada-compiler,
1172 [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
1173 [cf_ada_compiler=$withval],
1174 [cf_ada_compiler=gnatmake])
1176 cf_ada_package=terminal_interface
1178 AC_SUBST(cf_ada_make)
1179 AC_SUBST(cf_ada_compiler)
1180 AC_SUBST(cf_ada_package)
1182 AC_SUBST(cf_compile_generics)
1183 AC_SUBST(cf_generic_objects)
1185 CF_WITH_PATH(ada-include,
1186 [ --with-ada-include=DIR Ada includes are in DIR],
1188 PREFIX/lib/ada/adainclude,
1189 [$]prefix/lib/ada/adainclude)
1190 AC_SUBST(ADA_INCLUDE)
1192 CF_WITH_PATH(ada-objects,
1193 [ --with-ada-objects=DIR Ada objects are in DIR],
1195 PREFIX/lib/ada/adalib,
1196 [$]prefix/lib/ada/adalib)
1197 AC_SUBST(ADA_OBJECTS)
1202 ### Construct the library-subsets, if any, from this set of keywords:
1203 ### none, base, ext_funcs, ext_tinfo, termlib, widechar (see CF_LIB_RULES).
1204 AC_MSG_CHECKING(for library subsets)
1205 if test "$with_termlib" = yes ; then
1206 LIB_SUBSETS="termlib"
1207 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo"
1208 LIB_SUBSETS="${LIB_SUBSETS} "
1210 LIB_SUBSETS="termlib+"
1211 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}ext_tinfo+"
1213 LIB_SUBSETS="${LIB_SUBSETS}base"
1214 test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar"
1215 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
1216 AC_MSG_RESULT($LIB_SUBSETS)
1218 ### Construct the list of include-directories to be generated
1222 ### Build up pieces for makefile rules
1223 AC_MSG_CHECKING(default library suffix)
1224 CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
1225 AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
1226 AC_MSG_RESULT($DFT_ARG_SUFFIX)
1228 AC_MSG_CHECKING(default library-dependency suffix)
1229 CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_DEP_SUFFIX)dnl
1230 if test $DFT_LWR_MODEL = shared ; then
1231 case $cf_cv_system_name in #(vi
1233 DFT_DEP_SUFFIX=".dll.a"
1237 AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
1238 AC_MSG_RESULT($DFT_DEP_SUFFIX)
1240 AC_MSG_CHECKING(default object directory)
1241 CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
1242 AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
1243 AC_MSG_RESULT($DFT_OBJ_SUBDIR)
1245 # libtool thinks it can make c++ shared libraries (perhaps only g++)
1246 if test "$cf_with_cxx" = yes ; then
1247 AC_MSG_CHECKING(c++ library-dependency suffix)
1248 if test "$with_libtool" != "no"; then
1249 CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
1251 CF_LIB_SUFFIX(normal,CXX_LIB_SUFFIX)dnl we normally make a static library
1253 AC_MSG_RESULT($CXX_LIB_SUFFIX)
1254 AC_SUBST(CXX_LIB_SUFFIX)
1257 TINFO_LIST="$SHLIB_LIST"
1258 if test "$with_libtool" = no ; then
1259 test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}"
1262 AC_MSG_CHECKING(where we will install curses.h)
1263 test "$with_overwrite" = no && \
1264 test "x$includedir" = 'x${prefix}/include' && \
1265 includedir='$(prefix)/include/ncurses'${LIB_SUFFIX}
1266 AC_MSG_RESULT($includedir)
1268 ### Resolve a conflict between normal and wide-curses by forcing applications
1269 ### that will need libutf8 to add it to their configure script.
1270 if test "$with_overwrite" != no ; then
1271 if test "$NCURSES_LIBUTF8" = 1 ; then
1272 NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)'
1273 AC_MSG_WARN(Wide-character applications must define HAVE_LIBUTF8_H to include curses.h)
1277 AC_SUBST(EXTRA_LIBS)
1278 AC_SUBST(TINFO_LIST)
1279 AC_SUBST(SHLIB_LIST)
1281 ### Set up low-level terminfo dependencies for makefiles. Note that we
1282 ### could override this.
1283 if test "$with_termlib" = yes ; then
1284 TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}"
1285 if test "$DFT_LWR_MODEL" = "libtool"; then
1286 TEST_ARGS="${TEST_DEPS}"
1288 TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}"
1291 PROG_DEPS="$TEST_DEPS"
1292 PROG_ARGS="$TEST_ARGS"
1294 ### predefined stuff for the test programs
1295 AC_DEFINE(HAVE_SLK_COLOR)
1297 ### Construct the list of subdirectories for which we'll customize makefiles
1298 ### with the appropriate compile-rules.
1300 CF_SRC_MODULES($modules_to_build)
1303 AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP')
1305 AC_DEFINE_UNQUOTED(NCURSES_VERSION_STRING, "${NCURSES_MAJOR}.${NCURSES_MINOR}.${NCURSES_PATCH}")
1307 ### Now that we're done running tests, add the compiler-warnings, if any
1308 CF_ADD_CFLAGS($EXTRA_CFLAGS)
1310 ################################################################################
1311 test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in"
1313 include/MKterm.h.awk \
1314 include/curses.head:include/curses.h.in \
1321 ### Special initialization commands, used to pass information from the
1322 ### configuration-run into config.status
1325 CF_LIST_MODELS="$cf_list_models"
1326 DFT_LWR_MODEL="$DFT_LWR_MODEL"
1327 LDCONFIG="$LDCONFIG"
1328 LIB_NAME="$LIB_NAME"
1329 LIB_SUBSETS="$LIB_SUBSETS"
1330 LIB_SUFFIX="$LIB_SUFFIX"
1331 LIB_TRACING="$LIB_TRACING"
1332 MAKE_TERMINFO="$MAKE_TERMINFO"
1333 NCURSES_OSPEED="$NCURSES_OSPEED"
1334 SRC_SUBDIRS="$SRC_SUBDIRS"
1335 TERMINFO="$TERMINFO"
1336 TINFO_NAME="$TINFO_NAME"
1337 WITH_CURSES_H="$with_curses_h"
1338 WITH_ECHO="$with_echo"
1339 WITH_OVERWRITE="$with_overwrite"
1340 cf_cv_abi_version="$cf_cv_abi_version"
1341 cf_cv_do_symlinks="$cf_cv_do_symlinks"
1342 cf_cv_rel_version="$cf_cv_rel_version"
1343 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
1344 cf_cv_shlib_version="$cf_cv_shlib_version"
1345 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
1346 cf_cv_system_name="$cf_cv_system_name"
1347 cf_with_cxx_binding="$cf_with_cxx_binding"
1352 ${MAKE-make} preinstall