xref: /freebsd/contrib/ncurses/configure.in (revision 4f29da19bd44f0e99f021510460a81bf754c21d2)
1dnl***************************************************************************
2dnl Copyright (c) 1998-2001,2002 Free Software Foundation, Inc.              *
3dnl                                                                          *
4dnl Permission is hereby granted, free of charge, to any person obtaining a  *
5dnl copy of this software and associated documentation files (the            *
6dnl "Software"), to deal in the Software without restriction, including      *
7dnl without limitation the rights to use, copy, modify, merge, publish,      *
8dnl distribute, distribute with modifications, sublicense, and/or sell       *
9dnl copies of the Software, and to permit persons to whom the Software is    *
10dnl furnished to do so, subject to the following conditions:                 *
11dnl                                                                          *
12dnl The above copyright notice and this permission notice shall be included  *
13dnl in all copies or substantial portions of the Software.                   *
14dnl                                                                          *
15dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22dnl                                                                          *
23dnl Except as contained in this notice, the name(s) of the above copyright   *
24dnl holders shall not be used in advertising or otherwise to promote the     *
25dnl sale, use or other dealings in this Software without prior written       *
26dnl authorization.                                                           *
27dnl***************************************************************************
28dnl
29dnl Author: Thomas E. Dickey 1995-on
30dnl
31dnl $Id: configure.in,v 1.268 2002/06/15 17:40:45 tom Exp $
32dnl Process this file with autoconf to produce a configure script.
33dnl
34dnl See http://dickey.his.com/autoconf/ for additional information.
35dnl
36dnl ---------------------------------------------------------------------------
37AC_PREREQ(2.13.20020210)
38AC_REVISION($Revision: 1.268 $)
39AC_INIT(ncurses/base/lib_initscr.c)
40AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
41
42CF_SUBST_NCURSES_VERSION
43CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
44AC_ARG_WITH(system-type,
45[  --with-system-type=XXX  test: override derived host system-type],
46[AC_MSG_WARN(overriding system type to $withval)
47 cf_cv_system_name=$withval])
48
49# We need a configure script only when compiling as part of GNU C library.
50# Here we have to generate one of the files we need while compiling.
51#
52# The only problem is that users of the package might think they have to
53# run configure themself and find it irritating when nothing happens.
54#
55# So we try here to find out whether we are called from the glibc configure
56# or by a user.
57#
58dnl Check if we are a drop-in addition to glibc.
59AC_ARG_ENABLE(add-ons, dnl
60[  --enable-add-ons=DIR... used to check if we are a glibc add-on.],
61		[glibc_add_on=yes],
62		[glibc_add_on=])
63
64if test x"$glibc_add_on" = "xyes" ; then
65  rm -f $srcdir/Banner
66  # We are in glibc.
67  rm -f $srcdir/Makefile
68  cp $srcdir/Makefile.glibc $srcdir/Makefile
69  echo "ncurses `grep \"^[[ 	]]*ncurses-version[[ 	]]*=.*$\" \
70		$srcdir/Makefile | sed -e \
71		's/^[[ 	]]*ncurses-version[[ 	]]*=[[ 	]]*\([[^	^ ]]*\)[[ 	]]*$/\1/'`" > $srcdir/Banner
72  exit 0
73fi
74
75###	Save the given $CFLAGS to allow user-override.
76cf_user_CFLAGS="$CFLAGS"
77
78###	Default install-location
79CF_CFG_DEFAULTS
80
81###	Checks for programs.
82AC_PROG_CC
83GCC_VERSION=none
84if test "$GCC" = yes ; then
85	AC_MSG_CHECKING(version of gcc)
86	GCC_VERSION="`${CC} --version|head -1`"
87	AC_MSG_RESULT($GCC_VERSION)
88fi
89
90# If we're cross-compiling, allow the user to override the tools and their
91# options.  The configure script is oriented toward identifying the target
92# compiler, etc., but we need a host compiler to generate parts of the source.
93BUILD_CC='$(CC)'
94BUILD_CFLAGS='$(CFLAGS)'
95BUILD_LDFLAGS='$(LDFLAGS)'
96BUILD_LIBS='$(LIBS)'
97if test "$host_alias" != "$target_alias" ; then
98	AC_ARG_WITH(build-cc,
99		[  --with-build-cc=XXX     if cross-compiling, the host C compiler (\$BUILD_CC)],
100		[BUILD_CC="$withval"],
101		[AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)])
102	AC_ARG_WITH(build-cflags,
103		[  --with-build-cflags=XXX if cross-compiling, the host C compiler-flags],
104		[BUILD_CFLAGS="$withval"])
105	AC_ARG_WITH(build-ldflags,
106		[  --with-build-ldflags=XXX if cross-compiling, the host linker-flags],
107		[BUILD_LDFLAGS="$withval"])
108	AC_ARG_WITH(build-libs,
109		[  --with-build-libs=XXX   if cross-compiling, the host libraries],
110		[BUILD_LIBS="$withval"])
111fi
112AC_SUBST(BUILD_CC)
113AC_SUBST(BUILD_CFLAGS)
114AC_SUBST(BUILD_LDFLAGS)
115AC_SUBST(BUILD_LIBS)
116
117AC_PROG_CPP
118AC_PROG_GCC_TRADITIONAL
119AC_ISC_POSIX
120CF_ANSI_CC_REQD
121CF_PROG_EXT
122
123case "$cf_cv_system_name" in
124freebsd*) #(vi
125  test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
126  ;;
127*) LDPATH=$PATH:/sbin:/usr/sbin
128  AC_PATH_PROG(LDCONFIG,ldconfig,,$LDPATH)
129  ;;
130esac
131AC_SUBST(LDCONFIG)
132
133dnl DEFECT in autoconf 2.12:	an attempt to set policy, this breaks the
134dnl				configure script by not letting us test if C++
135dnl				is present, making this option necessary.
136AC_MSG_CHECKING(if you want to ensure bool is consistent with C++)
137AC_ARG_WITH(cxx,
138	[  --without-cxx           do not adjust ncurses bool to match C++],
139	[cf_with_cxx=$withval],
140	[cf_with_cxx=yes])
141AC_MSG_RESULT($cf_with_cxx)
142if test "X$cf_with_cxx" = Xno ; then
143	CXX=""
144	GXX=""
145else
146	pushdef([AC_MSG_ERROR],
147		[AC_MSG_RESULT([You don't have any C++ compiler, too bad]); dnl
148		cf_with_cxx=no; CXX=""; GXX="";])dnl
149	AC_PROG_CXX
150	popdef([AC_MSG_ERROR])dnl
151fi
152
153GXX_VERSION=none
154if test "$GXX" = yes; then
155	AC_MSG_CHECKING(version of g++)
156	GXX_VERSION="`${CXX-g++} --version|head -1`"
157	AC_MSG_RESULT($GXX_VERSION)
158	case $GXX_VERSION in
159	1*|2.[[0-6]]*)
160		GXX=""; CXX=""; ac_cv_prog_gxx=no
161		cf_cxx_library=no
162		AC_MSG_WARN(templates do not work)
163		;;
164	esac
165fi
166
167AC_MSG_CHECKING(if you want to build C++ binding and demo)
168AC_ARG_WITH(cxx-binding,
169	[  --without-cxx-binding   do not build C++ binding and demo],
170	[cf_with_cxx_binding=$withval],
171	[cf_with_cxx_binding=$cf_with_cxx])
172AC_MSG_RESULT($cf_with_cxx_binding)
173
174AC_MSG_CHECKING(if you want to build with Ada95)
175AC_ARG_WITH(ada,
176	[  --without-ada           suppress check for Ada95, don't build demo],
177	[cf_with_ada=$withval],
178	[cf_with_ada=yes])
179AC_MSG_RESULT($cf_with_ada)
180
181AC_MSG_CHECKING(if you want to build programs such as tic)
182AC_ARG_WITH(progs,
183	[  --without-progs         suppress build with programs (e.g., tic)],
184	[cf_with_progs=$withval],
185	[cf_with_progs=yes])
186AC_MSG_RESULT($cf_with_progs)
187
188AC_MSG_CHECKING(if you wish to install curses.h)
189AC_ARG_WITH(curses-h,
190	[  --without-curses-h      install curses.h as ncurses.h only],
191	[with_curses_h=$withval],
192	[with_curses_h=yes])
193AC_MSG_RESULT($with_curses_h)
194
195modules_to_build="ncurses"
196if test "X$cf_with_progs" != Xno ; then
197modules_to_build="$modules_to_build progs tack"
198fi
199modules_to_build="$modules_to_build panel menu form"
200
201AC_ARG_PROGRAM
202AC_PROG_AWK
203AC_PROG_MAKE_SET
204CF_PROG_INSTALL
205AC_SYS_LONG_FILE_NAMES
206CF_MIXEDCASE_FILENAMES
207AC_PROG_LN_S
208AC_PROG_RANLIB
209CF_MAKE_TAGS
210AC_CHECK_PROGS(LINT, tdlint lint alint)
211AC_CHECK_PROGS(MAN, man man_db)
212AC_SUBST(LINT_OPTS)
213
214dnl These are standard among *NIX systems, but not when cross-compiling
215CF_SUBST(loader,LD,ld)
216CF_SUBST(archiver,AR,ar)
217CF_SUBST(archiver options,AR_OPTS,rv)
218
219CF_MAKEFLAGS
220
221dnl Special option for use by system-builders: the install-prefix is used to
222dnl adjust the location into which the actual install is done, so that an
223dnl archive can be built without modifying the host system's configuration.
224AC_MSG_CHECKING(if you have specified an install-prefix)
225AC_ARG_WITH(install-prefix,
226	[  --with-install-prefix   prefixes actual install-location (\$DESTDIR)],
227	[case "$withval" in #(vi
228	yes|no) #(vi
229		;;
230	*)	DESTDIR="$withval"
231		;;
232	esac])
233AC_MSG_RESULT($DESTDIR)
234AC_SUBST(DESTDIR)
235
236###############################################################################
237CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
238
239### Options to allow the user to specify the set of libraries which are used.
240### Use "--without-normal --with-shared" to allow the default model to be
241### shared, for example.
242cf_list_models=""
243AC_SUBST(cf_list_models)dnl	the complete list of models ("normal debug")
244
245AC_MSG_CHECKING(if you want to build libraries with libtool)
246AC_ARG_WITH(libtool,
247	[  --with-libtool          generate libraries with libtool],
248	[with_libtool=$withval],
249	[with_libtool=no])
250AC_MSG_RESULT($with_libtool)
251if test "$with_libtool" = "yes"; then
252	cf_list_models="$cf_list_models libtool"
253	test -z "$LIBTOOL" && LIBTOOL=libtool
254else
255	LIBTOOL=""
256fi
257AC_SUBST(LIBTOOL)
258
259AC_MSG_CHECKING(if you want to build shared libraries)
260AC_ARG_WITH(shared,
261	[  --with-shared           generate shared-libraries],
262	[with_shared=$withval],
263	[with_shared=no])
264AC_MSG_RESULT($with_shared)
265test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
266
267AC_MSG_CHECKING(if you want to build static libraries)
268AC_ARG_WITH(normal,
269	[  --with-normal           generate normal-libraries (default)],
270	[with_normal=$withval],
271	[with_normal=yes])
272AC_MSG_RESULT($with_normal)
273test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
274
275AC_MSG_CHECKING(if you want to build debug libraries)
276AC_ARG_WITH(debug,
277	[  --with-debug            generate debug-libraries (default)],
278	[with_debug=$withval],
279	[with_debug=yes])
280AC_MSG_RESULT($with_debug)
281test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
282
283AC_MSG_CHECKING(if you want to build profiling libraries)
284AC_ARG_WITH(profile,
285	[  --with-profile          generate profile-libraries],
286	[with_profile=$withval],
287	[with_profile=no])
288AC_MSG_RESULT($with_profile)
289test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
290
291###############################################################################
292
293AC_MSG_CHECKING(for specified models)
294test -z "$cf_list_models" && cf_list_models=normal
295dnl If we use libtool to generate libraries, then it must be the only
296dnl specified model.
297test "$with_libtool" = "yes" && cf_list_models=libtool
298AC_MSG_RESULT($cf_list_models)
299
300### Use the first model as the default, and save its suffix for use in building
301### up test-applications.
302AC_MSG_CHECKING(for default model)
303DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'`
304AC_MSG_RESULT($DFT_LWR_MODEL)
305
306CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
307
308AC_SUBST(DFT_LWR_MODEL)dnl	the default model ("normal")
309AC_SUBST(DFT_UPR_MODEL)dnl	the default model ("NORMAL")
310
311TINFO_NAME=tinfo
312AC_SUBST(TINFO_NAME)
313
314LIB_NAME=ncurses
315AC_SUBST(LIB_NAME)
316
317LIB_DIR=../lib
318CF_LIB_PREFIX(cf_prefix)
319LIB_PREFIX=$cf_prefix
320AC_SUBST(LIB_PREFIX)
321
322LIB_SUFFIX=
323AC_SUBST(LIB_SUFFIX)
324
325###############################################################################
326
327AC_MSG_CHECKING(if you want to build a separate terminfo library)
328AC_ARG_WITH(termlib,
329	[  --with-termlib          generate separate terminfo library],
330	[with_termlib=$withval],
331	[with_termlib=no])
332AC_MSG_RESULT($with_termlib)
333
334### Checks for special libraries, must be done up-front.
335AC_MSG_CHECKING(if you want to link with dbmalloc for testing)
336AC_ARG_WITH(dbmalloc,
337	[  --with-dbmalloc         test: use Conor Cahill's dbmalloc library],
338	[with_dbmalloc=$withval],
339	[with_dbmalloc=no])
340AC_MSG_RESULT($with_dbmalloc)
341if test "$with_dbmalloc" = yes ; then
342	AC_CHECK_LIB(dbmalloc,debug_malloc)
343fi
344
345AC_MSG_CHECKING(if you want to link with dmalloc for testing)
346AC_ARG_WITH(dmalloc,
347	[  --with-dmalloc          test: use Gray Watson's dmalloc library],
348	[with_dmalloc=$withval],
349	[with_dmalloc=no])
350AC_MSG_RESULT($with_dmalloc)
351if test "$with_dmalloc" = yes ; then
352	AC_CHECK_LIB(dmalloc,dmalloc_debug)
353fi
354
355SHLIB_LIST=""
356AC_MSG_CHECKING(if you want to link with the gpm mouse library)
357AC_ARG_WITH(gpm,
358	[  --with-gpm              use Alessandro Rubini's GPM library],
359	[with_gpm=$withval],
360	[with_gpm=no])
361AC_MSG_RESULT($with_gpm)
362if test "$with_gpm" = yes ; then
363	AC_CHECK_LIB(gpm,Gpm_Open,[
364		EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS"
365		SHLIB_LIST="-lgpm $SHLIB_LIST"
366		AC_DEFINE(HAVE_LIBGPM)
367		AC_CHECK_HEADERS(gpm.h)
368	],AC_MSG_WARN(Cannot link with gpm library - read the FAQ))
369fi
370
371dnl Not all ports of gcc support the -g option
372
373if test X"$CC_G_OPT" = X"" ; then
374	CC_G_OPT='-g'
375	test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
376fi
377AC_SUBST(CC_G_OPT)
378
379if test X"$CXX_G_OPT" = X"" ; then
380	CXX_G_OPT='-g'
381	test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
382fi
383AC_SUBST(CXX_G_OPT)
384
385AC_MSG_CHECKING(for default loader flags)
386case $DFT_LWR_MODEL in
387libtool) LD_MODEL=''   ;;
388normal)  LD_MODEL=''   ;;
389debug)   LD_MODEL=$CC_G_OPT ;;
390profile) LD_MODEL='-pg';;
391shared)  LD_MODEL=''   ;;
392esac
393AC_SUBST(LD_MODEL)dnl		the type of link (e.g., -g or -pg)
394AC_MSG_RESULT($LD_MODEL)
395
396AC_MSG_CHECKING(if rpath option should be used)
397AC_ARG_ENABLE(rpath,
398[  --enable-rpath          use rpath option when generating shared libraries],
399[cf_cv_ld_rpath=$enableval],
400[cf_cv_ld_rpath=no])
401AC_MSG_RESULT($cf_cv_ld_rpath)
402
403CF_SHARED_OPTS
404if test "$CC_SHARED_OPTS" = "unknown"; then
405	for model in $cf_list_models; do
406		if test "$model" = "shared"; then
407			AC_ERROR(Shared libraries are not supported in this version)
408		fi
409	done
410fi
411
412###############################################################################
413CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
414
415###	use option --disable-overwrite to leave out the link to -lcurses
416AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
417AC_ARG_ENABLE(overwrite,
418	[  --disable-overwrite     leave out the link to -lcurses],
419	[with_overwrite=$enableval],
420	[if test "$prefix" != "/usr/local" ; then with_overwrite=yes; else with_overwrite=no; fi])
421AC_MSG_RESULT($with_overwrite)
422
423AC_MSG_CHECKING(if external terminfo-database is used)
424AC_ARG_ENABLE(database,
425	[  --disable-database      do not use terminfo, only fallbacks/termcap],
426	[use_database=$enableval],
427	[use_database=yes])
428AC_MSG_RESULT($use_database)
429
430case $host_os in #(vi
431os2*) #(vi
432	TERMINFO_SRC='${top_srcdir}/misc/emx.src'
433	;;
434*) #(vi
435	TERMINFO_SRC='${top_srcdir}/misc/terminfo.src'
436	;;
437esac
438AC_SUBST(TERMINFO_SRC)
439
440CF_PATHSEP
441if test "$use_database" != no ; then
442	AC_DEFINE(USE_DATABASE)
443	AC_MSG_CHECKING(which terminfo source-file will be installed)
444	AC_ARG_ENABLE(database,
445		[  --with-database=XXX     specify terminfo source to install],
446		[TERMINFO_SRC=$withval])
447	AC_MSG_RESULT($TERMINFO_SRC)
448fi
449
450AC_MSG_CHECKING(for list of fallback descriptions)
451AC_ARG_WITH(fallbacks,
452	[  --with-fallbacks=XXX    specify list of fallback terminal descriptions],
453	[with_fallback=$withval],
454	[with_fallback=])
455AC_MSG_RESULT($with_fallback)
456FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'`
457AC_SUBST(FALLBACK_LIST)
458
459MAKE_TERMINFO=
460if test "$use_database" = no ; then
461	TERMINFO="${datadir}/terminfo"
462	MAKE_TERMINFO="#"
463else
464
465AC_MSG_CHECKING(for list of terminfo directories)
466CF_WITH_PATHLIST(terminfo-dirs,
467	[  --with-terminfo-dirs=XXX specify list of terminfo directories],
468	TERMINFO_DIRS,
469	DATADIR/terminfo,
470	${datadir}/terminfo)
471AC_MSG_RESULT($TERMINFO_DIRS)
472test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS")
473
474AC_MSG_CHECKING(for default terminfo directory)
475CF_WITH_PATH(default-terminfo-dir,
476	[  --with-default-terminfo-dir=DIR default terminfo directory],
477	TERMINFO,
478	DATADIR/terminfo,
479	${datadir}/terminfo)
480AC_MSG_RESULT($TERMINFO)
481AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO")
482
483fi
484
485AC_SUBST(TERMINFO)
486AC_SUBST(MAKE_TERMINFO)
487
488###	use option --disable-big-core to make tic run on small machines
489###	We need 4Mb, check if we can allocate 50% more than that.
490AC_MSG_CHECKING(if big-core option selected)
491AC_ARG_ENABLE(big-core,
492	[  --disable-big-core      assume machine has little memory],
493	[with_big_core=$enableval],
494	[AC_TRY_RUN([
495#include <stdlib.h>
496#include <string.h>
497int main() {
498	unsigned long n = 6000000L;
499	char *s = malloc(n);
500	if (s != 0)
501		s[0] = s[n-1] = 0;
502	exit(s == 0);
503}],
504	[with_big_core=yes],
505	[with_big_core=no],
506	[with_big_core=no])])
507AC_MSG_RESULT($with_big_core)
508test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
509
510###	use option --enable-termcap to compile in the termcap fallback support
511AC_MSG_CHECKING(if you want termcap-fallback support)
512AC_ARG_ENABLE(termcap,
513	[  --enable-termcap        compile in termcap fallback support],
514	[with_termcap=$enableval],
515	[with_termcap=no])
516AC_MSG_RESULT($with_termcap)
517
518if test "$with_termcap" != "yes" ; then
519	if test "$use_database" = no ; then
520		if test -z $with_fallback ; then
521			AC_ERROR(You have disabled the database w/o specifying fallbacks)
522		fi
523	fi
524	AC_DEFINE(PURE_TERMINFO)
525else
526
527AC_DEFINE(USE_TERMCAP)
528AC_MSG_CHECKING(for list of termcap files)
529CF_WITH_PATHLIST(termpath,
530	[  --with-termpath=XXX     specify list of termcap files],
531	TERMPATH,
532	/etc/termcap:/usr/share/misc/termcap)
533AC_MSG_RESULT($TERMPATH)
534test -n "$TERMPATH" && AC_DEFINE_UNQUOTED(TERMPATH,"$TERMPATH")
535
536###	use option --enable-getcap to use a hacked getcap for reading termcaps
537AC_MSG_CHECKING(if fast termcap-loader is needed)
538AC_ARG_ENABLE(getcap,
539	[  --enable-getcap         fast termcap load, no xrefs to terminfo],
540	[with_getcap=$enableval],
541	[with_getcap=no])
542AC_MSG_RESULT($with_getcap)
543test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP)
544
545AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
546AC_ARG_ENABLE(getcap-cache,
547	[  --enable-getcap-cache   cache translated termcaps in ~/.terminfo],
548	[with_getcap_cache=$enableval],
549	[with_getcap_cache=no])
550AC_MSG_RESULT($with_getcap_cache)
551test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE)
552
553fi
554
555###   Use option --enable-symlinks to make tic use symlinks, not hard links
556###   to reduce storage requirements for the terminfo database.
557CF_LINK_FUNCS
558
559with_links=no
560with_symlinks=no
561
562if test "$ac_cv_func_link" != yes ; then
563    AC_MSG_CHECKING(if tic should use symbolic links)
564    if test "$ac_cv_func_symlink" = yes ; then
565    	with_symlinks=yes
566    else
567    	with_symlinks=no
568    fi
569    AC_MSG_RESULT($with_symlinks)
570elif test "$ac_cv_func_symlink" != yes ; then
571    AC_MSG_CHECKING(if tic should use hard links)
572    if test "$ac_cv_func_link" = yes ; then
573    	with_links=yes
574    else
575    	with_links=no
576    fi
577    AC_MSG_RESULT($with_links)
578else
579    AC_MSG_CHECKING(if tic should use symbolic links)
580    AC_ARG_ENABLE(symlinks,
581	[  --enable-symlinks       make tic use symbolic links not hard links],
582	[with_symlinks=$enableval],
583	[with_symlinks=no])
584    AC_MSG_RESULT($with_symlinks)
585fi
586
587test "$with_links" = yes && AC_DEFINE(USE_LINKS)
588test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS)
589
590###   use option --enable-broken-linker to force on use of broken-linker support
591AC_MSG_CHECKING(if you want broken-linker support code)
592AC_ARG_ENABLE(broken_linker,
593	[  --enable-broken_linker  compile with broken-linker support code],
594	[with_broken_linker=$enableval],
595	[with_broken_linker=$BROKEN_LINKER])
596AC_MSG_RESULT($with_broken_linker)
597
598BROKEN_LINKER=0
599if test "$with_broken_linker" = yes ; then
600	AC_DEFINE(BROKEN_LINKER)
601	BROKEN_LINKER=1
602elif test $DFT_LWR_MODEL = shared ; then
603	case $cf_cv_system_name in #(vi
604	cygwin*)
605		AC_DEFINE(BROKEN_LINKER)
606		BROKEN_LINKER=1
607		CF_VERBOSE(cygwin linker is broken anyway)
608		;;
609	esac
610fi
611AC_SUBST(BROKEN_LINKER)
612
613###   use option --with-bool to override bool's type
614AC_MSG_CHECKING(for type of bool)
615AC_ARG_WITH(bool,
616	[  --with-bool=TYPE        override fallback type of bool variable],
617	[NCURSES_BOOL="$withval"],
618	[NCURSES_BOOL=auto])
619AC_MSG_RESULT($NCURSES_BOOL)
620AC_SUBST(NCURSES_BOOL)
621
622###   use option --with-ospeed to override ospeed's type
623AC_MSG_CHECKING(for type of ospeed)
624AC_ARG_WITH(ospeed,
625	[  --with-ospeed=TYPE      override type of ospeed variable],
626	[NCURSES_OSPEED="$withval"],
627	[NCURSES_OSPEED=short])
628AC_MSG_RESULT($NCURSES_OSPEED)
629AC_SUBST(NCURSES_OSPEED)
630
631###   use option --enable-bsdpad to have tputs process BSD-style prefix padding
632AC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
633AC_ARG_ENABLE(bsdpad,
634	[  --enable-bsdpad         recognize BSD-style prefix padding],
635	[with_bsdpad=$enableval],
636	[with_bsdpad=no])
637AC_MSG_RESULT($with_bsdpad)
638test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS)
639
640### Enable compiling-in rcs id's
641AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
642AC_ARG_WITH(rcs-ids,
643	[  --with-rcs-ids          compile-in RCS identifiers],
644	[with_rcs_ids=$withval],
645	[with_rcs_ids=no])
646AC_MSG_RESULT($with_rcs_ids)
647test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
648
649###############################################################################
650CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ])
651
652###############################################################################
653CF_HELP_MESSAGE(Extensions:)
654
655### Note that some functions (such as const) are normally disabled anyway.
656AC_MSG_CHECKING(if you want to build with function extensions)
657AC_ARG_ENABLE(ext-funcs,
658	[  --disable-ext-funcs     disable function-extensions],
659	[with_ext_funcs=$enableval],
660	[with_ext_funcs=yes])
661AC_MSG_RESULT($with_ext_funcs)
662if test "$with_ext_funcs" = yes ; then
663	NCURSES_EXT_FUNCS=1
664	AC_DEFINE(HAVE_CURSES_VERSION)
665	AC_DEFINE(HAVE_HAS_KEY)
666	AC_DEFINE(HAVE_RESIZETERM)
667	AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
668	AC_DEFINE(HAVE_WRESIZE)
669	AC_DEFINE(NCURSES_EXT_FUNCS)
670else
671	NCURSES_EXT_FUNCS=0
672fi
673AC_SUBST(NCURSES_EXT_FUNCS)
674
675###   use option --enable-const to turn on use of const beyond that in XSI.
676AC_MSG_CHECKING(for extended use of const keyword)
677AC_ARG_ENABLE(const,
678	[  --enable-const          compile with extra/non-standard const],
679	[with_ext_const=$enableval],
680	[with_ext_const=no])
681AC_MSG_RESULT($with_ext_const)
682NCURSES_CONST='/*nothing*/'
683if test "$with_ext_const" = yes ; then
684	NCURSES_CONST=const
685fi
686AC_SUBST(NCURSES_CONST)
687
688AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code)
689AC_ARG_ENABLE(no-padding,
690	[  --enable-no-padding     compile with \$NCURSES_NO_PADDING code],
691	[with_no_padding=$enableval],
692	[with_no_padding=$with_ext_funcs])
693AC_MSG_RESULT($with_no_padding)
694test "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING)
695
696###   use option --enable-sigwinch to turn on use of SIGWINCH logic
697AC_MSG_CHECKING(if you want SIGWINCH handler)
698AC_ARG_ENABLE(sigwinch,
699	[  --enable-sigwinch       compile with SIGWINCH handler],
700	[with_sigwinch=$enableval],
701	[with_sigwinch=$with_ext_funcs])
702AC_MSG_RESULT($with_sigwinch)
703test "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH)
704
705###   use option --enable-tcap-names to allow user to define new capabilities
706AC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap)
707AC_ARG_ENABLE(tcap-names,
708	[  --enable-tcap-names     compile with user-definable terminal capabilities],
709	[with_tcap_names=$enableval],
710	[with_tcap_names=$with_ext_funcs])
711AC_MSG_RESULT($with_tcap_names)
712NCURSES_XNAMES=0
713test "$with_tcap_names" = yes && NCURSES_XNAMES=1
714AC_SUBST(NCURSES_XNAMES)
715
716###############################################################################
717# These options are relatively safe to experiment with.
718CF_HELP_MESSAGE(Development Code:)
719AC_MSG_CHECKING(if you want all development code)
720AC_ARG_WITH(develop,
721	[  --with-develop          enable all development options],
722	[with_develop=$withval],
723	[with_develop=no])
724AC_MSG_RESULT($with_develop)
725
726###   use option --enable-hard-tabs to turn on use of hard-tabs optimize
727AC_MSG_CHECKING(if you want hard-tabs code)
728AC_ARG_ENABLE(hard-tabs,
729	[  --enable-hard-tabs      compile with hard-tabs code],
730	[with_hardtabs=$enableval],
731	[with_hardtabs=$with_develop])
732AC_MSG_RESULT($with_hardtabs)
733test "$with_hardtabs" = yes && AC_DEFINE(USE_HARD_TABS)
734
735AC_MSG_CHECKING(if you want to use restrict environment when running as root)
736AC_ARG_ENABLE(root-environ,
737	[  --disable-root-environ  limit environment when running as root],
738	[with_root_environ=$enableval],
739	[with_root_environ=yes])
740AC_MSG_RESULT($with_root_environ)
741test "$with_root_environ" = yes && AC_DEFINE(USE_ROOT_ENVIRON)
742
743###   use option --enable-xmc-glitch to turn on use of magic-cookie optimize
744AC_MSG_CHECKING(if you want limited support for xmc)
745AC_ARG_ENABLE(xmc-glitch,
746	[  --enable-xmc-glitch     compile with limited support for xmc],
747	[with_xmc_glitch=$enableval],
748	[with_xmc_glitch=$with_develop])
749AC_MSG_RESULT($with_xmc_glitch)
750test "$with_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT)
751
752###############################################################################
753# These are just experimental, probably should not be in a package:
754CF_HELP_MESSAGE(Experimental Code:)
755
756AC_MSG_CHECKING(if you do not want to assume colors are white-on-black)
757AC_ARG_ENABLE(assumed-color,
758	[  --disable-assumed-color do not assume anything about default-colors],
759	[with_assumed_color=$enableval],
760	[with_assumed_color=yes])
761AC_MSG_RESULT($with_assumed_color)
762test "$with_assumed_color" = yes && AC_DEFINE(USE_ASSUMED_COLOR)
763
764###   use option --enable-hashmap to turn on use of hashmap scrolling logic
765AC_MSG_CHECKING(if you want hashmap scrolling-optimization code)
766AC_ARG_ENABLE(hashmap,
767	[  --disable-hashmap       compile without hashmap scrolling-optimization],
768	[with_hashmap=$enableval],
769	[with_hashmap=yes])
770AC_MSG_RESULT($with_hashmap)
771test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP)
772
773###   use option --enable-colorfgbg to turn on use of $COLORFGBG environment
774AC_MSG_CHECKING(if you want colorfgbg code)
775AC_ARG_ENABLE(colorfgbg,
776	[  --enable-colorfgbg      compile with \$COLORFGBG code],
777	[with_colorfgbg=$enableval],
778	[with_colorfgbg=no])
779AC_MSG_RESULT($with_colorfgbg)
780test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
781
782AC_MSG_CHECKING(if you want experimental safe-sprintf code)
783AC_ARG_ENABLE(safe-sprintf,
784	[  --enable-safe-sprintf   compile with experimental safe-sprintf code],
785	[with_safe_sprintf=$enableval],
786	[with_safe_sprintf=no])
787AC_MSG_RESULT($with_safe_sprintf)
788test "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF)
789
790###   use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
791# when hashmap is used scroll hints are useless
792if test "$with_hashmap" = no ; then
793AC_MSG_CHECKING(if you want to experiment without scrolling-hints code)
794AC_ARG_ENABLE(scroll-hints,
795	[  --disable-scroll-hints  compile without scroll-hints code],
796	[with_scroll_hints=$enableval],
797	[with_scroll_hints=yes])
798AC_MSG_RESULT($with_scroll_hints)
799test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS)
800fi
801
802###   use option --enable-widec to turn on use of wide-character support
803NCURSES_CH_T=chtype
804NCURSES_LIBUTF8=0
805NCURSES_MBSTATE_T=0
806AC_MSG_CHECKING(if you want experimental wide-character code)
807AC_ARG_ENABLE(widec,
808	[  --enable-widec          compile with experimental wide-char/UTF-8 code],
809	[with_widec=$enableval],
810	[with_widec=no])
811AC_MSG_RESULT($with_widec)
812if test "$with_widec" = yes ; then
813	LIB_SUFFIX="w${LIB_SUFFIX}"
814	AC_DEFINE(USE_WIDEC_SUPPORT)
815	CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
816	with_overwrite=no
817	NCURSES_CH_T=cchar_t
818	AC_CHECK_FUNC(putwc)
819if test "$ac_cv_func_putwc" != yes ; then
820	CF_LIBUTF8
821	if test "$cf_cv_libutf8" = yes ; then
822		NCURSES_LIBUTF8=1
823	fi
824fi
825	CF_MBSTATE_T
826	if test $cf_cv_mbstate_t = yes ; then
827		NCURSES_MBSTATE_T=1
828	fi
829fi
830AC_SUBST(NCURSES_CH_T)
831AC_SUBST(NCURSES_LIBUTF8)
832AC_SUBST(NCURSES_MBSTATE_T)
833
834AC_MSG_CHECKING(for terminal capabilities file)
835AC_ARG_WITH(caps,
836	[  --with-caps=alt         compile with experimental alternate Caps file],
837	[TERMINFO_CAPS=Caps.$withval],
838	[TERMINFO_CAPS=Caps])
839test -f ${srcdir}/include/${TERMINFO_CAPS} || TERMINFO_CAPS=Caps
840AC_MSG_RESULT($TERMINFO_CAPS)
841AC_SUBST(TERMINFO_CAPS)
842
843###############################################################################
844CF_HELP_MESSAGE(Testing/development Options:)
845
846###	use option --disable-echo to suppress full display compiling commands
847AC_MSG_CHECKING(if you want to display full commands during build)
848AC_ARG_ENABLE(echo,
849	[  --enable-echo           build: display "compiling" commands (default)],
850	[with_echo=$enableval],
851	[with_echo=yes])
852if test "$with_echo" = yes; then
853	ECHO_LINK=
854else
855	ECHO_LINK='@ echo linking $@ ... ;'
856	test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent"
857fi
858AC_MSG_RESULT($with_echo)
859AC_SUBST(ECHO_LINK)
860
861###	use option --enable-warnings to turn on all gcc warnings
862AC_MSG_CHECKING(if you want to see compiler warnings)
863AC_ARG_ENABLE(warnings,
864	[  --enable-warnings       build: turn on GCC compiler warnings],
865	[with_warnings=$enableval])
866AC_MSG_RESULT($with_warnings)
867
868if test -n "$with_warnings"; then
869 	ADAFLAGS="$ADAFLAGS -gnatg"
870	CF_GCC_WARNINGS
871fi
872CF_GCC_ATTRIBUTES
873
874###	use option --enable-assertions to turn on generation of assertion code
875AC_MSG_CHECKING(if you want to enable runtime assertions)
876AC_ARG_ENABLE(assertions,
877	[  --enable-assertions     test: turn on generation of assertion code],
878	[with_assertions=$enableval],
879	[with_assertions=no])
880AC_MSG_RESULT($with_assertions)
881if test -n "$GCC"
882then
883	if test "$with_assertions" = no
884	then
885		AC_DEFINE(NDEBUG)
886		CPPFLAGS="$CPPFLAGS -DNDEBUG"
887	else
888		ADAFLAGS="$ADAFLAGS -gnata"
889	fi
890fi
891
892###	use option --disable-leaks to suppress "permanent" leaks, for testing
893AC_ARG_ENABLE(leaks,
894	[  --disable-leaks         test: suppress permanent memory-leaks],
895	[test "$enableval" = no && AC_DEFINE(NO_LEAKS)])
896AC_DEFINE(HAVE_NC_ALLOC_H)
897
898###	use option --enable-expanded to generate certain macros as functions
899AC_ARG_ENABLE(expanded,
900	[  --enable-expanded       test: generate functions for certain macros],
901	[test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)])
902
903###	use option --disable-macros to suppress macros in favor of functions
904AC_ARG_ENABLE(macros,
905	[  --disable-macros        test: use functions rather than macros],
906	[test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)])
907
908###	Checks for libraries.
909AC_CHECK_FUNC(gettimeofday,
910	AC_DEFINE(HAVE_GETTIMEOFDAY),[
911
912AC_CHECK_LIB(bsd, gettimeofday,
913	AC_DEFINE(HAVE_GETTIMEOFDAY)
914	LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
915
916CF_MATH_LIB(MATH_LIB,sin(x))
917AC_SUBST(MATH_LIB)
918
919###	Checks for header files.
920CF_GNU_SOURCE
921AC_STDC_HEADERS
922AC_HEADER_DIRENT
923AC_HEADER_TIME
924CF_REGEX
925
926dnl These are some other potentially nonportable headers.
927AC_CHECK_HEADERS( \
928fcntl.h \
929getopt.h \
930libc.h \
931limits.h \
932locale.h \
933poll.h \
934sys/bsdtypes.h \
935sys/ioctl.h \
936sys/param.h \
937sys/poll.h \
938sys/select.h \
939sys/time.h \
940sys/times.h \
941ttyent.h \
942unistd.h \
943)
944
945# check for ISC (this may also define _POSIX_SOURCE)
946# Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
947if test "$ISC" = yes ; then
948	AC_CHECK_LIB(cposix,main)
949	AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
950fi
951
952CF_SYS_TIME_SELECT
953
954###	checks for compiler characteristics
955AC_LANG_C
956AC_C_CONST
957AC_C_INLINE
958test "$ac_cv_c_inline" != no && AC_DEFINE(CC_HAS_INLINE_FUNCS)
959
960CF_TYPEOF_CHTYPE
961
962###	Checks for external-data
963CF_ERRNO
964CF_LINK_DATAONLY
965
966###	Checks for library functions.
967AC_CHECK_FUNCS( \
968getcwd \
969getegid \
970geteuid \
971getttynam \
972issetugid \
973memccpy \
974nanosleep \
975poll \
976remove \
977select \
978setbuf \
979setbuffer \
980setvbuf \
981sigaction \
982sigvec \
983strdup \
984strstr \
985tcgetpgrp \
986times \
987vsnprintf \
988)
989if test "$with_getcap" = "yes" ; then
990	CF_CGETENT
991fi
992
993CF_ISASCII
994CF_STRUCT_SIGACTION
995CF_FUNC_TERMIOS
996CF_FUNC_VSSCANF
997CF_MKSTEMP
998
999# setup for prototype of fallback for vsscanf()
1000if test "$cf_cv_func_vsscanf" = vsscanf ; then
1001	HAVE_VSSCANF=1
1002else
1003	HAVE_VSSCANF=0
1004fi
1005AC_SUBST(HAVE_VSSCANF)
1006
1007dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
1008if test "$cross_compiling" = yes ; then
1009	AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
1010else
1011	AC_FUNC_SETVBUF_REVERSED
1012fi
1013AC_TYPE_SIGNAL
1014CF_TYPE_SIGACTION
1015CF_SIZECHANGE
1016CF_FUNC_MEMMOVE
1017CF_FUNC_POLL
1018
1019dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
1020if test -z "$cf_user_CFLAGS" ; then
1021	CF_STRIP_G_OPT(CFLAGS)
1022	CF_STRIP_G_OPT(CXXFLAGS)
1023fi
1024
1025dnl Check for C++ compiler characteristics (and ensure that it's there!)
1026CF_BOOL_DECL(cf_cv_cc_bool_type)
1027if test -n "$CXX" ; then
1028	AC_LANG_CPLUSPLUS
1029	CF_STDCPP_LIBRARY
1030
1031	case $GXX_VERSION in
1032	1*|2.[0-6]*)
1033		cf_cxx_library=yes
1034		;;
1035	*-2.7*|2.7*)
1036		CF_GPP_LIBRARY
1037		;;
1038	*)
1039		cf_cxx_library=no
1040		;;
1041	esac
1042
1043	AC_CHECK_HEADERS(typeinfo)
1044
1045	CF_BOOL_DECL
1046	CF_BOOL_SIZE
1047	CF_ETIP_DEFINES
1048	CF_CPP_PARAM_INIT
1049	CF_CPP_VSCAN_FUNC
1050
1051	CXX_AR='$(AR)'
1052	CXX_AR_OPTS='$(AR_OPTS)'
1053	case $cf_cv_system_name in #(vi
1054	irix*) #(vi
1055	    if test "$GXX" != yes ; then
1056		CXX_AR='$(CXX)'
1057		CXX_AR_OPTS='-ar -o'
1058	    fi
1059	    ;;
1060	sco3.2v5*) #(vi
1061	    CXXLDFLAGS="-u main"
1062	    ;;
1063	solaris2*)
1064	    if test "$GXX" != yes ; then
1065		CXX_AR='$(CXX)'
1066		CXX_AR_OPTS='-xar -o'
1067	    fi
1068	    ;;
1069	esac
1070	AC_SUBST(CXXLDFLAGS)
1071	AC_SUBST(CXX_AR)
1072	AC_SUBST(CXX_AR_OPTS)
1073else
1074	cf_cxx_library=no
1075	cf_cv_builtin_bool=1
1076
1077	# Just because we are not configuring against C++ right now does not
1078	# mean that a user will not want to use C++.  Some distributors disable
1079	# the C++ portion of this configuration as a shortcut (or just to avoid
1080	# compiling the demo in the c++ directory).  So we need a reasonable
1081	# default for the 'bool' type.
1082	#
1083	# Caveat: since the storage of the bool type is not standardized, it
1084	# may change.
1085
1086	if test "$NCURSES_BOOL" != auto ; then
1087		cf_cv_type_of_bool=$NCURSES_AUTO
1088	else
1089		if test "$cf_cv_header_stdbool_h" = 1 ; then
1090			CF_BOOL_SIZE
1091		else
1092			AC_MSG_CHECKING(for fallback type of bool)
1093			case "$host_cpu" in #(vi
1094			i?86)	cf_cv_type_of_bool=char	;; #(vi
1095			*)	cf_cv_type_of_bool=int	;;
1096			esac
1097			AC_MSG_RESULT($cf_cv_type_of_bool)
1098		fi
1099	fi
1100fi
1101AC_SUBST(CXXLIBS)
1102
1103CF_HELP_MESSAGE(Ada95 Binding Options:)
1104
1105dnl Check for availability of GNU Ada Translator (GNAT).
1106dnl At the moment we support no other Ada95 compiler.
1107if test "$cf_with_ada" != "no" ; then
1108cf_ada_make=gnatmake
1109AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
1110if test "$ac_cv_prog_gnat_exists" = no; then
1111   cf_ada_make=
1112else
1113   CF_GNAT_VERSION
1114   AC_CHECK_PROG(M4_exists, m4, yes, no)
1115   if test "$ac_cv_prog_M4_exists" = no; then
1116      cf_cv_prog_gnat_correct=no
1117      echo Ada95 binding required program m4 not found. Ada95 binding disabled.
1118   fi
1119   if test "$cf_cv_prog_gnat_correct" = yes; then
1120      AC_MSG_CHECKING(if GNAT works)
1121      CF_GNAT_TRY_RUN([procedure conftest;],
1122[with Text_IO;
1123with GNAT.OS_Lib;
1124procedure conftest is
1125begin
1126   Text_IO.Put ("Hello World");
1127   Text_IO.New_Line;
1128   GNAT.OS_Lib.OS_Exit (0);
1129end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
1130      AC_MSG_RESULT($cf_cv_prog_gnat_correct)
1131   fi
1132fi
1133if test	"$cf_cv_prog_gnat_correct" = yes; then
1134   ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
1135
1136   AC_ARG_WITH(ada-compiler,
1137	[  --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
1138	[cf_ada_compiler=$withval],
1139	[cf_ada_compiler=gnatmake])
1140
1141   cf_ada_package=terminal_interface
1142
1143   AC_SUBST(cf_ada_make)
1144   AC_SUBST(cf_ada_compiler)
1145   AC_SUBST(cf_ada_package)
1146   AC_SUBST(ADAFLAGS)
1147   AC_SUBST(cf_compile_generics)
1148   AC_SUBST(cf_generic_objects)
1149
1150   CF_WITH_PATH(ada-include,
1151       [  --with-ada-include=DIR  Ada includes are in DIR],
1152       ADA_INCLUDE,
1153       PREFIX/lib/ada/adainclude,
1154       [$]prefix/lib/ada/adainclude)
1155   AC_SUBST(ADA_INCLUDE)
1156
1157   CF_WITH_PATH(ada-objects,
1158       [  --with-ada-objects=DIR  Ada objects are in DIR],
1159       ADA_OBJECTS,
1160       PREFIX/lib/ada/adalib,
1161       [$]prefix/lib/ada/adalib)
1162   AC_SUBST(ADA_OBJECTS)
1163
1164fi
1165fi
1166
1167### It's not possible to appease gcc 2.6.3's conversion-warnings if we're
1168### using a 'char' for bools.  gcc 2.7.0's conversion-warnings are broken too
1169### badly to consider using for development purposes, but 2.5.8 is okay.
1170if test -n "$with_warnings"; then
1171	case $GCC_VERSION in
1172	2.6.3)
1173		if test "$cf_cv_type_of_bool" != "char"; then
1174			EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
1175		fi
1176		;;
1177	2.5*)
1178		EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
1179		;;
1180	esac
1181fi
1182
1183### Construct the library-subsets, if any, from this set of keywords:
1184### none, base, ext_funcs, termlib.
1185AC_MSG_CHECKING(for library subsets)
1186if test "$with_termlib" = yes ; then
1187	LIB_SUBSETS="termlib "
1188else
1189	LIB_SUBSETS="termlib+"
1190fi
1191LIB_SUBSETS="${LIB_SUBSETS}base"
1192test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar"
1193test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
1194AC_MSG_RESULT($LIB_SUBSETS)
1195
1196LIB_TRACING=DEBUG
1197ADA_TRACE=FALSE
1198case "$CFLAGS $CPPFLAGS" in
1199*-DTRACE*)
1200	LIB_TRACING=all
1201	ADA_TRACE=TRUE
1202	;;
1203esac
1204AC_SUBST(ADA_TRACE)
1205
1206### Construct the list of include-directories to be generated
1207CF_INCLUDE_DIRS
1208CF_ADA_INCLUDE_DIRS
1209
1210### Build up pieces for makefile rules
1211AC_MSG_CHECKING(default library suffix)
1212CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
1213AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
1214AC_MSG_RESULT($DFT_ARG_SUFFIX)
1215
1216AC_MSG_CHECKING(default library-dependency suffix)
1217CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_DEP_SUFFIX)dnl
1218if test $DFT_LWR_MODEL = shared ; then
1219	case $cf_cv_system_name in #(vi
1220	cygwin*)
1221		DFT_DEP_SUFFIX=".dll.a"
1222		;;
1223	esac
1224fi
1225AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
1226AC_MSG_RESULT($DFT_DEP_SUFFIX)
1227
1228AC_MSG_CHECKING(default object directory)
1229CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
1230AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
1231AC_MSG_RESULT($DFT_OBJ_SUBDIR)
1232
1233# libtool thinks it can make c++ shared libraries (perhaps only g++)
1234AC_MSG_CHECKING(c++ library-dependency suffix)
1235if test "$with_libtool" = "yes"; then
1236	CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
1237else
1238	CF_LIB_SUFFIX(normal,CXX_LIB_SUFFIX)dnl we normally make a static library
1239fi
1240AC_MSG_RESULT($CXX_LIB_SUFFIX)
1241AC_SUBST(CXX_LIB_SUFFIX)
1242
1243TINFO_LIST="$SHLIB_LIST"
1244test "$with_termlib" = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}"
1245
1246AC_MSG_CHECKING(where we will install curses.h)
1247test "$with_overwrite" = no && \
1248test "x$includedir" = 'x${prefix}/include' && \
1249	includedir='$(prefix)/include/ncurses'${LIB_SUFFIX}
1250AC_MSG_RESULT($includedir)
1251
1252AC_SUBST(EXTRA_LIBS)
1253AC_SUBST(TINFO_LIST)
1254AC_SUBST(SHLIB_LIST)
1255
1256### Set up low-level terminfo dependencies for makefiles.  Note that we
1257### could override this.
1258if test "$with_termlib" = yes ; then
1259	TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}"
1260	if test "$DFT_LWR_MODEL" = "libtool"; then
1261		TEST_ARGS="${TEST_DEPS}"
1262	else
1263		TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}"
1264	fi
1265fi
1266PROG_DEPS="$TEST_DEPS"
1267PROG_ARGS="$TEST_ARGS"
1268
1269### Construct the list of subdirectories for which we'll customize makefiles
1270### with the appropriate compile-rules.
1271
1272CF_SRC_MODULES($modules_to_build)
1273CF_DIRS_TO_MAKE
1274
1275AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP')
1276
1277### Now that we're done running tests, add the compiler-warnings, if any
1278CFLAGS="$CFLAGS $EXTRA_CFLAGS"
1279
1280################################################################################
1281AC_OUTPUT( \
1282	include/MKterm.h.awk \
1283	include/curses.head:include/curses.h.in \
1284	include/termcap.h \
1285	include/unctrl.h \
1286	misc/run_tic.sh:misc/run_tic.in \
1287	$SUB_MAKEFILES \
1288	Makefile,[
1289CF_LIB_RULES
1290],[
1291### Special initialization commands, used to pass information from the
1292### configuration-run into config.status
1293
1294AWK="$AWK"
1295CF_LIST_MODELS="$cf_list_models"
1296DFT_LWR_MODEL="$DFT_LWR_MODEL"
1297LDCONFIG="$LDCONFIG"
1298LIB_NAME="$LIB_NAME"
1299LIB_SUBSETS="$LIB_SUBSETS"
1300LIB_SUFFIX="$LIB_SUFFIX"
1301LIB_TRACING="$LIB_TRACING"
1302MAKE_TERMINFO="$MAKE_TERMINFO"
1303NCURSES_OSPEED="$NCURSES_OSPEED"
1304SRC_SUBDIRS="$SRC_SUBDIRS"
1305TERMINFO="$TERMINFO"
1306TINFO_NAME="$TINFO_NAME"
1307WITH_CURSES_H="$with_curses_h"
1308WITH_ECHO="$with_echo"
1309WITH_OVERWRITE="$with_overwrite"
1310cf_cv_abi_version="$cf_cv_abi_version"
1311cf_cv_do_symlinks="$cf_cv_do_symlinks"
1312cf_cv_rel_version="$cf_cv_rel_version"
1313cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
1314cf_cv_shlib_version="$cf_cv_shlib_version"
1315cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
1316cf_cv_system_name="$cf_cv_system_name"
1317cf_with_cxx_binding="$cf_with_cxx_binding"
1318target="$target"
1319
1320],sort)dnl
1321${MAKE-make} preinstall
1322