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.268 2002/06/15 17:40:45 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.20020210)
38 AC_REVISION($Revision: 1.268 $)
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_LDFLAGS='$(LDFLAGS)'
97 if test "$host_alias" != "$target_alias" ; then
99 [ --with-build-cc=XXX if cross-compiling, the host C compiler (\$BUILD_CC)],
100 [BUILD_CC="$withval"],
101 [AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)])
102 AC_ARG_WITH(build-cflags,
103 [ --with-build-cflags=XXX if cross-compiling, the host C compiler-flags],
104 [BUILD_CFLAGS="$withval"])
105 AC_ARG_WITH(build-ldflags,
106 [ --with-build-ldflags=XXX if cross-compiling, the host linker-flags],
107 [BUILD_LDFLAGS="$withval"])
108 AC_ARG_WITH(build-libs,
109 [ --with-build-libs=XXX if cross-compiling, the host libraries],
110 [BUILD_LIBS="$withval"])
113 AC_SUBST(BUILD_CFLAGS)
114 AC_SUBST(BUILD_LDFLAGS)
118 AC_PROG_GCC_TRADITIONAL
123 case "$cf_cv_system_name" in
125 test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
127 *) LDPATH=$PATH:/sbin:/usr/sbin
128 AC_PATH_PROG(LDCONFIG,ldconfig,,$LDPATH)
133 dnl DEFECT in autoconf 2.12: an attempt to set policy, this breaks the
134 dnl configure script by not letting us test if C++
135 dnl is present, making this option necessary.
136 AC_MSG_CHECKING(if you want to ensure bool is consistent with C++)
138 [ --without-cxx do not adjust ncurses bool to match C++],
139 [cf_with_cxx=$withval],
141 AC_MSG_RESULT($cf_with_cxx)
142 if test "X$cf_with_cxx" = Xno ; then
146 pushdef([AC_MSG_ERROR],
147 [AC_MSG_RESULT([You don't have any C++ compiler, too bad]); dnl
148 cf_with_cxx=no; CXX=""; GXX="";])dnl
150 popdef([AC_MSG_ERROR])dnl
154 if test "$GXX" = yes; then
155 AC_MSG_CHECKING(version of g++)
156 GXX_VERSION="`${CXX-g++} --version|head -1`"
157 AC_MSG_RESULT($GXX_VERSION)
160 GXX=""; CXX=""; ac_cv_prog_gxx=no
162 AC_MSG_WARN(templates do not work)
167 AC_MSG_CHECKING(if you want to build C++ binding and demo)
168 AC_ARG_WITH(cxx-binding,
169 [ --without-cxx-binding do not build C++ binding and demo],
170 [cf_with_cxx_binding=$withval],
171 [cf_with_cxx_binding=$cf_with_cxx])
172 AC_MSG_RESULT($cf_with_cxx_binding)
174 AC_MSG_CHECKING(if you want to build with Ada95)
176 [ --without-ada suppress check for Ada95, don't build demo],
177 [cf_with_ada=$withval],
179 AC_MSG_RESULT($cf_with_ada)
181 AC_MSG_CHECKING(if you want to build programs such as tic)
183 [ --without-progs suppress build with programs (e.g., tic)],
184 [cf_with_progs=$withval],
186 AC_MSG_RESULT($cf_with_progs)
188 AC_MSG_CHECKING(if you wish to install curses.h)
189 AC_ARG_WITH(curses-h,
190 [ --without-curses-h install curses.h as ncurses.h only],
191 [with_curses_h=$withval],
193 AC_MSG_RESULT($with_curses_h)
195 modules_to_build="ncurses"
196 if test "X$cf_with_progs" != Xno ; then
197 modules_to_build="$modules_to_build progs tack"
199 modules_to_build="$modules_to_build panel menu form"
205 AC_SYS_LONG_FILE_NAMES
206 CF_MIXEDCASE_FILENAMES
210 AC_CHECK_PROGS(LINT, tdlint lint alint)
211 AC_CHECK_PROGS(MAN, man man_db)
214 dnl These are standard among *NIX systems, but not when cross-compiling
215 CF_SUBST(loader,LD,ld)
216 CF_SUBST(archiver,AR,ar)
217 CF_SUBST(archiver options,AR_OPTS,rv)
221 dnl Special option for use by system-builders: the install-prefix is used to
222 dnl adjust the location into which the actual install is done, so that an
223 dnl archive can be built without modifying the host system's configuration.
224 AC_MSG_CHECKING(if you have specified an install-prefix)
225 AC_ARG_WITH(install-prefix,
226 [ --with-install-prefix prefixes actual install-location (\$DESTDIR)],
227 [case "$withval" in #(vi
230 *) DESTDIR="$withval"
233 AC_MSG_RESULT($DESTDIR)
236 ###############################################################################
237 CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
239 ### Options to allow the user to specify the set of libraries which are used.
240 ### Use "--without-normal --with-shared" to allow the default model to be
241 ### shared, for example.
243 AC_SUBST(cf_list_models)dnl the complete list of models ("normal debug")
245 AC_MSG_CHECKING(if you want to build libraries with libtool)
247 [ --with-libtool generate libraries with libtool],
248 [with_libtool=$withval],
250 AC_MSG_RESULT($with_libtool)
251 if test "$with_libtool" = "yes"; then
252 cf_list_models="$cf_list_models libtool"
253 test -z "$LIBTOOL" && LIBTOOL=libtool
259 AC_MSG_CHECKING(if you want to build shared libraries)
261 [ --with-shared generate shared-libraries],
262 [with_shared=$withval],
264 AC_MSG_RESULT($with_shared)
265 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
267 AC_MSG_CHECKING(if you want to build static libraries)
269 [ --with-normal generate normal-libraries (default)],
270 [with_normal=$withval],
272 AC_MSG_RESULT($with_normal)
273 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
275 AC_MSG_CHECKING(if you want to build debug libraries)
277 [ --with-debug generate debug-libraries (default)],
278 [with_debug=$withval],
280 AC_MSG_RESULT($with_debug)
281 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
283 AC_MSG_CHECKING(if you want to build profiling libraries)
285 [ --with-profile generate profile-libraries],
286 [with_profile=$withval],
288 AC_MSG_RESULT($with_profile)
289 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
291 ###############################################################################
293 AC_MSG_CHECKING(for specified models)
294 test -z "$cf_list_models" && cf_list_models=normal
295 dnl If we use libtool to generate libraries, then it must be the only
297 test "$with_libtool" = "yes" && cf_list_models=libtool
298 AC_MSG_RESULT($cf_list_models)
300 ### Use the first model as the default, and save its suffix for use in building
301 ### up test-applications.
302 AC_MSG_CHECKING(for default model)
303 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'`
304 AC_MSG_RESULT($DFT_LWR_MODEL)
306 CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
308 AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal")
309 AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL")
318 CF_LIB_PREFIX(cf_prefix)
319 LIB_PREFIX=$cf_prefix
325 ###############################################################################
327 AC_MSG_CHECKING(if you want to build a separate terminfo library)
329 [ --with-termlib generate separate terminfo library],
330 [with_termlib=$withval],
332 AC_MSG_RESULT($with_termlib)
334 ### Checks for special libraries, must be done up-front.
335 AC_MSG_CHECKING(if you want to link with dbmalloc for testing)
336 AC_ARG_WITH(dbmalloc,
337 [ --with-dbmalloc test: use Conor Cahill's dbmalloc library],
338 [with_dbmalloc=$withval],
340 AC_MSG_RESULT($with_dbmalloc)
341 if test "$with_dbmalloc" = yes ; then
342 AC_CHECK_LIB(dbmalloc,debug_malloc)
345 AC_MSG_CHECKING(if you want to link with dmalloc for testing)
347 [ --with-dmalloc test: use Gray Watson's dmalloc library],
348 [with_dmalloc=$withval],
350 AC_MSG_RESULT($with_dmalloc)
351 if test "$with_dmalloc" = yes ; then
352 AC_CHECK_LIB(dmalloc,dmalloc_debug)
356 AC_MSG_CHECKING(if you want to link with the gpm mouse library)
358 [ --with-gpm use Alessandro Rubini's GPM library],
361 AC_MSG_RESULT($with_gpm)
362 if test "$with_gpm" = yes ; then
363 AC_CHECK_LIB(gpm,Gpm_Open,[
364 EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS"
365 SHLIB_LIST="-lgpm $SHLIB_LIST"
366 AC_DEFINE(HAVE_LIBGPM)
367 AC_CHECK_HEADERS(gpm.h)
368 ],AC_MSG_WARN(Cannot link with gpm library - read the FAQ))
371 dnl Not all ports of gcc support the -g option
373 if test X"$CC_G_OPT" = X"" ; then
375 test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
379 if test X"$CXX_G_OPT" = X"" ; then
381 test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
385 AC_MSG_CHECKING(for default loader flags)
386 case $DFT_LWR_MODEL in
387 libtool) LD_MODEL='' ;;
388 normal) LD_MODEL='' ;;
389 debug) LD_MODEL=$CC_G_OPT ;;
390 profile) LD_MODEL='-pg';;
391 shared) LD_MODEL='' ;;
393 AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
394 AC_MSG_RESULT($LD_MODEL)
396 AC_MSG_CHECKING(if rpath option should be used)
398 [ --enable-rpath use rpath option when generating shared libraries],
399 [cf_cv_ld_rpath=$enableval],
401 AC_MSG_RESULT($cf_cv_ld_rpath)
404 if test "$CC_SHARED_OPTS" = "unknown"; then
405 for model in $cf_list_models; do
406 if test "$model" = "shared"; then
407 AC_ERROR(Shared libraries are not supported in this version)
412 ###############################################################################
413 CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
415 ### use option --disable-overwrite to leave out the link to -lcurses
416 AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
417 AC_ARG_ENABLE(overwrite,
418 [ --disable-overwrite leave out the link to -lcurses],
419 [with_overwrite=$enableval],
420 [if test "$prefix" != "/usr/local" ; then with_overwrite=yes; else with_overwrite=no; fi])
421 AC_MSG_RESULT($with_overwrite)
423 AC_MSG_CHECKING(if external terminfo-database is used)
424 AC_ARG_ENABLE(database,
425 [ --disable-database do not use terminfo, only fallbacks/termcap],
426 [use_database=$enableval],
428 AC_MSG_RESULT($use_database)
430 case $host_os in #(vi
432 TERMINFO_SRC='${top_srcdir}/misc/emx.src'
435 TERMINFO_SRC='${top_srcdir}/misc/terminfo.src'
438 AC_SUBST(TERMINFO_SRC)
441 if test "$use_database" != no ; then
442 AC_DEFINE(USE_DATABASE)
443 AC_MSG_CHECKING(which terminfo source-file will be installed)
444 AC_ARG_ENABLE(database,
445 [ --with-database=XXX specify terminfo source to install],
446 [TERMINFO_SRC=$withval])
447 AC_MSG_RESULT($TERMINFO_SRC)
450 AC_MSG_CHECKING(for list of fallback descriptions)
451 AC_ARG_WITH(fallbacks,
452 [ --with-fallbacks=XXX specify list of fallback terminal descriptions],
453 [with_fallback=$withval],
455 AC_MSG_RESULT($with_fallback)
456 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'`
457 AC_SUBST(FALLBACK_LIST)
460 if test "$use_database" = no ; then
461 TERMINFO="${datadir}/terminfo"
465 AC_MSG_CHECKING(for list of terminfo directories)
466 CF_WITH_PATHLIST(terminfo-dirs,
467 [ --with-terminfo-dirs=XXX specify list of terminfo directories],
471 AC_MSG_RESULT($TERMINFO_DIRS)
472 test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS")
474 AC_MSG_CHECKING(for default terminfo directory)
475 CF_WITH_PATH(default-terminfo-dir,
476 [ --with-default-terminfo-dir=DIR default terminfo directory],
480 AC_MSG_RESULT($TERMINFO)
481 AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO")
486 AC_SUBST(MAKE_TERMINFO)
488 ### use option --disable-big-core to make tic run on small machines
489 ### We need 4Mb, check if we can allocate 50% more than that.
490 AC_MSG_CHECKING(if big-core option selected)
491 AC_ARG_ENABLE(big-core,
492 [ --disable-big-core assume machine has little memory],
493 [with_big_core=$enableval],
498 unsigned long n = 6000000L;
506 [with_big_core=no])])
507 AC_MSG_RESULT($with_big_core)
508 test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
510 ### use option --enable-termcap to compile in the termcap fallback support
511 AC_MSG_CHECKING(if you want termcap-fallback support)
512 AC_ARG_ENABLE(termcap,
513 [ --enable-termcap compile in termcap fallback support],
514 [with_termcap=$enableval],
516 AC_MSG_RESULT($with_termcap)
518 if test "$with_termcap" != "yes" ; then
519 if test "$use_database" = no ; then
520 if test -z $with_fallback ; then
521 AC_ERROR(You have disabled the database w/o specifying fallbacks)
524 AC_DEFINE(PURE_TERMINFO)
527 AC_DEFINE(USE_TERMCAP)
528 AC_MSG_CHECKING(for list of termcap files)
529 CF_WITH_PATHLIST(termpath,
530 [ --with-termpath=XXX specify list of termcap files],
532 /etc/termcap:/usr/share/misc/termcap)
533 AC_MSG_RESULT($TERMPATH)
534 test -n "$TERMPATH" && AC_DEFINE_UNQUOTED(TERMPATH,"$TERMPATH")
536 ### use option --enable-getcap to use a hacked getcap for reading termcaps
537 AC_MSG_CHECKING(if fast termcap-loader is needed)
538 AC_ARG_ENABLE(getcap,
539 [ --enable-getcap fast termcap load, no xrefs to terminfo],
540 [with_getcap=$enableval],
542 AC_MSG_RESULT($with_getcap)
543 test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP)
545 AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
546 AC_ARG_ENABLE(getcap-cache,
547 [ --enable-getcap-cache cache translated termcaps in ~/.terminfo],
548 [with_getcap_cache=$enableval],
549 [with_getcap_cache=no])
550 AC_MSG_RESULT($with_getcap_cache)
551 test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE)
555 ### Use option --enable-symlinks to make tic use symlinks, not hard links
556 ### to reduce storage requirements for the terminfo database.
562 if test "$ac_cv_func_link" != yes ; then
563 AC_MSG_CHECKING(if tic should use symbolic links)
564 if test "$ac_cv_func_symlink" = yes ; then
569 AC_MSG_RESULT($with_symlinks)
570 elif test "$ac_cv_func_symlink" != yes ; then
571 AC_MSG_CHECKING(if tic should use hard links)
572 if test "$ac_cv_func_link" = yes ; then
577 AC_MSG_RESULT($with_links)
579 AC_MSG_CHECKING(if tic should use symbolic links)
580 AC_ARG_ENABLE(symlinks,
581 [ --enable-symlinks make tic use symbolic links not hard links],
582 [with_symlinks=$enableval],
584 AC_MSG_RESULT($with_symlinks)
587 test "$with_links" = yes && AC_DEFINE(USE_LINKS)
588 test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS)
590 ### use option --enable-broken-linker to force on use of broken-linker support
591 AC_MSG_CHECKING(if you want broken-linker support code)
592 AC_ARG_ENABLE(broken_linker,
593 [ --enable-broken_linker compile with broken-linker support code],
594 [with_broken_linker=$enableval],
595 [with_broken_linker=$BROKEN_LINKER])
596 AC_MSG_RESULT($with_broken_linker)
599 if test "$with_broken_linker" = yes ; then
600 AC_DEFINE(BROKEN_LINKER)
602 elif test $DFT_LWR_MODEL = shared ; then
603 case $cf_cv_system_name in #(vi
605 AC_DEFINE(BROKEN_LINKER)
607 CF_VERBOSE(cygwin linker is broken anyway)
611 AC_SUBST(BROKEN_LINKER)
613 ### use option --with-bool to override bool's type
614 AC_MSG_CHECKING(for type of bool)
616 [ --with-bool=TYPE override fallback type of bool variable],
617 [NCURSES_BOOL="$withval"],
619 AC_MSG_RESULT($NCURSES_BOOL)
620 AC_SUBST(NCURSES_BOOL)
622 ### use option --with-ospeed to override ospeed's type
623 AC_MSG_CHECKING(for type of ospeed)
625 [ --with-ospeed=TYPE override type of ospeed variable],
626 [NCURSES_OSPEED="$withval"],
627 [NCURSES_OSPEED=short])
628 AC_MSG_RESULT($NCURSES_OSPEED)
629 AC_SUBST(NCURSES_OSPEED)
631 ### use option --enable-bsdpad to have tputs process BSD-style prefix padding
632 AC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
633 AC_ARG_ENABLE(bsdpad,
634 [ --enable-bsdpad recognize BSD-style prefix padding],
635 [with_bsdpad=$enableval],
637 AC_MSG_RESULT($with_bsdpad)
638 test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS)
640 ### Enable compiling-in rcs id's
641 AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
643 [ --with-rcs-ids compile-in RCS identifiers],
644 [with_rcs_ids=$withval],
646 AC_MSG_RESULT($with_rcs_ids)
647 test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
649 ###############################################################################
650 CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ])
652 ###############################################################################
653 CF_HELP_MESSAGE(Extensions:)
655 ### Note that some functions (such as const) are normally disabled anyway.
656 AC_MSG_CHECKING(if you want to build with function extensions)
657 AC_ARG_ENABLE(ext-funcs,
658 [ --disable-ext-funcs disable function-extensions],
659 [with_ext_funcs=$enableval],
660 [with_ext_funcs=yes])
661 AC_MSG_RESULT($with_ext_funcs)
662 if test "$with_ext_funcs" = yes ; then
664 AC_DEFINE(HAVE_CURSES_VERSION)
665 AC_DEFINE(HAVE_HAS_KEY)
666 AC_DEFINE(HAVE_RESIZETERM)
667 AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
668 AC_DEFINE(HAVE_WRESIZE)
669 AC_DEFINE(NCURSES_EXT_FUNCS)
673 AC_SUBST(NCURSES_EXT_FUNCS)
675 ### use option --enable-const to turn on use of const beyond that in XSI.
676 AC_MSG_CHECKING(for extended use of const keyword)
678 [ --enable-const compile with extra/non-standard const],
679 [with_ext_const=$enableval],
681 AC_MSG_RESULT($with_ext_const)
682 NCURSES_CONST='/*nothing*/'
683 if test "$with_ext_const" = yes ; then
686 AC_SUBST(NCURSES_CONST)
688 AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code)
689 AC_ARG_ENABLE(no-padding,
690 [ --enable-no-padding compile with \$NCURSES_NO_PADDING code],
691 [with_no_padding=$enableval],
692 [with_no_padding=$with_ext_funcs])
693 AC_MSG_RESULT($with_no_padding)
694 test "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING)
696 ### use option --enable-sigwinch to turn on use of SIGWINCH logic
697 AC_MSG_CHECKING(if you want SIGWINCH handler)
698 AC_ARG_ENABLE(sigwinch,
699 [ --enable-sigwinch compile with SIGWINCH handler],
700 [with_sigwinch=$enableval],
701 [with_sigwinch=$with_ext_funcs])
702 AC_MSG_RESULT($with_sigwinch)
703 test "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH)
705 ### use option --enable-tcap-names to allow user to define new capabilities
706 AC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap)
707 AC_ARG_ENABLE(tcap-names,
708 [ --enable-tcap-names compile with user-definable terminal capabilities],
709 [with_tcap_names=$enableval],
710 [with_tcap_names=$with_ext_funcs])
711 AC_MSG_RESULT($with_tcap_names)
713 test "$with_tcap_names" = yes && NCURSES_XNAMES=1
714 AC_SUBST(NCURSES_XNAMES)
716 ###############################################################################
717 # These options are relatively safe to experiment with.
718 CF_HELP_MESSAGE(Development Code:)
719 AC_MSG_CHECKING(if you want all development code)
721 [ --with-develop enable all development options],
722 [with_develop=$withval],
724 AC_MSG_RESULT($with_develop)
726 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize
727 AC_MSG_CHECKING(if you want hard-tabs code)
728 AC_ARG_ENABLE(hard-tabs,
729 [ --enable-hard-tabs compile with hard-tabs code],
730 [with_hardtabs=$enableval],
731 [with_hardtabs=$with_develop])
732 AC_MSG_RESULT($with_hardtabs)
733 test "$with_hardtabs" = yes && AC_DEFINE(USE_HARD_TABS)
735 AC_MSG_CHECKING(if you want to use restrict environment when running as root)
736 AC_ARG_ENABLE(root-environ,
737 [ --disable-root-environ limit environment when running as root],
738 [with_root_environ=$enableval],
739 [with_root_environ=yes])
740 AC_MSG_RESULT($with_root_environ)
741 test "$with_root_environ" = yes && AC_DEFINE(USE_ROOT_ENVIRON)
743 ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize
744 AC_MSG_CHECKING(if you want limited support for xmc)
745 AC_ARG_ENABLE(xmc-glitch,
746 [ --enable-xmc-glitch compile with limited support for xmc],
747 [with_xmc_glitch=$enableval],
748 [with_xmc_glitch=$with_develop])
749 AC_MSG_RESULT($with_xmc_glitch)
750 test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT)
752 ###############################################################################
753 # These are just experimental, probably should not be in a package:
754 CF_HELP_MESSAGE(Experimental Code:)
756 AC_MSG_CHECKING(if you do not want to assume colors are white-on-black)
757 AC_ARG_ENABLE(assumed-color,
758 [ --disable-assumed-color do not assume anything about default-colors],
759 [with_assumed_color=$enableval],
760 [with_assumed_color=yes])
761 AC_MSG_RESULT($with_assumed_color)
762 test "$with_assumed_color" = yes && AC_DEFINE(USE_ASSUMED_COLOR)
764 ### use option --enable-hashmap to turn on use of hashmap scrolling logic
765 AC_MSG_CHECKING(if you want hashmap scrolling-optimization code)
766 AC_ARG_ENABLE(hashmap,
767 [ --disable-hashmap compile without hashmap scrolling-optimization],
768 [with_hashmap=$enableval],
770 AC_MSG_RESULT($with_hashmap)
771 test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP)
773 ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment
774 AC_MSG_CHECKING(if you want colorfgbg code)
775 AC_ARG_ENABLE(colorfgbg,
776 [ --enable-colorfgbg compile with \$COLORFGBG code],
777 [with_colorfgbg=$enableval],
779 AC_MSG_RESULT($with_colorfgbg)
780 test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
782 AC_MSG_CHECKING(if you want experimental safe-sprintf code)
783 AC_ARG_ENABLE(safe-sprintf,
784 [ --enable-safe-sprintf compile with experimental safe-sprintf code],
785 [with_safe_sprintf=$enableval],
786 [with_safe_sprintf=no])
787 AC_MSG_RESULT($with_safe_sprintf)
788 test "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF)
790 ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
791 # when hashmap is used scroll hints are useless
792 if test "$with_hashmap" = no ; then
793 AC_MSG_CHECKING(if you want to experiment without scrolling-hints code)
794 AC_ARG_ENABLE(scroll-hints,
795 [ --disable-scroll-hints compile without scroll-hints code],
796 [with_scroll_hints=$enableval],
797 [with_scroll_hints=yes])
798 AC_MSG_RESULT($with_scroll_hints)
799 test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS)
802 ### use option --enable-widec to turn on use of wide-character support
806 AC_MSG_CHECKING(if you want experimental wide-character code)
808 [ --enable-widec compile with experimental wide-char/UTF-8 code],
809 [with_widec=$enableval],
811 AC_MSG_RESULT($with_widec)
812 if test "$with_widec" = yes ; then
813 LIB_SUFFIX="w${LIB_SUFFIX}"
814 AC_DEFINE(USE_WIDEC_SUPPORT)
815 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
819 if test "$ac_cv_func_putwc" != yes ; then
821 if test "$cf_cv_libutf8" = yes ; then
826 if test $cf_cv_mbstate_t = yes ; then
830 AC_SUBST(NCURSES_CH_T)
831 AC_SUBST(NCURSES_LIBUTF8)
832 AC_SUBST(NCURSES_MBSTATE_T)
834 AC_MSG_CHECKING(for terminal capabilities file)
836 [ --with-caps=alt compile with experimental alternate Caps file],
837 [TERMINFO_CAPS=Caps.$withval],
838 [TERMINFO_CAPS=Caps])
839 test -f ${srcdir}/include/${TERMINFO_CAPS} || TERMINFO_CAPS=Caps
840 AC_MSG_RESULT($TERMINFO_CAPS)
841 AC_SUBST(TERMINFO_CAPS)
843 ###############################################################################
844 CF_HELP_MESSAGE(Testing/development Options:)
846 ### use option --disable-echo to suppress full display compiling commands
847 AC_MSG_CHECKING(if you want to display full commands during build)
849 [ --enable-echo build: display "compiling" commands (default)],
850 [with_echo=$enableval],
852 if test "$with_echo" = yes; then
855 ECHO_LINK='@ echo linking $@ ... ;'
856 test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent"
858 AC_MSG_RESULT($with_echo)
861 ### use option --enable-warnings to turn on all gcc warnings
862 AC_MSG_CHECKING(if you want to see compiler warnings)
863 AC_ARG_ENABLE(warnings,
864 [ --enable-warnings build: turn on GCC compiler warnings],
865 [with_warnings=$enableval])
866 AC_MSG_RESULT($with_warnings)
868 if test -n "$with_warnings"; then
869 ADAFLAGS="$ADAFLAGS -gnatg"
874 ### use option --enable-assertions to turn on generation of assertion code
875 AC_MSG_CHECKING(if you want to enable runtime assertions)
876 AC_ARG_ENABLE(assertions,
877 [ --enable-assertions test: turn on generation of assertion code],
878 [with_assertions=$enableval],
879 [with_assertions=no])
880 AC_MSG_RESULT($with_assertions)
883 if test "$with_assertions" = no
886 CPPFLAGS="$CPPFLAGS -DNDEBUG"
888 ADAFLAGS="$ADAFLAGS -gnata"
892 ### use option --disable-leaks to suppress "permanent" leaks, for testing
894 [ --disable-leaks test: suppress permanent memory-leaks],
895 [test "$enableval" = no && AC_DEFINE(NO_LEAKS)])
896 AC_DEFINE(HAVE_NC_ALLOC_H)
898 ### use option --enable-expanded to generate certain macros as functions
899 AC_ARG_ENABLE(expanded,
900 [ --enable-expanded test: generate functions for certain macros],
901 [test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)])
903 ### use option --disable-macros to suppress macros in favor of functions
904 AC_ARG_ENABLE(macros,
905 [ --disable-macros test: use functions rather than macros],
906 [test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)])
908 ### Checks for libraries.
909 AC_CHECK_FUNC(gettimeofday,
910 AC_DEFINE(HAVE_GETTIMEOFDAY),[
912 AC_CHECK_LIB(bsd, gettimeofday,
913 AC_DEFINE(HAVE_GETTIMEOFDAY)
914 LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
916 CF_MATH_LIB(MATH_LIB,sin(x))
919 ### Checks for header files.
926 dnl These are some other potentially nonportable headers.
945 # check for ISC (this may also define _POSIX_SOURCE)
946 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
947 if test "$ISC" = yes ; then
948 AC_CHECK_LIB(cposix,main)
949 AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
954 ### checks for compiler characteristics
958 test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS)
962 ### Checks for external-data
966 ### Checks for library functions.
989 if test "$with_getcap" = "yes" ; then
999 # setup for prototype of fallback for vsscanf()
1000 if test "$cf_cv_func_vsscanf" = vsscanf ; then
1005 AC_SUBST(HAVE_VSSCANF)
1007 dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
1008 if test "$cross_compiling" = yes ; then
1009 AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
1011 AC_FUNC_SETVBUF_REVERSED
1019 dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
1020 if test -z "$cf_user_CFLAGS" ; then
1021 CF_STRIP_G_OPT(CFLAGS)
1022 CF_STRIP_G_OPT(CXXFLAGS)
1025 dnl Check for C++ compiler characteristics (and ensure that it's there!)
1026 CF_BOOL_DECL(cf_cv_cc_bool_type)
1027 if test -n "$CXX" ; then
1031 case $GXX_VERSION in
1043 AC_CHECK_HEADERS(typeinfo)
1052 CXX_AR_OPTS='$(AR_OPTS)'
1053 case $cf_cv_system_name in #(vi
1055 if test "$GXX" != yes ; then
1057 CXX_AR_OPTS='-ar -o'
1061 CXXLDFLAGS="-u main"
1064 if test "$GXX" != yes ; then
1066 CXX_AR_OPTS='-xar -o'
1070 AC_SUBST(CXXLDFLAGS)
1072 AC_SUBST(CXX_AR_OPTS)
1075 cf_cv_builtin_bool=1
1077 # Just because we are not configuring against C++ right now does not
1078 # mean that a user will not want to use C++. Some distributors disable
1079 # the C++ portion of this configuration as a shortcut (or just to avoid
1080 # compiling the demo in the c++ directory). So we need a reasonable
1081 # default for the 'bool' type.
1083 # Caveat: since the storage of the bool type is not standardized, it
1086 if test "$NCURSES_BOOL" != auto ; then
1087 cf_cv_type_of_bool=$NCURSES_AUTO
1089 if test "$cf_cv_header_stdbool_h" = 1 ; then
1092 AC_MSG_CHECKING(for fallback type of bool)
1093 case "$host_cpu" in #(vi
1094 i?86) cf_cv_type_of_bool=char ;; #(vi
1095 *) cf_cv_type_of_bool=int ;;
1097 AC_MSG_RESULT($cf_cv_type_of_bool)
1103 CF_HELP_MESSAGE(Ada95 Binding Options:)
1105 dnl Check for availability of GNU Ada Translator (GNAT).
1106 dnl At the moment we support no other Ada95 compiler.
1107 if test "$cf_with_ada" != "no" ; then
1108 cf_ada_make=gnatmake
1109 AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
1110 if test "$ac_cv_prog_gnat_exists" = no; then
1114 AC_CHECK_PROG(M4_exists, m4, yes, no)
1115 if test "$ac_cv_prog_M4_exists" = no; then
1116 cf_cv_prog_gnat_correct=no
1117 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
1119 if test "$cf_cv_prog_gnat_correct" = yes; then
1120 AC_MSG_CHECKING(if GNAT works)
1121 CF_GNAT_TRY_RUN([procedure conftest;],
1124 procedure conftest is
1126 Text_IO.Put ("Hello World");
1128 GNAT.OS_Lib.OS_Exit (0);
1129 end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
1130 AC_MSG_RESULT($cf_cv_prog_gnat_correct)
1133 if test "$cf_cv_prog_gnat_correct" = yes; then
1134 ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
1136 AC_ARG_WITH(ada-compiler,
1137 [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
1138 [cf_ada_compiler=$withval],
1139 [cf_ada_compiler=gnatmake])
1141 cf_ada_package=terminal_interface
1143 AC_SUBST(cf_ada_make)
1144 AC_SUBST(cf_ada_compiler)
1145 AC_SUBST(cf_ada_package)
1147 AC_SUBST(cf_compile_generics)
1148 AC_SUBST(cf_generic_objects)
1150 CF_WITH_PATH(ada-include,
1151 [ --with-ada-include=DIR Ada includes are in DIR],
1153 PREFIX/lib/ada/adainclude,
1154 [$]prefix/lib/ada/adainclude)
1155 AC_SUBST(ADA_INCLUDE)
1157 CF_WITH_PATH(ada-objects,
1158 [ --with-ada-objects=DIR Ada objects are in DIR],
1160 PREFIX/lib/ada/adalib,
1161 [$]prefix/lib/ada/adalib)
1162 AC_SUBST(ADA_OBJECTS)
1167 ### It's not possible to appease gcc 2.6.3's conversion-warnings if we're
1168 ### using a 'char' for bools. gcc 2.7.0's conversion-warnings are broken too
1169 ### badly to consider using for development purposes, but 2.5.8 is okay.
1170 if test -n "$with_warnings"; then
1171 case $GCC_VERSION in
1173 if test "$cf_cv_type_of_bool" != "char"; then
1174 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
1178 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
1183 ### Construct the library-subsets, if any, from this set of keywords:
1184 ### none, base, ext_funcs, termlib.
1185 AC_MSG_CHECKING(for library subsets)
1186 if test "$with_termlib" = yes ; then
1187 LIB_SUBSETS="termlib "
1189 LIB_SUBSETS="termlib+"
1191 LIB_SUBSETS="${LIB_SUBSETS}base"
1192 test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar"
1193 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
1194 AC_MSG_RESULT($LIB_SUBSETS)
1198 case "$CFLAGS $CPPFLAGS" in
1206 ### Construct the list of include-directories to be generated
1210 ### Build up pieces for makefile rules
1211 AC_MSG_CHECKING(default library suffix)
1212 CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
1213 AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
1214 AC_MSG_RESULT($DFT_ARG_SUFFIX)
1216 AC_MSG_CHECKING(default library-dependency suffix)
1217 CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_DEP_SUFFIX)dnl
1218 if test $DFT_LWR_MODEL = shared ; then
1219 case $cf_cv_system_name in #(vi
1221 DFT_DEP_SUFFIX=".dll.a"
1225 AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
1226 AC_MSG_RESULT($DFT_DEP_SUFFIX)
1228 AC_MSG_CHECKING(default object directory)
1229 CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
1230 AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
1231 AC_MSG_RESULT($DFT_OBJ_SUBDIR)
1233 # libtool thinks it can make c++ shared libraries (perhaps only g++)
1234 AC_MSG_CHECKING(c++ library-dependency suffix)
1235 if test "$with_libtool" = "yes"; then
1236 CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
1238 CF_LIB_SUFFIX(normal,CXX_LIB_SUFFIX)dnl we normally make a static library
1240 AC_MSG_RESULT($CXX_LIB_SUFFIX)
1241 AC_SUBST(CXX_LIB_SUFFIX)
1243 TINFO_LIST="$SHLIB_LIST"
1244 test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}"
1246 AC_MSG_CHECKING(where we will install curses.h)
1247 test "$with_overwrite" = no && \
1248 test "x$includedir" = 'x${prefix}/include' && \
1249 includedir='$(prefix)/include/ncurses'${LIB_SUFFIX}
1250 AC_MSG_RESULT($includedir)
1252 AC_SUBST(EXTRA_LIBS)
1253 AC_SUBST(TINFO_LIST)
1254 AC_SUBST(SHLIB_LIST)
1256 ### Set up low-level terminfo dependencies for makefiles. Note that we
1257 ### could override this.
1258 if test "$with_termlib" = yes ; then
1259 TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}"
1260 if test "$DFT_LWR_MODEL" = "libtool"; then
1261 TEST_ARGS="${TEST_DEPS}"
1263 TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}"
1266 PROG_DEPS="$TEST_DEPS"
1267 PROG_ARGS="$TEST_ARGS"
1269 ### Construct the list of subdirectories for which we'll customize makefiles
1270 ### with the appropriate compile-rules.
1272 CF_SRC_MODULES($modules_to_build)
1275 AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP')
1277 ### Now that we're done running tests, add the compiler-warnings, if any
1278 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
1280 ################################################################################
1282 include/MKterm.h.awk \
1283 include/curses.head:include/curses.h.in \
1286 misc/run_tic.sh:misc/run_tic.in \
1291 ### Special initialization commands, used to pass information from the
1292 ### configuration-run into config.status
1295 CF_LIST_MODELS="$cf_list_models"
1296 DFT_LWR_MODEL="$DFT_LWR_MODEL"
1297 LDCONFIG="$LDCONFIG"
1298 LIB_NAME="$LIB_NAME"
1299 LIB_SUBSETS="$LIB_SUBSETS"
1300 LIB_SUFFIX="$LIB_SUFFIX"
1301 LIB_TRACING="$LIB_TRACING"
1302 MAKE_TERMINFO="$MAKE_TERMINFO"
1303 NCURSES_OSPEED="$NCURSES_OSPEED"
1304 SRC_SUBDIRS="$SRC_SUBDIRS"
1305 TERMINFO="$TERMINFO"
1306 TINFO_NAME="$TINFO_NAME"
1307 WITH_CURSES_H="$with_curses_h"
1308 WITH_ECHO="$with_echo"
1309 WITH_OVERWRITE="$with_overwrite"
1310 cf_cv_abi_version="$cf_cv_abi_version"
1311 cf_cv_do_symlinks="$cf_cv_do_symlinks"
1312 cf_cv_rel_version="$cf_cv_rel_version"
1313 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
1314 cf_cv_shlib_version="$cf_cv_shlib_version"
1315 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
1316 cf_cv_system_name="$cf_cv_system_name"
1317 cf_with_cxx_binding="$cf_with_cxx_binding"
1321 ${MAKE-make} preinstall