1 dnl***************************************************************************
2 dnl Copyright (c) 1998-2001,2002 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.274 2002/09/15 00:11:28 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.274 $)
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.
84 if test "$GCC" = yes ; then
85 AC_MSG_CHECKING(version of gcc)
86 GCC_VERSION="`${CC} --version|head -1`"
87 AC_MSG_RESULT($GCC_VERSION)
90 # If we're cross-compiling, allow the user to override the tools and their
91 # options. The configure script is oriented toward identifying the target
92 # compiler, etc., but we need a host compiler to generate parts of the source.
94 BUILD_CFLAGS='$(CFLAGS)'
95 BUILD_CPPFLAGS='$(CPPFLAGS)'
96 BUILD_LDFLAGS='$(LDFLAGS)'
98 if test "$host_alias" != "$target_alias" ; then
100 [ --with-build-cc=XXX if cross-compiling, the host C compiler (\$BUILD_CC)],
101 [BUILD_CC="$withval"],
102 [AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)])
103 AC_ARG_WITH(build-cflags,
104 [ --with-build-cflags=XXX if cross-compiling, the host C compiler-flags],
105 [BUILD_CFLAGS="$withval"])
106 AC_ARG_WITH(build-cppflags,
107 [ --with-build-cppflags=XXX if cross-compiling, the host C preprocessor-flags],
108 [BUILD_CPPFLAGS="$withval"])
109 AC_ARG_WITH(build-ldflags,
110 [ --with-build-ldflags=XXX if cross-compiling, the host linker-flags],
111 [BUILD_LDFLAGS="$withval"])
112 AC_ARG_WITH(build-libs,
113 [ --with-build-libs=XXX if cross-compiling, the host libraries],
114 [BUILD_LIBS="$withval"])
117 AC_SUBST(BUILD_CFLAGS)
118 AC_SUBST(BUILD_CPPFLAGS)
119 AC_SUBST(BUILD_LDFLAGS)
123 AC_PROG_GCC_TRADITIONAL
128 case "$cf_cv_system_name" in
130 test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
132 *) LDPATH=$PATH:/sbin:/usr/sbin
133 AC_PATH_PROG(LDCONFIG,ldconfig,,$LDPATH)
138 dnl DEFECT in autoconf 2.12: an attempt to set policy, this breaks the
139 dnl configure script by not letting us test if C++
140 dnl is present, making this option necessary.
141 AC_MSG_CHECKING(if you want to ensure bool is consistent with C++)
143 [ --without-cxx do not adjust ncurses bool to match C++],
144 [cf_with_cxx=$withval],
146 AC_MSG_RESULT($cf_with_cxx)
147 if test "X$cf_with_cxx" = Xno ; then
151 pushdef([AC_MSG_ERROR],
152 [AC_MSG_RESULT([You don't have any C++ compiler, too bad]); dnl
153 cf_with_cxx=no; CXX=""; GXX="";])dnl
155 popdef([AC_MSG_ERROR])dnl
159 if test "$GXX" = yes; then
160 AC_MSG_CHECKING(version of g++)
161 GXX_VERSION="`${CXX-g++} --version|head -1`"
162 AC_MSG_RESULT($GXX_VERSION)
165 GXX=""; CXX=""; ac_cv_prog_gxx=no
167 AC_MSG_WARN(templates do not work)
172 AC_MSG_CHECKING(if you want to build C++ binding and demo)
173 AC_ARG_WITH(cxx-binding,
174 [ --without-cxx-binding do not build C++ binding and demo],
175 [cf_with_cxx_binding=$withval],
176 [cf_with_cxx_binding=$cf_with_cxx])
177 AC_MSG_RESULT($cf_with_cxx_binding)
179 AC_MSG_CHECKING(if you want to build with Ada95)
181 [ --without-ada suppress check for Ada95, don't build demo],
182 [cf_with_ada=$withval],
184 AC_MSG_RESULT($cf_with_ada)
186 AC_MSG_CHECKING(if you want to build programs such as tic)
188 [ --without-progs suppress build with programs (e.g., tic)],
189 [cf_with_progs=$withval],
191 AC_MSG_RESULT($cf_with_progs)
193 AC_MSG_CHECKING(if you wish to install curses.h)
194 AC_ARG_WITH(curses-h,
195 [ --without-curses-h install curses.h as ncurses.h only],
196 [with_curses_h=$withval],
198 AC_MSG_RESULT($with_curses_h)
200 modules_to_build="ncurses"
201 if test "X$cf_with_progs" != Xno ; then
202 modules_to_build="$modules_to_build progs tack"
204 modules_to_build="$modules_to_build panel menu form"
210 AC_SYS_LONG_FILE_NAMES
211 CF_MIXEDCASE_FILENAMES
215 AC_CHECK_PROGS(LINT, tdlint lint alint)
216 AC_CHECK_PROGS(MAN, man man_db)
219 dnl These are standard among *NIX systems, but not when cross-compiling
220 CF_SUBST(loader,LD,ld)
221 CF_SUBST(archiver,AR,ar)
222 CF_SUBST(archiver options,AR_OPTS,rv)
226 dnl Special option for use by system-builders: the install-prefix is used to
227 dnl adjust the location into which the actual install is done, so that an
228 dnl archive can be built without modifying the host system's configuration.
229 AC_MSG_CHECKING(if you have specified an install-prefix)
230 AC_ARG_WITH(install-prefix,
231 [ --with-install-prefix prefixes actual install-location (\$DESTDIR)],
232 [case "$withval" in #(vi
235 *) DESTDIR="$withval"
238 AC_MSG_RESULT($DESTDIR)
241 ###############################################################################
242 CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
244 ### Options to allow the user to specify the set of libraries which are used.
245 ### Use "--without-normal --with-shared" to allow the default model to be
246 ### shared, for example.
248 AC_SUBST(cf_list_models)dnl the complete list of models ("normal debug")
250 AC_MSG_CHECKING(if you want to build libraries with libtool)
252 [ --with-libtool generate libraries with libtool],
253 [with_libtool=$withval],
255 AC_MSG_RESULT($with_libtool)
256 if test "$with_libtool" = "yes"; then
257 cf_list_models="$cf_list_models libtool"
258 test -z "$LIBTOOL" && LIBTOOL=libtool
264 AC_MSG_CHECKING(if you want to build shared libraries)
266 [ --with-shared generate shared-libraries],
267 [with_shared=$withval],
269 AC_MSG_RESULT($with_shared)
270 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
272 AC_MSG_CHECKING(if you want to build static libraries)
274 [ --with-normal generate normal-libraries (default)],
275 [with_normal=$withval],
277 AC_MSG_RESULT($with_normal)
278 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
280 AC_MSG_CHECKING(if you want to build debug libraries)
282 [ --with-debug generate debug-libraries (default)],
283 [with_debug=$withval],
285 AC_MSG_RESULT($with_debug)
286 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
288 AC_MSG_CHECKING(if you want to build profiling libraries)
290 [ --with-profile generate profile-libraries],
291 [with_profile=$withval],
293 AC_MSG_RESULT($with_profile)
294 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
296 ###############################################################################
298 AC_MSG_CHECKING(for specified models)
299 test -z "$cf_list_models" && cf_list_models=normal
300 dnl If we use libtool to generate libraries, then it must be the only
302 test "$with_libtool" = "yes" && cf_list_models=libtool
303 AC_MSG_RESULT($cf_list_models)
305 ### Use the first model as the default, and save its suffix for use in building
306 ### up test-applications.
307 AC_MSG_CHECKING(for default model)
308 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'`
309 AC_MSG_RESULT($DFT_LWR_MODEL)
311 CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
313 AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal")
314 AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL")
323 CF_LIB_PREFIX(cf_prefix)
324 LIB_PREFIX=$cf_prefix
330 ###############################################################################
332 AC_MSG_CHECKING(if you want to build a separate terminfo library)
334 [ --with-termlib generate separate terminfo library],
335 [with_termlib=$withval],
337 AC_MSG_RESULT($with_termlib)
339 ### Checks for special libraries, must be done up-front.
340 AC_MSG_CHECKING(if you want to link with dbmalloc for testing)
341 AC_ARG_WITH(dbmalloc,
342 [ --with-dbmalloc test: use Conor Cahill's dbmalloc library],
343 [with_dbmalloc=$withval],
345 AC_MSG_RESULT($with_dbmalloc)
346 if test "$with_dbmalloc" = yes ; then
347 AC_CHECK_LIB(dbmalloc,debug_malloc)
350 AC_MSG_CHECKING(if you want to link with dmalloc for testing)
352 [ --with-dmalloc test: use Gray Watson's dmalloc library],
353 [with_dmalloc=$withval],
355 AC_MSG_RESULT($with_dmalloc)
356 if test "$with_dmalloc" = yes ; then
357 AC_CHECK_LIB(dmalloc,dmalloc_debug)
361 AC_MSG_CHECKING(if you want to link with the gpm mouse library)
363 [ --with-gpm use Alessandro Rubini's GPM library],
366 AC_MSG_RESULT($with_gpm)
367 if test "$with_gpm" = yes ; then
368 AC_CHECK_LIB(gpm,Gpm_Open,[
369 EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS"
370 SHLIB_LIST="-lgpm $SHLIB_LIST"
371 AC_DEFINE(HAVE_LIBGPM)
372 AC_CHECK_HEADERS(gpm.h)
373 ],AC_MSG_WARN(Cannot link with gpm library - read the FAQ))
376 dnl Not all ports of gcc support the -g option
378 if test X"$CC_G_OPT" = X"" ; then
380 test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
384 if test X"$CXX_G_OPT" = X"" ; then
386 test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
390 AC_MSG_CHECKING(for default loader flags)
391 case $DFT_LWR_MODEL in
392 libtool) LD_MODEL='' ;;
393 normal) LD_MODEL='' ;;
394 debug) LD_MODEL=$CC_G_OPT ;;
395 profile) LD_MODEL='-pg';;
396 shared) LD_MODEL='' ;;
398 AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
399 AC_MSG_RESULT($LD_MODEL)
401 AC_MSG_CHECKING(if rpath option should be used)
403 [ --enable-rpath use rpath option when generating shared libraries],
404 [cf_cv_ld_rpath=$enableval],
406 AC_MSG_RESULT($cf_cv_ld_rpath)
409 if test "$CC_SHARED_OPTS" = "unknown"; then
410 for model in $cf_list_models; do
411 if test "$model" = "shared"; then
412 AC_ERROR(Shared libraries are not supported in this version)
417 ###############################################################################
418 CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
420 ### use option --disable-overwrite to leave out the link to -lcurses
421 AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
422 AC_ARG_ENABLE(overwrite,
423 [ --disable-overwrite leave out the link to -lcurses],
424 [with_overwrite=$enableval],
425 [if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi])
426 AC_MSG_RESULT($with_overwrite)
428 AC_MSG_CHECKING(if external terminfo-database is used)
429 AC_ARG_ENABLE(database,
430 [ --disable-database do not use terminfo, only fallbacks/termcap],
431 [use_database=$enableval],
433 AC_MSG_RESULT($use_database)
435 case $host_os in #(vi
437 TERMINFO_SRC='${top_srcdir}/misc/emx.src'
440 TERMINFO_SRC='${top_srcdir}/misc/terminfo.src'
443 AC_SUBST(TERMINFO_SRC)
446 if test "$use_database" != no ; then
447 AC_DEFINE(USE_DATABASE)
448 AC_MSG_CHECKING(which terminfo source-file will be installed)
449 AC_ARG_ENABLE(database,
450 [ --with-database=XXX specify terminfo source to install],
451 [TERMINFO_SRC=$withval])
452 AC_MSG_RESULT($TERMINFO_SRC)
455 AC_MSG_CHECKING(for list of fallback descriptions)
456 AC_ARG_WITH(fallbacks,
457 [ --with-fallbacks=XXX specify list of fallback terminal descriptions],
458 [with_fallback=$withval],
460 AC_MSG_RESULT($with_fallback)
461 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'`
462 AC_SUBST(FALLBACK_LIST)
465 if test "$use_database" = no ; then
466 TERMINFO="${datadir}/terminfo"
470 AC_MSG_CHECKING(for list of terminfo directories)
471 CF_WITH_PATHLIST(terminfo-dirs,
472 [ --with-terminfo-dirs=XXX specify list of terminfo directories],
476 AC_MSG_RESULT($TERMINFO_DIRS)
477 test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS")
479 AC_MSG_CHECKING(for default terminfo directory)
480 CF_WITH_PATH(default-terminfo-dir,
481 [ --with-default-terminfo-dir=DIR default terminfo directory],
485 AC_MSG_RESULT($TERMINFO)
486 AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO")
491 AC_SUBST(MAKE_TERMINFO)
493 ### use option --disable-big-core to make tic run on small machines
494 ### We need 4Mb, check if we can allocate 50% more than that.
495 AC_MSG_CHECKING(if big-core option selected)
496 AC_ARG_ENABLE(big-core,
497 [ --disable-big-core assume machine has little memory],
498 [with_big_core=$enableval],
503 unsigned long n = 6000000L;
511 [with_big_core=no])])
512 AC_MSG_RESULT($with_big_core)
513 test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
515 ### use option --enable-termcap to compile in the termcap fallback support
516 AC_MSG_CHECKING(if you want termcap-fallback support)
517 AC_ARG_ENABLE(termcap,
518 [ --enable-termcap compile in termcap fallback support],
519 [with_termcap=$enableval],
521 AC_MSG_RESULT($with_termcap)
523 if test "$with_termcap" != "yes" ; then
524 if test "$use_database" = no ; then
525 if test -z $with_fallback ; then
526 AC_ERROR(You have disabled the database w/o specifying fallbacks)
529 AC_DEFINE(PURE_TERMINFO)
532 AC_DEFINE(USE_TERMCAP)
533 AC_MSG_CHECKING(for list of termcap files)
534 CF_WITH_PATHLIST(termpath,
535 [ --with-termpath=XXX specify list of termcap files],
537 /etc/termcap:/usr/share/misc/termcap)
538 AC_MSG_RESULT($TERMPATH)
539 test -n "$TERMPATH" && AC_DEFINE_UNQUOTED(TERMPATH,"$TERMPATH")
541 ### use option --enable-getcap to use a hacked getcap for reading termcaps
542 AC_MSG_CHECKING(if fast termcap-loader is needed)
543 AC_ARG_ENABLE(getcap,
544 [ --enable-getcap fast termcap load, no xrefs to terminfo],
545 [with_getcap=$enableval],
547 AC_MSG_RESULT($with_getcap)
548 test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP)
550 AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
551 AC_ARG_ENABLE(getcap-cache,
552 [ --enable-getcap-cache cache translated termcaps in ~/.terminfo],
553 [with_getcap_cache=$enableval],
554 [with_getcap_cache=no])
555 AC_MSG_RESULT($with_getcap_cache)
556 test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE)
560 ### Use option --enable-symlinks to make tic use symlinks, not hard links
561 ### to reduce storage requirements for the terminfo database.
567 if test "$ac_cv_func_link" != yes ; then
568 AC_MSG_CHECKING(if tic should use symbolic links)
569 if test "$ac_cv_func_symlink" = yes ; then
574 AC_MSG_RESULT($with_symlinks)
575 elif test "$ac_cv_func_symlink" != yes ; then
576 AC_MSG_CHECKING(if tic should use hard links)
577 if test "$ac_cv_func_link" = yes ; then
582 AC_MSG_RESULT($with_links)
584 AC_MSG_CHECKING(if tic should use symbolic links)
585 AC_ARG_ENABLE(symlinks,
586 [ --enable-symlinks make tic use symbolic links not hard links],
587 [with_symlinks=$enableval],
589 AC_MSG_RESULT($with_symlinks)
592 test "$with_links" = yes && AC_DEFINE(USE_LINKS)
593 test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS)
595 ### use option --enable-broken-linker to force on use of broken-linker support
596 AC_MSG_CHECKING(if you want broken-linker support code)
597 AC_ARG_ENABLE(broken_linker,
598 [ --enable-broken_linker compile with broken-linker support code],
599 [with_broken_linker=$enableval],
600 [with_broken_linker=$BROKEN_LINKER])
601 AC_MSG_RESULT($with_broken_linker)
604 if test "$with_broken_linker" = yes ; then
605 AC_DEFINE(BROKEN_LINKER)
607 elif test $DFT_LWR_MODEL = shared ; then
608 case $cf_cv_system_name in #(vi
610 AC_DEFINE(BROKEN_LINKER)
612 CF_VERBOSE(cygwin linker is broken anyway)
616 AC_SUBST(BROKEN_LINKER)
618 ### use option --with-bool to override bool's type
619 AC_MSG_CHECKING(for type of bool)
621 [ --with-bool=TYPE override fallback type of bool variable],
622 [NCURSES_BOOL="$withval"],
624 AC_MSG_RESULT($NCURSES_BOOL)
625 AC_SUBST(NCURSES_BOOL)
627 ### use option --with-ospeed to override ospeed's type
628 AC_MSG_CHECKING(for type of ospeed)
630 [ --with-ospeed=TYPE override type of ospeed variable],
631 [NCURSES_OSPEED="$withval"],
632 [NCURSES_OSPEED=short])
633 AC_MSG_RESULT($NCURSES_OSPEED)
634 AC_SUBST(NCURSES_OSPEED)
636 ### use option --enable-bsdpad to have tputs process BSD-style prefix padding
637 AC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
638 AC_ARG_ENABLE(bsdpad,
639 [ --enable-bsdpad recognize BSD-style prefix padding],
640 [with_bsdpad=$enableval],
642 AC_MSG_RESULT($with_bsdpad)
643 test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS)
645 ### Enable compiling-in rcs id's
646 AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
648 [ --with-rcs-ids compile-in RCS identifiers],
649 [with_rcs_ids=$withval],
651 AC_MSG_RESULT($with_rcs_ids)
652 test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
654 ###############################################################################
655 CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ])
657 ###############################################################################
658 CF_HELP_MESSAGE(Extensions:)
660 ### Note that some functions (such as const) are normally disabled anyway.
661 AC_MSG_CHECKING(if you want to build with function extensions)
662 AC_ARG_ENABLE(ext-funcs,
663 [ --disable-ext-funcs disable function-extensions],
664 [with_ext_funcs=$enableval],
665 [with_ext_funcs=yes])
666 AC_MSG_RESULT($with_ext_funcs)
667 if test "$with_ext_funcs" = yes ; then
669 AC_DEFINE(HAVE_CURSES_VERSION)
670 AC_DEFINE(HAVE_HAS_KEY)
671 AC_DEFINE(HAVE_RESIZETERM)
672 AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
673 AC_DEFINE(HAVE_WRESIZE)
674 AC_DEFINE(NCURSES_EXT_FUNCS)
678 AC_SUBST(NCURSES_EXT_FUNCS)
680 ### use option --enable-const to turn on use of const beyond that in XSI.
681 AC_MSG_CHECKING(for extended use of const keyword)
683 [ --enable-const compile with extra/non-standard const],
684 [with_ext_const=$enableval],
686 AC_MSG_RESULT($with_ext_const)
687 NCURSES_CONST='/*nothing*/'
688 if test "$with_ext_const" = yes ; then
691 AC_SUBST(NCURSES_CONST)
693 AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code)
694 AC_ARG_ENABLE(no-padding,
695 [ --enable-no-padding compile with \$NCURSES_NO_PADDING code],
696 [with_no_padding=$enableval],
697 [with_no_padding=$with_ext_funcs])
698 AC_MSG_RESULT($with_no_padding)
699 test "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING)
701 ### use option --enable-sigwinch to turn on use of SIGWINCH logic
702 AC_MSG_CHECKING(if you want SIGWINCH handler)
703 AC_ARG_ENABLE(sigwinch,
704 [ --enable-sigwinch compile with SIGWINCH handler],
705 [with_sigwinch=$enableval],
706 [with_sigwinch=$with_ext_funcs])
707 AC_MSG_RESULT($with_sigwinch)
708 test "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH)
710 ### use option --enable-tcap-names to allow user to define new capabilities
711 AC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap)
712 AC_ARG_ENABLE(tcap-names,
713 [ --enable-tcap-names compile with user-definable terminal capabilities],
714 [with_tcap_names=$enableval],
715 [with_tcap_names=$with_ext_funcs])
716 AC_MSG_RESULT($with_tcap_names)
718 test "$with_tcap_names" = yes && NCURSES_XNAMES=1
719 AC_SUBST(NCURSES_XNAMES)
721 ###############################################################################
722 # These options are relatively safe to experiment with.
723 CF_HELP_MESSAGE(Development Code:)
724 AC_MSG_CHECKING(if you want all development code)
726 [ --with-develop enable all development options],
727 [with_develop=$withval],
729 AC_MSG_RESULT($with_develop)
731 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize
732 AC_MSG_CHECKING(if you want hard-tabs code)
733 AC_ARG_ENABLE(hard-tabs,
734 [ --enable-hard-tabs compile with hard-tabs code],
735 [with_hardtabs=$enableval],
736 [with_hardtabs=$with_develop])
737 AC_MSG_RESULT($with_hardtabs)
738 test "$with_hardtabs" = yes && AC_DEFINE(USE_HARD_TABS)
740 AC_MSG_CHECKING(if you want to use restrict environment when running as root)
741 AC_ARG_ENABLE(root-environ,
742 [ --disable-root-environ limit environment when running as root],
743 [with_root_environ=$enableval],
744 [with_root_environ=yes])
745 AC_MSG_RESULT($with_root_environ)
746 test "$with_root_environ" = yes && AC_DEFINE(USE_ROOT_ENVIRON)
748 ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize
749 AC_MSG_CHECKING(if you want limited support for xmc)
750 AC_ARG_ENABLE(xmc-glitch,
751 [ --enable-xmc-glitch compile with limited support for xmc],
752 [with_xmc_glitch=$enableval],
753 [with_xmc_glitch=$with_develop])
754 AC_MSG_RESULT($with_xmc_glitch)
755 test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT)
757 ###############################################################################
758 # These are just experimental, probably should not be in a package:
759 CF_HELP_MESSAGE(Experimental Code:)
761 AC_MSG_CHECKING(if you do not want to assume colors are white-on-black)
762 AC_ARG_ENABLE(assumed-color,
763 [ --disable-assumed-color do not assume anything about default-colors],
764 [with_assumed_color=$enableval],
765 [with_assumed_color=yes])
766 AC_MSG_RESULT($with_assumed_color)
767 test "$with_assumed_color" = yes && AC_DEFINE(USE_ASSUMED_COLOR)
769 ### use option --enable-hashmap to turn on use of hashmap scrolling logic
770 AC_MSG_CHECKING(if you want hashmap scrolling-optimization code)
771 AC_ARG_ENABLE(hashmap,
772 [ --disable-hashmap compile without hashmap scrolling-optimization],
773 [with_hashmap=$enableval],
775 AC_MSG_RESULT($with_hashmap)
776 test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP)
778 ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment
779 AC_MSG_CHECKING(if you want colorfgbg code)
780 AC_ARG_ENABLE(colorfgbg,
781 [ --enable-colorfgbg compile with \$COLORFGBG code],
782 [with_colorfgbg=$enableval],
784 AC_MSG_RESULT($with_colorfgbg)
785 test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
787 AC_MSG_CHECKING(if you want experimental safe-sprintf code)
788 AC_ARG_ENABLE(safe-sprintf,
789 [ --enable-safe-sprintf compile with experimental safe-sprintf code],
790 [with_safe_sprintf=$enableval],
791 [with_safe_sprintf=no])
792 AC_MSG_RESULT($with_safe_sprintf)
793 test "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF)
795 ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
796 # when hashmap is used scroll hints are useless
797 if test "$with_hashmap" = no ; then
798 AC_MSG_CHECKING(if you want to experiment without scrolling-hints code)
799 AC_ARG_ENABLE(scroll-hints,
800 [ --disable-scroll-hints compile without scroll-hints code],
801 [with_scroll_hints=$enableval],
802 [with_scroll_hints=yes])
803 AC_MSG_RESULT($with_scroll_hints)
804 test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS)
807 ### use option --enable-widec to turn on use of wide-character support
811 AC_MSG_CHECKING(if you want experimental wide-character code)
813 [ --enable-widec compile with experimental wide-char/UTF-8 code],
814 [with_widec=$enableval],
816 AC_MSG_RESULT($with_widec)
817 if test "$with_widec" = yes ; then
818 LIB_SUFFIX="w${LIB_SUFFIX}"
819 AC_DEFINE(USE_WIDEC_SUPPORT)
820 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
824 if test "$ac_cv_func_putwc" != yes ; then
826 if test "$cf_cv_libutf8" = yes ; then
831 if test $cf_cv_mbstate_t = yes ; then
835 AC_SUBST(NCURSES_CH_T)
836 AC_SUBST(NCURSES_LIBUTF8)
837 AC_SUBST(NCURSES_MBSTATE_T)
839 AC_MSG_CHECKING(for terminal capabilities file)
841 [ --with-caps=alt compile with experimental alternate Caps file],
842 [TERMINFO_CAPS=Caps.$withval],
843 [TERMINFO_CAPS=Caps])
844 test -f ${srcdir}/include/${TERMINFO_CAPS} || TERMINFO_CAPS=Caps
845 AC_MSG_RESULT($TERMINFO_CAPS)
846 AC_SUBST(TERMINFO_CAPS)
848 ###############################################################################
849 CF_HELP_MESSAGE(Testing/development Options:)
851 ### use option --disable-echo to suppress full display compiling commands
852 AC_MSG_CHECKING(if you want to display full commands during build)
854 [ --enable-echo build: display "compiling" commands (default)],
855 [with_echo=$enableval],
857 if test "$with_echo" = yes; then
860 ECHO_LINK='@ echo linking $@ ... ;'
861 test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent"
863 AC_MSG_RESULT($with_echo)
866 ### use option --enable-warnings to turn on all gcc warnings
867 AC_MSG_CHECKING(if you want to see compiler warnings)
868 AC_ARG_ENABLE(warnings,
869 [ --enable-warnings build: turn on GCC compiler warnings],
870 [with_warnings=$enableval])
871 AC_MSG_RESULT($with_warnings)
873 if test -n "$with_warnings"; then
874 ADAFLAGS="$ADAFLAGS -gnatg"
879 ### use option --enable-assertions to turn on generation of assertion code
880 AC_MSG_CHECKING(if you want to enable runtime assertions)
881 AC_ARG_ENABLE(assertions,
882 [ --enable-assertions test: turn on generation of assertion code],
883 [with_assertions=$enableval],
884 [with_assertions=no])
885 AC_MSG_RESULT($with_assertions)
888 if test "$with_assertions" = no
891 CPPFLAGS="$CPPFLAGS -DNDEBUG"
893 ADAFLAGS="$ADAFLAGS -gnata"
897 ### use option --disable-leaks to suppress "permanent" leaks, for testing
899 [ --disable-leaks test: suppress permanent memory-leaks],
900 [test "$enableval" = no && AC_DEFINE(NO_LEAKS)])
901 AC_DEFINE(HAVE_NC_ALLOC_H)
903 ### use option --enable-expanded to generate certain macros as functions
904 AC_ARG_ENABLE(expanded,
905 [ --enable-expanded test: generate functions for certain macros],
906 [test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)])
908 ### use option --disable-macros to suppress macros in favor of functions
909 AC_ARG_ENABLE(macros,
910 [ --disable-macros test: use functions rather than macros],
911 [test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)])
913 ### Checks for libraries.
914 AC_CHECK_FUNC(gettimeofday,
915 AC_DEFINE(HAVE_GETTIMEOFDAY),[
917 AC_CHECK_LIB(bsd, gettimeofday,
918 AC_DEFINE(HAVE_GETTIMEOFDAY)
919 LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
921 CF_MATH_LIB(MATH_LIB,sin(x))
924 ### Checks for header files.
931 dnl These are some other potentially nonportable headers.
950 # check for ISC (this may also define _POSIX_SOURCE)
951 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
952 if test "$ISC" = yes ; then
953 AC_CHECK_LIB(cposix,main)
954 AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
959 ### checks for compiler characteristics
963 test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS)
967 ### Checks for external-data
971 ### Checks for library functions.
994 if test "$with_getcap" = "yes" ; then
1004 # setup for prototype of fallback for vsscanf()
1005 if test "$cf_cv_func_vsscanf" = vsscanf ; then
1010 AC_SUBST(HAVE_VSSCANF)
1012 dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
1013 if test "$cross_compiling" = yes ; then
1014 AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
1016 AC_FUNC_SETVBUF_REVERSED
1024 dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
1025 if test -z "$cf_user_CFLAGS" ; then
1026 CF_STRIP_G_OPT(CFLAGS)
1027 CF_STRIP_G_OPT(CXXFLAGS)
1030 dnl Check for C++ compiler characteristics (and ensure that it's there!)
1031 CF_BOOL_DECL(cf_cv_cc_bool_type)
1032 if test -n "$CXX" ; then
1036 case $GXX_VERSION in
1048 AC_CHECK_HEADERS(typeinfo)
1057 CXX_AR_OPTS='$(AR_OPTS)'
1058 case $cf_cv_system_name in #(vi
1060 if test "$GXX" != yes ; then
1062 CXX_AR_OPTS='-ar -o'
1066 CXXLDFLAGS="-u main"
1069 if test "$GXX" != yes ; then
1071 CXX_AR_OPTS='-xar -o'
1075 AC_SUBST(CXXLDFLAGS)
1077 AC_SUBST(CXX_AR_OPTS)
1080 cf_cv_builtin_bool=1
1082 # Just because we are not configuring against C++ right now does not
1083 # mean that a user will not want to use C++. Some distributors disable
1084 # the C++ portion of this configuration as a shortcut (or just to avoid
1085 # compiling the demo in the c++ directory). So we need a reasonable
1086 # default for the 'bool' type.
1088 # Caveat: since the storage of the bool type is not standardized, it
1091 if test "$NCURSES_BOOL" != auto ; then
1092 cf_cv_type_of_bool=$NCURSES_AUTO
1094 if test "$cf_cv_header_stdbool_h" = 1 ; then
1097 AC_MSG_CHECKING(for fallback type of bool)
1098 case "$host_cpu" in #(vi
1099 i?86) cf_cv_type_of_bool=char ;; #(vi
1100 *) cf_cv_type_of_bool=int ;;
1102 AC_MSG_RESULT($cf_cv_type_of_bool)
1108 CF_HELP_MESSAGE(Ada95 Binding Options:)
1110 dnl Check for availability of GNU Ada Translator (GNAT).
1111 dnl At the moment we support no other Ada95 compiler.
1112 if test "$cf_with_ada" != "no" ; then
1113 cf_ada_make=gnatmake
1114 AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
1115 if test "$ac_cv_prog_gnat_exists" = no; then
1119 AC_CHECK_PROG(M4_exists, m4, yes, no)
1120 if test "$ac_cv_prog_M4_exists" = no; then
1121 cf_cv_prog_gnat_correct=no
1122 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
1124 if test "$cf_cv_prog_gnat_correct" = yes; then
1125 AC_MSG_CHECKING(if GNAT works)
1126 CF_GNAT_TRY_RUN([procedure conftest;],
1129 procedure conftest is
1131 Text_IO.Put ("Hello World");
1133 GNAT.OS_Lib.OS_Exit (0);
1134 end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
1135 AC_MSG_RESULT($cf_cv_prog_gnat_correct)
1138 if test "$cf_cv_prog_gnat_correct" = yes; then
1139 ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
1141 AC_ARG_WITH(ada-compiler,
1142 [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
1143 [cf_ada_compiler=$withval],
1144 [cf_ada_compiler=gnatmake])
1146 cf_ada_package=terminal_interface
1148 AC_SUBST(cf_ada_make)
1149 AC_SUBST(cf_ada_compiler)
1150 AC_SUBST(cf_ada_package)
1152 AC_SUBST(cf_compile_generics)
1153 AC_SUBST(cf_generic_objects)
1155 CF_WITH_PATH(ada-include,
1156 [ --with-ada-include=DIR Ada includes are in DIR],
1158 PREFIX/lib/ada/adainclude,
1159 [$]prefix/lib/ada/adainclude)
1160 AC_SUBST(ADA_INCLUDE)
1162 CF_WITH_PATH(ada-objects,
1163 [ --with-ada-objects=DIR Ada objects are in DIR],
1165 PREFIX/lib/ada/adalib,
1166 [$]prefix/lib/ada/adalib)
1167 AC_SUBST(ADA_OBJECTS)
1172 ### It's not possible to appease gcc 2.6.3's conversion-warnings if we're
1173 ### using a 'char' for bools. gcc 2.7.0's conversion-warnings are broken too
1174 ### badly to consider using for development purposes, but 2.5.8 is okay.
1175 if test -n "$with_warnings"; then
1176 case $GCC_VERSION in
1178 if test "$cf_cv_type_of_bool" != "char"; then
1179 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
1183 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
1188 ### Construct the library-subsets, if any, from this set of keywords:
1189 ### none, base, ext_funcs, termlib.
1190 AC_MSG_CHECKING(for library subsets)
1191 if test "$with_termlib" = yes ; then
1192 LIB_SUBSETS="termlib "
1194 LIB_SUBSETS="termlib+"
1196 LIB_SUBSETS="${LIB_SUBSETS}base"
1197 test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar"
1198 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
1199 AC_MSG_RESULT($LIB_SUBSETS)
1203 case "$CFLAGS $CPPFLAGS" in
1211 ### Construct the list of include-directories to be generated
1215 ### Build up pieces for makefile rules
1216 AC_MSG_CHECKING(default library suffix)
1217 CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
1218 AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
1219 AC_MSG_RESULT($DFT_ARG_SUFFIX)
1221 AC_MSG_CHECKING(default library-dependency suffix)
1222 CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_DEP_SUFFIX)dnl
1223 if test $DFT_LWR_MODEL = shared ; then
1224 case $cf_cv_system_name in #(vi
1226 DFT_DEP_SUFFIX=".dll.a"
1230 AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
1231 AC_MSG_RESULT($DFT_DEP_SUFFIX)
1233 AC_MSG_CHECKING(default object directory)
1234 CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
1235 AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
1236 AC_MSG_RESULT($DFT_OBJ_SUBDIR)
1238 # libtool thinks it can make c++ shared libraries (perhaps only g++)
1239 AC_MSG_CHECKING(c++ library-dependency suffix)
1240 if test "$with_libtool" = "yes"; then
1241 CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
1243 CF_LIB_SUFFIX(normal,CXX_LIB_SUFFIX)dnl we normally make a static library
1245 AC_MSG_RESULT($CXX_LIB_SUFFIX)
1246 AC_SUBST(CXX_LIB_SUFFIX)
1248 TINFO_LIST="$SHLIB_LIST"
1249 test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}"
1251 AC_MSG_CHECKING(where we will install curses.h)
1252 test "$with_overwrite" = no && \
1253 test "x$includedir" = 'x${prefix}/include' && \
1254 includedir='$(prefix)/include/ncurses'${LIB_SUFFIX}
1255 AC_MSG_RESULT($includedir)
1257 ### Resolve a conflict between normal and wide-curses by forcing applications
1258 ### that will need libutf8 to add it to their configure script.
1259 if test "$with_overwrite" != no ; then
1260 if test "$NCURSES_LIBUTF8" = 1 ; then
1261 NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)'
1262 AC_MSG_WARN(Wide-character applications must define HAVE_LIBUTF8_H to include curses.h)
1266 AC_SUBST(EXTRA_LIBS)
1267 AC_SUBST(TINFO_LIST)
1268 AC_SUBST(SHLIB_LIST)
1270 ### Set up low-level terminfo dependencies for makefiles. Note that we
1271 ### could override this.
1272 if test "$with_termlib" = yes ; then
1273 TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}"
1274 if test "$DFT_LWR_MODEL" = "libtool"; then
1275 TEST_ARGS="${TEST_DEPS}"
1277 TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}"
1280 PROG_DEPS="$TEST_DEPS"
1281 PROG_ARGS="$TEST_ARGS"
1283 ### Construct the list of subdirectories for which we'll customize makefiles
1284 ### with the appropriate compile-rules.
1286 CF_SRC_MODULES($modules_to_build)
1289 AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP')
1291 ### Now that we're done running tests, add the compiler-warnings, if any
1292 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
1294 ################################################################################
1296 include/MKterm.h.awk \
1297 include/curses.head:include/curses.h.in \
1300 misc/run_tic.sh:misc/run_tic.in \
1305 ### Special initialization commands, used to pass information from the
1306 ### configuration-run into config.status
1309 CF_LIST_MODELS="$cf_list_models"
1310 DFT_LWR_MODEL="$DFT_LWR_MODEL"
1311 LDCONFIG="$LDCONFIG"
1312 LIB_NAME="$LIB_NAME"
1313 LIB_SUBSETS="$LIB_SUBSETS"
1314 LIB_SUFFIX="$LIB_SUFFIX"
1315 LIB_TRACING="$LIB_TRACING"
1316 MAKE_TERMINFO="$MAKE_TERMINFO"
1317 NCURSES_OSPEED="$NCURSES_OSPEED"
1318 SRC_SUBDIRS="$SRC_SUBDIRS"
1319 TERMINFO="$TERMINFO"
1320 TINFO_NAME="$TINFO_NAME"
1321 WITH_CURSES_H="$with_curses_h"
1322 WITH_ECHO="$with_echo"
1323 WITH_OVERWRITE="$with_overwrite"
1324 cf_cv_abi_version="$cf_cv_abi_version"
1325 cf_cv_do_symlinks="$cf_cv_do_symlinks"
1326 cf_cv_rel_version="$cf_cv_rel_version"
1327 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
1328 cf_cv_shlib_version="$cf_cv_shlib_version"
1329 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
1330 cf_cv_system_name="$cf_cv_system_name"
1331 cf_with_cxx_binding="$cf_with_cxx_binding"
1335 ${MAKE-make} preinstall