150276Speterdnl***************************************************************************
2184989Srafandnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
350276Speterdnl                                                                          *
450276Speterdnl Permission is hereby granted, free of charge, to any person obtaining a  *
550276Speterdnl copy of this software and associated documentation files (the            *
650276Speterdnl "Software"), to deal in the Software without restriction, including      *
750276Speterdnl without limitation the rights to use, copy, modify, merge, publish,      *
850276Speterdnl distribute, distribute with modifications, sublicense, and/or sell       *
950276Speterdnl copies of the Software, and to permit persons to whom the Software is    *
1050276Speterdnl furnished to do so, subject to the following conditions:                 *
1150276Speterdnl                                                                          *
1250276Speterdnl The above copyright notice and this permission notice shall be included  *
1350276Speterdnl in all copies or substantial portions of the Software.                   *
1450276Speterdnl                                                                          *
1550276Speterdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
1650276Speterdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
1750276Speterdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
1850276Speterdnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
1950276Speterdnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
2050276Speterdnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
2150276Speterdnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
2250276Speterdnl                                                                          *
2350276Speterdnl Except as contained in this notice, the name(s) of the above copyright   *
2450276Speterdnl holders shall not be used in advertising or otherwise to promote the     *
2550276Speterdnl sale, use or other dealings in this Software without prior written       *
2650276Speterdnl authorization.                                                           *
2750276Speterdnl***************************************************************************
2850276Speterdnl
2998503Speterdnl Author: Thomas E. Dickey 1995-on
3050276Speterdnl
31184989Srafandnl $Id: configure.in,v 1.454 2008/10/18 14:53:32 tom Exp $
3250276Speterdnl Process this file with autoconf to produce a configure script.
3366963Speterdnl
34166124Srafandnl See http://invisible-island.net/autoconf/ for additional information.
3566963Speterdnl
3666963Speterdnl ---------------------------------------------------------------------------
3798503SpeterAC_PREREQ(2.13.20020210)
38184989SrafanAC_REVISION($Revision: 1.454 $)
3950276SpeterAC_INIT(ncurses/base/lib_initscr.c)
4050276SpeterAC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
4150276Speter
42166124SrafanCF_TOP_BUILDDIR
4350276SpeterCF_SUBST_NCURSES_VERSION
44166124Srafan
45166124SrafanCF_WITH_REL_VERSION(NCURSES)
46166124SrafanCF_WITH_ABI_VERSION
47166124Srafan
4866963SpeterCF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
4950276SpeterAC_ARG_WITH(system-type,
5050276Speter[  --with-system-type=XXX  test: override derived host system-type],
5150276Speter[AC_MSG_WARN(overriding system type to $withval)
5250276Speter cf_cv_system_name=$withval])
5350276Speter
5450276Speter###	Save the given $CFLAGS to allow user-override.
5550276Spetercf_user_CFLAGS="$CFLAGS"
5650276Speter
5750276Speter###	Default install-location
5850276SpeterCF_CFG_DEFAULTS
5950276Speter
6050276Speter###	Checks for programs.
6150276SpeterAC_PROG_CC
62166124SrafanCF_GCC_VERSION
6397049Speter
6450276SpeterAC_PROG_CPP
6550276SpeterAC_PROG_GCC_TRADITIONAL
66166124SrafanCF_PROG_CC_C_O(CC)
6750276SpeterAC_ISC_POSIX
6850276SpeterCF_ANSI_CC_REQD
6950276SpeterCF_PROG_EXT
70166124SrafanCF_PROG_LDCONFIG
7150276Speter
7250276Speterdnl DEFECT in autoconf 2.12:	an attempt to set policy, this breaks the
7350276Speterdnl				configure script by not letting us test if C++
7450276Speterdnl				is present, making this option necessary.
7556639SpeterAC_MSG_CHECKING(if you want to ensure bool is consistent with C++)
7650276SpeterAC_ARG_WITH(cxx,
7756639Speter	[  --without-cxx           do not adjust ncurses bool to match C++],
7850276Speter	[cf_with_cxx=$withval],
7950276Speter	[cf_with_cxx=yes])
8050276SpeterAC_MSG_RESULT($cf_with_cxx)
8156639Speterif test "X$cf_with_cxx" = Xno ; then
8256639Speter	CXX=""
8356639Speter	GXX=""
8456639Speterelse
85166124Srafan	# with autoconf 2.13, we can change the error to a warning:
8662449Speter	pushdef([AC_MSG_ERROR],
87166124Srafan		[AC_MSG_RESULT(no)
88166124Srafan		 AC_MSG_WARN([You don't have any C++ compiler, too bad])
8962449Speter		cf_with_cxx=no; CXX=""; GXX="";])dnl
9056639Speter	AC_PROG_CXX
9162449Speter	popdef([AC_MSG_ERROR])dnl
92166124Srafan	# autoconf 2.5x removed the error - by hardcoding it to g++.
93166124Srafan	if test "$CXX" = "g++" ; then
94166124Srafan		AC_PATH_PROG(CXX,g++)
95166124Srafan	fi
96166124Srafan	if test "$CXX" = "g++" ; then
97166124Srafan		AC_MSG_WARN(ignoring hardcoded g++)
98166124Srafan		cf_with_cxx=no; CXX=""; GXX="";
99166124Srafan	fi
10050276Speterfi
10166963Speter
102166124SrafanCF_GXX_VERSION
103166124Srafancase $GXX_VERSION in
104166124Srafan1*|2.[[0-6]]*)
105166124Srafan	# GXX=""; CXX=""; ac_cv_prog_gxx=no
106166124Srafan	# cf_cxx_library=no
107166124Srafan	AC_MSG_WARN(templates do not work)
108166124Srafan	;;
109166124Srafanesac
11050276Speter
11156639SpeterAC_MSG_CHECKING(if you want to build C++ binding and demo)
11256639SpeterAC_ARG_WITH(cxx-binding,
11356639Speter	[  --without-cxx-binding   do not build C++ binding and demo],
11456639Speter	[cf_with_cxx_binding=$withval],
11556639Speter	[cf_with_cxx_binding=$cf_with_cxx])
11656639SpeterAC_MSG_RESULT($cf_with_cxx_binding)
11756639Speter
11850276SpeterAC_MSG_CHECKING(if you want to build with Ada95)
11950276SpeterAC_ARG_WITH(ada,
12050276Speter	[  --without-ada           suppress check for Ada95, don't build demo],
12150276Speter	[cf_with_ada=$withval],
12250276Speter	[cf_with_ada=yes])
12350276SpeterAC_MSG_RESULT($cf_with_ada)
12450276Speter
12550276SpeterAC_MSG_CHECKING(if you want to build programs such as tic)
12650276SpeterAC_ARG_WITH(progs,
12750276Speter	[  --without-progs         suppress build with programs (e.g., tic)],
12850276Speter	[cf_with_progs=$withval],
12950276Speter	[cf_with_progs=yes])
13050276SpeterAC_MSG_RESULT($cf_with_progs)
13150276Speter
13276726SpeterAC_MSG_CHECKING(if you wish to install curses.h)
13376726SpeterAC_ARG_WITH(curses-h,
13476726Speter	[  --without-curses-h      install curses.h as ncurses.h only],
13576726Speter	[with_curses_h=$withval],
13676726Speter	[with_curses_h=yes])
13776726SpeterAC_MSG_RESULT($with_curses_h)
13876726Speter
13950276Spetermodules_to_build="ncurses"
14050276Speterif test "X$cf_with_progs" != Xno ; then
14150276Spetermodules_to_build="$modules_to_build progs tack"
14250276Speterfi
14350276Spetermodules_to_build="$modules_to_build panel menu form"
14450276Speter
14566963SpeterAC_ARG_PROGRAM
146166124Srafan
147166124SrafanCF_PROG_AWK
148166124SrafanCF_PROG_EGREP
14950276SpeterCF_PROG_INSTALL
150166124SrafanCF_PROG_LINT
15150276SpeterAC_PROG_LN_S
152166124Srafan
153174993SrafanAC_SYS_LONG_FILE_NAMES
154174993Srafan
155174993SrafanAC_MSG_CHECKING(if we should assume mixed-case filenames)
156174993SrafanAC_ARG_ENABLE(mixed-case,
157174993Srafan	[  --enable-mixed-case     tic should assume mixed-case filenames],
158174993Srafan	[enable_mixedcase=$enableval],
159174993Srafan	[enable_mixedcase=auto])
160174993SrafanAC_MSG_RESULT($enable_mixedcase)
161174993Srafanif test "$enable_mixedcase" = "auto" ; then
162174993Srafan    CF_MIXEDCASE_FILENAMES
163174993Srafanelse
164174993Srafan    cf_cv_mixedcase=$enable_mixedcase
165174993Srafan    if test "$enable_mixedcase" = "yes" ; then
166174993Srafan        AC_DEFINE(MIXEDCASE_FILENAMES)
167174993Srafan    fi
168174993Srafanfi
169174993Srafan
170174993Srafan# do this after mixed-case option (tags/TAGS is not as important as tic).
171166124SrafanAC_PROG_MAKE_SET
17266963SpeterCF_MAKE_TAGS
173166124SrafanCF_MAKEFLAGS
17450276Speter
17550276Speterdnl These are standard among *NIX systems, but not when cross-compiling
176166124SrafanAC_CHECK_TOOL(RANLIB, ranlib, ':')
177166124SrafanAC_CHECK_TOOL(LD, ld, ld)
178166124SrafanAC_CHECK_TOOL(AR, ar, ar)
17950276SpeterCF_SUBST(archiver options,AR_OPTS,rv)
18050276Speter
18150276Speterdnl Special option for use by system-builders: the install-prefix is used to
18250276Speterdnl adjust the location into which the actual install is done, so that an
18350276Speterdnl archive can be built without modifying the host system's configuration.
18450276SpeterAC_MSG_CHECKING(if you have specified an install-prefix)
18550276SpeterAC_ARG_WITH(install-prefix,
186166124Srafan	[  --with-install-prefix   prefixes actual install-location ($DESTDIR)],
18750276Speter	[case "$withval" in #(vi
18850276Speter	yes|no) #(vi
18950276Speter		;;
19066963Speter	*)	DESTDIR="$withval"
19150276Speter		;;
19250276Speter	esac])
19366963SpeterAC_MSG_RESULT($DESTDIR)
19466963SpeterAC_SUBST(DESTDIR)
19550276Speter
19650276Speter###############################################################################
197166124SrafanCF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:)
198166124Srafan# If we're cross-compiling, allow the user to override the tools and their
199166124Srafan# options.  The configure script is oriented toward identifying the host
200166124Srafan# compiler, etc., but we need a build compiler to generate parts of the source.
201166124SrafanCF_BUILD_CC
202166124Srafan
203166124Srafan###############################################################################
20450276SpeterCF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
20550276Speter
20650276Speter### Options to allow the user to specify the set of libraries which are used.
20750276Speter### Use "--without-normal --with-shared" to allow the default model to be
20850276Speter### shared, for example.
20950276Spetercf_list_models=""
21062449SpeterAC_SUBST(cf_list_models)dnl	the complete list of models ("normal debug")
21150276Speter
212166124SrafanCF_WITH_LIBTOOL
213166124Srafanif test "$with_libtool" != "no" ; then
214166124Srafan
215166124Srafancf_list_models="$cf_list_models libtool"
216166124Srafan
21776726Speterelse
21876726Speter
21950276SpeterAC_MSG_CHECKING(if you want to build shared libraries)
22050276SpeterAC_ARG_WITH(shared,
22150276Speter	[  --with-shared           generate shared-libraries],
22250276Speter	[with_shared=$withval],
22350276Speter	[with_shared=no])
22450276SpeterAC_MSG_RESULT($with_shared)
22550276Spetertest "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
22650276Speter
22750276SpeterAC_MSG_CHECKING(if you want to build static libraries)
22850276SpeterAC_ARG_WITH(normal,
22950276Speter	[  --with-normal           generate normal-libraries (default)],
23050276Speter	[with_normal=$withval],
23150276Speter	[with_normal=yes])
23250276SpeterAC_MSG_RESULT($with_normal)
23350276Spetertest "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
23450276Speter
23550276SpeterAC_MSG_CHECKING(if you want to build debug libraries)
23650276SpeterAC_ARG_WITH(debug,
23750276Speter	[  --with-debug            generate debug-libraries (default)],
23850276Speter	[with_debug=$withval],
23950276Speter	[with_debug=yes])
24050276SpeterAC_MSG_RESULT($with_debug)
24150276Spetertest "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
24250276Speter
24350276SpeterAC_MSG_CHECKING(if you want to build profiling libraries)
24450276SpeterAC_ARG_WITH(profile,
24550276Speter	[  --with-profile          generate profile-libraries],
24650276Speter	[with_profile=$withval],
24750276Speter	[with_profile=no])
24850276SpeterAC_MSG_RESULT($with_profile)
24950276Spetertest "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
25050276Speter
251166124Srafanfi
252166124Srafan
25362449Speter###############################################################################
25462449Speter
25562449SpeterAC_MSG_CHECKING(for specified models)
25662449Spetertest -z "$cf_list_models" && cf_list_models=normal
25776726Speterdnl If we use libtool to generate libraries, then it must be the only
25876726Speterdnl specified model.
259166124Srafantest "$with_libtool" != "no" && cf_list_models=libtool
26062449SpeterAC_MSG_RESULT($cf_list_models)
26162449Speter
26262449Speter### Use the first model as the default, and save its suffix for use in building
26362449Speter### up test-applications.
26462449SpeterAC_MSG_CHECKING(for default model)
265166124SrafanDFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
26662449SpeterAC_MSG_RESULT($DFT_LWR_MODEL)
26762449Speter
26862449SpeterCF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
26962449Speter
27062449SpeterAC_SUBST(DFT_LWR_MODEL)dnl	the default model ("normal")
27162449SpeterAC_SUBST(DFT_UPR_MODEL)dnl	the default model ("NORMAL")
27262449Speter
273174993SrafanTICS_NAME=tic
274174993SrafanAC_SUBST(TICS_NAME)
275174993Srafan
27662449SpeterTINFO_NAME=tinfo
27762449SpeterAC_SUBST(TINFO_NAME)
27862449Speter
27962449SpeterLIB_NAME=ncurses
28062449SpeterAC_SUBST(LIB_NAME)
28162449Speter
28262449SpeterLIB_DIR=../lib
283166124SrafanLIB_2ND=../../lib
284166124Srafan
28562449SpeterCF_LIB_PREFIX(cf_prefix)
28662449SpeterLIB_PREFIX=$cf_prefix
28762449SpeterAC_SUBST(LIB_PREFIX)
28862449Speter
28962449SpeterLIB_SUFFIX=
29062449SpeterAC_SUBST(LIB_SUFFIX)
29162449Speter
29262449Speter###############################################################################
29362449Speter
29450276SpeterAC_MSG_CHECKING(if you want to build a separate terminfo library)
29550276SpeterAC_ARG_WITH(termlib,
29650276Speter	[  --with-termlib          generate separate terminfo library],
29750276Speter	[with_termlib=$withval],
29850276Speter	[with_termlib=no])
29950276SpeterAC_MSG_RESULT($with_termlib)
30050276Speter
301174993SrafanAC_MSG_CHECKING(if you want to build a separate tic library)
302174993SrafanAC_ARG_WITH(ticlib,
303174993Srafan	[  --with-ticlib           generate separate tic library],
304174993Srafan	[with_ticlib=$withval],
305174993Srafan	[with_ticlib=no])
306174993SrafanAC_MSG_RESULT($with_ticlib)
307174993Srafan
30850276Speter### Checks for special libraries, must be done up-front.
30950276SpeterSHLIB_LIST=""
310166124SrafanCF_WITH_GPM
311166124Srafanif test "$with_gpm" != no ; then
312166124Srafan	AC_MSG_CHECKING(if you want to load GPM dynamically)
313166124Srafan	AC_ARG_WITH(dlsym,
314166124Srafan		[  --without-dlsym         do not use dlsym() to load GPM dynamically],
315166124Srafan		[with_dlsym=$withval],
316166124Srafan		[with_dlsym=yes])
317166124Srafan	AC_MSG_RESULT($with_dlsym)
318166124Srafan	if test "$with_dlsym" = yes ; then
319166124Srafan		CF_FUNC_DLSYM
320166124Srafan		if test "$with_gpm" != yes ; then
321166124Srafan			CF_VERBOSE(assuming soname for gpm is $with_gpm)
322166124Srafan			cf_cv_gpm_soname="$with_gpm"
323166124Srafan		else
324166124Srafan			CF_LIB_SONAME([#include <gpm.h>],[if (Gpm_Open(0,0)) Gpm_Close();],gpm)
325166124Srafan		fi
326166124Srafan		test "$cf_cv_gpm_soname" != "unknown" && AC_DEFINE_UNQUOTED(LIBGPM_SONAME,"$cf_cv_gpm_soname")
327166124Srafan		SHLIB_LIST="-ldl $SHLIB_LIST"
328166124Srafan	else
32950276Speter		SHLIB_LIST="-lgpm $SHLIB_LIST"
330166124Srafan	fi
331166124Srafan	AC_DEFINE(HAVE_LIBGPM)
332174993Srafan	CF_CHECK_GPM_WGETCH
33350276Speterfi
33450276Speter
335166124SrafanCF_WITH_SYSMOUSE
336166124Srafan
33750276Speterdnl Not all ports of gcc support the -g option
33850276Speter
33950276Speterif test X"$CC_G_OPT" = X"" ; then
34050276Speter	CC_G_OPT='-g'
34150276Speter	test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
34250276Speterfi
34350276SpeterAC_SUBST(CC_G_OPT)
34450276Speter
34550276Speterif test X"$CXX_G_OPT" = X"" ; then
34650276Speter	CXX_G_OPT='-g'
34750276Speter	test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
34850276Speterfi
34950276SpeterAC_SUBST(CXX_G_OPT)
35050276Speter
35162449SpeterAC_MSG_CHECKING(for default loader flags)
35250276Spetercase $DFT_LWR_MODEL in
35376726Speterlibtool) LD_MODEL=''   ;;
35450276Speternormal)  LD_MODEL=''   ;;
35550276Speterdebug)   LD_MODEL=$CC_G_OPT ;;
35650276Speterprofile) LD_MODEL='-pg';;
35750276Spetershared)  LD_MODEL=''   ;;
35850276Speteresac
35950276SpeterAC_SUBST(LD_MODEL)dnl		the type of link (e.g., -g or -pg)
36062449SpeterAC_MSG_RESULT($LD_MODEL)
36150276Speter
362174993Srafancase $DFT_LWR_MODEL in
363174993Srafanshared)
364184989SrafanCF_ENABLE_RPATH
365174993SrafanAC_MSG_CHECKING(if shared libraries should be relinked during install)
366174993SrafanAC_ARG_ENABLE(relink,
367174993Srafan[  --disable-relink        relink shared libraries during install],
368174993Srafan[cf_cv_do_relink=$enableval],
369174993Srafan[cf_cv_do_relink=yes])
370174993SrafanAC_MSG_RESULT($cf_cv_do_relink)
371174993Srafan	;;
372174993Srafanesac
37350276Speter
37450276SpeterCF_SHARED_OPTS
37550276Speterif test "$CC_SHARED_OPTS" = "unknown"; then
37650276Speter	for model in $cf_list_models; do
37750276Speter		if test "$model" = "shared"; then
37850276Speter			AC_ERROR(Shared libraries are not supported in this version)
37950276Speter		fi
38050276Speter	done
38150276Speterfi
38250276Speter
38350276Speter###############################################################################
38450276SpeterCF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
38550276Speter
38650276Speter###	use option --disable-overwrite to leave out the link to -lcurses
38750276SpeterAC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
38850276SpeterAC_ARG_ENABLE(overwrite,
38950276Speter	[  --disable-overwrite     leave out the link to -lcurses],
39062449Speter	[with_overwrite=$enableval],
391166124Srafan	[if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi])
39250276SpeterAC_MSG_RESULT($with_overwrite)
39350276Speter
39450276SpeterAC_MSG_CHECKING(if external terminfo-database is used)
39550276SpeterAC_ARG_ENABLE(database,
39697049Speter	[  --disable-database      do not use terminfo, only fallbacks/termcap],
39766963Speter	[use_database=$enableval],
39866963Speter	[use_database=yes])
39966963SpeterAC_MSG_RESULT($use_database)
40050276Speter
40166963Spetercase $host_os in #(vi
40266963Speteros2*) #(vi
40366963Speter	TERMINFO_SRC='${top_srcdir}/misc/emx.src'
40466963Speter	;;
40566963Speter*) #(vi
40666963Speter	TERMINFO_SRC='${top_srcdir}/misc/terminfo.src'
40766963Speter	;;
40866963Speteresac
40966963SpeterAC_SUBST(TERMINFO_SRC)
41066963Speter
41197049SpeterCF_PATHSEP
41266963Speterif test "$use_database" != no ; then
41366963Speter	AC_DEFINE(USE_DATABASE)
414166124Srafan
41566963Speter	AC_MSG_CHECKING(which terminfo source-file will be installed)
41666963Speter	AC_ARG_ENABLE(database,
41766963Speter		[  --with-database=XXX     specify terminfo source to install],
41866963Speter		[TERMINFO_SRC=$withval])
41966963Speter	AC_MSG_RESULT($TERMINFO_SRC)
420166124Srafan
421166124Srafan	AC_MSG_CHECKING(whether to use hashed database instead of directory/tree)
422166124Srafan	AC_ARG_WITH(hashed-db,
423166124Srafan		[  --with-hashed-db        specify hashed-database library],,
424166124Srafan		[with_hashed_db=no])
425166124Srafan	AC_MSG_RESULT($with_hashed_db)
426184989Srafanelse
427184989Srafan	with_hashed_db=no
42866963Speterfi
42966963Speter
43050276SpeterAC_MSG_CHECKING(for list of fallback descriptions)
43150276SpeterAC_ARG_WITH(fallbacks,
43250276Speter	[  --with-fallbacks=XXX    specify list of fallback terminal descriptions],
43350276Speter	[with_fallback=$withval],
43450276Speter	[with_fallback=])
43550276SpeterAC_MSG_RESULT($with_fallback)
436166124SrafanFALLBACK_LIST=`echo "$with_fallback" | sed -e 's/,/ /g'`
43750276SpeterAC_SUBST(FALLBACK_LIST)
43850276Speter
439166124SrafanAC_MSG_CHECKING(if you want modern xterm or antique)
440166124SrafanAC_ARG_WITH(xterm-new,
441166124Srafan	[  --without-xterm-new     specify if xterm terminfo should be old version],
442166124Srafan	[with_xterm_new=$withval],
443166124Srafan	[with_xterm_new=yes])
444166124Srafancase $with_xterm_new in
445166124Srafanno)	with_xterm_new=xterm-old;;
446166124Srafan*)	with_xterm_new=xterm-new;;
447166124Srafanesac
448166124SrafanAC_MSG_RESULT($with_xterm_new)
449166124SrafanWHICH_XTERM=$with_xterm_new
450166124SrafanAC_SUBST(WHICH_XTERM)
451166124Srafan
45297049SpeterMAKE_TERMINFO=
45366963Speterif test "$use_database" = no ; then
45466963Speter	TERMINFO="${datadir}/terminfo"
45597049Speter	MAKE_TERMINFO="#"
45666963Speterelse
45766963Speter
45850276SpeterAC_MSG_CHECKING(for list of terminfo directories)
45950276SpeterCF_WITH_PATHLIST(terminfo-dirs,
46050276Speter	[  --with-terminfo-dirs=XXX specify list of terminfo directories],
46150276Speter	TERMINFO_DIRS,
46250276Speter	DATADIR/terminfo,
46350276Speter	${datadir}/terminfo)
46450276SpeterAC_MSG_RESULT($TERMINFO_DIRS)
46550276Spetertest -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS")
46650276Speter
46766963SpeterAC_MSG_CHECKING(for default terminfo directory)
46866963SpeterCF_WITH_PATH(default-terminfo-dir,
46966963Speter	[  --with-default-terminfo-dir=DIR default terminfo directory],
47066963Speter	TERMINFO,
47166963Speter	DATADIR/terminfo,
47266963Speter	${datadir}/terminfo)
47366963SpeterAC_MSG_RESULT($TERMINFO)
47466963SpeterAC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO")
47566963Speter
47650276Speterfi
47750276Speter
47866963SpeterAC_SUBST(TERMINFO)
47997049SpeterAC_SUBST(MAKE_TERMINFO)
48066963Speter
48150276Speter###	use option --disable-big-core to make tic run on small machines
48250276Speter###	We need 4Mb, check if we can allocate 50% more than that.
48350276SpeterAC_MSG_CHECKING(if big-core option selected)
48450276SpeterAC_ARG_ENABLE(big-core,
48550276Speter	[  --disable-big-core      assume machine has little memory],
48650276Speter	[with_big_core=$enableval],
48750276Speter	[AC_TRY_RUN([
48850276Speter#include <stdlib.h>
48950276Speter#include <string.h>
49066963Speterint main() {
49166963Speter	unsigned long n = 6000000L;
49266963Speter	char *s = malloc(n);
49366963Speter	if (s != 0)
49466963Speter		s[0] = s[n-1] = 0;
495166124Srafan	${cf_cv_main_return:-return}(s == 0);
49666963Speter}],
49750276Speter	[with_big_core=yes],
49850276Speter	[with_big_core=no],
49950276Speter	[with_big_core=no])])
50050276SpeterAC_MSG_RESULT($with_big_core)
50150276Spetertest "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
50250276Speter
503174993Srafan### ISO C only guarantees 512-char strings, we have tables which load faster
504184989Srafan### when constructed using "big" strings.  More than the C compiler, the awk
505184989Srafan### program is a limit on most vendor UNIX systems.  Check that we can build.
506174993SrafanAC_MSG_CHECKING(if big-strings option selected)
507174993SrafanAC_ARG_ENABLE(big-strings,
508174993Srafan	[  --disable-big-strings   assume compiler has only standard-size strings],
509184989Srafan	[with_big_strings=$enableval],
510184989Srafan	[CF_AWK_BIG_PRINTF(12000,with_big_strings)])
511174993SrafanAC_MSG_RESULT($with_big_strings)
512174993Srafan
513174993SrafanUSE_BIG_STRINGS=0
514174993Srafantest "$with_big_strings" = "yes" && USE_BIG_STRINGS=1
515174993SrafanAC_SUBST(USE_BIG_STRINGS)
516174993Srafan
51750276Speter###	use option --enable-termcap to compile in the termcap fallback support
51850276SpeterAC_MSG_CHECKING(if you want termcap-fallback support)
51950276SpeterAC_ARG_ENABLE(termcap,
52050276Speter	[  --enable-termcap        compile in termcap fallback support],
52150276Speter	[with_termcap=$enableval],
52250276Speter	[with_termcap=no])
52350276SpeterAC_MSG_RESULT($with_termcap)
52450276Speter
52550276Speterif test "$with_termcap" != "yes" ; then
52697049Speter	if test "$use_database" = no ; then
527166124Srafan		if test -z "$with_fallback" ; then
52897049Speter			AC_ERROR(You have disabled the database w/o specifying fallbacks)
52997049Speter		fi
53097049Speter	fi
53150276Speter	AC_DEFINE(PURE_TERMINFO)
53250276Speterelse
53350276Speter
534174993Srafanif test "$with_ticlib" != no ; then
535174993Srafan	AC_ERROR(Options --with-ticlib and --enable-termcap cannot be combined)
536174993Srafanfi
537174993Srafan
53897049SpeterAC_DEFINE(USE_TERMCAP)
53997049SpeterAC_MSG_CHECKING(for list of termcap files)
54097049SpeterCF_WITH_PATHLIST(termpath,
54197049Speter	[  --with-termpath=XXX     specify list of termcap files],
54297049Speter	TERMPATH,
54397049Speter	/etc/termcap:/usr/share/misc/termcap)
54497049SpeterAC_MSG_RESULT($TERMPATH)
54597049Spetertest -n "$TERMPATH" && AC_DEFINE_UNQUOTED(TERMPATH,"$TERMPATH")
54697049Speter
54750276Speter###	use option --enable-getcap to use a hacked getcap for reading termcaps
54850276SpeterAC_MSG_CHECKING(if fast termcap-loader is needed)
54950276SpeterAC_ARG_ENABLE(getcap,
55050276Speter	[  --enable-getcap         fast termcap load, no xrefs to terminfo],
55150276Speter	[with_getcap=$enableval],
55250276Speter	[with_getcap=no])
55350276SpeterAC_MSG_RESULT($with_getcap)
55450276Spetertest "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP)
55550276Speter
55650276SpeterAC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
55750276SpeterAC_ARG_ENABLE(getcap-cache,
55850276Speter	[  --enable-getcap-cache   cache translated termcaps in ~/.terminfo],
55950276Speter	[with_getcap_cache=$enableval],
56050276Speter	[with_getcap_cache=no])
56150276SpeterAC_MSG_RESULT($with_getcap_cache)
56250276Spetertest "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE)
56350276Speter
56450276Speterfi
56550276Speter
566166124Srafan###   Use option --disable-home-terminfo to completely remove ~/.terminfo
567166124SrafanAC_MSG_CHECKING(if ~/.terminfo is wanted)
568166124SrafanAC_ARG_ENABLE(home-terminfo,
569166124Srafan	[  --disable-home-terminfo drop ~/.terminfo from terminfo search-path],
570166124Srafan	[with_home_terminfo=$enableval],
571166124Srafan	[with_home_terminfo=yes])
572166124SrafanAC_MSG_RESULT($with_home_terminfo)
573166124Srafantest "$with_home_terminfo" = "yes" && AC_DEFINE(USE_HOME_TERMINFO)
574166124Srafan
575166124SrafanAC_MSG_CHECKING(if you want to use restricted environment when running as root)
576166124SrafanAC_ARG_ENABLE(root-environ,
577166124Srafan	[  --disable-root-environ  restrict environment when running as root],
578166124Srafan	[with_root_environ=$enableval],
579166124Srafan	[with_root_environ=yes])
580166124SrafanAC_MSG_RESULT($with_root_environ)
581166124Srafantest "$with_root_environ" = yes && AC_DEFINE(USE_ROOT_ENVIRON)
582166124Srafan
58350276Speter###   Use option --enable-symlinks to make tic use symlinks, not hard links
58450276Speter###   to reduce storage requirements for the terminfo database.
58550276SpeterCF_LINK_FUNCS
58650276Speter
58750276Speterwith_links=no
58850276Speterwith_symlinks=no
58950276Speter
590166124Srafan# soft links (symbolic links) are useful for some systems where hard links do
591166124Srafan# not work, or to make it simpler to copy terminfo trees around.
592166124Srafanif test "$ac_cv_func_symlink" = yes ; then
59350276Speter    AC_MSG_CHECKING(if tic should use symbolic links)
594166124Srafan    AC_ARG_ENABLE(symlinks,
595166124Srafan	[  --enable-symlinks       make tic use symbolic links not hard links],
596166124Srafan	[with_symlinks=$enableval],
597166124Srafan	[with_symlinks=no])
59850276Speter    AC_MSG_RESULT($with_symlinks)
599166124Srafanfi
600166124Srafan
601166124Srafan# If we have hard links and did not choose to use soft links instead, there is
602166124Srafan# no reason to make this choice optional - use the hard links.
603166124Srafanif test "$with_symlinks" = no ; then
60450276Speter    AC_MSG_CHECKING(if tic should use hard links)
60550276Speter    if test "$ac_cv_func_link" = yes ; then
606166124Srafan	with_links=yes
60750276Speter    else
608166124Srafan	with_links=no
60950276Speter    fi
61050276Speter    AC_MSG_RESULT($with_links)
61150276Speterfi
61250276Speter
61350276Spetertest "$with_links" = yes && AC_DEFINE(USE_LINKS)
61450276Spetertest "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS)
61550276Speter
61662449Speter###   use option --enable-broken-linker to force on use of broken-linker support
61762449SpeterAC_MSG_CHECKING(if you want broken-linker support code)
61862449SpeterAC_ARG_ENABLE(broken_linker,
61962449Speter	[  --enable-broken_linker  compile with broken-linker support code],
62062449Speter	[with_broken_linker=$enableval],
621166124Srafan	[with_broken_linker=${BROKEN_LINKER-no}])
62262449SpeterAC_MSG_RESULT($with_broken_linker)
62362449Speter
62497049SpeterBROKEN_LINKER=0
62597049Speterif test "$with_broken_linker" = yes ; then
62697049Speter	AC_DEFINE(BROKEN_LINKER)
62797049Speter	BROKEN_LINKER=1
628166124Srafanelif test "$DFT_LWR_MODEL" = shared ; then
62997049Speter	case $cf_cv_system_name in #(vi
63097049Speter	cygwin*)
63197049Speter		AC_DEFINE(BROKEN_LINKER)
63297049Speter		BROKEN_LINKER=1
63397049Speter		CF_VERBOSE(cygwin linker is broken anyway)
63497049Speter		;;
63597049Speter	esac
63697049Speterfi
63797049SpeterAC_SUBST(BROKEN_LINKER)
63897049Speter
639166124Srafan###   use option --enable-bsdpad to have tputs process BSD-style prefix padding
640166124SrafanAC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
641166124SrafanAC_ARG_ENABLE(bsdpad,
642166124Srafan	[  --enable-bsdpad         recognize BSD-style prefix padding],
643166124Srafan	[with_bsdpad=$enableval],
644166124Srafan	[with_bsdpad=no])
645166124SrafanAC_MSG_RESULT($with_bsdpad)
646166124Srafantest "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS)
647166124Srafan
648166124Srafan###   use option --enable-widec to turn on use of wide-character support
649166124SrafanNCURSES_CH_T=chtype
650166124SrafanNCURSES_LIBUTF8=0
651166124Srafan
652166124SrafanNEED_WCHAR_H=0
653166124SrafanNCURSES_MBSTATE_T=0
654166124SrafanNCURSES_WCHAR_T=0
655166124SrafanNCURSES_WINT_T=0
656166124Srafan
657166124Srafan# Check to define _XOPEN_SOURCE "automatically"
658166124SrafanCF_XOPEN_SOURCE
659166124Srafan
660166124Srafan# Work around breakage on OS X
661166124SrafanCF_SIGWINCH
662166124Srafan
663166124Srafan# Checks for CODESET support.
664166124SrafanAM_LANGINFO_CODESET
665166124Srafan
666166124Srafan# use these variables to work around a defect in gcc's fixincludes.
667166124SrafanNCURSES_OK_WCHAR_T=
668166124SrafanNCURSES_OK_WINT_T=
669166124Srafan
670166124SrafanAC_MSG_CHECKING(if you want wide-character code)
671166124SrafanAC_ARG_ENABLE(widec,
672166124Srafan	[  --enable-widec          compile with wide-char/UTF-8 code],
673166124Srafan	[with_widec=$enableval],
674166124Srafan	[with_widec=no])
675166124SrafanAC_MSG_RESULT($with_widec)
676166124Srafanif test "$with_widec" = yes ; then
677166124Srafan	LIB_SUFFIX="w${LIB_SUFFIX}"
678166124Srafan	AC_DEFINE(USE_WIDEC_SUPPORT)
679166124Srafan	CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED)
680166124Srafan	# with_overwrite=no
681166124Srafan	NCURSES_CH_T=cchar_t
682184989Srafan	AC_CHECK_FUNCS(putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs)
683166124Srafan	if test "$ac_cv_func_putwc" != yes ; then
684184989Srafan		CF_UTF8_LIB
685184989Srafan		if test "$cf_cv_utf8_lib" != no ; then
686166124Srafan			NCURSES_LIBUTF8=1
687166124Srafan		fi
688166124Srafan	fi
689166124Srafan	CF_WCHAR_TYPE(mbstate_t, NCURSES_MBSTATE_T)
690166124Srafan	CF_WCHAR_TYPE(wchar_t,   NCURSES_WCHAR_T,   NCURSES_OK_WCHAR_T)
691166124Srafan	CF_WCHAR_TYPE(wint_t,    NCURSES_WINT_T,    NCURSES_OK_WINT_T)
692166124Srafan
693166124Srafan	if test "$NCURSES_MBSTATE_T" != 0; then
694166124Srafan		AC_DEFINE(NEED_MBSTATE_T_DEF)
695166124Srafan	fi
696166124Srafanfi
697166124SrafanAC_SUBST(NCURSES_CH_T)
698166124SrafanAC_SUBST(NCURSES_LIBUTF8)
699166124Srafan
700166124SrafanAC_SUBST(NEED_WCHAR_H)
701166124SrafanAC_SUBST(NCURSES_MBSTATE_T)
702166124SrafanAC_SUBST(NCURSES_WCHAR_T)
703166124SrafanAC_SUBST(NCURSES_WINT_T)
704166124Srafan
705166124SrafanAC_SUBST(NCURSES_OK_WCHAR_T)
706166124SrafanAC_SUBST(NCURSES_OK_WINT_T)
707166124Srafan
708166124Srafan###   use option --disable-lp64 to allow long chtype
709166124Srafancase $cf_cv_abi_version in
710166124Srafan[[345]]*)
711166124Srafan	default_with_lp64=no
712166124Srafan	;;
713166124Srafan*)
714166124Srafan	default_with_lp64=yes
715166124Srafan	;;
716166124Srafanesac
717166124Srafan
718166124SrafanAC_MSG_CHECKING(whether to enable _LP64 definition in curses.h)
719166124SrafanAC_ARG_ENABLE(lp64,
720166124Srafan	[  --disable-lp64          allow chtype to be long (ignore _LP64)],
721166124Srafan	[with_lp64=$enableval],
722166124Srafan	[with_lp64=$default_with_lp64])
723166124SrafanAC_MSG_RESULT($with_lp64)
724166124Srafan
725166124Srafanif test "$with_lp64" = yes ; then
726166124Srafan	cf_cv_enable_lp64=1
727166124Srafanelse
728166124Srafan	cf_cv_enable_lp64=0
729166124Srafanfi
730166124SrafanAC_SUBST(cf_cv_enable_lp64)
731166124Srafan
732166124SrafanCF_LARGEFILE
733166124Srafan
734174993Srafan###   use option --disable-tparm-varargs to make tparm() conform to X/Open
735166124SrafanAC_MSG_CHECKING(if you want tparm not to use X/Open fixed-parameter list)
736166124SrafanAC_ARG_ENABLE(tparm-varargs,
737166124Srafan	[  --disable-tparm-varargs compile tparm() without varargs interface],
738166124Srafan	[with_tparm_varargs=$enableval],
739166124Srafan	[with_tparm_varargs=yes])
740166124SrafanAC_MSG_RESULT($with_tparm_varargs)
741166124SrafanNCURSES_TPARM_VARARGS=0
742166124Srafantest "$with_tparm_varargs" = yes && NCURSES_TPARM_VARARGS=1
743166124SrafanAC_SUBST(NCURSES_TPARM_VARARGS)
744166124Srafan
745184989Srafan###   use option --disable-tic-depends to make libtic not explicitly depend on ncurses/ncursesw
746184989Srafanif test "$with_ticlib" != no ; then
747184989SrafanAC_MSG_CHECKING(if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library)
748184989SrafanAC_ARG_ENABLE(tic-depends,
749184989Srafan	[  --disable-tic-depends   link tic library without explicit dependency on ncurses library],
750184989Srafan	[with_tic_depends=$enableval],
751184989Srafan	[with_tic_depends=yes])
752184989SrafanAC_MSG_RESULT($with_tic_depends)
753184989Srafanelse
754184989Srafan	with_tic_depends=no
755184989Srafanfi
756184989Srafan
75797049Speter###   use option --with-bool to override bool's type
75897049SpeterAC_MSG_CHECKING(for type of bool)
75997049SpeterAC_ARG_WITH(bool,
76097049Speter	[  --with-bool=TYPE        override fallback type of bool variable],
76197049Speter	[NCURSES_BOOL="$withval"],
76297049Speter	[NCURSES_BOOL=auto])
76397049SpeterAC_MSG_RESULT($NCURSES_BOOL)
76497049SpeterAC_SUBST(NCURSES_BOOL)
76597049Speter
766166124SrafanAC_MSG_CHECKING(for alternate terminal capabilities file)
767166124SrafanAC_ARG_WITH(caps,
768166124Srafan	[  --with-caps=alt         compile with alternate Caps file],
769166124Srafan	[TERMINFO_CAPS=Caps.$withval],
770166124Srafan	[TERMINFO_CAPS=Caps])
771166124Srafantest -f "${srcdir}/include/${TERMINFO_CAPS}" || TERMINFO_CAPS=Caps
772166124SrafanAC_MSG_RESULT($TERMINFO_CAPS)
773166124SrafanAC_SUBST(TERMINFO_CAPS)
774166124Srafan
775166124Srafan###   use option --with-chtype to override chtype's type
776166124SrafanAC_MSG_CHECKING(for type of chtype)
777166124SrafanAC_ARG_WITH(chtype,
778166124Srafan	[  --with-chtype=TYPE      override type of chtype],
779166124Srafan	[NCURSES_CHTYPE="$withval"],
780166124Srafan	[NCURSES_CHTYPE=auto])
781166124SrafanAC_MSG_RESULT($NCURSES_CHTYPE)
782166124Srafan
78376726Speter###   use option --with-ospeed to override ospeed's type
78476726SpeterAC_MSG_CHECKING(for type of ospeed)
78576726SpeterAC_ARG_WITH(ospeed,
78676726Speter	[  --with-ospeed=TYPE      override type of ospeed variable],
78797049Speter	[NCURSES_OSPEED="$withval"],
78876726Speter	[NCURSES_OSPEED=short])
78976726SpeterAC_MSG_RESULT($NCURSES_OSPEED)
79076726SpeterAC_SUBST(NCURSES_OSPEED)
79176726Speter
792166124Srafan###   use option --with-mmask-t to override mmask_t's type
793166124SrafanAC_MSG_CHECKING(for type of mmask_t)
794166124SrafanAC_ARG_WITH(mmask-t,
795166124Srafan	[  --with-mmask-t=TYPE     override type of mmask_t],
796166124Srafan	[NCURSES_MMASK_T="$withval"],
797166124Srafan	[NCURSES_MMASK_T=auto])
798166124SrafanAC_MSG_RESULT($NCURSES_MMASK_T)
79950276Speter
80062449Speter### Enable compiling-in rcs id's
80162449SpeterAC_MSG_CHECKING(if RCS identifiers should be compiled-in)
80262449SpeterAC_ARG_WITH(rcs-ids,
80362449Speter	[  --with-rcs-ids          compile-in RCS identifiers],
80462449Speter	[with_rcs_ids=$withval],
80562449Speter	[with_rcs_ids=no])
80662449SpeterAC_MSG_RESULT($with_rcs_ids)
80762449Spetertest "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
80862449Speter
80962449Speter###############################################################################
81066963SpeterCF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ])
81166963Speter
81266963Speter###############################################################################
81362449SpeterCF_HELP_MESSAGE(Extensions:)
81462449Speter
81562449Speter### Note that some functions (such as const) are normally disabled anyway.
81662449SpeterAC_MSG_CHECKING(if you want to build with function extensions)
81762449SpeterAC_ARG_ENABLE(ext-funcs,
81862449Speter	[  --disable-ext-funcs     disable function-extensions],
81962449Speter	[with_ext_funcs=$enableval],
82062449Speter	[with_ext_funcs=yes])
82162449SpeterAC_MSG_RESULT($with_ext_funcs)
82262449Speterif test "$with_ext_funcs" = yes ; then
82397049Speter	NCURSES_EXT_FUNCS=1
82466963Speter	AC_DEFINE(HAVE_CURSES_VERSION)
82562449Speter	AC_DEFINE(HAVE_HAS_KEY)
82662449Speter	AC_DEFINE(HAVE_RESIZETERM)
827166124Srafan	AC_DEFINE(HAVE_RESIZE_TERM)
82862449Speter	AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
82962449Speter	AC_DEFINE(HAVE_WRESIZE)
83062449Speter	AC_DEFINE(NCURSES_EXT_FUNCS)
83197049Speterelse
83297049Speter	NCURSES_EXT_FUNCS=0
83362449Speterfi
83497049SpeterAC_SUBST(NCURSES_EXT_FUNCS)
83562449Speter
83650276Speter###   use option --enable-const to turn on use of const beyond that in XSI.
83750276SpeterAC_MSG_CHECKING(for extended use of const keyword)
83850276SpeterAC_ARG_ENABLE(const,
83950276Speter	[  --enable-const          compile with extra/non-standard const],
84050276Speter	[with_ext_const=$enableval],
84150276Speter	[with_ext_const=no])
84250276SpeterAC_MSG_RESULT($with_ext_const)
84366963SpeterNCURSES_CONST='/*nothing*/'
84450276Speterif test "$with_ext_const" = yes ; then
84550276Speter	NCURSES_CONST=const
84650276Speterfi
84750276SpeterAC_SUBST(NCURSES_CONST)
84850276Speter
849184989Srafan###   use option --enable-ext-colors to turn on use of colors beyond 16.
850184989SrafanAC_MSG_CHECKING(if you want to use extended colors)
851184989SrafanAC_ARG_ENABLE(ext-colors,
852184989Srafan	[  --enable-ext-colors     compile for 256-color support],
853184989Srafan	[with_ext_colors=$enableval],
854184989Srafan	[with_ext_colors=no])
855184989SrafanAC_MSG_RESULT($with_ext_colors)
856184989SrafanNCURSES_EXT_COLORS=0
857184989Srafanif test "$with_ext_colors" = yes ; then
858184989Srafan	if test "$with_widec" != yes ; then
859184989Srafan		AC_MSG_ERROR(This option applies only to wide-character library)
860184989Srafan	else
861184989Srafan		# cannot be ABI 5 since it changes sizeof(cchar_t)
862184989Srafan		CF_NCURSES_ABI_6
863184989Srafan	fi
864184989Srafan	NCURSES_EXT_COLORS=1
865184989Srafan	AC_DEFINE(NCURSES_EXT_COLORS)
866184989Srafanfi
867184989SrafanAC_SUBST(NCURSES_EXT_COLORS)
868184989Srafan
869184989Srafan###   use option --enable-ext-mouse to modify coding to support 5-button mice
870184989SrafanAC_MSG_CHECKING(if you want to use extended mouse encoding)
871184989SrafanAC_ARG_ENABLE(ext-mouse,
872184989Srafan	[  --enable-ext-mouse      compile for extended mouse-encoding],
873184989Srafan	[with_ext_mouse=$enableval],
874184989Srafan	[with_ext_mouse=no])
875184989SrafanAC_MSG_RESULT($with_ext_mouse)
876184989SrafanNCURSES_MOUSE_VERSION=1
877184989Srafanif test "$with_ext_mouse" = yes ; then
878184989Srafan	NCURSES_MOUSE_VERSION=2
879184989Srafan	CF_NCURSES_ABI_6
880184989Srafanfi
881184989SrafanAC_SUBST(NCURSES_MOUSE_VERSION)
882184989Srafan
88362449SpeterAC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code)
88462449SpeterAC_ARG_ENABLE(no-padding,
885166124Srafan	[  --enable-no-padding     compile with $NCURSES_NO_PADDING code],
88662449Speter	[with_no_padding=$enableval],
88762449Speter	[with_no_padding=$with_ext_funcs])
88862449SpeterAC_MSG_RESULT($with_no_padding)
88962449Spetertest "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING)
89062449Speter
891166124SrafanAC_CHECK_SIZEOF([signed char], 0)
892166124Srafanif test "$ac_cv_sizeof_signed_char" = 1 ; then
893166124Srafan	NCURSES_SBOOL="signed char"
894166124Srafanelse
895166124Srafan	NCURSES_SBOOL="char"
896166124Srafanfi
897166124SrafanAC_MSG_CHECKING(if you want to use signed Boolean array in term.h)
898166124SrafanAC_ARG_ENABLE(signed-char,
899174993Srafan	[  --enable-signed-char    compile using signed Boolean's in term.h],
900166124Srafan	[with_signed_char=$enableval],
901166124Srafan	[with_signed_char=no])
902166124SrafanAC_MSG_RESULT($with_signed_char)
903166124Srafantest "$with_signed_char" != yes && NCURSES_SBOOL="char"
904166124SrafanAC_SUBST(NCURSES_SBOOL)
905166124Srafan
90662449Speter###   use option --enable-sigwinch to turn on use of SIGWINCH logic
90762449SpeterAC_MSG_CHECKING(if you want SIGWINCH handler)
90862449SpeterAC_ARG_ENABLE(sigwinch,
90962449Speter	[  --enable-sigwinch       compile with SIGWINCH handler],
91062449Speter	[with_sigwinch=$enableval],
91162449Speter	[with_sigwinch=$with_ext_funcs])
91262449SpeterAC_MSG_RESULT($with_sigwinch)
91362449Spetertest "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH)
91462449Speter
91562449Speter###   use option --enable-tcap-names to allow user to define new capabilities
91662449SpeterAC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap)
91762449SpeterAC_ARG_ENABLE(tcap-names,
91862449Speter	[  --enable-tcap-names     compile with user-definable terminal capabilities],
91962449Speter	[with_tcap_names=$enableval],
92062449Speter	[with_tcap_names=$with_ext_funcs])
92162449SpeterAC_MSG_RESULT($with_tcap_names)
92262449SpeterNCURSES_XNAMES=0
92362449Spetertest "$with_tcap_names" = yes && NCURSES_XNAMES=1
92462449SpeterAC_SUBST(NCURSES_XNAMES)
92562449Speter
92650276Speter###############################################################################
92766963Speter# These options are relatively safe to experiment with.
92866963SpeterCF_HELP_MESSAGE(Development Code:)
92966963SpeterAC_MSG_CHECKING(if you want all development code)
93050276SpeterAC_ARG_WITH(develop,
931166124Srafan	[  --without-develop       disable development options],
93250276Speter	[with_develop=$withval],
93350276Speter	[with_develop=no])
93450276SpeterAC_MSG_RESULT($with_develop)
93550276Speter
93650276Speter###   use option --enable-hard-tabs to turn on use of hard-tabs optimize
93766963SpeterAC_MSG_CHECKING(if you want hard-tabs code)
93850276SpeterAC_ARG_ENABLE(hard-tabs,
939166124Srafan	[  --enable-hard-tabs      compile with hard-tabs code],,
940166124Srafan	[enable_hard_tabs=$with_develop])
941166124SrafanAC_MSG_RESULT($enable_hard_tabs)
942166124Srafantest "$enable_hard_tabs" = yes && AC_DEFINE(USE_HARD_TABS)
94350276Speter
94466963Speter###   use option --enable-xmc-glitch to turn on use of magic-cookie optimize
94566963SpeterAC_MSG_CHECKING(if you want limited support for xmc)
94666963SpeterAC_ARG_ENABLE(xmc-glitch,
947166124Srafan	[  --enable-xmc-glitch     compile with support for xmc (magic-cookie)],,
948166124Srafan	[enable_xmc_glitch=$with_develop])
949166124SrafanAC_MSG_RESULT($enable_xmc_glitch)
950166124Srafantest "$enable_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT)
95166963Speter
95266963Speter###############################################################################
95366963Speter# These are just experimental, probably should not be in a package:
95466963SpeterCF_HELP_MESSAGE(Experimental Code:)
95566963Speter
95666963SpeterAC_MSG_CHECKING(if you do not want to assume colors are white-on-black)
95766963SpeterAC_ARG_ENABLE(assumed-color,
95866963Speter	[  --disable-assumed-color do not assume anything about default-colors],
95966963Speter	[with_assumed_color=$enableval],
96066963Speter	[with_assumed_color=yes])
96166963SpeterAC_MSG_RESULT($with_assumed_color)
96266963Spetertest "$with_assumed_color" = yes && AC_DEFINE(USE_ASSUMED_COLOR)
96366963Speter
96466963Speter###   use option --enable-hashmap to turn on use of hashmap scrolling logic
96566963SpeterAC_MSG_CHECKING(if you want hashmap scrolling-optimization code)
96666963SpeterAC_ARG_ENABLE(hashmap,
96766963Speter	[  --disable-hashmap       compile without hashmap scrolling-optimization],
96866963Speter	[with_hashmap=$enableval],
96966963Speter	[with_hashmap=yes])
97066963SpeterAC_MSG_RESULT($with_hashmap)
97166963Spetertest "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP)
97266963Speter
97398503Speter###   use option --enable-colorfgbg to turn on use of $COLORFGBG environment
97498503SpeterAC_MSG_CHECKING(if you want colorfgbg code)
97598503SpeterAC_ARG_ENABLE(colorfgbg,
976166124Srafan	[  --enable-colorfgbg      compile with $COLORFGBG code],
97798503Speter	[with_colorfgbg=$enableval],
97898503Speter	[with_colorfgbg=no])
97998503SpeterAC_MSG_RESULT($with_colorfgbg)
98098503Spetertest "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
98198503Speter
982184989Srafan# This is still experimental (20080329), but should ultimately be moved to
983184989Srafan# the script-block --with-normal, etc.
984184989SrafanCF_WITH_PTHREAD
985184989Srafan
986184989SrafanAC_MSG_CHECKING(if you want to use weak-symbols for pthreads)
987184989SrafanAC_ARG_ENABLE(weak-symbols,
988184989Srafan    [  --enable-weak-symbols   enable weak-symbols for pthreads],
989184989Srafan    [use_weak_symbols=$withval],
990184989Srafan    [use_weak_symbols=no])
991184989SrafanAC_MSG_RESULT($use_weak_symbols)
992184989Srafanif test "$use_weak_symbols" = yes ; then
993184989Srafan    CF_WEAK_SYMBOLS
994184989Srafanelse
995184989Srafan    cf_cv_weak_symbols=no
996166124Srafanfi
997166124Srafan
998184989Srafanif test $cf_cv_weak_symbols = yes ; then
999184989Srafan    AC_DEFINE(USE_WEAK_SYMBOLS)
1000166124Srafanfi
1001166124Srafan
1002184989SrafanPTHREAD=
1003178866Srafanif test "$with_pthread" = "yes" ; then
1004178866Srafan    AC_DEFINE(USE_PTHREADS)
1005178866Srafan    enable_reentrant=yes
1006184989Srafan    if test $cf_cv_weak_symbols = yes ; then
1007184989Srafan        PTHREAD=-lpthread
1008184989Srafan    fi
1009178866Srafanfi
1010184989SrafanAC_SUBST(PTHREAD)
1011178866Srafan
1012174993Srafan# Reentrant code has to be opaque; there's little advantage to making ncurses
1013178866Srafan# opaque outside of that, so there is no --enable-opaque option.  We can use
1014178866Srafan# this option without --with-pthreads, but this will be always set for
1015178866Srafan# pthreads.
1016174993SrafanAC_MSG_CHECKING(if you want experimental reentrant code)
1017174993SrafanAC_ARG_ENABLE(reentrant,
1018174993Srafan	[  --enable-reentrant      compile with experimental reentrant code],
1019174993Srafan	[with_reentrant=$enableval],
1020174993Srafan	[with_reentrant=no])
1021174993SrafanAC_MSG_RESULT($with_reentrant)
1022174993Srafanif test "$with_reentrant" = yes ; then
1023174993Srafan	cf_cv_enable_reentrant=1
1024174993Srafan	cf_cv_enable_opaque="NCURSES_INTERNALS"
1025174993Srafan	NCURSES_OPAQUE=1
1026174993Srafan	NCURSES_SIZE_T=int
1027184989Srafan    if test $cf_cv_weak_symbols = yes ; then
1028184989Srafan        CF_REMOVE_LIB(LIBS,$LIBS,pthread)
1029184989Srafan    else
1030184989Srafan        LIB_SUFFIX="t${LIB_SUFFIX}"
1031184989Srafan    fi
1032174993Srafan	AC_DEFINE(USE_REENTRANT)
1033174993Srafan	CF_NCURSES_ABI_6
1034174993Srafanelse
1035174993Srafan	cf_cv_enable_reentrant=0
1036174993Srafan	cf_cv_enable_opaque="NCURSES_OPAQUE"
1037174993Srafan	NCURSES_OPAQUE=0
1038174993Srafan	NCURSES_SIZE_T=short
1039174993Srafanfi
1040174993SrafanAC_SUBST(cf_cv_enable_reentrant)
1041174993SrafanAC_SUBST(cf_cv_enable_opaque)
1042174993SrafanAC_SUBST(NCURSES_OPAQUE)
1043174993SrafanAC_SUBST(NCURSES_SIZE_T)
1044174993Srafan
104550276SpeterAC_MSG_CHECKING(if you want experimental safe-sprintf code)
104650276SpeterAC_ARG_ENABLE(safe-sprintf,
104750276Speter	[  --enable-safe-sprintf   compile with experimental safe-sprintf code],
104850276Speter	[with_safe_sprintf=$enableval],
104950276Speter	[with_safe_sprintf=no])
105050276SpeterAC_MSG_RESULT($with_safe_sprintf)
105150276Spetertest "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF)
105250276Speter
105350276Speter###   use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
105462449Speter# when hashmap is used scroll hints are useless
105562449Speterif test "$with_hashmap" = no ; then
105650276SpeterAC_MSG_CHECKING(if you want to experiment without scrolling-hints code)
105750276SpeterAC_ARG_ENABLE(scroll-hints,
105862449Speter	[  --disable-scroll-hints  compile without scroll-hints code],
105950276Speter	[with_scroll_hints=$enableval],
106062449Speter	[with_scroll_hints=yes])
106150276SpeterAC_MSG_RESULT($with_scroll_hints)
106250276Spetertest "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS)
106362449Speterfi
106450276Speter
1065166124SrafanAC_MSG_CHECKING(if you want experimental wgetch-events code)
1066166124SrafanAC_ARG_ENABLE(wgetch-events,
1067166124Srafan	[  --enable-wgetch-events  compile with experimental wgetch-events code],
1068166124Srafan	[with_wgetch_events=$enableval],
1069166124Srafan	[with_wgetch_events=no])
1070166124SrafanAC_MSG_RESULT($with_wgetch_events)
1071166124Srafantest "$with_wgetch_events" = yes && AC_DEFINE(NCURSES_WGETCH_EVENTS)
107250276Speter
107350276Speter###############################################################################
107450276SpeterCF_HELP_MESSAGE(Testing/development Options:)
107550276Speter
107650276Speter###	use option --disable-echo to suppress full display compiling commands
107766963SpeterAC_MSG_CHECKING(if you want to display full commands during build)
107850276SpeterAC_ARG_ENABLE(echo,
107950276Speter	[  --enable-echo           build: display "compiling" commands (default)],
108050276Speter	[with_echo=$enableval],
108150276Speter	[with_echo=yes])
108250276Speterif test "$with_echo" = yes; then
108350276Speter	ECHO_LINK=
108450276Speterelse
108550276Speter	ECHO_LINK='@ echo linking $@ ... ;'
108676726Speter	test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent"
1087174993Srafan	test -n "$LIBTOOL_CXX" && LIBTOOL_CXX="$LIBTOOL_CXX --silent"
108850276Speterfi
108966963SpeterAC_MSG_RESULT($with_echo)
109050276SpeterAC_SUBST(ECHO_LINK)
109150276Speter
109250276Speter###	use option --enable-warnings to turn on all gcc warnings
109366963SpeterAC_MSG_CHECKING(if you want to see compiler warnings)
109450276SpeterAC_ARG_ENABLE(warnings,
109550276Speter	[  --enable-warnings       build: turn on GCC compiler warnings],
109650276Speter	[with_warnings=$enableval])
109776726SpeterAC_MSG_RESULT($with_warnings)
109876726Speter
1099174993Srafanif test "x$with_warnings" = "xyes"; then
110050276Speter 	ADAFLAGS="$ADAFLAGS -gnatg"
1101174993Srafan	CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum)
1102166124Srafan	if test "$cf_with_cxx" = yes ; then
1103166124Srafan		CF_GXX_WARNINGS(Wno-unused)
1104166124Srafan	fi
110550276Speterfi
110650276SpeterCF_GCC_ATTRIBUTES
110750276Speter
110850276Speter###	use option --enable-assertions to turn on generation of assertion code
110966963SpeterAC_MSG_CHECKING(if you want to enable runtime assertions)
111050276SpeterAC_ARG_ENABLE(assertions,
111150276Speter	[  --enable-assertions     test: turn on generation of assertion code],
111250276Speter	[with_assertions=$enableval],
111350276Speter	[with_assertions=no])
111466963SpeterAC_MSG_RESULT($with_assertions)
111550276Speterif test -n "$GCC"
111650276Speterthen
111766963Speter	if test "$with_assertions" = no
111850276Speter	then
111950276Speter		AC_DEFINE(NDEBUG)
112050276Speter		CPPFLAGS="$CPPFLAGS -DNDEBUG"
112150276Speter	else
112250276Speter		ADAFLAGS="$ADAFLAGS -gnata"
112350276Speter	fi
112450276Speterfi
112550276Speter
112650276Speter###	use option --disable-leaks to suppress "permanent" leaks, for testing
1127166124SrafanCF_DISABLE_LEAKS
112850276SpeterAC_DEFINE(HAVE_NC_ALLOC_H)
112950276Speter
113050276Speter###	use option --enable-expanded to generate certain macros as functions
113150276SpeterAC_ARG_ENABLE(expanded,
113250276Speter	[  --enable-expanded       test: generate functions for certain macros],
113366963Speter	[test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)])
113450276Speter
113550276Speter###	use option --disable-macros to suppress macros in favor of functions
113650276SpeterAC_ARG_ENABLE(macros,
113750276Speter	[  --disable-macros        test: use functions rather than macros],
113866963Speter	[test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)])
113950276Speter
1140166124Srafan# Normally we only add trace() to the debug-library.  Allow this to be
1141166124Srafan# extended to all models of the ncurses library:
1142166124Srafancf_all_traces=no
1143166124Srafancase "$CFLAGS $CPPFLAGS" in
1144166124Srafan*-DTRACE*)
1145166124Srafan	cf_all_traces=yes
1146166124Srafan	;;
1147166124Srafanesac
1148166124Srafan
1149166124SrafanAC_MSG_CHECKING(whether to add trace feature to all models)
1150166124SrafanAC_ARG_WITH(trace,
1151166124Srafan[  --with-trace            test: add trace() function to all models of ncurses],
1152166124Srafan[cf_with_trace=$withval],
1153166124Srafan[cf_with_trace=$cf_all_traces])
1154166124SrafanAC_MSG_RESULT($cf_with_trace)
1155166124Srafan
1156166124Srafanif test "$cf_with_trace" = yes ; then
1157166124Srafan	LIB_TRACING=all
1158166124Srafan	ADA_TRACE=TRUE
1159166124Srafan	CF_ADD_CFLAGS(-DTRACE)
1160166124Srafanelse
1161166124Srafan	LIB_TRACING=DEBUG
1162166124Srafan	ADA_TRACE=FALSE
1163166124Srafanfi
1164166124Srafan
1165166124SrafanAC_SUBST(ADA_TRACE)
1166166124Srafan
116750276Speter###	Checks for libraries.
116850276SpeterAC_CHECK_FUNC(gettimeofday,
116950276Speter	AC_DEFINE(HAVE_GETTIMEOFDAY),[
117050276Speter
117150276SpeterAC_CHECK_LIB(bsd, gettimeofday,
117250276Speter	AC_DEFINE(HAVE_GETTIMEOFDAY)
117350276Speter	LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
117450276Speter
117562449SpeterCF_MATH_LIB(MATH_LIB,sin(x))
117650276SpeterAC_SUBST(MATH_LIB)
117750276Speter
117850276Speter###	Checks for header files.
117950276SpeterAC_STDC_HEADERS
118050276SpeterAC_HEADER_DIRENT
118197049SpeterAC_HEADER_TIME
118250276SpeterCF_REGEX
118350276Speter
118450276Speterdnl These are some other potentially nonportable headers.
118550276SpeterAC_CHECK_HEADERS( \
118650276Speterfcntl.h \
118750276Spetergetopt.h \
118850276Speterlimits.h \
118950276Speterlocale.h \
119062449Speterpoll.h \
119150276Spetersys/bsdtypes.h \
119250276Spetersys/ioctl.h \
119350276Spetersys/param.h \
119462449Spetersys/poll.h \
119550276Spetersys/select.h \
119650276Spetersys/time.h \
119750276Spetersys/times.h \
119850276Speterttyent.h \
119950276Speterunistd.h \
1200166124Srafanwctype.h \
120150276Speter)
120250276Speter
120350276Speter# check for ISC (this may also define _POSIX_SOURCE)
120450276Speter# Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
120550276Speterif test "$ISC" = yes ; then
120650276Speter	AC_CHECK_LIB(cposix,main)
120750276Speter	AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
120850276Speterfi
120950276Speter
121050276SpeterCF_SYS_TIME_SELECT
121150276Speter
121250276Speter###	checks for compiler characteristics
121350276SpeterAC_LANG_C
121450276SpeterAC_C_CONST
1215174993SrafanCF_C_INLINE(NCURSES_INLINE,1200)
1216174993SrafanCF_SIG_ATOMIC_T
121750276Speter
1218166124Srafanif test $NCURSES_CHTYPE = auto ; then
1219166124Srafan	CF_TYPEOF_CHTYPE
1220166124Srafanelse
1221166124Srafan	cf_cv_typeof_chtype=$NCURSES_CHTYPE
1222166124Srafanfi
1223174993Srafantest "$cf_cv_typeof_chtype" = unsigned && cf_cv_typeof_chtype=""
1224166124SrafanAC_SUBST(cf_cv_typeof_chtype)
1225166124Srafan
1226166124SrafanCF_UNSIGNED_LITERALS
1227166124Srafancf_cv_1UL="1"
1228174993Srafantest ".$cf_cv_unsigned_literals" = .yes && cf_cv_1UL="${cf_cv_1UL}U"
1229174993Srafantest ".$cf_cv_typeof_chtype"    = .long && cf_cv_1UL="${cf_cv_1UL}L"
1230166124SrafanAC_SUBST(cf_cv_1UL)
1231166124Srafan
1232166124Srafanif test $NCURSES_MMASK_T = auto ; then
1233166124Srafan	cf_cv_typeof_mmask_t=long
1234166124Srafanelse
1235166124Srafan	cf_cv_typeof_mmask_t=$NCURSES_MMASK_T
1236166124Srafanfi
1237174993Srafantest "$cf_cv_typeof_mmask_t" = unsigned && cf_cv_typeof_mmask_t=""
1238166124SrafanAC_SUBST(cf_cv_typeof_mmask_t)
1239166124Srafan
124050276Speter###	Checks for external-data
124150276SpeterCF_ERRNO
124250276SpeterCF_LINK_DATAONLY
124350276Speter
124450276Speter###	Checks for library functions.
124562449SpeterAC_CHECK_FUNCS( \
124662449Spetergetcwd \
124766963Spetergetegid \
124866963Spetergeteuid \
124950276Spetergetttynam \
125066963Speterissetugid \
125150276Speterpoll \
125250276Speterremove \
125350276Speterselect \
125450276Spetersetbuf \
125550276Spetersetbuffer \
125650276Spetersetvbuf \
125750276Spetersigaction \
125850276Spetersigvec \
125950276Speterstrdup \
126050276Speterstrstr \
126150276Spetertcgetpgrp \
126250276Spetertimes \
126350276Spetervsnprintf \
126450276Speter)
126550276Speterif test "$with_getcap" = "yes" ; then
126650276Speter	CF_CGETENT
126750276Speterfi
126850276Speter
126950276SpeterCF_ISASCII
127050276SpeterCF_STRUCT_SIGACTION
1271166124SrafanCF_FUNC_NANOSLEEP
127266963SpeterCF_FUNC_TERMIOS
127397049SpeterCF_FUNC_VSSCANF
127497049SpeterCF_MKSTEMP
127550276Speter
127697049Speter# setup for prototype of fallback for vsscanf()
1277166124SrafanCF_SUBST_IF(["$cf_cv_func_vsscanf" = vsscanf], HAVE_VSSCANF, 1, 0)
127897049Speter
127950276Speterdnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
128050276Speterif test "$cross_compiling" = yes ; then
128150276Speter	AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
128250276Speterelse
128350276Speter	AC_FUNC_SETVBUF_REVERSED
128450276Speterfi
128550276SpeterAC_TYPE_SIGNAL
128650276SpeterCF_TYPE_SIGACTION
128750276SpeterCF_SIZECHANGE
128850276SpeterCF_FUNC_MEMMOVE
128962449SpeterCF_FUNC_POLL
129050276Speter
1291178866Srafan# special check for test/ditto.c
1292178866SrafanCF_FUNC_OPENPTY
1293178866Srafanif test "$cf_cv_func_openpty" != no ; then
1294178866Srafan    AC_DEFINE_UNQUOTED(USE_OPENPTY_HEADER,<$cf_cv_func_openpty>)
1295178866Srafan    AC_DEFINE(USE_XTERM_PTY)
1296178866Srafan    if test "$cf_cv_lib_util" = yes ; then
1297178866Srafan        TEST_LIBS="-lutil $TEST_LIBS"
1298178866Srafan    fi
1299178866Srafanfi
1300178866SrafanAC_SUBST(TEST_LIBS)
1301178866Srafan
1302166124Srafanif test "$with_hashed_db" != no ; then
1303166124Srafan	AC_DEFINE(USE_HASHED_DB)
1304174993Srafan	CF_HASHED_DB($with_hashed_db)
1305166124Srafanfi
1306166124Srafan
130750276Speterdnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
1308166124Srafanif test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
130950276Speter	CF_STRIP_G_OPT(CFLAGS)
131050276Speter	CF_STRIP_G_OPT(CXXFLAGS)
131150276Speterfi
131250276Speter
1313166124Srafan# Just in case, check if the C compiler has a bool type.
131450276SpeterCF_BOOL_DECL(cf_cv_cc_bool_type)
1315166124Srafan
1316166124Srafan# Check for C++ compiler characteristics (and ensure that it's there!)
131750276Speterif test -n "$CXX" ; then
131850276Speter	AC_LANG_CPLUSPLUS
131956639Speter	CF_STDCPP_LIBRARY
1320166124Srafan	CF_PROG_CC_C_O(CXX)
132176726Speter
132297049Speter	case $GXX_VERSION in
132397049Speter	1*|2.[0-6]*)
132497049Speter		cf_cxx_library=yes
132597049Speter		;;
132697049Speter	*-2.7*|2.7*)
132797049Speter		CF_GPP_LIBRARY
132897049Speter		;;
132997049Speter	*)
133066963Speter		cf_cxx_library=no
133197049Speter		;;
133297049Speter	esac
133376726Speter
1334174993Srafan	AC_CHECK_HEADERS(iostream typeinfo)
133576726Speter
1336184989Srafan    if test x"$ac_cv_header_iostream" = xyes ; then
1337184989Srafan        AC_MSG_CHECKING(if iostream uses std-namespace)
1338184989Srafan        AC_TRY_COMPILE([
1339184989Srafan#include <iostream>
1340184989Srafanusing std::endl;
1341184989Srafanusing std::cerr;],[
1342184989Srafancerr << "testing" << endl;
1343184989Srafan],[cf_iostream_namespace=yes],[cf_iostream_namespace=no])
1344184989Srafan        AC_MSG_RESULT($cf_iostream_namespace)
1345184989Srafan        if test "$cf_iostream_namespace" = yes ; then
1346184989Srafan            AC_DEFINE(IOSTREAM_NAMESPACE)
1347184989Srafan        fi
1348184989Srafan    fi
1349184989Srafan
135050276Speter	CF_BOOL_DECL
135150276Speter	CF_BOOL_SIZE
135250276Speter	CF_ETIP_DEFINES
135356639Speter	CF_CPP_PARAM_INIT
1354166124Srafan	CF_CPP_STATIC_CAST
135576726Speter
135697049Speter	CXX_AR='$(AR)'
135797049Speter	CXX_AR_OPTS='$(AR_OPTS)'
135856639Speter	case $cf_cv_system_name in #(vi
135997049Speter	irix*) #(vi
136097049Speter	    if test "$GXX" != yes ; then
136197049Speter		CXX_AR='$(CXX)'
136297049Speter		CXX_AR_OPTS='-ar -o'
136397049Speter	    fi
136497049Speter	    ;;
136597049Speter	sco3.2v5*) #(vi
136656639Speter	    CXXLDFLAGS="-u main"
136756639Speter	    ;;
136897049Speter	solaris2*)
136997049Speter	    if test "$GXX" != yes ; then
137097049Speter		CXX_AR='$(CXX)'
137197049Speter		CXX_AR_OPTS='-xar -o'
137297049Speter	    fi
137397049Speter	    ;;
137456639Speter	esac
137556639Speter	AC_SUBST(CXXLDFLAGS)
137697049Speter	AC_SUBST(CXX_AR)
137797049Speter	AC_SUBST(CXX_AR_OPTS)
137850276Speterelse
137950276Speter	cf_cxx_library=no
138056639Speter	cf_cv_builtin_bool=1
138150276Speter
138250276Speter	# Just because we are not configuring against C++ right now does not
138350276Speter	# mean that a user will not want to use C++.  Some distributors disable
138450276Speter	# the C++ portion of this configuration as a shortcut (or just to avoid
138550276Speter	# compiling the demo in the c++ directory).  So we need a reasonable
138650276Speter	# default for the 'bool' type.
138750276Speter	#
138850276Speter	# Caveat: since the storage of the bool type is not standardized, it
138950276Speter	# may change.
139050276Speter
139197049Speter	if test "$NCURSES_BOOL" != auto ; then
1392166124Srafan		cf_cv_type_of_bool=$NCURSES_BOOL
1393166124Srafan		cf_cv_header_stdbool_h=0
139497049Speter	else
139597049Speter		if test "$cf_cv_header_stdbool_h" = 1 ; then
139697049Speter			CF_BOOL_SIZE
139797049Speter		else
139897049Speter			AC_MSG_CHECKING(for fallback type of bool)
139997049Speter			case "$host_cpu" in #(vi
140097049Speter			i?86)	cf_cv_type_of_bool=char	;; #(vi
140197049Speter			*)	cf_cv_type_of_bool=int	;;
140297049Speter			esac
140397049Speter			AC_MSG_RESULT($cf_cv_type_of_bool)
140497049Speter		fi
140597049Speter	fi
140650276Speterfi
140750276SpeterAC_SUBST(CXXLIBS)
140850276Speter
1409166124Srafan# If the C compiler did not declare bool, and we did not determine that the C++
1410166124Srafan# compiler does not declare bool, turn on an ifdef in curses.h that makes the
1411166124Srafan# ncurses library use the same type as C++ bool.  Note that this allows one to
1412166124Srafan# specify the type of bool in a configure-script option and postpone
1413166124Srafan# integration with the C++ compiler provided that the types are compatible.
1414166124SrafanUSE_CXX_BOOL=1
1415166124Srafanif test $cf_cv_cc_bool_type = 1
1416166124Srafanthen
1417166124Srafan	# oops: C has a bool.  Unlikely, but C++ could differ.
1418166124Srafan	USE_CXX_BOOL=0
1419166124Srafanelif test $cf_cv_builtin_bool = 0
1420166124Srafanthen
1421166124Srafan	# C++ has no bool
1422166124Srafan	USE_CXX_BOOL=0
1423166124Srafanelse
1424166124Srafan	# this is the normal case
1425166124Srafan	USE_CXX_BOOL='defined(__cplusplus)'
1426166124Srafanfi
1427166124SrafanAC_SUBST(USE_CXX_BOOL)
1428166124Srafan
142950276SpeterCF_HELP_MESSAGE(Ada95 Binding Options:)
143050276Speter
1431174993Srafandnl If the Ada95 source-tree is present, add that to the build unless it will
1432174993Srafandnl not work, or was not requested.
1433174993Srafanif test -f "${srcdir}/Ada95/Makefile.in" ; then
1434174993Srafan
1435174993Srafandnl libtool does not know anything about GNAT, though a change made in 1998
1436174993Srafandnl provided for it "someday".  Disable the ada subtree if we are using
1437174993Srafandnl libtool -TD 20070714
1438174993Srafanif test "$cf_with_ada" != "no" ; then
1439174993Srafan    if test "$with_libtool" != "no"; then
1440174993Srafan	AC_MSG_WARN(libtool does not support Ada - disabling feature)
1441174993Srafan	cf_with_ada=no
1442174993Srafan    fi
1443174993Srafanfi
1444174993Srafan
144550276Speterdnl Check for availability of GNU Ada Translator (GNAT).
144650276Speterdnl At the moment we support no other Ada95 compiler.
144750276Speterif test "$cf_with_ada" != "no" ; then
144850276Spetercf_ada_make=gnatmake
144950276SpeterAC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
145050276Speterif test "$ac_cv_prog_gnat_exists" = no; then
145150276Speter   cf_ada_make=
145250276Speterelse
145350276Speter   CF_GNAT_VERSION
145466963Speter   AC_CHECK_PROG(M4_exists, m4, yes, no)
145566963Speter   if test "$ac_cv_prog_M4_exists" = no; then
145650276Speter      cf_cv_prog_gnat_correct=no
145750276Speter      echo Ada95 binding required program m4 not found. Ada95 binding disabled.
145850276Speter   fi
145950276Speter   if test "$cf_cv_prog_gnat_correct" = yes; then
146050276Speter      AC_MSG_CHECKING(if GNAT works)
146150276Speter      CF_GNAT_TRY_RUN([procedure conftest;],
146250276Speter[with Text_IO;
146350276Speterwith GNAT.OS_Lib;
146450276Speterprocedure conftest is
146550276Speterbegin
146650276Speter   Text_IO.Put ("Hello World");
146750276Speter   Text_IO.New_Line;
146850276Speter   GNAT.OS_Lib.OS_Exit (0);
146950276Speterend conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
147050276Speter      AC_MSG_RESULT($cf_cv_prog_gnat_correct)
147150276Speter   fi
147250276Speterfi
147350276Speterif test	"$cf_cv_prog_gnat_correct" = yes; then
147450276Speter   ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
147550276Speter
1476166124Srafan   AC_MSG_CHECKING(if GNAT pragma Unreferenced works)
1477166124Srafan   CF_GNAT_TRY_LINK([procedure conftest;],
1478166124Srafan[with Text_IO;
1479166124Srafanwith GNAT.OS_Lib;
1480166124Srafanprocedure conftest is
1481166124Srafan   test : Integer;
1482166124Srafan   pragma Unreferenced (test);
1483166124Srafanbegin
1484166124Srafan   test := 1;
1485166124Srafan   Text_IO.Put ("Hello World");
1486166124Srafan   Text_IO.New_Line;
1487166124Srafan   GNAT.OS_Lib.OS_Exit (0);
1488166124Srafanend conftest;],[cf_cv_pragma_unreferenced=yes],[cf_cv_pragma_unreferenced=no])
1489166124Srafan   AC_MSG_RESULT($cf_cv_pragma_unreferenced)
1490166124Srafan
1491166124Srafan   # if the pragma is supported, use it (needed in the Trace code).
1492166124Srafan   if test $cf_cv_pragma_unreferenced = yes ; then
1493166124Srafan      PRAGMA_UNREF=TRUE
1494166124Srafan   else
1495166124Srafan      PRAGMA_UNREF=FALSE
1496166124Srafan   fi
1497166124Srafan
149850276Speter   AC_ARG_WITH(ada-compiler,
149966963Speter	[  --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
150050276Speter	[cf_ada_compiler=$withval],
150150276Speter	[cf_ada_compiler=gnatmake])
150250276Speter
150350276Speter   cf_ada_package=terminal_interface
150450276Speter
150550276Speter   AC_SUBST(cf_ada_make)
150650276Speter   AC_SUBST(cf_ada_compiler)
150750276Speter   AC_SUBST(cf_ada_package)
150850276Speter   AC_SUBST(ADAFLAGS)
150950276Speter   AC_SUBST(cf_compile_generics)
151050276Speter   AC_SUBST(cf_generic_objects)
1511166124Srafan   AC_SUBST(PRAGMA_UNREF)
151250276Speter
151350276Speter   CF_WITH_PATH(ada-include,
151450276Speter       [  --with-ada-include=DIR  Ada includes are in DIR],
151550276Speter       ADA_INCLUDE,
151662449Speter       PREFIX/lib/ada/adainclude,
151762449Speter       [$]prefix/lib/ada/adainclude)
151850276Speter   AC_SUBST(ADA_INCLUDE)
151950276Speter
152050276Speter   CF_WITH_PATH(ada-objects,
152150276Speter       [  --with-ada-objects=DIR  Ada objects are in DIR],
152250276Speter       ADA_OBJECTS,
152362449Speter       PREFIX/lib/ada/adalib,
152462449Speter       [$]prefix/lib/ada/adalib)
152550276Speter   AC_SUBST(ADA_OBJECTS)
152650276Speter
152750276Speterfi
152850276Speterfi
1529174993Srafanelse
1530174993Srafan   cf_with_ada=no
153150276Speterfi
153250276Speter
1533174993Srafan### Construct the ncurses library-subsets, if any, from this set of keywords:
1534174993Srafan###	none, base, ext_funcs, ext_tinfo, ticlib, termlib, widechar
1535174993Srafan###
1536174993Srafan### ticlib modules may be a separate library, otherwise contained in termlib.
1537174993Srafan### termlib modules may be a separate library, otherwise contained in ncurses.
1538174993Srafan###
1539174993Srafan### The of "+" or " " between the tokens controls the way the script
1540174993Srafan### chooses to split module lists into libraries.
1541174993Srafan###
1542174993Srafan### (see CF_LIB_RULES).
154350276SpeterAC_MSG_CHECKING(for library subsets)
1544174993SrafanLIB_SUBSETS=
1545174993Srafan
1546174993Srafanif test "$cf_with_progs" = yes || test "$with_ticlib" != no || test "$with_termcap" != no; then
1547174993Srafan	LIB_SUBSETS="${LIB_SUBSETS}ticlib"
1548174993Srafan	if test "$with_ticlib" != no ; then
1549174993Srafan		LIB_SUBSETS="${LIB_SUBSETS} "
1550174993Srafan	else
1551174993Srafan		LIB_SUBSETS="${LIB_SUBSETS}+"
1552174993Srafan	fi
1553174993Srafanfi
1554174993Srafan
1555174993SrafanLIB_SUBSETS="${LIB_SUBSETS}termlib"
1556174993Srafantest "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo"
1557166124Srafanif test "$with_termlib" != no ; then
1558166124Srafan	LIB_SUBSETS="${LIB_SUBSETS} "
155950276Speterelse
1560174993Srafan	LIB_SUBSETS="${LIB_SUBSETS}+"
156150276Speterfi
1562174993Srafan
156350276SpeterLIB_SUBSETS="${LIB_SUBSETS}base"
1564166124Srafantest "$with_widec"     = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar"
156550276Spetertest "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
1566174993Srafan
156750276SpeterAC_MSG_RESULT($LIB_SUBSETS)
156850276Speter
156950276Speter### Construct the list of include-directories to be generated
157050276SpeterCF_INCLUDE_DIRS
157150276SpeterCF_ADA_INCLUDE_DIRS
157250276Speter
157362449Speter### Build up pieces for makefile rules
157462449SpeterAC_MSG_CHECKING(default library suffix)
157562449SpeterCF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
157662449SpeterAC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
157762449SpeterAC_MSG_RESULT($DFT_ARG_SUFFIX)
157862449Speter
157962449SpeterAC_MSG_CHECKING(default library-dependency suffix)
1580184989SrafanCF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_LIB_SUFFIX,DFT_DEP_SUFFIX)dnl
158162449SpeterAC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
158262449SpeterAC_MSG_RESULT($DFT_DEP_SUFFIX)
158362449Speter
158462449SpeterAC_MSG_CHECKING(default object directory)
158562449SpeterCF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
158662449SpeterAC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
158762449SpeterAC_MSG_RESULT($DFT_OBJ_SUBDIR)
158862449Speter
158976726Speter# libtool thinks it can make c++ shared libraries (perhaps only g++)
1590166124Srafanif test "$cf_with_cxx" = yes ; then
159176726SpeterAC_MSG_CHECKING(c++ library-dependency suffix)
1592166124Srafanif test "$with_libtool" != "no"; then
159376726Speter	CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
159476726Speterelse
1595184989Srafan	CF_LIB_SUFFIX(normal,CXX_LIB_SUFFIX,CXX_DEP_SUFFIX)dnl we normally make a static library
159676726Speterfi
159776726SpeterAC_MSG_RESULT($CXX_LIB_SUFFIX)
159876726SpeterAC_SUBST(CXX_LIB_SUFFIX)
1599166124Srafanfi
160076726Speter
1601174993Srafan# do not want -ldl in build except as needed for -lncurses dependency
1602174993Srafanif test "$with_dlsym" = yes ; then
1603174993Srafanif test $DFT_LWR_MODEL = shared || \
1604174993Srafan   test $DFT_LWR_MODEL = libtool ; then
1605174993Srafan	CF_REMOVE_LIB(LIBS,$LIBS,dl)
1606174993Srafanfi
1607174993Srafanfi
1608166124Srafan### Set up low-level terminfo dependencies for makefiles.
1609174993Srafan
1610174993Srafan# TICS_LIST and TINFO_LIST are needed to build libtic.so and libterm.so, but
1611174993Srafan# do not need libdl
1612174993SrafanTICS_LIST=
1613174993Srafanif test "$with_dlsym" = yes ; then
1614174993Srafan	CF_REMOVE_LIB(TINFO_LIST,$SHLIB_LIST,dl)
1615174993Srafanfi
1616174993Srafan
1617174993Srafanif test "$with_ticlib" != no ; then
1618174993Srafan
1619174993Srafan	if test "$with_ticlib" != yes ; then
1620174993Srafan		TICS_NAME=$with_ticlib
1621174993Srafan		TICS_ARG_SUFFIX="${with_ticlib}`echo ${DFT_ARG_SUFFIX}|sed -e "s/^${LIB_SUFFIX}//"`"
1622174993Srafan		TICS_DEP_SUFFIX="${with_ticlib}`echo ${DFT_DEP_SUFFIX}|sed -e "s/^${LIB_SUFFIX}//"`"
1623174993Srafan		TICS_LIB_SUFFIX="${with_ticlib}"
1624174993Srafan	else
1625174993Srafan		TICS_ARG_SUFFIX="${TICS_NAME}${DFT_ARG_SUFFIX}"
1626174993Srafan		TICS_DEP_SUFFIX="${TICS_NAME}${DFT_DEP_SUFFIX}"
1627174993Srafan		TICS_LIB_SUFFIX="${TICS_NAME}${LIB_SUFFIX}"
1628174993Srafan	fi
1629174993Srafan	TICS_ARGS="-L${LIB_DIR} -l${TICS_LIB_SUFFIX}"
1630174993Srafanelse
1631174993Srafan	TICS_ARGS="-L${LIB_DIR} -l${LIB_NAME}${DFT_ARG_SUFFIX}"
1632174993Srafanfi
1633174993SrafanAC_SUBST(TICS_ARG_SUFFIX)
1634174993SrafanAC_SUBST(TICS_DEP_SUFFIX)
1635174993SrafanAC_SUBST(TICS_LIB_SUFFIX)
1636174993SrafanAC_SUBST(TICS_ARGS)
1637174993Srafan
1638166124Srafanif test "$with_termlib" != no ; then
163962449Speter
1640166124Srafan	if test "$with_termlib" != yes ; then
1641166124Srafan		TINFO_NAME=$with_termlib
1642174993Srafan		TINFO_SUFFIX="`echo ${DFT_LIB_SUFFIX}|sed -e "s/^${LIB_SUFFIX}//"`"
1643166124Srafan		TINFO_ARG_SUFFIX="${with_termlib}`echo ${DFT_ARG_SUFFIX}|sed -e "s/^${LIB_SUFFIX}//"`"
1644166124Srafan		TINFO_DEP_SUFFIX="${with_termlib}`echo ${DFT_DEP_SUFFIX}|sed -e "s/^${LIB_SUFFIX}//"`"
1645166124Srafan		TINFO_LIB_SUFFIX="${with_termlib}"
1646166124Srafan	else
1647174993Srafan		TINFO_SUFFIX=${DFT_LIB_SUFFIX}
1648166124Srafan		TINFO_ARG_SUFFIX="${TINFO_NAME}${DFT_ARG_SUFFIX}"
1649166124Srafan		TINFO_DEP_SUFFIX="${TINFO_NAME}${DFT_DEP_SUFFIX}"
1650166124Srafan		TINFO_LIB_SUFFIX="${TINFO_NAME}${LIB_SUFFIX}"
1651166124Srafan	fi
1652166124Srafan
1653166124Srafan	TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_DEP_SUFFIX}"
1654166124Srafan	TEST_DEP2="${LIB_2ND}/${LIB_PREFIX}${TINFO_DEP_SUFFIX}"
1655166124Srafan	if test "$DFT_LWR_MODEL" = "libtool"; then
1656166124Srafan		TEST_ARGS="${TEST_DEPS}"
1657166124Srafan		TEST_ARG2="${TEST_DEP2}"
1658166124Srafan		TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS"
1659166124Srafan	else
1660166124Srafan		TEST_ARGS="-l${TINFO_ARG_SUFFIX}"
1661166124Srafan		TEST_ARG2="-l${TINFO_ARG_SUFFIX}"
1662174993Srafan		TICS_LIST="$SHLIB_LIST -l${TINFO_LIB_SUFFIX}"
1663166124Srafan		TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS"
1664166124Srafan		SHLIB_LIST="$SHLIB_LIST -l${TINFO_LIB_SUFFIX}"
1665166124Srafan	fi
1666166124Srafanelse
1667174993Srafan	# the next lines are needed for linking libtic over libncurses
1668174993Srafan	TINFO_NAME=${LIB_NAME}
1669174993Srafan	TINFO_SUFFIX=${DFT_LIB_SUFFIX}
1670174993Srafan	TINFO_ARG_SUFFIX=${LIB_NAME}${DFT_ARG_SUFFIX}
1671184989Srafan	if test "$with_tic_depends" = yes ; then
1672184989Srafan		TICS_LIST="$SHLIB_LIST -l${LIB_NAME}${DFT_ARG_SUFFIX}"
1673184989Srafan	else
1674184989Srafan		TICS_LIST="$SHLIB_LIST"
1675184989Srafan	fi
1676174993Srafan
1677166124Srafan	TINFO_ARGS="-L${LIB_DIR} -l${LIB_NAME}${DFT_ARG_SUFFIX}"
1678166124Srafanfi
1679174993Srafan
1680174993Srafanif test "$DFT_LWR_MODEL" = shared ; then
1681174993Srafan	case $cf_cv_system_name in #(vi
1682174993Srafan	cygwin*)
1683174993Srafan		# "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
1684174993Srafan		TINFO_SUFFIX=.dll
1685174993Srafan		;;
1686174993Srafan	esac
1687174993Srafanfi
1688174993Srafan
1689166124SrafanAC_SUBST(TINFO_ARG_SUFFIX)
1690166124SrafanAC_SUBST(TINFO_DEP_SUFFIX)
1691166124SrafanAC_SUBST(TINFO_LIB_SUFFIX)
1692166124SrafanAC_SUBST(TINFO_ARGS)
1693166124Srafan
1694174993Srafanif test "$with_dlsym" = yes ; then
1695174993Srafan	CF_REMOVE_LIB(TICS_LIST,$TICS_LIST,dl)
1696174993Srafanfi
1697174993Srafan
1698178866Srafanif test "$DFT_LWR_MODEL" = "libtool"; then
1699178866Srafan    OBJEXT=lo
1700178866Srafanfi
1701178866Srafan
1702166124Srafan# needed for Ada95
1703166124SrafanTINFO_ARGS2=`echo "$TINFO_ARGS" | sed -e 's,-L\.\./,-L../../,'`
1704166124SrafanAC_SUBST(TINFO_ARGS2)
1705166124Srafan
1706174993Srafancase $DFT_LWR_MODEL in
1707174993Srafannormal|debug|profile)
1708174993Srafan	CF_LDFLAGS_STATIC
1709174993Srafan	;;
1710174993Srafanesac
1711174993Srafan
171262449SpeterAC_MSG_CHECKING(where we will install curses.h)
171362449Spetertest "$with_overwrite" = no && \
171462449Spetertest "x$includedir" = 'x${prefix}/include' && \
1715166124Srafan	includedir='${prefix}/include/ncurses'${LIB_SUFFIX}
171662449SpeterAC_MSG_RESULT($includedir)
171762449Speter
1718166124Srafan### Resolve a conflict between normal and wide-curses by forcing applications
1719166124Srafan### that will need libutf8 to add it to their configure script.
1720166124Srafanif test "$with_overwrite" != no ; then
1721166124Srafanif test "$NCURSES_LIBUTF8" = 1 ; then
1722166124Srafan	NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)'
1723166124Srafan	AC_MSG_WARN(Wide-character applications must define HAVE_LIBUTF8_H to include curses.h)
1724166124Srafanfi
1725166124Srafanfi
1726166124Srafan
1727166124SrafanAC_SUBST(WITH_OVERWRITE)
1728174993SrafanAC_SUBST(TICS_LIST)
172962449SpeterAC_SUBST(TINFO_LIST)
173062449SpeterAC_SUBST(SHLIB_LIST)
173162449Speter
1732174993Srafan# used to separate tack out of the tree
1733174993SrafanNCURSES_TREE=
1734174993SrafanAC_SUBST(NCURSES_TREE)
1735174993Srafan
1736166124Srafan### predefined stuff for the test programs
1737166124SrafanAC_DEFINE(HAVE_SLK_COLOR)
173850276Speter
173950276Speter### Construct the list of subdirectories for which we'll customize makefiles
174050276Speter### with the appropriate compile-rules.
174150276Speter
174250276SpeterCF_SRC_MODULES($modules_to_build)
1743174993Srafan
1744174993Srafanif test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then
1745174993Srafan   SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config"
1746174993Srafanfi
1747174993Srafan
174850276SpeterCF_DIRS_TO_MAKE
174950276Speter
175076726SpeterAC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP')
175176726Speter
1752166124SrafanAC_DEFINE_UNQUOTED(NCURSES_VERSION_STRING, "${NCURSES_MAJOR}.${NCURSES_MINOR}.${NCURSES_PATCH}")
1753166124Srafan
175450276Speter### Now that we're done running tests, add the compiler-warnings, if any
1755166124SrafanCF_ADD_CFLAGS($EXTRA_CFLAGS)
175650276Speter
1757174993Srafan### If we're building with rpath, try to link non-standard libs that way too.
1758174993Srafanif test "$DFT_LWR_MODEL" = "shared"; then
1759174993Srafan  CF_RPATH_HACK
1760174993Srafanfi
1761174993Srafan
1762166124Srafan### Define substitutions for header files to avoid name-pollution
1763166124SrafanCF_SUBST_IF(["$cf_cv_have_tcgetattr" = yes], HAVE_TCGETATTR, 1, 0)
1764166124SrafanCF_SUBST_IF(["$ac_cv_header_termio_h" = yes], HAVE_TERMIO_H, 1, 0)
1765166124SrafanCF_SUBST_IF(["$ac_cv_header_termios_h" = yes], HAVE_TERMIOS_H, 1, 0)
1766166124Srafan
176750276Speter################################################################################
1768166124Srafantest "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in"
1769166124SrafanSUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in"
177050276SpeterAC_OUTPUT( \
177150276Speter	include/MKterm.h.awk \
177297049Speter	include/curses.head:include/curses.h.in \
177350276Speter	include/termcap.h \
177450276Speter	include/unctrl.h \
177550276Speter	$SUB_MAKEFILES \
177650276Speter	Makefile,[
1777166124SrafanCF_PRG_RULES([$srcdir/test/mk-test.awk ECHO_LINK="$ECHO_LINK"], test)
1778166124SrafanCF_LIB_RULES($SRC_SUBDIRS)
177950276Speter],[
178050276Speter### Special initialization commands, used to pass information from the
178150276Speter### configuration-run into config.status
178250276Speter
178350276SpeterAWK="$AWK"
1784166124SrafanDFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
178550276SpeterDFT_LWR_MODEL="$DFT_LWR_MODEL"
1786166124SrafanECHO_LINK="$ECHO_LINK"
178750276SpeterLDCONFIG="$LDCONFIG"
178850276SpeterLIB_NAME="$LIB_NAME"
178997049SpeterLIB_SUBSETS="$LIB_SUBSETS"
179062449SpeterLIB_SUFFIX="$LIB_SUFFIX"
179162449SpeterLIB_TRACING="$LIB_TRACING"
179297049SpeterMAKE_TERMINFO="$MAKE_TERMINFO"
1793166124SrafanNCURSES_MAJOR="$NCURSES_MAJOR"
1794166124SrafanNCURSES_MINOR="$NCURSES_MINOR"
179597049SpeterNCURSES_OSPEED="$NCURSES_OSPEED"
1796166124SrafanNCURSES_PATCH="$NCURSES_PATCH"
179750276SpeterSRC_SUBDIRS="$SRC_SUBDIRS"
179866963SpeterTERMINFO="$TERMINFO"
1799166124SrafanTINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX"
1800166124SrafanTINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX"
180150276SpeterTINFO_NAME="$TINFO_NAME"
1802174993SrafanTINFO_SUFFIX="$TINFO_SUFFIX"
1803174993SrafanTICS_ARG_SUFFIX="$TICS_ARG_SUFFIX"
1804174993SrafanTICS_LIB_SUFFIX="$TICS_LIB_SUFFIX"
1805174993SrafanTICS_NAME="$TICS_NAME"
180697049SpeterWITH_CURSES_H="$with_curses_h"
180750276SpeterWITH_ECHO="$with_echo"
180850276SpeterWITH_OVERWRITE="$with_overwrite"
1809166124Srafancf_LIST_MODELS="$cf_list_models"
181050276Spetercf_cv_abi_version="$cf_cv_abi_version"
1811174993Srafancf_cv_do_relink="$cf_cv_do_relink"
181250276Spetercf_cv_do_symlinks="$cf_cv_do_symlinks"
1813166124Srafancf_cv_enable_lp64="$cf_cv_enable_lp64"
1814174993Srafancf_cv_enable_opaque="$cf_cv_enable_opaque"
1815166124Srafancf_cv_prog_CC_c_o=$cf_cv_prog_CC_c_o
1816166124Srafancf_cv_prog_CXX_c_o=$cf_cv_prog_CXX_c_o
181750276Spetercf_cv_rel_version="$cf_cv_rel_version"
181850276Spetercf_cv_rm_so_locs="$cf_cv_rm_so_locs"
1819184989Srafancf_cv_shared_soname='$cf_cv_shared_soname'
182097049Spetercf_cv_shlib_version="$cf_cv_shlib_version"
182197049Spetercf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
182250276Spetercf_cv_system_name="$cf_cv_system_name"
182356639Spetercf_with_cxx_binding="$cf_with_cxx_binding"
1824166124Srafanhost="$host"
182550276Spetertarget="$target"
182650276Speter
1827166124Srafan],cat)dnl
182850276Speter${MAKE-make} preinstall
1829