1 dnl***************************************************************************
2 dnl Copyright (c) 1998,1999 Free Software Foundation, Inc. *
4 dnl Permission is hereby granted, free of charge, to any person obtaining a *
5 dnl copy of this software and associated documentation files (the *
6 dnl "Software"), to deal in the Software without restriction, including *
7 dnl without limitation the rights to use, copy, modify, merge, publish, *
8 dnl distribute, distribute with modifications, sublicense, and/or sell *
9 dnl copies of the Software, and to permit persons to whom the Software is *
10 dnl furnished to do so, subject to the following conditions: *
12 dnl The above copyright notice and this permission notice shall be included *
13 dnl in all copies or substantial portions of the Software. *
15 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 dnl Except as contained in this notice, the name(s) of the above copyright *
24 dnl holders shall not be used in advertising or otherwise to promote the *
25 dnl sale, use or other dealings in this Software without prior written *
27 dnl***************************************************************************
29 dnl Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
31 dnl $Id: configure.in,v 1.195 2000/07/05 22:24:29 tom Exp $
32 dnl Process this file with autoconf to produce a configure script.
33 AC_PREREQ(2.12.971230)
34 AC_REVISION($Revision: 1.195 $)
35 AC_INIT(ncurses/base/lib_initscr.c)
36 AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
38 CF_SUBST_NCURSES_VERSION
40 AC_ARG_WITH(system-type,
41 [ --with-system-type=XXX test: override derived host system-type],
42 [AC_MSG_WARN(overriding system type to $withval)
43 cf_cv_system_name=$withval])
45 # We need a configure script only when compiling as part of GNU C library.
46 # Here we have to generate one of the files we need while compiling.
48 # The only problem is that users of the package might think they have to
49 # run configure themself and find it irritating when nothing happens.
51 # So we try here to find out whether we are called from the glibc configure
54 dnl Check if we are a drop-in addition to glibc.
55 AC_ARG_ENABLE(add-ons, dnl
56 [ --enable-add-ons=DIR... used to check if we are a glibc add-on.],
60 dnl We need to use [ and ] for other purposes for a while now.
62 if test x"$glibc_add_on" = "xyes" ; then
65 rm -f $srcdir/Makefile
66 cp $srcdir/Makefile.glibc $srcdir/Makefile
67 echo "ncurses `grep \"^[ ]*ncurses-version[ ]*=.*$\" \
68 $srcdir/Makefile | sed -e \
69 's/^[ ]*ncurses-version[ ]*=[ ]*\([^ ^ ]*\)[ ]*$/\1/'`" > $srcdir/Banner
74 ### Save the given $CFLAGS to allow user-override.
75 cf_user_CFLAGS="$CFLAGS"
77 ### Default install-location
80 ### Checks for programs.
82 if test -n "$GCC" ; then
83 AC_MSG_CHECKING(version of gcc)
86 if test $host != $build; then
87 AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)
90 AC_PROG_GCC_TRADITIONAL
95 case "$cf_cv_system_name" in
97 test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
99 *) LDPATH=$PATH:/sbin:/usr/sbin
100 AC_PATH_PROG(LDCONFIG,ldconfig,,$LDPATH)
105 dnl DEFECT in autoconf 2.12: an attempt to set policy, this breaks the
106 dnl configure script by not letting us test if C++
107 dnl is present, making this option necessary.
108 AC_MSG_CHECKING(if you want to ensure bool is consistent with C++)
110 [ --without-cxx do not adjust ncurses bool to match C++],
111 [cf_with_cxx=$withval],
113 AC_MSG_RESULT($cf_with_cxx)
114 if test "X$cf_with_cxx" = Xno ; then
118 pushdef([AC_MSG_ERROR],
119 [AC_MSG_RESULT([You don't have any C++ compiler, too bad]); dnl
120 cf_with_cxx=no; CXX=""; GXX="";])dnl
122 popdef([AC_MSG_ERROR])dnl
125 if test -n "$GXX" ; then case "`${CXX-g++} --version`" in 1*|2.[0-6]*) GXX=""; CXX=""; ac_cv_prog_gxx=no; cf_cxx_library=no ; echo No: templates do not work;; esac; fi
128 AC_MSG_CHECKING(if you want to build C++ binding and demo)
129 AC_ARG_WITH(cxx-binding,
130 [ --without-cxx-binding do not build C++ binding and demo],
131 [cf_with_cxx_binding=$withval],
132 [cf_with_cxx_binding=$cf_with_cxx])
133 AC_MSG_RESULT($cf_with_cxx_binding)
135 AC_MSG_CHECKING(if you want to build with Ada95)
137 [ --without-ada suppress check for Ada95, don't build demo],
138 [cf_with_ada=$withval],
140 AC_MSG_RESULT($cf_with_ada)
142 AC_MSG_CHECKING(if you want to build programs such as tic)
144 [ --without-progs suppress build with programs (e.g., tic)],
145 [cf_with_progs=$withval],
147 AC_MSG_RESULT($cf_with_progs)
149 modules_to_build="ncurses"
150 if test "X$cf_with_progs" != Xno ; then
151 modules_to_build="$modules_to_build progs tack"
153 modules_to_build="$modules_to_build panel menu form"
158 AC_SYS_LONG_FILE_NAMES
161 AC_CHECK_PROGS(LINT, tdlint lint alint)
162 AC_CHECK_PROGS(MAN, man man_db)
165 dnl These are standard among *NIX systems, but not when cross-compiling
166 CF_SUBST(loader,LD,ld)
167 CF_SUBST(archiver,AR,ar)
168 CF_SUBST(archiver options,AR_OPTS,rv)
172 dnl Special option for use by system-builders: the install-prefix is used to
173 dnl adjust the location into which the actual install is done, so that an
174 dnl archive can be built without modifying the host system's configuration.
175 AC_MSG_CHECKING(if you have specified an install-prefix)
176 AC_ARG_WITH(install-prefix,
177 [ --with-install-prefix prefixes actual install-location],
178 [case "$withval" in #(vi
181 *) INSTALL_PREFIX="$withval"
184 AC_MSG_RESULT($INSTALL_PREFIX)
185 AC_SUBST(INSTALL_PREFIX)
187 ###############################################################################
190 ###############################################################################
191 CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
193 ### Options to allow the user to specify the set of libraries which are used.
194 ### Use "--without-normal --with-shared" to allow the default model to be
195 ### shared, for example.
197 AC_SUBST(cf_list_models)dnl the complete list of models ("normal debug")
199 AC_MSG_CHECKING(if you want to build shared libraries)
201 [ --with-shared generate shared-libraries],
202 [with_shared=$withval],
204 AC_MSG_RESULT($with_shared)
205 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
207 AC_MSG_CHECKING(if you want to build static libraries)
209 [ --with-normal generate normal-libraries (default)],
210 [with_normal=$withval],
212 AC_MSG_RESULT($with_normal)
213 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
215 AC_MSG_CHECKING(if you want to build debug libraries)
217 [ --with-debug generate debug-libraries (default)],
218 [with_debug=$withval],
220 AC_MSG_RESULT($with_debug)
221 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
223 AC_MSG_CHECKING(if you want to build profiling libraries)
225 [ --with-profile generate profile-libraries],
226 [with_profile=$withval],
228 AC_MSG_RESULT($with_profile)
229 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
231 ###############################################################################
233 AC_MSG_CHECKING(for specified models)
234 test -z "$cf_list_models" && cf_list_models=normal
235 AC_MSG_RESULT($cf_list_models)
237 ### Use the first model as the default, and save its suffix for use in building
238 ### up test-applications.
239 AC_MSG_CHECKING(for default model)
240 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'`
241 AC_MSG_RESULT($DFT_LWR_MODEL)
243 CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
245 AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal")
246 AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL")
255 CF_LIB_PREFIX(cf_prefix)
256 LIB_PREFIX=$cf_prefix
262 ###############################################################################
264 AC_MSG_CHECKING(if you want to build a separate terminfo library)
266 [ --with-termlib generate separate terminfo library],
267 [with_termlib=$withval],
269 AC_MSG_RESULT($with_termlib)
271 ### Checks for special libraries, must be done up-front.
272 AC_MSG_CHECKING(if you want to link with dbmalloc for testing)
273 AC_ARG_WITH(dbmalloc,
274 [ --with-dbmalloc test: use Conor Cahill's dbmalloc library],
275 [with_dbmalloc=$withval],
277 AC_MSG_RESULT($with_dbmalloc)
278 if test $with_dbmalloc = yes ; then
279 AC_CHECK_LIB(dbmalloc,debug_malloc)
282 AC_MSG_CHECKING(if you want to link with dmalloc for testing)
284 [ --with-dmalloc test: use Gray Watson's dmalloc library],
285 [with_dmalloc=$withval],
287 AC_MSG_RESULT($with_dmalloc)
288 if test $with_dmalloc = yes ; then
289 AC_CHECK_LIB(dmalloc,dmalloc_debug)
293 AC_MSG_CHECKING(if you want to link with the gpm mouse library)
295 [ --with-gpm use Alessandro Rubini's GPM library],
298 AC_MSG_RESULT($with_gpm)
299 if test $with_gpm = yes ; then
300 AC_CHECK_LIB(gpm,Gpm_Open,[
301 EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS"
302 SHLIB_LIST="-lgpm $SHLIB_LIST"
303 AC_DEFINE(HAVE_LIBGPM)
304 AC_CHECK_HEADERS(gpm.h)
305 ],AC_MSG_WARN(Cannot link with gpm library - read the FAQ))
308 dnl Not all ports of gcc support the -g option
310 if test X"$CC_G_OPT" = X"" ; then
312 test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
316 if test X"$CXX_G_OPT" = X"" ; then
318 test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
322 AC_MSG_CHECKING(for default loader flags)
323 case $DFT_LWR_MODEL in
324 normal) LD_MODEL='' ;;
325 debug) LD_MODEL=$CC_G_OPT ;;
326 profile) LD_MODEL='-pg';;
327 shared) LD_MODEL='' ;;
329 AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
330 AC_MSG_RESULT($LD_MODEL)
332 AC_MSG_CHECKING(if rpath option should be used)
334 [ --enable-rpath use rpath option when generating shared libraries],
335 [cf_cv_ld_rpath=$enableval],
337 AC_MSG_RESULT($cf_cv_ld_rpath)
340 if test "$CC_SHARED_OPTS" = "unknown"; then
341 for model in $cf_list_models; do
342 if test "$model" = "shared"; then
343 AC_ERROR(Shared libraries are not supported in this version)
348 ###############################################################################
349 CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
351 ### use option --disable-overwrite to leave out the link to -lcurses
352 AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
353 AC_ARG_ENABLE(overwrite,
354 [ --disable-overwrite leave out the link to -lcurses],
355 [with_overwrite=$enableval],
356 [with_overwrite=yes])
357 AC_MSG_RESULT($with_overwrite)
359 AC_MSG_CHECKING(if external terminfo-database is used)
360 AC_ARG_ENABLE(database,
361 [ --disable-database use only built-in data],
362 [with_database=$enableval],
364 AC_MSG_RESULT($with_database)
365 test $with_database != no && AC_DEFINE(USE_DATABASE)
367 AC_MSG_CHECKING(for list of fallback descriptions)
368 AC_ARG_WITH(fallbacks,
369 [ --with-fallbacks=XXX specify list of fallback terminal descriptions],
370 [with_fallback=$withval],
372 AC_MSG_RESULT($with_fallback)
373 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'`
374 AC_SUBST(FALLBACK_LIST)
376 AC_MSG_CHECKING(for list of terminfo directories)
377 CF_WITH_PATHLIST(terminfo-dirs,
378 [ --with-terminfo-dirs=XXX specify list of terminfo directories],
382 AC_MSG_RESULT($TERMINFO_DIRS)
383 test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS")
385 if test $with_database = no ; then
386 if test -z $with_fallback ; then
387 AC_ERROR(You have disabled the database w/o specifying fallbacks)
391 ### use option --disable-big-core to make tic run on small machines
392 ### We need 4Mb, check if we can allocate 50% more than that.
393 AC_MSG_CHECKING(if big-core option selected)
394 AC_ARG_ENABLE(big-core,
395 [ --disable-big-core assume machine has little memory],
396 [with_big_core=$enableval],
400 int main() { exit(malloc(6000000L) == 0); }],
403 [with_big_core=no])])
404 AC_MSG_RESULT($with_big_core)
405 test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
407 ### use option --enable-termcap to compile in the termcap fallback support
408 AC_MSG_CHECKING(if you want termcap-fallback support)
409 AC_ARG_ENABLE(termcap,
410 [ --enable-termcap compile in termcap fallback support],
411 [with_termcap=$enableval],
413 AC_MSG_RESULT($with_termcap)
415 if test "$with_termcap" != "yes" ; then
416 AC_DEFINE(PURE_TERMINFO)
419 ### use option --enable-getcap to use a hacked getcap for reading termcaps
420 AC_MSG_CHECKING(if fast termcap-loader is needed)
421 AC_ARG_ENABLE(getcap,
422 [ --enable-getcap fast termcap load, no xrefs to terminfo],
423 [with_getcap=$enableval],
425 AC_MSG_RESULT($with_getcap)
426 test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP)
428 AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
429 AC_ARG_ENABLE(getcap-cache,
430 [ --enable-getcap-cache cache translated termcaps in ~/.terminfo],
431 [with_getcap_cache=$enableval],
432 [with_getcap_cache=no])
433 AC_MSG_RESULT($with_getcap_cache)
434 test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE)
438 ### Use option --enable-symlinks to make tic use symlinks, not hard links
439 ### to reduce storage requirements for the terminfo database.
445 if test "$ac_cv_func_link" != yes ; then
446 AC_MSG_CHECKING(if tic should use symbolic links)
447 if test "$ac_cv_func_symlink" = yes ; then
452 AC_MSG_RESULT($with_symlinks)
453 elif test "$ac_cv_func_symlink" != yes ; then
454 AC_MSG_CHECKING(if tic should use hard links)
455 if test "$ac_cv_func_link" = yes ; then
460 AC_MSG_RESULT($with_links)
462 AC_MSG_CHECKING(if tic should use symbolic links)
463 AC_ARG_ENABLE(symlinks,
464 [ --enable-symlinks make tic use symbolic links not hard links],
465 [with_symlinks=$enableval],
467 AC_MSG_RESULT($with_symlinks)
470 test "$with_links" = yes && AC_DEFINE(USE_LINKS)
471 test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS)
473 ### use option --enable-broken-linker to force on use of broken-linker support
474 AC_MSG_CHECKING(if you want broken-linker support code)
475 AC_ARG_ENABLE(broken_linker,
476 [ --enable-broken_linker compile with broken-linker support code],
477 [with_broken_linker=$enableval],
478 [with_broken_linker=$BROKEN_LINKER])
479 AC_MSG_RESULT($with_broken_linker)
480 test "$with_broken_linker" = yes && AC_DEFINE(BROKEN_LINKER)
482 ### use option --enable-bsdpad to have tputs process BSD-style prefix padding
483 AC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
484 AC_ARG_ENABLE(bsdpad,
485 [ --enable-bsdpad recognize BSD-style prefix padding],
486 [with_bsdpad=$enableval],
488 AC_MSG_RESULT($with_bsdpad)
489 test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS)
491 ### Enable compiling-in rcs id's
492 AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
494 [ --with-rcs-ids compile-in RCS identifiers],
495 [with_rcs_ids=$withval],
497 AC_MSG_RESULT($with_rcs_ids)
498 test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
500 ###############################################################################
501 CF_HELP_MESSAGE(Extensions:)
503 ### Note that some functions (such as const) are normally disabled anyway.
504 AC_MSG_CHECKING(if you want to build with function extensions)
505 AC_ARG_ENABLE(ext-funcs,
506 [ --disable-ext-funcs disable function-extensions],
507 [with_ext_funcs=$enableval],
508 [with_ext_funcs=yes])
509 AC_MSG_RESULT($with_ext_funcs)
510 if test "$with_ext_funcs" = yes ; then
511 AC_DEFINE(HAVE_HAS_KEY)
512 AC_DEFINE(HAVE_RESIZETERM)
513 AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
514 AC_DEFINE(HAVE_WRESIZE)
515 AC_DEFINE(NCURSES_EXT_FUNCS)
518 ### use option --enable-const to turn on use of const beyond that in XSI.
519 AC_MSG_CHECKING(for extended use of const keyword)
521 [ --enable-const compile with extra/non-standard const],
522 [with_ext_const=$enableval],
524 AC_MSG_RESULT($with_ext_const)
526 if test "$with_ext_const" = yes ; then
527 AC_DEFINE(NCURSES_CONST,const)
530 AC_SUBST(NCURSES_CONST)
532 ### use option --enable-hashmap to turn on use of hashmap scrolling logic
533 AC_MSG_CHECKING(if you want hashmap scrolling-optimization code)
534 AC_ARG_ENABLE(hashmap,
535 [ --enable-hashmap compile with hashmap scrolling-optimization code],
536 [with_hashmap=$enableval],
538 AC_MSG_RESULT($with_hashmap)
539 test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP)
541 AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code)
542 AC_ARG_ENABLE(no-padding,
543 [ --enable-no-padding compile with \$NCURSES_NO_PADDING code],
544 [with_no_padding=$enableval],
545 [with_no_padding=$with_ext_funcs])
546 AC_MSG_RESULT($with_no_padding)
547 test "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING)
549 ### use option --enable-sigwinch to turn on use of SIGWINCH logic
550 AC_MSG_CHECKING(if you want SIGWINCH handler)
551 AC_ARG_ENABLE(sigwinch,
552 [ --enable-sigwinch compile with SIGWINCH handler],
553 [with_sigwinch=$enableval],
554 [with_sigwinch=$with_ext_funcs])
555 AC_MSG_RESULT($with_sigwinch)
556 test "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH)
558 ### use option --enable-tcap-names to allow user to define new capabilities
559 AC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap)
560 AC_ARG_ENABLE(tcap-names,
561 [ --enable-tcap-names compile with user-definable terminal capabilities],
562 [with_tcap_names=$enableval],
563 [with_tcap_names=$with_ext_funcs])
564 AC_MSG_RESULT($with_tcap_names)
566 test "$with_tcap_names" = yes && NCURSES_XNAMES=1
567 AC_SUBST(NCURSES_XNAMES)
569 ###############################################################################
570 CF_HELP_MESSAGE(Experimental Code:)
571 AC_MSG_CHECKING(if you want all experimental code)
573 [ --with-develop enable all experimental options for testing],
574 [with_develop=$withval],
576 AC_MSG_RESULT($with_develop)
578 ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment
579 AC_MSG_CHECKING(if you want experimental colorfgbg code)
580 AC_ARG_ENABLE(hard-tabs,
581 [ --enable-colorfgbg compile with experimental \$COLORFGBG code],
582 [with_colorfgbg=$enableval],
583 [with_colorfgbg=$with_develop])
584 AC_MSG_RESULT($with_colorfgbg)
585 test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
587 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize
588 AC_MSG_CHECKING(if you want experimental hard-tabs code)
589 AC_ARG_ENABLE(hard-tabs,
590 [ --enable-hard-tabs compile with experimental hard-tabs code],
591 [with_hardtabs=$enableval],
592 [with_hardtabs=$with_develop])
593 AC_MSG_RESULT($with_hardtabs)
594 test "$with_hardtabs" = yes && AC_DEFINE(USE_HARD_TABS)
596 AC_MSG_CHECKING(if you want experimental safe-sprintf code)
597 AC_ARG_ENABLE(safe-sprintf,
598 [ --enable-safe-sprintf compile with experimental safe-sprintf code],
599 [with_safe_sprintf=$enableval],
600 [with_safe_sprintf=no])
601 AC_MSG_RESULT($with_safe_sprintf)
602 test "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF)
604 ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
605 # when hashmap is used scroll hints are useless
606 if test "$with_hashmap" = no ; then
607 AC_MSG_CHECKING(if you want to experiment without scrolling-hints code)
608 AC_ARG_ENABLE(scroll-hints,
609 [ --disable-scroll-hints compile without scroll-hints code],
610 [with_scroll_hints=$enableval],
611 [with_scroll_hints=yes])
612 AC_MSG_RESULT($with_scroll_hints)
613 test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS)
616 ### use option --enable-widec to turn on use of wide-character support
617 AC_MSG_CHECKING(if you want experimental wide-character code)
619 [ --enable-widec compile with experimental wide-char code],
620 [with_widec=$enableval],
622 AC_MSG_RESULT($with_widec)
623 if test "$with_widec" = yes ; then
624 LIB_SUFFIX="w${LIB_SUFFIX}"
625 AC_DEFINE(USE_WIDEC_SUPPORT)
628 ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize
629 AC_MSG_CHECKING(if you want experimental xmc code)
630 AC_ARG_ENABLE(xmc-glitch,
631 [ --enable-xmc-glitch compile with experimental xmc code],
632 [with_xmc_glitch=$enableval],
633 [with_xmc_glitch=$with_develop])
634 AC_MSG_RESULT($with_xmc_glitch)
635 test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT)
637 ###############################################################################
638 CF_HELP_MESSAGE(Testing/development Options:)
640 ### use option --disable-echo to suppress full display compiling commands
642 [ --enable-echo build: display "compiling" commands (default)],
643 [with_echo=$enableval],
645 if test "$with_echo" = yes; then
648 ECHO_LINK='@ echo linking $@ ... ;'
652 ### use option --enable-warnings to turn on all gcc warnings
653 AC_ARG_ENABLE(warnings,
654 [ --enable-warnings build: turn on GCC compiler warnings],
655 [with_warnings=$enableval])
656 if test -n "$with_warnings"; then
657 ADAFLAGS="$ADAFLAGS -gnatg"
662 ### use option --enable-assertions to turn on generation of assertion code
663 AC_ARG_ENABLE(assertions,
664 [ --enable-assertions test: turn on generation of assertion code],
665 [with_assertions=$enableval],
666 [with_assertions=no])
669 if test $with_assertions = no
672 CPPFLAGS="$CPPFLAGS -DNDEBUG"
674 ADAFLAGS="$ADAFLAGS -gnata"
678 ### use option --disable-leaks to suppress "permanent" leaks, for testing
680 [ --disable-leaks test: suppress permanent memory-leaks],
681 [test $enableval = no && AC_DEFINE(NO_LEAKS)])
682 AC_DEFINE(HAVE_NC_ALLOC_H)
684 ### use option --enable-expanded to generate certain macros as functions
685 AC_ARG_ENABLE(expanded,
686 [ --enable-expanded test: generate functions for certain macros],
687 [test $enableval = yes && AC_DEFINE(NCURSES_EXPANDED)])
689 ### use option --disable-macros to suppress macros in favor of functions
690 AC_ARG_ENABLE(macros,
691 [ --disable-macros test: use functions rather than macros],
692 [test $enableval = no && AC_DEFINE(NCURSES_NOMACROS)])
694 ### Checks for libraries.
695 AC_CHECK_FUNC(gettimeofday,
696 AC_DEFINE(HAVE_GETTIMEOFDAY),[
698 AC_CHECK_LIB(bsd, gettimeofday,
699 AC_DEFINE(HAVE_GETTIMEOFDAY)
700 LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
702 CF_MATH_LIB(MATH_LIB,sin(x))
705 ### Checks for header files.
710 dnl These are some other potentially nonportable headers.
731 # check for ISC (this may also define _POSIX_SOURCE)
732 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
733 if test "$ISC" = yes ; then
734 AC_CHECK_LIB(cposix,main)
735 AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
736 AC_CHECK_HEADERS( sys/termio.h )
741 ### checks for compiler characteristics
745 test $ac_cv_c_inline != no && AC_DEFINE(CC_HAS_INLINE_FUNCS)
750 ### Checks for external-data
755 ### Checks for library functions.
779 if test "$with_getcap" = "yes" ; then
787 dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
788 if test "$cross_compiling" = yes ; then
789 AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
791 AC_FUNC_SETVBUF_REVERSED
799 dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
800 if test -z "$cf_user_CFLAGS" ; then
801 CF_STRIP_G_OPT(CFLAGS)
802 CF_STRIP_G_OPT(CXXFLAGS)
805 dnl Check for C++ compiler characteristics (and ensure that it's there!)
806 CF_BOOL_DECL(cf_cv_cc_bool_type)
807 if test -n "$CXX" ; then
810 case "`${CXX-g++} --version`" in
821 AC_CHECK_HEADERS(typeinfo)
826 case $cf_cv_system_name in #(vi
836 # Just because we are not configuring against C++ right now does not
837 # mean that a user will not want to use C++. Some distributors disable
838 # the C++ portion of this configuration as a shortcut (or just to avoid
839 # compiling the demo in the c++ directory). So we need a reasonable
840 # default for the 'bool' type.
842 # Caveat: since the storage of the bool type is not standardized, it
845 AC_MSG_CHECKING(for fallback type of bool)
846 case "$host_cpu" in #(vi
847 i?86) cf_cv_type_of_bool=char ;; #(vi
848 *) cf_cv_type_of_bool=int ;;
850 AC_MSG_RESULT($cf_cv_type_of_bool)
854 CF_HELP_MESSAGE(Ada95 Binding Options:)
856 dnl Check for availability of GNU Ada Translator (GNAT).
857 dnl At the moment we support no other Ada95 compiler.
858 if test "$cf_with_ada" != "no" ; then
860 AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
861 if test "$ac_cv_prog_gnat_exists" = no; then
865 AC_CHECK_PROG(m4_exists, m4, yes, no)
866 if test "$ac_cv_prog_m4_exists" = no; then
867 cf_cv_prog_gnat_correct=no
868 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
870 if test "$cf_cv_prog_gnat_correct" = yes; then
871 AC_MSG_CHECKING(if GNAT works)
872 CF_GNAT_TRY_RUN([procedure conftest;],
875 procedure conftest is
877 Text_IO.Put ("Hello World");
879 GNAT.OS_Lib.OS_Exit (0);
880 end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
881 AC_MSG_RESULT($cf_cv_prog_gnat_correct)
884 if test "$cf_cv_prog_gnat_correct" = yes; then
885 ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
887 AC_ARG_WITH(ada-compiler,
888 [ --with-ada-compiler=CMD Specify Ada95 compiler command (default gnatmake)],
889 [cf_ada_compiler=$withval],
890 [cf_ada_compiler=gnatmake])
892 cf_ada_package=terminal_interface
894 AC_SUBST(cf_ada_make)
895 AC_SUBST(cf_ada_compiler)
896 AC_SUBST(cf_ada_package)
898 AC_SUBST(cf_compile_generics)
899 AC_SUBST(cf_generic_objects)
901 CF_WITH_PATH(ada-include,
902 [ --with-ada-include=DIR Ada includes are in DIR],
904 PREFIX/lib/ada/adainclude,
905 [$]prefix/lib/ada/adainclude)
906 AC_SUBST(ADA_INCLUDE)
908 CF_WITH_PATH(ada-objects,
909 [ --with-ada-objects=DIR Ada objects are in DIR],
911 PREFIX/lib/ada/adalib,
912 [$]prefix/lib/ada/adalib)
913 AC_SUBST(ADA_OBJECTS)
915 # This has been fixed!
916 # if test $with_shared = no
918 # AC_MSG_WARN(Ada95 applications will not link properly with static libraries)
923 ### It's not possible to appease gcc 2.6.3's conversion-warnings if we're
924 ### using a 'char' for bools. gcc 2.7.0's conversion-warnings are broken too
925 ### badly to consider using for development purposes, but 2.5.8 is okay.
926 if test -n "$with_warnings"; then
927 if test -n "$GCC"; then
928 case "`$CC --version`" in
930 if test "$cf_cv_type_of_bool" != "char"; then
931 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
935 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
941 ### Construct the library-subsets, if any, from this set of keywords:
942 ### none, base, ext_funcs, termlib.
943 AC_MSG_CHECKING(for library subsets)
944 if test "$with_termlib" = yes ; then
945 LIB_SUBSETS="termlib "
947 LIB_SUBSETS="termlib+"
949 LIB_SUBSETS="${LIB_SUBSETS}base"
950 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
951 AC_MSG_RESULT($LIB_SUBSETS)
960 ### Construct the list of include-directories to be generated
964 ### Build up pieces for makefile rules
965 AC_MSG_CHECKING(default library suffix)
966 CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
967 AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
968 AC_MSG_RESULT($DFT_ARG_SUFFIX)
970 AC_MSG_CHECKING(default library-dependency suffix)
971 CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_DEP_SUFFIX)dnl
972 AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
973 AC_MSG_RESULT($DFT_DEP_SUFFIX)
975 AC_MSG_CHECKING(default object directory)
976 CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
977 AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
978 AC_MSG_RESULT($DFT_OBJ_SUBDIR)
980 TINFO_LIST="$SHLIB_LIST"
981 test $with_termlib = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}"
983 AC_MSG_CHECKING(where we will install curses.h)
984 test "$with_overwrite" = no && \
985 test "x$includedir" = 'x${prefix}/include' && \
986 includedir='$(prefix)/include/ncurses'${LIB_SUFFIX}
987 AC_MSG_RESULT($includedir)
993 ### Set up low-level terminfo dependencies for makefiles. Note that we
994 ### could override this.
995 if test "$with_termlib" = yes ; then
996 TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}"
997 TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}"
999 PROG_DEPS="$TEST_DEPS"
1000 PROG_ARGS="$TEST_ARGS"
1002 ### Construct the list of subdirectories for which we'll customize makefiles
1003 ### with the appropriate compile-rules.
1005 CF_SRC_MODULES($modules_to_build)
1008 ### Now that we're done running tests, add the compiler-warnings, if any
1009 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
1011 ################################################################################
1013 include/MKterm.h.awk \
1021 ### Special initialization commands, used to pass information from the
1022 ### configuration-run into config.status
1025 CF_LIST_MODELS="$cf_list_models"
1026 DFT_LWR_MODEL="$DFT_LWR_MODEL"
1027 LDCONFIG="$LDCONFIG"
1028 LIB_NAME="$LIB_NAME"
1029 LIB_SUFFIX="$LIB_SUFFIX"
1030 LIB_SUBSETS="$LIB_SUBSETS"
1031 LIB_TRACING="$LIB_TRACING"
1032 SRC_SUBDIRS="$SRC_SUBDIRS"
1033 TINFO_NAME="$TINFO_NAME"
1034 WITH_ECHO="$with_echo"
1035 WITH_OVERWRITE="$with_overwrite"
1036 cf_cv_abi_version="$cf_cv_abi_version"
1037 cf_cv_do_symlinks="$cf_cv_do_symlinks"
1038 cf_cv_rel_version="$cf_cv_rel_version"
1039 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
1040 cf_cv_system_name="$cf_cv_system_name"
1041 cf_with_cxx_binding="$cf_with_cxx_binding"
1042 cf_cv_shlib_version="$cf_cv_shlib_version"
1046 ${MAKE-make} preinstall