xref: /src/contrib/ncurses/configure.in (revision 68ad2b0d7af2a3571c4abac9afa712f9b09b721c)
1dnl***************************************************************************
2dnl Copyright 2018-2024,2025 Thomas E. Dickey                                *
3dnl Copyright 1998-2017,2018 Free Software Foundation, Inc.                  *
4dnl                                                                          *
5dnl Permission is hereby granted, free of charge, to any person obtaining a  *
6dnl copy of this software and associated documentation files (the            *
7dnl "Software"), to deal in the Software without restriction, including      *
8dnl without limitation the rights to use, copy, modify, merge, publish,      *
9dnl distribute, distribute with modifications, sublicense, and/or sell       *
10dnl copies of the Software, and to permit persons to whom the Software is    *
11dnl furnished to do so, subject to the following conditions:                 *
12dnl                                                                          *
13dnl The above copyright notice and this permission notice shall be included  *
14dnl in all copies or substantial portions of the Software.                   *
15dnl                                                                          *
16dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23dnl                                                                          *
24dnl Except as contained in this notice, the name(s) of the above copyright   *
25dnl holders shall not be used in advertising or otherwise to promote the     *
26dnl sale, use or other dealings in this Software without prior written       *
27dnl authorization.                                                           *
28dnl***************************************************************************
29dnl
30dnl Author: Thomas E. Dickey 1995-on
31dnl
32dnl $Id: configure.in,v 1.824 2025/12/27 00:12:13 tom Exp $
33dnl Process this file with autoconf to produce a configure script.
34dnl
35dnl For additional information, see
36dnl     https://invisible-island.net/autoconf/
37dnl     https://invisible-island.net/autoconf/my-autoconf.html
38dnl
39dnl ---------------------------------------------------------------------------
40AC_PREREQ(2.52.20210101)
41AC_REVISION($Revision: 1.824 $)
42AC_INIT
43AC_CONFIG_SRCDIR([ncurses/base/lib_initscr.c])
44AC_CONFIG_HEADERS([include/ncurses_cfg.h:include/ncurses_cfg.hin])
45
46AC_DEFUN([AC_PATH_XTRA],[])dnl ignore dependencies on this
47
48CF_TOP_BUILDDIR
49CF_SUBST_NCURSES_VERSION
50CF_VERSION_INFO(NCURSES,ncurses)
51
52CF_WITH_REL_VERSION(NCURSES)
53CF_NCURSES_WITH_ABI_VERSION
54
55CF_WITH_SYSTYPE
56
57###	Save the given $CFLAGS to allow user-override.
58cf_user_CFLAGS="$CFLAGS"
59
60###	Default install-location
61CF_CFG_DEFAULTS
62### Defaults for ncurses ABI
63CF_ABI_DEFAULTS
64
65### override ABI version, e.g., packagers
66CF_WITH_ABI_ALTERED
67
68###	Checks for programs.
69CF_WITH_ADA
70AC_PROG_CPP
71AC_PROG_GCC_TRADITIONAL
72CF_PROG_CC_C_O(CC,[$CFLAGS $CPPFLAGS])
73CF_PROG_LDCONFIG
74
75dnl DEFECT in autoconf 2.12:	an attempt to set policy, this breaks the
76dnl				configure script by not letting us test if C++
77dnl				is present, making this option necessary.
78AC_MSG_CHECKING(if you want to ensure bool is consistent with C++)
79AC_ARG_WITH(cxx,
80	[  --without-cxx           do not adjust ncurses bool to match C++],
81	[cf_with_cxx=$withval],
82	[cf_with_cxx=yes])
83AC_MSG_RESULT($cf_with_cxx)
84if test "X$cf_with_cxx" = Xno ; then
85	CXX=""
86	GXX=""
87else
88	# with autoconf 2.13, we can change the error to a warning:
89	pushdef([AC_MSG_ERROR],
90		[AC_MSG_RESULT(no)
91		 AC_MSG_WARN([You don't have any C++ compiler, too bad])
92		cf_with_cxx=no; CXX=""; GXX="";])dnl
93	AC_PROG_CXX
94	popdef([AC_MSG_ERROR])dnl
95
96	AC_LANG_PUSH(C++)
97	if test "x$cf_with_cxx" != xno
98	then
99		# Several of the C++ configurations do not work, particularly when
100		# cross-compiling (20140913 -TD)
101		AC_MSG_CHECKING(if $CXX works)
102
103		save_CPPFLAGS="$CPPFLAGS"
104		eval cf_includedir=${includedir}
105		CPPFLAGS="$CPPFLAGS -I${cf_includedir}"
106		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
107#include <stdlib.h>
108#include <stdio.h>
109],
110		[
111		printf("Hello world!\n")
112		])],
113		[cf_cxx_works=yes],
114		[cf_cxx_works=no])
115		CPPFLAGS="$save_CPPFLAGS"
116
117		AC_MSG_RESULT($cf_cxx_works)
118		if test "x$cf_cxx_works" = xno
119		then
120			AC_MSG_WARN([Ignore $CXX, since it cannot compile hello-world.])
121			cf_with_cxx=no; CXX=""; GXX="";
122		fi
123	fi
124	AC_LANG_POP
125
126	# autoconf 2.5x removed the error (hardcoding it to g++, or just blank)
127	if test "$CXX" = "g++" ; then
128		AC_PATH_PROG(CXX,g++)
129	fi
130	case "x$CXX" in
131	(x|xg++)
132		AC_MSG_WARN([You don't have any C++ compiler, too bad])
133		cf_with_cxx=no; CXX=""; GXX="";
134		;;
135	esac
136fi
137
138CF_GXX_VERSION
139case "$GXX_VERSION" in
140([[1-9]][[0-9]].*)
141	;;
142(1.*|2.[[0-6]]*)
143	AC_MSG_WARN(templates do not work)
144	;;
145esac
146
147AC_MSG_CHECKING(if you want to build C++ binding and demo)
148AC_ARG_WITH(cxx-binding,
149	[  --without-cxx-binding   do not build C++ binding and demo],
150	[cf_with_cxx_binding=$withval],
151	[cf_with_cxx_binding=$cf_with_cxx])
152AC_MSG_RESULT($cf_with_cxx_binding)
153
154AC_MSG_CHECKING(if you want to build with Ada)
155AC_MSG_RESULT($cf_with_ada)
156
157AC_MSG_CHECKING(if you want to install terminal database)
158AC_ARG_ENABLE(db-install,
159	[  --disable-db-install    suppress install of terminal database],
160	[cf_with_db_install=$enableval],
161	[cf_with_db_install=yes])
162AC_MSG_RESULT($cf_with_db_install)
163
164AC_MSG_CHECKING(if you want to install manpages)
165AC_ARG_WITH(manpages,
166	[  --without-manpages      suppress install of manpages],
167	[cf_with_manpages=$withval],
168	[cf_with_manpages=yes])
169AC_MSG_RESULT($cf_with_manpages)
170
171AC_MSG_CHECKING(if you want to build programs such as tic)
172AC_ARG_WITH(progs,
173	[  --without-progs         suppress build/install with programs (e.g., tic)],
174	[cf_with_progs=$withval],
175	[cf_with_progs=yes])
176AC_MSG_RESULT($cf_with_progs)
177
178AC_MSG_CHECKING(if you want to build test-programs)
179AC_ARG_WITH(tests,
180	[  --without-tests         suppress build/install with test-programs],
181	[cf_with_tests=$withval],
182	[cf_with_tests=yes])
183AC_MSG_RESULT($cf_with_tests)
184
185AC_MSG_CHECKING(if you wish to install curses.h)
186AC_ARG_WITH(curses-h,
187	[  --without-curses-h      install curses.h as ncurses.h only],
188	[with_curses_h=$withval],
189	[with_curses_h=yes])
190AC_MSG_RESULT($with_curses_h)
191
192modules_to_build="ncurses"
193test "X$cf_with_progs" != Xno && modules_to_build="$modules_to_build progs"
194modules_to_build="$modules_to_build panel menu form"
195
196AC_ARG_PROGRAM
197
198CF_PROG_AWK
199CF_PROG_INSTALL
200CF_PROG_LINT
201CF_PROG_LN_S
202
203AC_SYS_LONG_FILE_NAMES
204
205# Provide for renaming "ncurses5-config" to "ncurses5X-config", etc., in case
206# of package conflict.
207cf_config_suffix=
208AC_ARG_WITH(config-suffix,
209	[  --with-config-suffix=X  name ncurses*X-config file with X],
210	[case "x$withval" in
211	(xyes|xno)
212		AC_MSG_WARN(expected a value for config-suffix option)
213		;;
214	(*)	cf_config_suffix="$withval"
215		;;
216	esac])
217AC_SUBST(cf_config_suffix)
218
219# If we find pkg-config, check if we should install the ".pc" files.
220CF_PKG_CONFIG
221CF_WITH_PKG_CONFIG_LIBDIR
222CF_ENABLE_PC_FILES
223if test -z "$MAKE_PC_FILES"
224then
225	AC_MSG_CHECKING(for suffix to add to pkg-config files)
226AC_ARG_WITH(pc-suffix,
227	[[  --with-pc-suffix[=XXX]  suffix pkg-config files with XXX]],
228	[case "x$withval" in
229	(xyes|xno)
230		PC_MODULE_SUFFIX=
231		;;
232	(*)	PC_MODULE_SUFFIX="$withval"
233		;;
234	esac])
235	test -z "$PC_MODULE_SUFFIX" && PC_MODULE_SUFFIX=none
236	AC_MSG_RESULT($PC_MODULE_SUFFIX)
237	test "$PC_MODULE_SUFFIX" = none && PC_MODULE_SUFFIX=
238	AC_SUBST(PC_MODULE_SUFFIX)
239fi
240
241AC_MSG_CHECKING(if we should assume mixed-case filenames)
242AC_ARG_ENABLE(mixed-case,
243	[  --enable-mixed-case     tic should assume mixed-case filenames],
244	[enable_mixedcase=$enableval],
245	[enable_mixedcase=auto])
246AC_MSG_RESULT($enable_mixedcase)
247if test "$enable_mixedcase" = "auto" ; then
248	CF_MIXEDCASE_FILENAMES
249else
250	cf_cv_mixedcase=$enable_mixedcase
251	if test "x$enable_mixedcase" = "xyes" ; then
252		AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if tic should assume mixed-case filenames])
253	fi
254fi
255
256# do this after mixed-case option (tags/TAGS is not as important as tic).
257AC_PROG_MAKE_SET
258CF_MAKE_PHONY
259CF_MAKE_TAGS
260
261dnl These are standard among *NIX systems, but not when cross-compiling
262AC_CHECK_TOOL(RANLIB, ranlib, ':')
263AC_CHECK_TOOL(LD, ld, ld)
264AC_CHECK_TOOL(AR, ar, ar)
265AC_CHECK_TOOL(NM, nm, nm)
266CF_AR_FLAGS
267
268CF_INSTALL_PREFIX
269
270###############################################################################
271CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:)
272# If we're cross-compiling, allow the user to override the tools and their
273# options.  The configure script is oriented toward identifying the host
274# compiler, etc., but we need a build compiler to generate parts of the source.
275
276case "$cf_cv_system_name" in
277(*-msvc*)
278	LDFLAGS="$LDFLAGS user32.lib"
279	export LDFLAGS
280	;;
281esac
282
283CF_BUILD_CC
284
285###############################################################################
286CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
287
288### Options to allow the user to specify the set of libraries which are used.
289### Use "--without-normal --with-shared" to allow the default model to be
290### shared, for example.
291cf_list_models=""
292AC_SUBST(cf_list_models)dnl	the complete list of models ("normal debug")
293
294CF_WITH_LIBTOOL
295if test "$with_libtool" != "no" ; then
296
297cf_list_models="$cf_list_models libtool"
298
299else
300
301AC_MSG_CHECKING(if you want to build shared libraries)
302AC_ARG_WITH(shared,
303	[  --with-shared           generate shared-libraries],
304	[with_shared=$withval],
305	[with_shared=no])
306AC_MSG_RESULT($with_shared)
307test "x$with_shared" = "xyes" && cf_list_models="$cf_list_models shared"
308
309AC_MSG_CHECKING(if you want to build static libraries)
310AC_ARG_WITH(normal,
311	[  --with-normal           generate normal-libraries (default)],
312	[with_normal=$withval],
313	[with_normal=yes])
314AC_MSG_RESULT($with_normal)
315test "x$with_normal" = "xyes" && cf_list_models="$cf_list_models normal"
316
317AC_MSG_CHECKING(if you want to build debug libraries)
318AC_ARG_WITH(debug,
319	[  --with-debug            generate debug-libraries (default)],
320	[with_debug=$withval],
321	[with_debug=yes])
322AC_MSG_RESULT($with_debug)
323test "x$with_debug" = "xyes" && cf_list_models="$cf_list_models debug"
324
325AC_MSG_CHECKING(if you want to build profiling libraries)
326AC_ARG_WITH(profile,
327	[  --with-profile          generate profile-libraries],
328	[with_profile=$withval],
329	[with_profile=no])
330AC_MSG_RESULT($with_profile)
331test "x$with_profile" = "xyes" && cf_list_models="$cf_list_models profile"
332
333fi
334
335if test "X$cf_with_cxx_binding" != Xno; then
336if test "x$with_shared" = "xyes"; then
337AC_MSG_CHECKING(if you want to build C++ shared libraries)
338AC_ARG_WITH(cxx-shared,
339	[  --with-cxx-shared       generate C++ shared-libraries],
340	[with_shared_cxx=$withval],
341	[with_shared_cxx=no])
342AC_MSG_RESULT($with_shared_cxx)
343fi
344fi
345
346###############################################################################
347
348AC_MSG_CHECKING(for specified models)
349test -z "$cf_list_models" && cf_list_models=normal
350dnl If we use libtool to generate libraries, then it must be the only
351dnl specified model.
352test "$with_libtool" != "no" && cf_list_models=libtool
353AC_MSG_RESULT($cf_list_models)
354
355### Use the first model as the default, and save its suffix for use in building
356### up test-applications.
357AC_MSG_CHECKING(for default model)
358DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
359AC_MSG_RESULT($DFT_LWR_MODEL)
360
361CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
362
363AC_SUBST(DFT_LWR_MODEL)dnl	the default model ("normal")
364AC_SUBST(DFT_UPR_MODEL)dnl	the default model ("NORMAL")
365
366TICS_NAME=tic
367AC_SUBST(TICS_NAME)
368
369TINFO_NAME=tinfo
370AC_SUBST(TINFO_NAME)
371
372LIB_NAME=ncurses
373AC_SUBST(LIB_NAME)
374
375LIB_DIR=../lib
376LIB_2ND=../../lib
377
378CF_WITH_LIB_PREFIX(cf_prefix)
379
380LIB_SUFFIX=
381AC_SUBST(LIB_SUFFIX)
382CF_PATHSEP
383
384# headers needed for checks...
385AC_CHECK_DECL(exit)
386AC_HEADER_DIRENT
387
388###############################################################################
389
390AC_MSG_CHECKING(if you want to build a separate terminfo library)
391AC_ARG_WITH(termlib,
392	[  --with-termlib          generate separate terminfo library],
393	[with_termlib=$withval],
394	[with_termlib=no])
395AC_MSG_RESULT($with_termlib)
396
397AC_MSG_CHECKING(if you want to build a separate tic library)
398AC_ARG_WITH(ticlib,
399	[  --with-ticlib           generate separate tic library],
400	[with_ticlib=$withval],
401	[with_ticlib=no])
402AC_MSG_RESULT($with_ticlib)
403
404dnl Not all ports of gcc support the -g option
405
406if test X"$CC_G_OPT" = X"" ; then
407	CC_G_OPT='-g'
408	test -n "$GCC" && test "x${ac_cv_prog_cc_g}" != xyes && CC_G_OPT=''
409fi
410AC_SUBST(CC_G_OPT)
411
412if test X"$CXX_G_OPT" = X"" ; then
413	CXX_G_OPT='-g'
414	test -n "$GXX" && test "x${ac_cv_prog_cxx_g}" != xyes && CXX_G_OPT=''
415fi
416AC_SUBST(CXX_G_OPT)
417
418AC_MSG_CHECKING(for default loader flags)
419case "$DFT_LWR_MODEL" in
420(libtool) LD_MODEL=''   ;;
421(normal)  LD_MODEL=''   ;;
422(debug)   LD_MODEL=$CC_G_OPT ;;
423(profile) LD_MODEL='-pg';;
424(shared)  LD_MODEL=''   ;;
425esac
426AC_SUBST(LD_MODEL)dnl		the type of link (e.g., -g or -pg)
427AC_MSG_RESULT([${LD_MODEL:-(none)}])
428
429case "$DFT_LWR_MODEL" in
430(shared)
431CF_ENABLE_RPATH
432AC_MSG_CHECKING(if shared libraries should be relinked during install)
433AC_ARG_ENABLE(relink,
434[  --disable-relink        relink shared libraries during install],
435[cf_cv_do_relink=$enableval],
436[cf_cv_do_relink=yes])
437AC_MSG_RESULT($cf_cv_do_relink)
438	;;
439esac
440
441# we will build libraries one-level down.
442rel_builddir=..
443CF_SHARED_OPTS
444for model in $cf_list_models ; do
445	case "$model" in
446	(libtool)
447		CF_WITH_LIBTOOL_OPTS
448		CF_WITH_EXPORT_SYMS
449		;;
450	(shared)
451		if test "$CC_SHARED_OPTS" = "unknown"; then
452			AC_MSG_ERROR(Shared libraries are not supported in this version)
453		fi
454		# workaround for inept transition to PIE vs PIC...
455		AC_MSG_CHECKING(if current CFLAGS link properly)
456		AC_LINK_IFELSE([AC_LANG_PROGRAM(
457			[#include <stdio.h>],
458			[printf("Hello work\\n");])],
459			[cf_cflags_work=yes],
460			[cf_cflags_work=no])
461		AC_MSG_RESULT($cf_cflags_work)
462		if test "$cf_cflags_work" = no
463		then
464			CF_VERBOSE(try to work around by appending shared-options)
465			CFLAGS="$CFLAGS $CC_SHARED_OPTS"
466		fi
467		CF_WITH_VERSIONED_SYMS
468		;;
469	esac
470done
471
472### Checks for special libraries, must be done up-front.
473SHLIB_LIST=""
474CF_WITH_GPM
475if test "$with_gpm" != no ; then
476	AC_MSG_CHECKING(if you want to load GPM dynamically)
477	AC_ARG_WITH(dlsym,
478		[  --without-dlsym         do not use dlsym() to load GPM dynamically],
479		[with_dlsym=$withval],
480		[with_dlsym=yes])
481	AC_MSG_RESULT($with_dlsym)
482	if test "x$with_dlsym" = xyes ; then
483		CF_FUNC_DLSYM
484		if test "x$with_gpm" != xyes ; then
485			CF_VERBOSE(assuming soname for gpm is $with_gpm)
486			cf_cv_gpm_soname="$with_gpm"
487		else
488			CF_LIB_SONAME([#include <gpm.h>],[if (Gpm_Open(0,0)) Gpm_Close();],gpm)
489		fi
490		test "$cf_cv_gpm_soname" != "unknown" && AC_DEFINE_UNQUOTED(LIBGPM_SONAME,"$cf_cv_gpm_soname",[Define as needed to set the gpm share library soname])
491		SHLIB_LIST="-ldl $SHLIB_LIST"
492		CF_ADD_LIB(dl,PRIVATE_LIBS)
493	else
494		SHLIB_LIST="-lgpm $SHLIB_LIST"
495		CF_ADD_LIB(gpm,TEST_LIBS)
496		CF_ADD_LIB(gpm,PRIVATE_LIBS)
497	fi
498	AC_DEFINE(HAVE_LIBGPM,1,[Define to 1 if we have the gpm library])
499	CF_CHECK_GPM_WGETCH
500fi
501
502CF_WITH_PCRE2
503CF_WITH_SYSMOUSE
504
505# pretend that ncurses==ncursesw==ncursest
506AC_MSG_CHECKING(if you want to disable library suffixes)
507CF_ARG_DISABLE(lib-suffixes,
508	[  --disable-lib-suffixes  disable library suffixes],
509	[disable_lib_suffixes=yes],
510	[disable_lib_suffixes=no],
511	no)
512AC_MSG_RESULT($disable_lib_suffixes)
513
514### If we're building with rpath, try to link non-standard libs that way too.
515if test "$DFT_LWR_MODEL" = "shared" && test "x$cf_cv_enable_rpath" != xno; then
516	CF_DISABLE_RPATH_HACK
517fi
518
519### Depending on the system, someone may use rpath to build ncurses but not
520# want users of the package to rely upon that feature.  Give those people an
521# option to suppress that detail from EXTRA_LDFLAGS.
522EXTRA_PKG_LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
523if test -n "$EXTRA_PKG_LDFLAGS"
524then
525	AC_MSG_CHECKING(if you want to disable extra LDFLAGS for package-scripts)
526	CF_ARG_DISABLE(pkg-ldflags,
527		[  --disable-pkg-ldflags   disable extra LDFLAGS for package-scripts],
528		[disable_pkg_ldflags=yes],
529		[disable_pkg_ldflags=no],
530		no)
531	AC_MSG_RESULT($disable_pkg_ldflags)
532	test "$disable_pkg_ldflags" = yes && EXTRA_PKG_LDFLAGS=
533fi
534AC_SUBST(EXTRA_PKG_LDFLAGS)
535
536###############################################################################
537CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
538
539###	use option --with-extra-suffix to append suffix to headers and libraries
540AC_MSG_CHECKING(for extra suffix to append to header/library paths)
541EXTRA_SUFFIX=
542AC_ARG_WITH(extra-suffix,
543	[[  --with-extra-suffix[=X] append extra suffix X to header/library paths]],
544	[case x$withval in
545	(xno)
546		;;
547	(xyes|x)
548		EXTRA_SUFFIX=$cf_cv_abi_version
549		;;
550	(*)
551		EXTRA_SUFFIX=$withval
552		;;
553	esac
554	])
555AC_MSG_RESULT([${EXTRA_SUFFIX:-(none)}])
556AC_SUBST(EXTRA_SUFFIX)
557
558###	use option --disable-overwrite to leave out the link to -lcurses
559AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
560AC_ARG_ENABLE(overwrite,
561	[  --disable-overwrite     put headers in subdir, omit link to -lcurses],
562	[with_overwrite=$enableval],
563	[if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi])
564AC_MSG_RESULT($with_overwrite)
565
566AC_MSG_CHECKING(if external terminfo-database is used)
567AC_ARG_ENABLE(database,
568	[  --disable-database      do not use terminfo, only fallbacks/termcap],
569	[use_database=$enableval],
570	[use_database=yes])
571AC_MSG_RESULT($use_database)
572
573case "$host_os" in
574(os2*)
575	TERMINFO_SRC='${top_srcdir}/misc/emx.src'
576	;;
577(*)
578	TERMINFO_SRC='${top_srcdir}/misc/terminfo.src'
579	;;
580esac
581AC_SUBST(TERMINFO_SRC)
582
583NCURSES_USE_DATABASE=0
584if test "$use_database" != no ; then
585	NCURSES_USE_DATABASE=1
586
587	AC_MSG_CHECKING(which terminfo source-file will be installed)
588	AC_ARG_WITH(database,
589		[  --with-database=XXX     specify terminfo source to install],
590		[TERMINFO_SRC=$withval])
591	AC_MSG_RESULT($TERMINFO_SRC)
592
593	AC_MSG_CHECKING(whether to use hashed database instead of directory/tree)
594	AC_ARG_WITH(hashed-db,
595		[  --with-hashed-db        specify hashed-database library],,
596		[with_hashed_db=no])
597	AC_MSG_RESULT($with_hashed_db)
598else
599	with_hashed_db=no
600fi
601AC_SUBST(NCURSES_USE_DATABASE)
602
603AC_MSG_CHECKING(for list of fallback terminal descriptions)
604AC_ARG_WITH(fallbacks,
605	[  --with-fallbacks=XXX    specify list of fallback terminal descriptions],
606	[with_fallback=$withval],
607	[with_fallback=])
608AC_MSG_RESULT([${with_fallback:-(none)}])
609
610case ".$with_fallback" in
611(.|.no)
612	FALLBACK_LIST=
613	;;
614(.yes)
615	AC_MSG_WARN(expected a list of terminal descriptions)
616	;;
617(*)
618	FALLBACK_LIST=`echo "$with_fallback" | sed -e 's/,/ /g'`
619	;;
620esac
621
622# The fallback feature in ncurses relies upon tic/infocmp outside the build
623# tree for generating the terminal descriptions that will be compiled into the
624# library.  If your toolchain is old, it may not handle current terminal
625# databases.  Use configure-options to point to the tools which will be used,
626# rather than the first ones found on the $PATH.
627AC_CHECK_TOOL(TIC, tic)
628AC_CHECK_TOOL(INFOCMP, infocmp)
629if test -n "$FALLBACK_LIST"
630then
631	CF_WITH_PATH_PROG(TIC,     tic,     [for fallbacks], $PATH:/usr/local/ncurses/bin)
632	CF_WITH_PATH_PROG(INFOCMP, infocmp, [for fallbacks], $PATH:/usr/local/ncurses/bin)
633	test -z "$TIC" && FALLBACK_LIST=
634	test -z "$INFOCMP" && FALLBACK_LIST=
635	if test -z "$FALLBACK_LIST"
636	then
637		AC_MSG_WARN(ignoring fallback option because tic/infocmp are not available)
638	fi
639fi
640AC_SUBST(TIC)
641AC_SUBST(INFOCMP)
642
643USE_FALLBACKS=
644test -z "$FALLBACK_LIST" && USE_FALLBACKS="#"
645AC_SUBST(FALLBACK_LIST)
646AC_SUBST(USE_FALLBACKS)
647
648AC_MSG_CHECKING(if you want modern xterm or antique)
649AC_ARG_WITH(xterm-new,
650	[  --without-xterm-new     specify if xterm terminfo should be old version],
651	[with_xterm_new=$withval],
652	[with_xterm_new=yes])
653case "$with_xterm_new" in
654(no) with_xterm_new=xterm-old;;
655(*)	 with_xterm_new=xterm-new;;
656esac
657AC_MSG_RESULT($with_xterm_new)
658WHICH_XTERM=$with_xterm_new
659AC_SUBST(WHICH_XTERM)
660
661CF_WITH_XTERM_KBS
662
663MAKE_TERMINFO=
664if test "$use_database" = no ; then
665	TERMINFO="${datadir}/terminfo"
666	MAKE_TERMINFO="#"
667else
668
669AC_MSG_CHECKING(for list of terminfo directories)
670CF_WITH_PATHLIST(terminfo-dirs,
671	[  --with-terminfo-dirs=XXX specify list of terminfo directories],
672	TERMINFO_DIRS,
673	DATADIR/terminfo,
674	${datadir}/terminfo)
675AC_MSG_RESULT($TERMINFO_DIRS)
676test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS",[Define as needed to predefine the TERMINFO_DIR searchlist])
677
678case "x$TERMINFO" in
679x???:*)
680	AC_MSG_WARN(ignoring non-directory/file TERMINFO value)
681	unset TERMINFO
682	;;
683esac
684
685AC_MSG_CHECKING(for default terminfo directory)
686CF_WITH_PATH(default-terminfo-dir,
687	[  --with-default-terminfo-dir=DIR default terminfo directory],
688	TERMINFO,
689	DATADIR/terminfo,
690	${datadir}/terminfo)
691AC_MSG_RESULT($TERMINFO)
692AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO",[Define to set the default terminal database path])
693
694fi
695
696AC_SUBST(TERMINFO)
697AC_SUBST(MAKE_TERMINFO)
698
699###	use option --disable-big-core to make tic run on small machines
700###	We need 4Mb, check if we can allocate 50% more than that.
701AC_MSG_CHECKING(if big-core option selected)
702AC_ARG_ENABLE(big-core,
703	[  --disable-big-core      assume machine has little memory],
704	[with_big_core=$enableval],
705	[AC_TRY_RUN([
706#include <stdlib.h>
707#include <string.h>
708int main(void) {
709	unsigned long n = 6000000L;
710	char *s = malloc(n);
711	if (s != 0)
712		s[0] = s[n-1] = 0;
713	${cf_cv_main_return:-return}(s == 0);
714}],
715	[with_big_core=yes],
716	[with_big_core=no],
717	[with_big_core=no])])
718AC_MSG_RESULT($with_big_core)
719test "x$with_big_core" = "xyes" && AC_DEFINE(HAVE_BIG_CORE,1,[Define to 1 if machine has ample memory for tic])
720
721### ISO C only guarantees 512-char strings, we have tables which load faster
722### when constructed using "big" strings.  More than the C compiler, the awk
723### program is a limit on most vendor UNIX systems.  Check that we can build.
724AC_MSG_CHECKING(if big-strings option selected)
725AC_ARG_ENABLE(big-strings,
726	[  --disable-big-strings   assume compiler has only standard-size strings],
727	[with_big_strings=$enableval],
728	[CF_AWK_BIG_PRINTF(12000,with_big_strings)])
729AC_MSG_RESULT($with_big_strings)
730
731USE_BIG_STRINGS=0
732test "x$with_big_strings" = "xyes" && USE_BIG_STRINGS=1
733AC_SUBST(USE_BIG_STRINGS)
734
735###	use option --enable-termcap to compile in the termcap fallback support
736AC_MSG_CHECKING(if you want termcap-fallback support)
737AC_ARG_ENABLE(termcap,
738	[  --enable-termcap        compile in termcap fallback support],
739	[with_termcap=$enableval],
740	[with_termcap=no])
741AC_MSG_RESULT($with_termcap)
742
743NCURSES_USE_TERMCAP=0
744if test "x$with_termcap" != "xyes" ; then
745	if test "$use_database" = no ; then
746		if test -z "$with_fallback" ; then
747			AC_MSG_ERROR(You have disabled the database w/o specifying fallbacks)
748		fi
749	fi
750	AC_DEFINE(PURE_TERMINFO,1,[Define to 1 if we should support only terminfo])
751else
752
753	if test "$with_ticlib" != no ; then
754		AC_MSG_ERROR(Options --with-ticlib and --enable-termcap cannot be combined)
755	fi
756
757	NCURSES_USE_TERMCAP=1
758	AC_MSG_CHECKING(for list of termcap files)
759	CF_WITH_PATHLIST(termpath,
760		[  --with-termpath=XXX     specify list of termcap files],
761		TERMPATH,
762		/etc/termcap:/usr/share/misc/termcap)
763	AC_MSG_RESULT($TERMPATH)
764	test -n "$TERMPATH" && AC_DEFINE_UNQUOTED(TERMPATH,"$TERMPATH",[Define to set the termcap searchlist])
765
766	###	use option --enable-getcap to use a hacked getcap for reading termcaps
767	AC_MSG_CHECKING(if fast termcap-loader is needed)
768	AC_ARG_ENABLE(getcap,
769		[  --enable-getcap         fast termcap load, no xrefs to terminfo],
770		[with_getcap=$enableval],
771		[with_getcap=no])
772	AC_MSG_RESULT($with_getcap)
773	test "x$with_getcap" = "xyes" && AC_DEFINE(USE_GETCAP,1,[Define to 1 to use fast termcap-loader])
774
775	AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
776	AC_ARG_ENABLE(getcap-cache,
777		[  --enable-getcap-cache   cache translated termcaps in ~/.terminfo],
778		[with_getcap_cache=$enableval],
779		[with_getcap_cache=no])
780	AC_MSG_RESULT($with_getcap_cache)
781	test "x$with_getcap_cache" = "xyes" && AC_DEFINE(USE_GETCAP_CACHE,1,[Define to 1 if translated termcap should be stored in $HOME/.terminfo])
782
783fi
784AC_SUBST(NCURSES_USE_TERMCAP)
785
786###   Use option --disable-home-terminfo to completely remove ~/.terminfo
787AC_MSG_CHECKING(if ~/.terminfo is wanted)
788AC_ARG_ENABLE(home-terminfo,
789	[  --disable-home-terminfo drop ~/.terminfo from terminfo search-path],
790	[with_home_terminfo=$enableval],
791	[with_home_terminfo=yes])
792AC_MSG_RESULT($with_home_terminfo)
793test "x$with_home_terminfo" = "xyes" && AC_DEFINE(USE_HOME_TERMINFO,1,[Define to 1 if $HOME/.terminfo feature is wanted])
794
795CF_CHECK_MULTIUSER
796
797if test "$cf_cv_multiuser" = yes; then
798
799AC_MSG_CHECKING(if you want to permit root to use ncurses environment variables)
800AC_ARG_ENABLE(root-environ,
801	[  --disable-root-environ  restrict root use of ncurses environment variables],
802	[with_root_environ=$enableval],
803	[with_root_environ=yes])
804AC_MSG_RESULT($with_root_environ)
805test "x$with_root_environ" = xyes && AC_DEFINE(USE_ROOT_ENVIRON,1,[Define to 1 if root/setuid application is allowed to use ncurses environment])
806
807AC_MSG_CHECKING(if you want to permit setuid programs to access all files)
808AC_ARG_ENABLE(root-access,
809	[  --disable-root-access   restrict file-access when running setuid],
810	[with_root_access=$enableval],
811	[with_root_access=yes])
812AC_MSG_RESULT($with_root_access)
813test "x$with_root_access" = xyes && AC_DEFINE(USE_ROOT_ACCESS,1,[Define to 1 if setuid is allowed all file-access])
814
815AC_MSG_CHECKING(if you want to permit setuid use of ncurses environment variables)
816AC_ARG_ENABLE(setuid-environ,
817	[  --disable-setuid-environ restrict setuid use of ncurses environment variables],
818	[with_setuid_environ=$enableval],
819	[with_setuid_environ=$with_root_environ])
820AC_MSG_RESULT($with_setuid_environ)
821test "x$with_setuid_environ" = xyes && AC_DEFINE(USE_SETUID_ENVIRON,1,[Define to 1 if setuid/setgid application is allowed to use ncurses environment])
822
823else
824	if test -n "$enable_root_environ$enable_root_access$enable_setuid_environ"
825	then
826		AC_MSG_WARN(ignoring options used only for multiuser systems)
827	fi
828
829fi # cf_cv_multiuser
830
831###   Use option --enable-symlinks to make tic use symlinks, not hard links
832###   to reduce storage requirements for the terminfo database.
833CF_LINK_FUNCS
834
835with_links=no
836with_symlinks=no
837
838# soft links (symbolic links) are useful for some systems where hard links do
839# not work, or to make it simpler to copy terminfo trees around.
840if test "x$ac_cv_func_symlink" = xyes ; then
841	AC_MSG_CHECKING(if tic should use symbolic links)
842	AC_ARG_ENABLE(symlinks,
843	[  --enable-symlinks       make tic use symbolic links not hard links],
844	[with_symlinks=$enableval],
845	[with_symlinks=no])
846	AC_MSG_RESULT($with_symlinks)
847fi
848
849# If we have hard links and did not choose to use soft links instead, there is
850# no reason to make this choice optional - use the hard links.
851if test "$with_symlinks" = no ; then
852	AC_MSG_CHECKING(if tic should use hard links)
853	if test "x$ac_cv_func_link" = xyes ; then
854		with_links=yes
855	else
856		with_links=no
857	fi
858	AC_MSG_RESULT($with_links)
859fi
860
861test "x$with_links" = xyes && AC_DEFINE(USE_LINKS,1,[Define to 1 if hardlinks should be used in terminfo database])
862test "x$with_symlinks" = xyes && AC_DEFINE(USE_SYMLINKS,1,[Define to 1 if symbolic links should be used in terminfo database])
863
864###   use option --enable-broken-linker to force on use of broken-linker support
865CF_ENABLE_BROKEN_LINKER
866
867###   use option --enable-bsdpad to have tputs process BSD-style prefix padding
868AC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
869AC_ARG_ENABLE(bsdpad,
870	[  --enable-bsdpad         recognize BSD-style prefix padding],
871	[with_bsdpad=$enableval],
872	[with_bsdpad=no])
873AC_MSG_RESULT($with_bsdpad)
874test "x$with_bsdpad" = xyes && AC_DEFINE(BSD_TPUTS,1,[Define to 1 to recognize BSD-style prefix padding])
875
876###   use option --enable-widec to turn on use of wide-character support
877NCURSES_CH_T=chtype
878NCURSES_LIBUTF8=0
879
880NEED_WCHAR_H=0
881NCURSES_MBSTATE_T=0
882NCURSES_WCHAR_T=0
883NCURSES_WINT_T=0
884
885# Check to define _XOPEN_SOURCE "automatically"
886CPPFLAGS_before_XOPEN="$CPPFLAGS"
887CF_XOPEN_SOURCE(600)
888CPPFLAGS_after_XOPEN="$CPPFLAGS"
889
890# Work around breakage on OS X
891CF_SIGWINCH
892
893# Checks for CODESET support.
894AM_LANGINFO_CODESET
895
896# use these variables to work around a defect in gcc's fixincludes.
897NCURSES_OK_WCHAR_T=
898NCURSES_OK_WINT_T=
899
900AC_MSG_CHECKING(if you want wide-character code)
901AC_ARG_ENABLE(widec,
902	[  --disable-widec         compile without wide character and UTF-8 support],
903	[with_widec=$enableval],
904	[with_widec=$cf_dft_widec])
905AC_MSG_RESULT($with_widec)
906
907NCURSES_WCWIDTH_GRAPHICS=1
908AC_SUBST(NCURSES_WCWIDTH_GRAPHICS)
909
910if test "x$with_widec" = xyes ; then
911	if test "x$disable_lib_suffixes" = xno ; then
912		LIB_SUFFIX="w${LIB_SUFFIX}"
913	fi
914	AC_DEFINE(USE_WIDEC_SUPPORT,1,[Define to 1 to compile with wide character and UTF-8 support])
915	AC_DEFINE(NCURSES_WIDECHAR,1,[Define to 1 to compile with wide character and UTF-8 support])
916	case "$CPPFLAGS" in
917	(*_XOPEN_SOURCE=*)
918		;;
919	(*)
920		AC_MSG_WARN(_XOPEN_SOURCE feature test macro appears to be predefined)
921		# CPPFLAGS="$CPPFLAGS -DNCURSES_WIDECHAR"
922		CPPFLAGS_after_XOPEN="$CPPFLAGS_after_XOPEN -DNCURSES_WIDECHAR"
923		;;
924	esac
925
926	CF_CHECK_WCHAR_H
927	CF_CHECK_WCWIDTH_GRAPHICS
928	test "$cf_cv_wcwidth_graphics" = no && NCURSES_WCWIDTH_GRAPHICS=0
929
930	# with_overwrite=no
931	NCURSES_CH_T=cchar_t
932	AC_CHECK_FUNCS(putwc btowc wctob wmemchr mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs wcwidth)
933	if test "x$ac_cv_func_putwc" != xyes ; then
934		CF_UTF8_LIB
935		if test "$cf_cv_utf8_lib" != no ; then
936			NCURSES_LIBUTF8=1
937		fi
938	fi
939	CF_WCHAR_TYPE(mbstate_t, NCURSES_MBSTATE_T)
940	CF_WCHAR_TYPE(wchar_t,   NCURSES_WCHAR_T,   NCURSES_OK_WCHAR_T)
941	CF_WCHAR_TYPE(wint_t,    NCURSES_WINT_T,    NCURSES_OK_WINT_T)
942
943	if test "$NCURSES_MBSTATE_T" != 0; then
944		AC_DEFINE(NEED_MBSTATE_T_DEF,1,[Define to 1 if we must declare mbstate_t])
945	fi
946fi
947AC_SUBST(NCURSES_CH_T)
948AC_SUBST(NCURSES_LIBUTF8)
949
950AC_SUBST(NEED_WCHAR_H)
951AC_SUBST(NCURSES_MBSTATE_T)
952AC_SUBST(NCURSES_WCHAR_T)
953AC_SUBST(NCURSES_WINT_T)
954
955AC_SUBST(NCURSES_OK_WCHAR_T)
956AC_SUBST(NCURSES_OK_WINT_T)
957
958###   use option --disable-lp64 to allow long chtype
959AC_MSG_CHECKING(whether to enable _LP64 definition in curses.h)
960AC_ARG_ENABLE(lp64,
961	[  --disable-lp64          allow chtype to be long (ignore _LP64)],
962	[with_lp64=$enableval],
963	[with_lp64=$cf_dft_with_lp64])
964AC_MSG_RESULT($with_lp64)
965
966if test "x$with_lp64" = xyes ; then
967	cf_cv_enable_lp64=1
968else
969	cf_cv_enable_lp64=0
970fi
971AC_SUBST(cf_cv_enable_lp64)
972
973CF_LARGEFILE
974
975###   use option --disable-tparm-varargs to make tparm() conform to X/Open
976AC_MSG_CHECKING(if you want tparm not to use X/Open fixed-parameter list)
977AC_ARG_ENABLE(tparm-varargs,
978	[  --disable-tparm-varargs compile tparm() without varargs interface],
979	[with_tparm_varargs=$enableval],
980	[with_tparm_varargs=yes])
981AC_MSG_RESULT($with_tparm_varargs)
982NCURSES_TPARM_VARARGS=0
983test "x$with_tparm_varargs" = xyes && NCURSES_TPARM_VARARGS=1
984AC_SUBST(NCURSES_TPARM_VARARGS)
985
986###   use option --disable-tic-depends to make libtic not explicitly depend on ncurses/ncursesw
987if test "$with_ticlib" != no ; then
988AC_MSG_CHECKING(if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library)
989AC_ARG_ENABLE(tic-depends,
990	[  --disable-tic-depends   link tic library without explicit dependency on ncurses library],
991	[with_tic_depends=$enableval],
992	[with_tic_depends=yes])
993AC_MSG_RESULT($with_tic_depends)
994else
995	with_tic_depends=no
996fi
997
998###   use option --enable-wattr-macros to enable wattr* macros in curses.h
999AC_MSG_CHECKING(if you want to enable wattr* macros)
1000AC_ARG_ENABLE(wattr-macros,
1001	[  --enable-wattr-macros   enable wattr* macros],
1002	[with_wattr_macros=$enableval],
1003	[with_wattr_macros=no])
1004if [[ "x$with_wattr_macros" != xyes ]]; then
1005	NCURSES_WATTR_MACROS=0
1006	AC_MSG_RESULT(no)
1007else
1008	NCURSES_WATTR_MACROS=1
1009	AC_MSG_RESULT(yes)
1010fi
1011AC_SUBST(NCURSES_WATTR_MACROS)
1012
1013CF_WITH_X11_RGB
1014
1015###   use option --with-bool to override bool's type
1016CF_WITH_TYPE(bool,
1017	[  --with-bool=TYPE        fall back to TYPE for curses 'bool' typedef],
1018	NCURSES_BOOL,
1019	auto)
1020
1021AC_MSG_CHECKING(for alternate terminal capabilities file)
1022AC_ARG_WITH(caps,
1023	[  --with-caps=alt         compile with alternate Caps file],
1024	[TERMINFO_CAPS=Caps.$withval],
1025	[TERMINFO_CAPS=Caps])
1026if test ! -f "${srcdir}/include/${TERMINFO_CAPS}"
1027then
1028	AC_MSG_WARN(file not found: "${srcdir}/include/${TERMINFO_CAPS}")
1029	TERMINFO_CAPS=Caps
1030fi
1031AC_MSG_RESULT($TERMINFO_CAPS)
1032AC_SUBST(TERMINFO_CAPS)
1033
1034###   use option --with-chtype to override chtype's type
1035CF_WITH_TYPE(chtype,
1036	[  --with-chtype=TYPE      override type of chtype],
1037	NCURSES_CHTYPE,
1038	$cf_dft_chtype)
1039
1040###   use option --with-ospeed to override ospeed's type
1041CF_WITH_TYPE(ospeed,
1042	[  --with-ospeed=TYPE      override type of ospeed variable],
1043	NCURSES_OSPEED,
1044	short)
1045
1046###   use option --with-mmask-t to override mmask_t's type
1047CF_WITH_TYPE(mmask-t,
1048	[  --with-mmask-t=TYPE     override type of mmask_t],
1049	NCURSES_MMASK_T,
1050	$cf_dft_mmask_t)
1051
1052###   option --enable-lp64 can give unexpected results
1053if test "$cf_cv_enable_lp64" = 1 ; then
1054	test -n "$with_chtype"  && test "$NCURSES_CHTYPE"  != unsigned && AC_MSG_WARN(option --enable-lp64 overrides --with-chtype)
1055	test -n "$with_mmask_t" && test "$NCURSES_MMASK_T" != unsigned && AC_MSG_WARN(option --enable-lp64 overrides --with-mmask-t)
1056fi
1057
1058###   use option --with-ccharw-max to override CCHARW_MAX size
1059AC_MSG_CHECKING(for size CCHARW_MAX)
1060AC_ARG_WITH(ccharw-max,
1061	[  --with-ccharw-max=XXX   override size CCHARW_MAX],
1062	[NCURSES_CCHARW_MAX="$withval"],
1063	[NCURSES_CCHARW_MAX=$cf_dft_ccharw_max])
1064AC_MSG_RESULT($NCURSES_CCHARW_MAX)
1065AC_SUBST(NCURSES_CCHARW_MAX)
1066
1067AC_CHECK_SIZEOF([signed char])
1068if test "$ac_cv_sizeof_signed_char" = 1 ; then
1069	NCURSES_SBOOL="signed char"
1070else
1071	NCURSES_SBOOL="char"
1072fi
1073AC_MSG_CHECKING(whether to use signed chars for Boolean array in term.h)
1074AC_ARG_ENABLE(signed-char,
1075	[  --enable-signed-char    use signed chars for Boolean array in term.h],
1076	[with_signed_char=$enableval],
1077	[with_signed_char=$cf_dft_signed_char])
1078AC_MSG_RESULT($with_signed_char)
1079test "x$with_signed_char" != xyes && NCURSES_SBOOL="char"
1080AC_SUBST(NCURSES_SBOOL)
1081
1082###   use option --with-tparm-arg to override tparm's argument type
1083CF_WITH_TYPE(tparm-arg,
1084	[  --with-tparm-arg=TYPE   override parameter type of tparm],
1085	NCURSES_TPARM_ARG,
1086	$cf_dft_tparm_arg)
1087
1088### Enable compiling-in rcs id's
1089AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
1090AC_ARG_WITH(rcs-ids,
1091	[  --with-rcs-ids          compile-in RCS identifiers],
1092	[with_rcs_ids=$withval],
1093	[with_rcs_ids=no])
1094AC_MSG_RESULT($with_rcs_ids)
1095test "x$with_rcs_ids" = xyes && AC_DEFINE(USE_RCS_IDS,1,[Define to 1 to compile-in RCS identifiers])
1096
1097###############################################################################
1098CF_HELP_MESSAGE(Extensions:)
1099
1100### Note that some functions (such as const) are normally disabled anyway.
1101AC_MSG_CHECKING(if you want to build with function extensions)
1102AC_ARG_ENABLE(ext-funcs,
1103	[  --disable-ext-funcs     disable function-extensions],
1104	[with_ext_funcs=$enableval],
1105	[with_ext_funcs=yes])
1106AC_MSG_RESULT($with_ext_funcs)
1107if test "x$with_ext_funcs" = xyes ; then
1108	NCURSES_EXT_FUNCS=1
1109	AC_DEFINE(NCURSES_EXT_FUNCS,1,[Define to 1 to enable ncurses extended functions])
1110	AC_DEFINE(HAVE_ASSUME_DEFAULT_COLORS,1,[Define to 1 to enable assume_default_colors() function in test-programs])
1111	AC_DEFINE(HAVE_CURSES_VERSION,1,[Define to 1 to enable curses_version() function in test-programs])
1112	AC_DEFINE(HAVE_HAS_KEY,1,[Define to 1 to enable has_key() function in test-programs])
1113	AC_DEFINE(HAVE_RESIZETERM,1,[Define to 1 to enable resizeterm() function in test-programs])
1114	AC_DEFINE(HAVE_RESIZE_TERM,1,[Define to 1 to enable resize_term() function in test-programs])
1115	AC_DEFINE(HAVE_TERM_ENTRY_H,1,[Define to 1 to enable term_entry() function in test-programs])
1116	AC_DEFINE(HAVE_USE_DEFAULT_COLORS,1,[Define to 1 to enable use_default_colors() function in test-programs])
1117	AC_DEFINE(HAVE_USE_SCREEN,1,[Define to 1 to enable use_screen() function in test-programs])
1118	AC_DEFINE(HAVE_USE_WINDOW,1,[Define to 1 to enable use_window() function in test-programs])
1119	AC_DEFINE(HAVE_WRESIZE,1,[Define to 1 to enable wresize() function in test-programs])
1120	GENERATED_EXT_FUNCS=generated
1121else
1122	cf_dft_ext_spfuncs=no
1123	cf_dft_ext_colors=no
1124	NCURSES_EXT_FUNCS=0
1125	GENERATED_EXT_FUNCS=
1126fi
1127AC_SUBST(NCURSES_EXT_FUNCS)
1128AC_SUBST(GENERATED_EXT_FUNCS)
1129
1130AC_MSG_CHECKING(if you want to build with SCREEN extensions)
1131AC_ARG_ENABLE(sp-funcs,
1132	[  --enable-sp-funcs       enable SCREEN-extensions],
1133	[with_sp_funcs=$enableval],
1134	[with_sp_funcs=$cf_dft_ext_spfuncs])
1135AC_MSG_RESULT($with_sp_funcs)
1136if test "x$with_sp_funcs" = xyes ; then
1137	NCURSES_SP_FUNCS=1
1138	AC_DEFINE(NCURSES_SP_FUNCS,1,[Define to 1 to enable SCREEN-extensions])
1139	AC_DEFINE(HAVE_TPUTS_SP,1,[Define to 1 to enable tputs_sp() function in test-programs])
1140	GENERATED_SP_FUNCS=generated
1141else
1142	NCURSES_SP_FUNCS=0
1143	GENERATED_SP_FUNCS=
1144fi
1145AC_SUBST(NCURSES_SP_FUNCS)
1146AC_SUBST(GENERATED_SP_FUNCS)
1147
1148case "$cf_cv_system_name" in
1149(*mingw32*|*mingw64*|*-msvc*)
1150	cf_dft_term_driver=yes
1151	;;
1152(*)
1153	cf_dft_term_driver=no
1154	;;
1155esac
1156
1157AC_MSG_CHECKING(if you want to build with terminal-driver)
1158AC_ARG_ENABLE(term-driver,
1159	[  --enable-term-driver    enable terminal-driver],
1160	[with_term_driver=$enableval],
1161	[with_term_driver=$cf_dft_term_driver])
1162AC_MSG_RESULT($with_term_driver)
1163if test "x$with_term_driver" = xyes ; then
1164	AC_DEFINE(USE_TERM_DRIVER,1,[Define to 1 to enable terminal-driver])
1165	if test "x$with_termlib" != xno ; then
1166		AC_MSG_ERROR(The term-driver option conflicts with the termlib option)
1167	fi
1168	if test "x$with_sp_funcs" != xyes ; then
1169		AC_MSG_ERROR(The term-driver option relies upon sp-funcs)
1170	fi
1171fi
1172
1173###   use option --enable-const to turn on use of const beyond that in XSI.
1174AC_MSG_CHECKING(for extended use of const keyword)
1175AC_ARG_ENABLE(const,
1176	[  --enable-const          compile with extra/non-standard const],
1177	[with_ext_const=$enableval],
1178	[with_ext_const=$cf_dft_ext_const])
1179AC_MSG_RESULT($with_ext_const)
1180NCURSES_CONST='/*nothing*/'
1181if test "x$with_ext_const" = xyes ; then
1182	NCURSES_CONST=const
1183fi
1184AC_SUBST(NCURSES_CONST)
1185
1186###   use option --enable-ext-colors to turn on use of colors beyond 16.
1187NCURSES_EXT_COLORS=0
1188NCURSES_RGB_COLORS=0
1189AC_MSG_CHECKING(if you want to use extended colors)
1190AC_ARG_ENABLE(ext-colors,
1191	[  --enable-ext-colors     compile for 256-color support],
1192	[with_ext_colors=$enableval],
1193	[with_ext_colors=$cf_dft_ext_colors])
1194AC_MSG_RESULT($with_ext_colors)
1195if test "x$with_ext_colors" = xyes ; then
1196	if test "x$with_widec" != xyes ; then
1197		AC_MSG_WARN(This option applies only to wide-character library)
1198	else
1199		# cannot be ABI 5 since it changes sizeof(cchar_t)
1200		CF_NCURSES_ABI_6
1201		NCURSES_EXT_COLORS=1
1202		AC_DEFINE(NCURSES_EXT_COLORS,1,[Define to 1 to compile for 256-color support])
1203		AC_DEFINE(HAVE_ALLOC_PAIR,1,[Define to 1 to enable alloc_pair() function])
1204		AC_DEFINE(HAVE_INIT_EXTENDED_COLOR,1,[Define to 1 to enable init_extended_color() function in test-programs])
1205		AC_DEFINE(HAVE_RESET_COLOR_PAIRS,1,[Define to 1 to enable reset_color_pairs() function in test-programs])
1206	fi
1207	###   use option --enable-rgb-color to extend support for direct-color
1208	AC_MSG_CHECKING(if you want to extend support for direct color)
1209	AC_ARG_ENABLE(rgb-color,
1210		[  --enable-rgb-color      compile for extended direct-color],
1211		[with_rgb_color=$enableval],
1212		[with_rgb_color=$cf_dft_rgb_color])
1213	AC_MSG_RESULT($with_rgb_color)
1214	if test "x$with_rgb_color" = xyes ; then
1215		NCURSES_RGB_COLORS=1
1216		AC_DEFINE(NCURSES_RGB_COLORS,1,[Define to 1 to compile for extended direct-color support])
1217	fi
1218fi
1219AC_SUBST(NCURSES_EXT_COLORS)
1220AC_SUBST(NCURSES_RGB_COLORS)
1221
1222###   use option --enable-ext-mouse to modify coding to support 5-button mice
1223AC_MSG_CHECKING(if you want to use extended mouse encoding)
1224AC_ARG_ENABLE(ext-mouse,
1225	[  --enable-ext-mouse      compile for extended mouse-encoding],
1226	[with_ext_mouse=$enableval],
1227	[with_ext_mouse=$cf_dft_ext_mouse])
1228AC_MSG_RESULT($with_ext_mouse)
1229if test "x$with_ext_mouse" = xyes ; then
1230	CF_NCURSES_ABI_6
1231fi
1232
1233if test $cf_cv_abi_default -le 5 ; then
1234	NCURSES_MOUSE_VERSION=1
1235elif test $cf_cv_abi_default -le 6 ; then
1236	NCURSES_MOUSE_VERSION=2
1237else
1238	NCURSES_MOUSE_VERSION=3
1239fi
1240
1241AC_SUBST(NCURSES_MOUSE_VERSION)
1242
1243###   use option --enable-ext-putwin to turn on extended screendumps
1244AC_MSG_CHECKING(if you want to use extended putwin/screendump)
1245AC_ARG_ENABLE(ext-putwin,
1246	[  --enable-ext-putwin     compile with extended putwin/screendump],
1247	[with_ext_putwin=$enableval],
1248	[with_ext_putwin=$cf_dft_ext_putwin])
1249AC_MSG_RESULT($with_ext_putwin)
1250if test "x$with_ext_putwin" = xyes ; then
1251	AC_DEFINE(NCURSES_EXT_PUTWIN,1,[Define to 1 to compile with extended putwin/screendump])
1252fi
1253
1254AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code)
1255AC_ARG_ENABLE(no-padding,
1256	[  --enable-no-padding     compile with $NCURSES_NO_PADDING code],
1257	[with_no_padding=$enableval],
1258	[with_no_padding=$with_ext_funcs])
1259AC_MSG_RESULT($with_no_padding)
1260test "x$with_no_padding" = xyes && AC_DEFINE(NCURSES_NO_PADDING,1,[Define to 1 to compile with $NCURSES_NO_PADDING code])
1261
1262###   use option --enable-sigwinch to turn on use of SIGWINCH logic
1263AC_MSG_CHECKING(if you want SIGWINCH handler)
1264AC_ARG_ENABLE(sigwinch,
1265	[  --enable-sigwinch       compile with SIGWINCH handler],
1266	[with_sigwinch=$enableval],
1267	[with_sigwinch=$with_ext_funcs])
1268AC_MSG_RESULT($with_sigwinch)
1269if test "x$with_sigwinch" = xyes
1270then
1271	AC_DEFINE(USE_SIGWINCH,1,[Define to 1 to compile with SIGWINCH handler])
1272	cf_cv_enable_sigwinch=1
1273else
1274	cf_cv_enable_sigwinch=0
1275fi
1276AC_SUBST(cf_cv_enable_sigwinch)
1277
1278###   use option --enable-tcap-names to allow user to define new capabilities
1279AC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap)
1280AC_ARG_ENABLE(tcap-names,
1281	[  --enable-tcap-names     compile with user-definable terminal capabilities],
1282	[with_tcap_names=$enableval],
1283	[with_tcap_names=$with_ext_funcs])
1284AC_MSG_RESULT($with_tcap_names)
1285NCURSES_XNAMES=0
1286if test "x$with_tcap_names" = xyes; then
1287	NCURSES_XNAMES=1
1288	AC_DEFINE(NCURSES_XNAMES,1,[Define to 1 to compile with user-definable terminal capabilities])
1289fi
1290AC_SUBST(NCURSES_XNAMES)
1291
1292##############################################################################
1293
1294USE_NAMED_PIPES=0
1295INTERNALS_HDR=
1296
1297case "$cf_cv_system_name" in
1298(*mingw32*|*mingw64*|*-msvc*)
1299	CF_CHECK_NAMED_PIPES
1300	if test "$cf_cv_named_pipes" = yes; then
1301		AC_MSG_CHECKING(if you want to use named pipes with -Windows driver)
1302		AC_ARG_ENABLE(named-pipes,
1303			[  --enable-named-pipes    use named pipes with Windows driver],
1304			[with_named_pipes=$enableval],
1305			[with_named_pipes=no])
1306		AC_MSG_RESULT($with_named_pipes)
1307	else
1308		with_named_pipes=no
1309	fi
1310	if test "x$with_named_pipes" = xyes
1311	then
1312		AC_DEFINE(USE_NAMED_PIPES,1,[Define to 1 to use named pipes with win32 driver])
1313		USE_NAMED_PIPES=1
1314	fi
1315	INTERNALS_HDR='../include/nc_win32.h'
1316	# MinGW32 sets $WD to its directory.
1317	if test -n "$WD"
1318	then
1319		if test -d "$WD"
1320		then
1321			AC_DEFINE(USE_DOS_PATHS,1,[Define to 1 to use DOS pathnames internally])
1322		fi
1323	fi
1324	;;
1325esac
1326
1327AC_SUBST(USE_NAMED_PIPES)
1328AC_SUBST(INTERNALS_HDR)
1329
1330##############################################################################
1331CF_HELP_MESSAGE(Reentrant Code:)
1332CF_WITH_PTHREAD
1333
1334if test "x$with_pthread" != xno; then
1335	AC_CHECK_FUNC(pthread_kill,[
1336		AC_MSG_CHECKING(if you want to allow EINTR in wgetch with pthreads)
1337		AC_ARG_ENABLE(pthreads-eintr,
1338			[  --enable-pthreads-eintr enable EINTR in wgetch with pthreads],
1339			[use_pthreads_eintr=$enableval],
1340			[use_pthreads_eintr=no])
1341		AC_MSG_RESULT($use_pthreads_eintr)
1342		if test "x$use_pthreads_eintr" = xyes ; then
1343			AC_DEFINE(USE_PTHREADS_EINTR,1,[Define to 1 to enable EINTR in wgetch with pthreads])
1344		fi])
1345
1346	AC_MSG_CHECKING(if you want to use weak-symbols for pthreads)
1347	AC_ARG_ENABLE(weak-symbols,
1348		[  --enable-weak-symbols   enable weak-symbols for pthreads],
1349		[use_weak_symbols=$enableval],
1350		[use_weak_symbols=no])
1351	AC_MSG_RESULT($use_weak_symbols)
1352	if test "x$use_weak_symbols" = xyes ; then
1353		CF_WEAK_SYMBOLS
1354	else
1355		cf_cv_weak_symbols=no
1356	fi
1357
1358	if test "x$cf_cv_weak_symbols" = xyes ; then
1359		AC_DEFINE(USE_WEAK_SYMBOLS,1,[Define to 1 to enable weak-symbols for pthreads])
1360	fi
1361fi
1362
1363PTHREAD=
1364if test "x$with_pthread" = "xyes" ; then
1365	AC_DEFINE(USE_PTHREADS,1,[Define to 1 to use pthreads feature])
1366	enable_reentrant=yes
1367	if test "x$cf_cv_weak_symbols" = xyes ; then
1368		PTHREAD=-lpthread
1369		CF_ADD_LIB(pthread,PRIVATE_LIBS)
1370	fi
1371fi
1372AC_SUBST(PTHREAD)
1373
1374# Reentrant code has to be opaque; there's little advantage to making ncurses
1375# opaque outside of that, so there is no --enable-opaque option.  We can use
1376# this option without --with-pthreads, but this will be always set for
1377# pthreads.
1378AC_MSG_CHECKING(if you want reentrant code)
1379AC_ARG_ENABLE(reentrant,
1380	[  --enable-reentrant      compile with reentrant code],
1381	[with_reentrant=$enableval],
1382	[with_reentrant=no])
1383AC_MSG_RESULT($with_reentrant)
1384if test "x$with_reentrant" = xyes ; then
1385	cf_cv_enable_reentrant=1
1386	cf_cv_enable_opaque="NCURSES_INTERNALS"
1387	NCURSES_SIZE_T=int
1388	if test "x$cf_cv_weak_symbols" = xyes ; then
1389		CF_REMOVE_LIB(LIBS,$LIBS,pthread)
1390		CF_ADD_LIB(pthread,TEST_LIBS)
1391		CF_ADD_LIB(pthread,TEST_LIBS2)
1392		CF_ADD_LIB(pthread,PRIVATE_LIBS)
1393	else
1394		# when not using weak symbols but with_reentrant,
1395		# add 't' to the library suffix on all platforms
1396		# except cygwin, where we only do that if ALSO
1397		# compiling with full thread support.
1398		case "$host" in
1399		(*cygwin* | *msys*)
1400			if test "$with_pthread" = "yes" ; then
1401				if test "x$disable_lib_suffixes" = "xno" ; then
1402					LIB_SUFFIX="t${LIB_SUFFIX}"
1403				fi
1404			fi ;;
1405		(*)
1406			if test "x$disable_lib_suffixes" = "xno" ; then
1407				LIB_SUFFIX="t${LIB_SUFFIX}"
1408			fi
1409			;;
1410		esac
1411	fi
1412	AC_DEFINE(USE_REENTRANT,1,[Define to 1 to use reentrant feature])
1413	CF_NCURSES_ABI_6
1414else
1415	cf_cv_enable_reentrant=0
1416	cf_cv_enable_opaque="NCURSES_OPAQUE"
1417	NCURSES_SIZE_T=$cf_dft_ordinate_type
1418fi
1419AC_SUBST(cf_cv_enable_reentrant)
1420AC_SUBST(cf_cv_enable_opaque)
1421
1422AC_SUBST(NCURSES_SIZE_T)
1423
1424AC_MSG_CHECKING(whether curses library structures should be opaque)
1425CF_ARG_DISABLE(opaque-curses,
1426	[  --disable-opaque-curses do not make WINDOW, etc., structures opaque],
1427	[enable_opaque_curses=no],[
1428	 test "$cf_cv_enable_reentrant" = 1 && enable_opaque_curses=yes
1429	 test "$cf_cv_enable_reentrant" = 1 || enable_opaque_curses=$cf_dft_opaque_curses
1430	])
1431AC_MSG_RESULT($enable_opaque_curses)
1432
1433test "$cf_cv_enable_reentrant" = 1 && \
1434test "$enable_opaque_curses" = no && \
1435AC_MSG_ERROR(reentrant configuration requires opaque library)
1436
1437AC_MSG_CHECKING(whether form library structures should be opaque)
1438CF_ARG_DISABLE(opaque-form,
1439	[  --disable-opaque-form   do not make form library structures opaque],
1440	[enable_opaque_form=no],[enable_opaque_form=$cf_dft_opaque_curses])
1441AC_MSG_RESULT($enable_opaque_form)
1442
1443AC_MSG_CHECKING(whether menu library structures should be opaque)
1444CF_ARG_DISABLE(opaque-menu,
1445	[  --disable-opaque-menu   do not make menu library structures opaque],
1446	[enable_opaque_menu=no],[enable_opaque_menu=$cf_dft_opaque_curses])
1447AC_MSG_RESULT($enable_opaque_menu)
1448
1449AC_MSG_CHECKING(whether panel library structures should be opaque)
1450CF_ARG_DISABLE(opaque-panel,
1451	[  --disable-opaque-panel  do not make panel library structures opaque],
1452	[enable_opaque_panel=no],[enable_opaque_panel=$cf_dft_opaque_curses])
1453AC_MSG_RESULT($enable_opaque_panel)
1454
1455NCURSES_OPAQUE=0;		test "$enable_opaque_curses" = yes && NCURSES_OPAQUE=1
1456NCURSES_OPAQUE_FORM=0;	test "$enable_opaque_form"   = yes && NCURSES_OPAQUE_FORM=1
1457NCURSES_OPAQUE_MENU=0;	test "$enable_opaque_menu"   = yes && NCURSES_OPAQUE_MENU=1
1458NCURSES_OPAQUE_PANEL=0;	test "$enable_opaque_panel"  = yes && NCURSES_OPAQUE_PANEL=1
1459
1460AC_SUBST(NCURSES_OPAQUE)
1461AC_SUBST(NCURSES_OPAQUE_FORM)
1462AC_SUBST(NCURSES_OPAQUE_MENU)
1463AC_SUBST(NCURSES_OPAQUE_PANEL)
1464
1465### Allow using a different wrap-prefix
1466if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
1467	AC_MSG_CHECKING(for prefix used to wrap public variables)
1468	AC_ARG_WITH(wrap-prefix,
1469		[  --with-wrap-prefix=XXX  override prefix used for public variables],
1470		[NCURSES_WRAP_PREFIX=$withval],
1471		[NCURSES_WRAP_PREFIX=_nc_])
1472	AC_MSG_RESULT($NCURSES_WRAP_PREFIX)
1473else
1474	NCURSES_WRAP_PREFIX=_nc_
1475fi
1476AC_SUBST(NCURSES_WRAP_PREFIX)
1477AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX",[Define to override _nc_ prefix])
1478
1479###############################################################################
1480# These options are relatively safe to experiment with.
1481CF_HELP_MESSAGE(Development Code:)
1482AC_MSG_CHECKING(if you want all development code)
1483AC_ARG_WITH(develop,
1484	[  --without-develop       disable development options],
1485	[with_develop=$withval],
1486	[with_develop=no])
1487AC_MSG_RESULT($with_develop)
1488
1489###   use option --enable-check-size to detect screensize with CPR
1490AC_MSG_CHECKING(if you want to check screensize of serial terminals)
1491AC_ARG_ENABLE(check-size,
1492	[  --enable-check-size     compile-in code to detect screensize of serial terminals],,
1493	[enable_check_size=$with_develop])
1494AC_MSG_RESULT($enable_check_size)
1495test "x$enable_check_size" = xyes && AC_DEFINE(USE_CHECK_SIZE,1,[Define to 1 to compile-in code to detect screensize])
1496
1497###   use option --enable-hard-tabs to turn on use of hard-tabs optimize
1498AC_MSG_CHECKING(if you want hard-tabs code)
1499AC_ARG_ENABLE(hard-tabs,
1500	[  --enable-hard-tabs      compile with hard-tabs code],,
1501	[enable_hard_tabs=$with_develop])
1502AC_MSG_RESULT($enable_hard_tabs)
1503test "x$enable_hard_tabs" = xyes && AC_DEFINE(USE_HARD_TABS,1,[Define to 1 to compile with hard-tabs code])
1504
1505###   use option --enable-xmc-glitch to turn on use of magic-cookie optimize
1506AC_MSG_CHECKING(if you want limited support for xmc)
1507AC_ARG_ENABLE(xmc-glitch,
1508	[  --enable-xmc-glitch     compile with support for xmc (magic-cookie)],,
1509	[enable_xmc_glitch=$with_develop])
1510AC_MSG_RESULT($enable_xmc_glitch)
1511test "x$enable_xmc_glitch" = xyes && AC_DEFINE(USE_XMC_SUPPORT,1,[Define to 1 to compile with support for xmc (magic-cookie)])
1512
1513###############################################################################
1514# These are just experimental, probably should not be in a package:
1515CF_HELP_MESSAGE(Experimental Code:)
1516
1517AC_MSG_CHECKING(if you do not want to assume colors are white-on-black)
1518AC_ARG_ENABLE(assumed-color,
1519	[  --disable-assumed-color do not assume anything about default-colors],
1520	[with_assumed_color=$enableval],
1521	[with_assumed_color=yes])
1522AC_MSG_RESULT($with_assumed_color)
1523test "x$with_assumed_color" = xyes && AC_DEFINE(USE_ASSUMED_COLOR,1,[Define to 1 to assume things about default-colors])
1524
1525###   use option --enable-hashmap to turn on use of hashmap scrolling logic
1526AC_MSG_CHECKING(if you want hashmap scrolling-optimization code)
1527AC_ARG_ENABLE(hashmap,
1528	[  --disable-hashmap       compile without hashmap scrolling-optimization],
1529	[with_hashmap=$enableval],
1530	[with_hashmap=yes])
1531AC_MSG_RESULT($with_hashmap)
1532test "x$with_hashmap" = xyes && AC_DEFINE(USE_HASHMAP,1,[Define to 1 to compile with hashmap scrolling-optimization])
1533
1534###   use option --enable-colorfgbg to turn on use of $COLORFGBG environment
1535AC_MSG_CHECKING(if you want colorfgbg code)
1536AC_ARG_ENABLE(colorfgbg,
1537	[  --enable-colorfgbg      compile-in experimental $COLORFGBG code],
1538	[with_colorfgbg=$enableval],
1539	[with_colorfgbg=no])
1540AC_MSG_RESULT($with_colorfgbg)
1541test "x$with_colorfgbg" = xyes && AC_DEFINE(USE_COLORFGBG,1,[Define to 1 to compile-in experimental $COLORFGBG code])
1542
1543###   use option --enable-fvisibility to turn on use of gcc-specific feature
1544AC_MSG_CHECKING(if you want to use gcc -fvisibility option)
1545AC_ARG_ENABLE(fvisibility,
1546	[  --enable-fvisibility    compile with -fvisibility=hidden],
1547	[cf_with_fvisibility=$enableval],
1548	[cf_with_fvisibility=no])
1549AC_MSG_RESULT($cf_with_fvisibility)
1550
1551NCURSES_IMPEXP=
1552NCURSES_CXX_IMPEXP=
1553if test "x$cf_with_fvisibility" = xyes; then
1554	CF_CHECK_FVISIBILITY($CC,CFLAGS,cf_cv_fvisibility_hidden)
1555	if test "x$cf_cv_fvisibility_hidden" = xyes
1556	then
1557		CF_ADD_CFLAGS([-fvisibility=hidden])
1558		NCURSES_IMPEXP="__attribute__ ((visibility(\"default\")))"
1559	fi
1560	if test -n "$CXX"
1561	then
1562		AC_LANG_PUSH(C++)
1563		CF_CHECK_FVISIBILITY($CXX,CXXFLAGS,cf_cv_fvisibility_hidden2)
1564		if test "x$cf_cv_fvisibility_hidden2" = xyes
1565		then
1566			CF_ADD_CXXFLAGS([-fvisibility=hidden])
1567			NCURSES_CXX_IMPEXP="__attribute__ ((visibility(\"default\")))"
1568		fi
1569		AC_LANG_POP
1570	fi
1571fi
1572AC_SUBST(NCURSES_IMPEXP)
1573AC_SUBST(NCURSES_CXX_IMPEXP)
1574
1575###   use option --enable-interop to turn on use of bindings used for interop
1576AC_MSG_CHECKING(if you want interop bindings)
1577AC_ARG_ENABLE(interop,
1578	[  --enable-interop        compile-in interop bindings],
1579	[with_exp_interop=$enableval],
1580	[with_exp_interop=$cf_dft_interop])
1581AC_MSG_RESULT($with_exp_interop)
1582
1583NCURSES_INTEROP_FUNCS=0
1584test "x$with_exp_interop" = xyes && NCURSES_INTEROP_FUNCS=1
1585AC_SUBST(NCURSES_INTEROP_FUNCS)
1586
1587
1588AC_MSG_CHECKING(if you want experimental safe-sprintf code)
1589AC_ARG_ENABLE(safe-sprintf,
1590	[  --enable-safe-sprintf   compile with experimental safe-sprintf code],
1591	[with_safe_sprintf=$enableval],
1592	[with_safe_sprintf=no])
1593AC_MSG_RESULT($with_safe_sprintf)
1594
1595###   use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
1596# when hashmap is used scroll hints are useless
1597if test "$with_hashmap" = no ; then
1598AC_MSG_CHECKING(if you want to experiment without scrolling-hints code)
1599AC_ARG_ENABLE(scroll-hints,
1600	[  --disable-scroll-hints  compile without scroll-hints code],
1601	[with_scroll_hints=$enableval],
1602	[with_scroll_hints=yes])
1603AC_MSG_RESULT($with_scroll_hints)
1604test "x$with_scroll_hints" = xyes && AC_DEFINE(USE_SCROLL_HINTS,1,[Define to 1 to compile without scroll-hints code])
1605fi
1606
1607case x$cf_cv_abi_default in
1608(x[[789]])
1609	NCURSES_WGETCH_EVENTS=0
1610	;;
1611(*)
1612AC_MSG_CHECKING(if you want wgetch-events code)
1613AC_ARG_ENABLE(wgetch-events,
1614	[  --enable-wgetch-events  compile with wgetch-events code],
1615	[with_wgetch_events=$enableval],
1616	[with_wgetch_events=no])
1617AC_MSG_RESULT($with_wgetch_events)
1618if test "x$with_wgetch_events" = xyes ; then
1619	AC_DEFINE(NCURSES_WGETCH_EVENTS,1,[Define to 1 to compile with wgetch-events code])
1620	NCURSES_WGETCH_EVENTS=1
1621else
1622	NCURSES_WGETCH_EVENTS=0
1623fi
1624esac
1625AC_SUBST(NCURSES_WGETCH_EVENTS)
1626
1627case "$cf_cv_system_name" in
1628(*mingw32*|*mingw64*|*-msvc*)
1629	AC_ARG_ENABLE(exp-win32,
1630		[  --enable-exp-win32      obsolete option for Windows driver],
1631		[AC_MSG_WARN(The --enable-exp-win32 option is obsolete)])
1632	;;
1633esac
1634
1635###############################################################################
1636CF_HELP_MESSAGE(Testing/development Options:)
1637
1638###	use option --disable-echo to suppress full display compiling commands
1639CF_DISABLE_ECHO
1640if test "x$enable_echo" = xyes; then
1641	ECHO_LINK=
1642else
1643	ECHO_LINK='@ echo linking $@ ... ;'
1644	test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent"
1645	test -n "$LIBTOOL_CXX" && LIBTOOL_CXX="$LIBTOOL_CXX --silent"
1646fi
1647AC_SUBST(ECHO_LINK)
1648
1649# --disable-stripping is used for debugging
1650CF_INSTALL_OPTS
1651
1652# If we're avoiding relinking of shared libraries during install, that is to
1653# avoid modifying the build-tree.  For the same reason, avoid doing ranlib if
1654# the install program has "-p" (for preserving timestamps).
1655cf_cv_do_reranlib=yes
1656if test "x$cf_cv_install_p" = xyes
1657then
1658	if test "x$cf_cv_do_relink" != xyes
1659	then
1660		cf_cv_do_reranlib=no
1661		INSTALL_OPT_P="-p"
1662		INSTALL_LIB="$INSTALL_LIB $INSTALL_OPT_P"
1663	fi
1664fi
1665AC_SUBST(INSTALL_OPT_P)
1666
1667###	use option --enable-warnings to turn on all gcc warnings
1668CF_ENABLE_WARNINGS(Wno-unknown-pragmas Wswitch-enum,yes)
1669
1670if test "x$enable_warnings" = "xyes"; then
1671 	CF_ADD_ADAFLAGS(-gnatwa -gnatyg)
1672	if test "x$cf_with_cxx" = xyes ; then
1673		CF_GXX_WARNINGS(Wno-unused)
1674	fi
1675fi
1676CF_ENABLE_STRING_HACKS
1677
1678###	use option --enable-assertions to turn on generation of assertion code
1679AC_MSG_CHECKING(if you want to enable runtime assertions)
1680AC_ARG_ENABLE(assertions,
1681	[  --enable-assertions     test: turn on generation of assertion code],
1682	[with_assertions=$enableval],
1683	[with_assertions=no])
1684AC_MSG_RESULT($with_assertions)
1685if test -n "$GCC"
1686then
1687	if test "$with_assertions" = no
1688	then
1689		CPPFLAGS="$CPPFLAGS -DNDEBUG"
1690	else
1691		CF_ADD_ADAFLAGS(-gnata)
1692	fi
1693fi
1694
1695###	use option --disable-leaks to suppress "permanent" leaks, for testing
1696CF_DISABLE_LEAKS
1697AC_DEFINE(HAVE_NC_ALLOC_H,1,[Define to 1 if we have nc_alloc.h header])
1698
1699###	use option --enable-expanded to generate certain macros as functions
1700AC_ARG_ENABLE(expanded,
1701	[  --enable-expanded       test: generate functions for certain macros],
1702	[test "x$enableval" = xyes && AC_DEFINE(NCURSES_EXPANDED,1,[Define to 1 to generate functions for certain macros])])
1703
1704###	use option --disable-macros to suppress macros in favor of functions
1705AC_ARG_ENABLE(macros,
1706	[  --disable-macros        test: use functions rather than macros],
1707	[test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS,1,[Define to 1 to use functions rather than macros])])
1708
1709# Normally we only add trace() to the debug-library.  Allow this to be
1710# extended to all models of the ncurses library:
1711cf_all_traces=no
1712case "$CFLAGS $CPPFLAGS" in
1713(*-DTRACE*)
1714	cf_all_traces=yes
1715	;;
1716esac
1717
1718AC_MSG_CHECKING(whether to add trace feature to all models)
1719AC_ARG_WITH(trace,
1720[  --with-trace            test: add trace() function to all models of ncurses],
1721[cf_with_trace=$withval],
1722[cf_with_trace=$cf_all_traces])
1723AC_MSG_RESULT($cf_with_trace)
1724
1725if test "x$cf_with_trace" = xyes ; then
1726	LIB_TRACING=all
1727	ADA_TRACE=TRUE
1728	AC_DEFINE(TRACE,1,[Define to 1 if we have support trace functions])
1729	AC_DEFINE(HAVE__TRACEF,1,[Define to 1 if we have _tracef function])
1730else
1731	LIB_TRACING=DEBUG
1732	ADA_TRACE=FALSE
1733fi
1734
1735AC_SUBST(ADA_TRACE)
1736
1737CF_DISABLE_GNAT_PROJECTS
1738
1739###	Checks for libraries.
1740case "$cf_cv_system_name" in
1741(*mingw32*|*mingw64*)
1742	# Note: WINVER may be a problem with Windows 10
1743	if test "x$with_named_pipes" = xyes ; then
1744		CPPFLAGS="$CPPFLAGS -DWINVER=0x0600 -DWIN32_LEAN_AND_MEAN"
1745	else
1746		CPPFLAGS="$CPPFLAGS -DWINVER=0x0501 -DWIN32_LEAN_AND_MEAN"
1747	fi
1748	CF_CHECK_LIBSSP
1749	;;
1750(*)
1751	;;
1752esac
1753
1754CF_MATH_LIB(MATH_LIB,pow(sin(x),x))
1755AC_SUBST(MATH_LIB)
1756
1757###	Checks for header files.
1758AC_HEADER_TIME
1759CF_REGEX
1760
1761dnl These are some other potentially nonportable headers.
1762AC_CHECK_HEADERS( \
1763alloca.h \
1764fcntl.h \
1765getopt.h \
1766limits.h \
1767locale.h \
1768malloc.h \
1769math.h \
1770poll.h \
1771sys/auxv.h \
1772sys/fsuid.h \
1773sys/ioctl.h \
1774sys/param.h \
1775sys/poll.h \
1776sys/select.h \
1777sys/time.h \
1778sys/times.h \
1779unistd.h \
1780wctype.h \
1781)
1782
1783CF_GETOPT_HEADER
1784
1785CF_CHECK_ENVIRON(environ)
1786CF_CHECK_GETENV
1787if test "x$cf_cv_consistent_getenv" = xno && \
1788	test "x$cf_with_trace" = xyes
1789then
1790	AC_MSG_WARN(The NCURSES_TRACE environment variable is not supported with this configuration)
1791fi
1792
1793CF_SYS_TIME_SELECT
1794
1795###	checks for compiler characteristics
1796AC_LANG([C])
1797AC_C_CONST
1798CF_C_INLINE(NCURSES_INLINE,1200)
1799CF_SIG_ATOMIC_T
1800
1801if test "$NCURSES_CHTYPE" = auto ; then
1802	CF_TYPEOF_CHTYPE
1803else
1804	cf_cv_typeof_chtype=$NCURSES_CHTYPE
1805fi
1806test "$cf_cv_typeof_chtype" = unsigned && cf_cv_typeof_chtype=""
1807AC_SUBST(cf_cv_typeof_chtype)
1808
1809CF_UNSIGNED_LITERALS
1810cf_cv_1UL="1"
1811test ".$cf_cv_unsigned_literals" = .yes && cf_cv_1UL="${cf_cv_1UL}U"
1812test ".$cf_cv_typeof_chtype"    = .long && cf_cv_1UL="${cf_cv_1UL}L"
1813AC_SUBST(cf_cv_1UL)
1814
1815if test "$NCURSES_MMASK_T" = auto ; then
1816	cf_cv_typeof_mmask_t=long
1817else
1818	cf_cv_typeof_mmask_t=$NCURSES_MMASK_T
1819fi
1820test "$cf_cv_typeof_mmask_t" = unsigned && cf_cv_typeof_mmask_t=""
1821AC_SUBST(cf_cv_typeof_mmask_t)
1822
1823###	Checks for external-data
1824CF_ERRNO
1825CF_LINK_DATAONLY
1826
1827###	Checks for library functions.
1828CF_FUNC_GETTIME
1829AC_CHECK_FUNCS( \
1830fpathconf \
1831getcwd \
1832getauxval \
1833getegid \
1834geteuid \
1835getopt \
1836getuid \
1837issetugid \
1838localeconv \
1839poll \
1840remove \
1841select \
1842setbuf \
1843setbuffer \
1844setfsuid \
1845setvbuf \
1846sigaction \
1847sigvec \
1848snprintf \
1849strdup \
1850strstr \
1851sysconf \
1852tcgetpgrp \
1853times \
1854tsearch \
1855vsnprintf \
1856)
1857
1858CF_FUNC_GETTTYNAM
1859
1860if test "x$ac_cv_func_getopt" = xno && \
1861   test "x$cf_with_progs$cf_with_tests" != xnono; then
1862	AC_MSG_ERROR(getopt is required for building programs)
1863fi
1864
1865if test "x$with_safe_sprintf" = xyes
1866then
1867	if test "x$ac_cv_func_vsnprintf" = xyes
1868	then
1869		AC_MSG_WARN(will use vsnprintf instead of safe-sprintf option)
1870	else
1871		AC_DEFINE(USE_SAFE_SPRINTF,1,[Define to 1 to compile with experimental safe-sprintf code])
1872	fi
1873fi
1874
1875if test "x$with_getcap" = "xyes" ; then
1876	CF_CGETENT
1877fi
1878
1879CF_ISASCII
1880CF_STRUCT_SIGACTION
1881CF_FUNC_NANOSLEEP
1882CF_FUNC_TERMIOS
1883CF_FUNC_VSSCANF
1884CF_MKSTEMP
1885
1886# setup for prototype of fallback for vsscanf()
1887CF_SUBST_IF(["$cf_cv_func_vsscanf" = vsscanf], HAVE_VSSCANF, 1, 0)
1888
1889dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
1890if test "x$cross_compiling" = xyes ; then
1891	AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
1892else
1893	AC_FUNC_SETVBUF_REVERSED
1894fi
1895AC_CHECK_TYPE(intptr_t, long)
1896AC_CHECK_TYPE(ssize_t, int)
1897CF_TYPE_SIGACTION
1898CF_SIZECHANGE
1899CF_FUNC_MEMMOVE
1900CF_FUNC_POLL
1901CF_MB_LEN_MAX
1902CF_VA_COPY
1903AC_FUNC_FORK([])
1904CF_FOPEN_BIN_R
1905CF_CHECK_TYPE2(cc_t,termios.h)
1906CF_CHECK_TYPE2(speed_t,termios.h)
1907CF_CHECK_TYPE2(tcflag_t,termios.h)
1908CF_CHECK_TYPE2(sigset_t,signal.h)
1909
1910# special check for test/ditto.c
1911CF_FUNC_OPENPTY
1912if test "$cf_cv_func_openpty" != no ; then
1913	AC_DEFINE_UNQUOTED(USE_OPENPTY_HEADER,<$cf_cv_func_openpty>,[Define to actual header for openpty function])
1914	AC_DEFINE(USE_XTERM_PTY,1,[Define to 1 if we should assume xterm pseudoterminal interface])
1915	if test "x$cf_cv_lib_util" = xyes ; then
1916		CF_ADD_LIB(util,TEST_LIBS)
1917	fi
1918fi
1919AC_SUBST(TEST_LIBS)
1920AC_SUBST(TEST_LIBS2)
1921
1922if test "$with_hashed_db" != no ; then
1923	AC_DEFINE(USE_HASHED_DB,1,[Define to 1 if we should build terminfo in hashed database])
1924	CF_HASHED_DB($with_hashed_db)
1925fi
1926
1927dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
1928if test -z "$cf_user_CFLAGS" && test "$enable_leaks" = yes ; then
1929	CF_STRIP_G_OPT(CFLAGS)
1930	CF_STRIP_G_OPT(CXXFLAGS)
1931fi
1932
1933# Just in case, check if the C compiler has a bool type.
1934CF_BOOL_DECL(cf_cv_cc_bool_type)
1935if test "$cf_cv_cc_bool_type" = yes; then
1936	USE_BUILTIN_BOOL=1
1937else
1938	USE_BUILTIN_BOOL=0
1939fi
1940AC_SUBST(USE_BUILTIN_BOOL)
1941
1942test "$cf_cv_header_stdbool_h" = yes && AC_DEFINE(USE_STDBOOL_H,1,[Define to 1 if we can include stdbool.h])
1943
1944# Check for C++ compiler characteristics (and ensure that it's there!)
1945if test -n "$CXX" ; then
1946	AC_LANG([C++])
1947	CF_STDCPP_LIBRARY
1948	CF_PROG_CC_C_O(CXX,[$CXXFLAGS $CPPFLAGS])
1949
1950	case "$GXX_VERSION" in
1951	(1.*|2.[[0-6]]*|[[1-9]][[0-9]].*)
1952		cf_cxx_library=yes
1953		;;
1954	(*-2.7*|2.7*)
1955		CF_GPP_LIBRARY
1956		;;
1957	(*)
1958		cf_cxx_library=no
1959		;;
1960	esac
1961
1962	AC_CHECK_HEADERS(new exception typeinfo)
1963	CF_CXX_IOSTREAM_NAMESPACE
1964	CF_BOOL_DECL
1965	CF_BOOL_SIZE
1966	CF_ETIP_DEFINES
1967	CF_CPP_OVERRIDE
1968	CF_CPP_PARAM_INIT
1969	CF_CPP_STATIC_CAST
1970	CF_CXX_AR_FLAGS
1971else
1972	cf_cxx_library=no
1973	cf_cv_builtin_bool=yes
1974
1975	# Just because we are not configuring against C++ right now does not
1976	# mean that a user will not want to use C++.  Some distributors disable
1977	# the C++ portion of this configuration as a shortcut (or just to avoid
1978	# compiling the demo in the c++ directory).  So we need a reasonable
1979	# default for the 'bool' type.
1980	#
1981	# Caveat: since the storage of the bool type is not standardized, it
1982	# may change.
1983
1984	if test "$NCURSES_BOOL" != auto ; then
1985		cf_cv_type_of_bool=$NCURSES_BOOL
1986		USE_STDBOOL_H=0
1987	else
1988		CF_BOOL_SIZE
1989	fi
1990fi
1991AC_SUBST(CXXLIBS)
1992
1993# If the C compiler did not declare bool, and we did not determine that the C++
1994# compiler does not declare bool, turn on an ifdef in curses.h that makes the
1995# ncurses library use the same type as C++ bool.  Note that this allows one to
1996# specify the type of bool in a configure-script option and postpone
1997# integration with the C++ compiler provided that the types are compatible.
1998USE_CXX_BOOL=1
1999if test "$USE_BUILTIN_BOOL" = 1
2000then
2001	# oops: C has a bool.  Unlikely, but C++ could differ.
2002	USE_CXX_BOOL=0
2003elif test "$cf_cv_builtin_bool" = no
2004then
2005	# C++ has no bool
2006	USE_CXX_BOOL=0
2007else
2008	# this is the normal case
2009	USE_CXX_BOOL='defined(__cplusplus)'
2010fi
2011AC_SUBST(USE_CXX_BOOL)
2012
2013CF_HELP_MESSAGE(Ada Binding Options:)
2014
2015dnl If the Ada95 source-tree is present, add that to the build unless it will
2016dnl not work, or was not requested.
2017if test -f "${srcdir}/Ada95/Makefile.in" ; then
2018
2019dnl libtool does not know anything about GNAT, though a change made in 1998
2020dnl provided for it "someday".  Disable the ada subtree if we are using
2021dnl libtool -TD 20070714
2022	if test "$cf_with_ada" != "no" ; then
2023		if test "$with_libtool" != "no"; then
2024			AC_MSG_WARN(libtool does not support Ada - disabling feature)
2025			cf_with_ada=no
2026		fi
2027	fi
2028
2029dnl Check for availability of GNU Ada Translator (GNAT).
2030dnl At the moment we support no other Ada compiler.
2031	if test "$cf_with_ada" != "no" ; then
2032		if test	"x$cf_cv_prog_gnat_correct" = xyes; then
2033			CF_ADD_ADAFLAGS(-gnatpn)
2034			CF_FIXUP_ADAFLAGS
2035
2036			CF_GNATPREP_OPT_T
2037
2038			CF_GNAT_GENERICS
2039			CF_GNAT_SIGINT
2040			CF_GNAT_PROJECTS
2041
2042			CF_WITH_ADA_COMPILER
2043
2044			cf_ada_package=terminal_interface
2045			AC_SUBST(cf_ada_package)
2046
2047			CF_WITH_ADA_INCLUDE
2048			CF_WITH_ADA_OBJECTS
2049			CF_WITH_ADA_SHAREDLIB
2050
2051			# allow the Ada binding to be renamed
2052			CF_WITH_ADA_LIBNAME(AdaCurses)
2053		fi
2054	fi
2055else
2056	cf_with_ada=no
2057fi
2058
2059# do this "late" to avoid conflict with header-checks
2060if test "x$with_widec" = xyes ; then
2061	AC_CHECK_SIZEOF(wchar_t)
2062	# cross-compiling to mingw can run into the problem that attempting to
2063	# link with the regex library fails, causing the test to not set this to
2064	# a number.  "recent" autoconf does not address this problem either -TD
2065	if test -z "$ac_cv_sizeof_wchar_t"
2066	then
2067		CF_VERBOSE(test failed (assume 2))
2068		sed /SIZEOF_WCHAR_T/d confdefs.h >confdefs.tmp
2069		mv confdefs.tmp confdefs.h
2070		echo "#define SIZEOF_WCHAR_T 2" >>confdefs.h
2071	fi
2072fi
2073
2074### Construct the ncurses library-subsets, if any, from this set of keywords:
2075###	none, base, ext_funcs, ext_tinfo, ticlib, termlib, widechar
2076###
2077### ticlib modules may be a separate library, otherwise contained in termlib.
2078### termlib modules may be a separate library, otherwise contained in ncurses.
2079###
2080### The of "+" or " " between the tokens controls the way the script
2081### chooses to split module lists into libraries.
2082###
2083### (see CF_LIB_RULES).
2084AC_MSG_CHECKING(for library subsets)
2085LIB_SUBSETS=
2086
2087if test "x$cf_with_progs" = xyes || test "$with_ticlib" != no || test "$with_termcap" != no; then
2088	LIB_SUBSETS="${LIB_SUBSETS}ticlib"
2089	if test "$with_ticlib" != no ; then
2090		LIB_SUBSETS="${LIB_SUBSETS} "
2091	else
2092		LIB_SUBSETS="${LIB_SUBSETS}+"
2093	fi
2094fi
2095
2096LIB_SUBSETS="${LIB_SUBSETS}termlib"
2097test "x$with_ext_funcs" = xyes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo"
2098
2099if test "$with_termlib" != no ; then
2100	LIB_SUBSETS="${LIB_SUBSETS} "
2101else
2102	LIB_SUBSETS="${LIB_SUBSETS}+"
2103fi
2104
2105LIB_SUBSETS="${LIB_SUBSETS}base"
2106
2107# Most term-driver calls are to tinfo, but some like init_pair are to the
2108# base library (so it resides in base).
2109if test "$with_term_driver" != no ; then
2110	LIB_SUBSETS="${LIB_SUBSETS}+port_drivers"
2111	case "$cf_cv_system_name" in
2112	(*mingw32*|*mingw64*)
2113		if test "x$with_named_pipes" = xyes ; then
2114			LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32"
2115		else
2116			LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con"
2117		fi
2118		CPPFLAGS="$CPPFLAGS -DUSE_WIN32CON_DRIVER"
2119		;;
2120	(*msys*|*cygwin*)
2121		LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_msys2"
2122		;;
2123	(*)
2124		LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo"
2125		;;
2126	esac
2127elif test "x$with_named_pipes" = xyes ; then
2128	case "$cf_cv_system_name" in
2129	(*mingw32*|*mingw64*)
2130		LIB_SUBSETS="${LIB_SUBSETS}+port_win32"
2131		;;
2132	(*)
2133		;;
2134	esac
2135fi
2136
2137test "x$with_widec"     = xyes && LIB_SUBSETS="${LIB_SUBSETS}+widechar"
2138test "x$with_ext_funcs" = xyes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
2139
2140AC_MSG_RESULT($LIB_SUBSETS)
2141
2142### Construct the list of include-directories to be generated
2143CF_INCLUDE_DIRS
2144CF_ADA_INCLUDE_DIRS
2145
2146### Build up pieces for makefile rules
2147AC_MSG_CHECKING(default library suffix)
2148CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
2149AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
2150AC_MSG_RESULT($DFT_ARG_SUFFIX)
2151
2152AC_MSG_CHECKING(default library-dependency suffix)
2153CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_LIB_SUFFIX,DFT_DEP_SUFFIX)dnl
2154AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
2155AC_MSG_RESULT($DFT_DEP_SUFFIX)
2156
2157AC_MSG_CHECKING(default object directory)
2158CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
2159AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
2160AC_MSG_RESULT($DFT_OBJ_SUBDIR)
2161
2162if test "x$cf_with_cxx" = xyes ; then
2163AC_MSG_CHECKING(c++ library-dependency suffix)
2164if test "$with_libtool" != "no"; then
2165	# libtool thinks it can make c++ shared libraries (perhaps only g++)
2166	CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
2167elif test "$with_shared_cxx" != "no"; then
2168	# also for g++ users...
2169	CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
2170else
2171	# we normally make a static library because C/C++ library rules differ
2172	CF_LIB_SUFFIX(normal,CXX_LIB_SUFFIX,CXX_DEP_SUFFIX)
2173fi
2174AC_MSG_RESULT($CXX_LIB_SUFFIX)
2175AC_SUBST(CXX_LIB_SUFFIX)
2176fi
2177
2178# do not want -ldl in build except as needed for -lncurses dependency
2179if test "x$with_dlsym" = xyes ; then
2180if test "$DFT_LWR_MODEL" = shared || \
2181   test "$DFT_LWR_MODEL" = libtool ; then
2182	CF_REMOVE_LIB(LIBS,$LIBS,dl)
2183fi
2184fi
2185### Set up low-level terminfo dependencies for makefiles.
2186
2187# TICS_LIST and TINFO_LIST are needed to build libtic.so and libterm.so, but
2188# do not need libdl
2189TICS_LIST=
2190if test "x$with_dlsym" = xyes ; then
2191	CF_REMOVE_LIB(TINFO_LIST,$SHLIB_LIST,dl)
2192fi
2193
2194USE_ARG_SUFFIX="${DFT_ARG_SUFFIX}${EXTRA_SUFFIX}"
2195ABI_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}"
2196USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}${cf_cv_abi_version}
2197if test -n "$EXTRA_SUFFIX" && test "x$EXTRA_SUFFIX" != "x${cf_cv_abi_version}"
2198then
2199	USE_CFG_SUFFIX="${USE_CFG_SUFFIX}${EXTRA_SUFFIX}"
2200fi
2201AC_SUBST(USE_ARG_SUFFIX)
2202AC_SUBST(USE_CFG_SUFFIX)
2203AC_SUBST(ABI_SUFFIX)
2204
2205if test "$with_ticlib" != no ; then
2206
2207	if test "x$with_ticlib" != xyes ; then
2208		TICS_NAME=$with_ticlib
2209		TICS_SUFFIX="`echo "${DFT_LIB_SUFFIX}" |sed -e "s/^${ABI_SUFFIX}//"`"
2210		TICS_ARG_SUFFIX="${with_ticlib}`echo "${USE_ARG_SUFFIX}" |sed -e "s/^${LIB_SUFFIX}//"`"
2211		TICS_DEP_SUFFIX="${with_ticlib}`echo "${DFT_DEP_SUFFIX}" |sed -e "s/^${LIB_SUFFIX}//"`"
2212		TICS_LIB_SUFFIX="${with_ticlib}"
2213	else
2214		TICS_SUFFIX=${DFT_LIB_SUFFIX}
2215		TICS_ARG_SUFFIX="${TICS_NAME}${USE_ARG_SUFFIX}"
2216		TICS_DEP_SUFFIX="${TICS_NAME}${DFT_DEP_SUFFIX}"
2217		TICS_LIB_SUFFIX="${TICS_NAME}${ABI_SUFFIX}"
2218	fi
2219	TICS_LDFLAGS="-L${LIB_DIR}"
2220	TICS_LIBS="-l${TICS_ARG_SUFFIX}"
2221else
2222	TICS_SUFFIX=${DFT_LIB_SUFFIX}
2223	TICS_LDFLAGS="-L${LIB_DIR}"
2224	TICS_LIBS="-l${LIB_NAME}${USE_ARG_SUFFIX}"
2225fi
2226AC_SUBST(TICS_ARG_SUFFIX)
2227AC_SUBST(TICS_DEP_SUFFIX)
2228AC_SUBST(TICS_LIB_SUFFIX)
2229AC_SUBST(TICS_LDFLAGS)
2230AC_SUBST(TICS_LIBS)
2231
2232if test "$with_termlib" != no ; then
2233
2234	if test "x$with_termlib" != xyes ; then
2235		TINFO_NAME=$with_termlib
2236		TINFO_SUFFIX="`echo "${DFT_LIB_SUFFIX}" |sed -e "s/^${ABI_SUFFIX}//"`"
2237		TINFO_ARG_SUFFIX="${with_termlib}`echo "${USE_ARG_SUFFIX}" |sed -e "s/^${LIB_SUFFIX}//"`"
2238		TINFO_DEP_SUFFIX="${with_termlib}`echo "${DFT_DEP_SUFFIX}" |sed -e "s/^${LIB_SUFFIX}//"`"
2239		TINFO_LIB_SUFFIX="${with_termlib}"
2240	else
2241		TINFO_SUFFIX=${DFT_LIB_SUFFIX}
2242		TINFO_ARG_SUFFIX="${TINFO_NAME}${USE_ARG_SUFFIX}"
2243		TINFO_DEP_SUFFIX="${TINFO_NAME}${DFT_DEP_SUFFIX}"
2244		TINFO_LIB_SUFFIX="${TINFO_NAME}${ABI_SUFFIX}"
2245	fi
2246
2247	TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_DEP_SUFFIX}"
2248	TEST_DEP2="${LIB_2ND}/${LIB_PREFIX}${TINFO_DEP_SUFFIX}"
2249	if test "$DFT_LWR_MODEL" = "libtool"; then
2250		TEST_ARGS="${TEST_DEPS}"
2251		TEST_ARG2="${TEST_DEP2}"
2252		TINFO_LDFLAGS="-L${LIB_DIR}"
2253		TINFO_LIBS="$TEST_ARGS"
2254		TICS_LIST="$SHLIB_LIST $TEST_ARGS"
2255		SHLIB_LIST="${SHLIB_LIST} $TEST_ARGS"
2256	else
2257		TEST_ARGS="-l${TINFO_ARG_SUFFIX}"
2258		TEST_ARG2="-l${TINFO_ARG_SUFFIX}"
2259		if test "x$with_term_driver" != xno ; then
2260			TICS_LIST="$SHLIB_LIST -l${LIB_NAME}${USE_ARG_SUFFIX}"
2261			TICS_LIBS="$TICS_LIBS -l${LIB_NAME}${USE_ARG_SUFFIX}"
2262			TINFO_LIBS="-l${LIB_NAME}${USE_ARG_SUFFIX} $TEST_ARGS"
2263		else
2264			TICS_LIST="$SHLIB_LIST -l${TINFO_LIB_SUFFIX}"
2265			TINFO_LIBS="$TEST_ARGS"
2266		fi
2267		TINFO_LDFLAGS="-L${LIB_DIR}"
2268		SHLIB_LIST="$SHLIB_LIST -l${TINFO_LIB_SUFFIX}"
2269	fi
2270else
2271	# the next lines are needed for linking libtic over libncurses
2272	TINFO_NAME=${LIB_NAME}
2273	TINFO_SUFFIX=${DFT_LIB_SUFFIX}
2274	TINFO_ARG_SUFFIX=${LIB_NAME}${USE_ARG_SUFFIX}
2275	if test "x$with_tic_depends" = xyes ; then
2276		TICS_LIST="$SHLIB_LIST -l${LIB_NAME}${USE_ARG_SUFFIX}"
2277	else
2278		TICS_LIST="$SHLIB_LIST"
2279	fi
2280
2281	TINFO_LDFLAGS="-L${LIB_DIR}"
2282	TINFO_LIBS="-l${LIB_NAME}${USE_ARG_SUFFIX}"
2283fi
2284
2285if test "$DFT_LWR_MODEL" = shared ; then
2286	case "$cf_cv_system_name" in
2287	(cygwin*|msys*)
2288		# "lib" files have ".dll.a" suffix, "cyg"or "msys-" files have ".dll"
2289		TINFO_SUFFIX=.dll
2290		;;
2291	esac
2292fi
2293
2294AC_SUBST(TINFO_ARG_SUFFIX)
2295AC_SUBST(TINFO_DEP_SUFFIX)
2296AC_SUBST(TINFO_LIB_SUFFIX)
2297AC_SUBST(TINFO_LDFLAGS)
2298AC_SUBST(TINFO_LIBS)
2299
2300if test "x$with_dlsym" = xyes ; then
2301	CF_REMOVE_LIB(TICS_LIST,$TICS_LIST,dl)
2302fi
2303
2304if test "$DFT_LWR_MODEL" = "libtool"; then
2305	OBJEXT=lo
2306fi
2307
2308# needed for Ada95
2309TINFO_LDFLAGS2=`echo "$TINFO_LDFLAGS" | sed -e 's,-L\.\./,-L../../,'`
2310AC_SUBST(TINFO_LDFLAGS2)
2311
2312case "$DFT_LWR_MODEL" in
2313(normal|debug|profile)
2314	CF_LDFLAGS_STATIC
2315	;;
2316esac
2317
2318AC_MSG_CHECKING(where we will install curses.h)
2319AC_SUBST(includesubdir)
2320includesubdir=
2321if test "$with_overwrite" = no && \
2322 { test "x$includedir" = 'x${prefix}/include' || \
2323   test "x$includedir" = "x${prefix}/include"; }
2324then
2325	includesubdir="/ncurses${ABI_SUFFIX}"
2326fi
2327AC_MSG_RESULT(${includedir}${includesubdir})
2328
2329### Resolve a conflict between normal and wide-curses by forcing applications
2330### that will need libutf8 to add it to their configure script.
2331if test "$with_overwrite" != no ; then
2332if test "$NCURSES_LIBUTF8" = 1 ; then
2333	NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)'
2334	AC_MSG_WARN(Wide-character applications must define HAVE_LIBUTF8_H to include curses.h)
2335fi
2336fi
2337WITH_OVERWRITE=$with_overwrite
2338
2339### At least on MinGW a shared library build without libtool
2340### requires adding the additional libs to the link list.
2341case "$cf_cv_system_name" in
2342(*mingw32*|*mingw64*)
2343	if test "$DFT_LWR_MODEL" != "libtool"; then
2344   	   SHLIB_LIST="$SHLIB_LIST ${LIBS}"
2345	fi
2346	;;
2347*)	;;
2348esac
2349
2350AC_SUBST(WITH_OVERWRITE)
2351AC_SUBST(TICS_LIST)
2352AC_SUBST(TINFO_LIST)
2353AC_SUBST(SHLIB_LIST)
2354
2355### predefined stuff for the test programs
2356AC_DEFINE(HAVE_SLK_COLOR,1,[Define to 1 if we have slk_color for test-programs])
2357
2358# pkgsrc uses these
2359CF_HELP_MESSAGE(Library basenames for pkgsrc:)
2360CF_WITH_LIB_BASENAME(FORM_NAME,form)
2361CF_WITH_LIB_BASENAME(MENU_NAME,menu)
2362CF_WITH_LIB_BASENAME(PANEL_NAME,panel)
2363CF_WITH_LIB_BASENAME(CXX_NAME,cxx,ncurses++)
2364
2365### Construct the list of subdirectories for which we'll customize makefiles
2366### with the appropriate compile-rules.
2367
2368CF_SRC_MODULES($modules_to_build)
2369
2370if test "x$cf_with_ada" = "xyes" && test "x$cf_cv_prog_gnat_correct" = "xyes"; then
2371   SUB_MAKEFILES="$SUB_MAKEFILES Ada95/src/library.gpr:Ada95/src/library.gpr.in"
2372   SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${USE_CFG_SUFFIX}-config:Ada95/gen/adacurses-config.in"
2373   SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${USE_CFG_SUFFIX}-config.1:man/MKada_config.in"
2374fi
2375
2376CF_DIRS_TO_MAKE
2377
2378# symbols that differ when compiling Ada95 by itself.
2379NCURSES_SHLIB2=$SHELL' $(top_srcdir)/misc/shlib'
2380AC_SUBST(NCURSES_SHLIB2)
2381
2382# values to use as strings
2383AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR',[Define to override ':' as library path-separator])
2384
2385AC_DEFINE_UNQUOTED(NCURSES_VERSION_STRING, "${NCURSES_MAJOR}.${NCURSES_MINOR}.${NCURSES_PATCH}",[Define to 1 if machine has ample memory for tic])
2386
2387### Define substitutions for header files to avoid name-pollution
2388CF_SUBST_IF(["x$cf_cv_have_tcgetattr" = xyes],   HAVE_TCGETATTR, 1, 0)
2389CF_SUBST_IF(["x$ac_cv_header_stdint_h" = xyes],  HAVE_STDINT_H,  1, 0)
2390CF_SUBST_IF(["x$ac_cv_header_sgtty_h" = xyes],   HAVE_SGTTY_H,   1, 0)
2391CF_SUBST_IF(["x$ac_cv_header_termio_h" = xyes],  HAVE_TERMIO_H,  1, 0)
2392CF_SUBST_IF(["x$ac_cv_header_termios_h" = xyes], HAVE_TERMIOS_H, 1, 0)
2393
2394case "x${ac_cv_header_termios_h}${ac_cv_header_termio_h}${ac_cv_header_sgtty_h}${cf_cv_have_tcgetattr}" in
2395(*yes*)
2396	;;
2397(*)
2398	case "$cf_cv_system_name" in
2399	(*mingw32*|*mingw64*|*-msvc*)
2400		;;
2401	(*)
2402		AC_MSG_ERROR(No termio/termios/sgtty found)
2403		;;
2404	esac
2405	;;
2406esac
2407
2408###############################################################################
2409CF_MAN_PAGES([ captoinfo clear infocmp infotocap reset tabs tic toe tput tset ])
2410
2411################################################################################
2412test "x$use_database" = xyes && \
2413SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in"
2414
2415SUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in"
2416SUB_MAKEFILES="$SUB_MAKEFILES man/ncurses${USE_CFG_SUFFIX}-config.1:man/MKncu_config.in"
2417
2418if test "x$enable_pc_files" = xyes && test -z "$MAKE_PC_FILES" ; then
2419SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
2420fi
2421AC_SUBST(cross_compiling)
2422
2423if test "x$cf_with_tests" != xno ; then
2424	MAKE_TESTS=
2425else
2426	MAKE_TESTS="#"
2427fi
2428AC_SUBST(MAKE_TESTS)
2429
2430ADAHTML_DIR=../../doc/html/ada
2431AC_SUBST(ADAHTML_DIR)
2432
2433# workaround for OS/2 (20151017)
2434case "$cf_cv_system_name" in
2435(os2*)
2436	LIBTOOL_OPTS_CXX="-os2dllname ncurs++"
2437	;;
2438(*)
2439	LIBTOOL_OPTS_CXX=
2440	;;
2441esac
2442AC_SUBST(LIBTOOL_OPTS_CXX)
2443
2444# workaround for g++ versus Solaris (20131116)
2445case "$cf_cv_system_name" in
2446(solaris2*)
2447	case "x$CPPFLAGS" in
2448	(*-D_XOPEN_SOURCE_EXTENDED*)
2449		CF_VERBOSE(moving _XOPEN_SOURCE_EXTENDED to work around g++ problem)
2450		CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
2451		CPPFLAGS=`echo "x$CPPFLAGS" | sed -e  's/^.//' -e 's/-D_XOPEN_SOURCE_EXTENDED//'`
2452		;;
2453	esac
2454	;;
2455esac
2456
2457# Help to automatically enable the extended curses features when using either
2458# the *-config or the ".pc" files by adding defines.
2459AC_MSG_CHECKING(for defines to add to ncurses${USE_CFG_SUFFIX}${cf_config_suffix}-config script)
2460PKG_CFLAGS=
2461for cf_loop1 in $CPPFLAGS_after_XOPEN
2462do
2463	cf_found=no
2464	for cf_loop2 in $CPPFLAGS_before_XOPEN
2465	do
2466		if test "x$cf_loop1" = "x$cf_loop2"
2467		then
2468			cf_found=yes
2469			break
2470		fi
2471	done
2472	test "$cf_found" = no && PKG_CFLAGS="$PKG_CFLAGS $cf_loop1"
2473done
2474AC_MSG_RESULT($PKG_CFLAGS)
2475AC_SUBST(PKG_CFLAGS)
2476CF_GLOB_FULLPATH
2477
2478# AC_CHECK_SIZEOF demands a literal parameter, no variables.  So we do this.
2479case "x$NCURSES_OSPEED" in
2480(*short*)
2481	cf_compatible=1
2482	;;
2483(*)
2484	cf_compatible=0
2485	;;
2486esac
2487AC_DEFINE_UNQUOTED(NCURSES_OSPEED_COMPAT,$cf_compatible,[Define to 1 if termcap variable ospeed is short])
2488
2489case "x$cf_cv_typeof_chtype" in
2490(xshort|xint|xlong)
2491	cf_cv_typeof_chtype="unsigned $cf_cv_typeof_chtype"
2492	;;
2493esac
2494
2495case "x$cf_cv_typeof_mmask_t" in
2496(xshort|xint|xlong)
2497	cf_cv_typeof_mmask_t="unsigned $cf_cv_typeof_mmask_t"
2498	;;
2499esac
2500
2501# substitute into misc/Makefile to suppress
2502# (un)install.data from the
2503# (un)install rules.
2504if test "x$cf_with_db_install" = "xno"; then
2505	MISC_INSTALL_DATA=
2506	MISC_UNINSTALL_DATA=
2507else
2508	MISC_INSTALL_DATA=install.data
2509	MISC_UNINSTALL_DATA=uninstall.data
2510fi
2511AC_SUBST(MISC_INSTALL_DATA)
2512AC_SUBST(MISC_UNINSTALL_DATA)
2513
2514if test "x$cf_with_db_install" = "xno" || test "x$TERMINFO_SRC" = "xno"; then
2515	MAKE_DATABASE="#"
2516else
2517	MAKE_DATABASE="$MAKE_TERMINFO"
2518fi
2519AC_SUBST(MAKE_DATABASE)
2520
2521dnl Override the package used for exported symbols
2522if test -n "$PACKAGE"
2523then
2524	PACKAGE="${PACKAGE}${DFT_ARG_SUFFIX}"
2525	export PACKAGE
2526	echo "package: $PACKAGE"
2527fi
2528
2529UNALTERED_SYMS=
2530cf_filter_syms=no
2531
2532if test -n "$RESULTING_SYMS"
2533then
2534	cf_filter_syms=$cf_dft_filter_syms
2535	CF_VERBOSE(will map symbols to ABI=$cf_cv_abi_default)
2536fi
2537
2538if test "x$WILDCARD_SYMS" = xno
2539then
2540	cf_filter_syms=yes
2541fi
2542
2543test "x$cf_with_trace" = xyes && NCURSES_INLINE=
2544
2545UNALTERED_SYMS=`echo "$RESULTING_SYMS" | sed -e 's/\\$/\\\\$/g'`
2546if test "$cf_filter_syms" = yes
2547then
2548	RESULTING_SYMS=resulting.map
2549fi
2550AC_SUBST(UNALTERED_SYMS)
2551
2552if test "x$cross_compiling" = xyes ; then
2553	ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
2554	CHECK_BUILD="#"
2555else
2556	ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
2557	CHECK_BUILD=
2558fi
2559AC_SUBST(ADAGEN_LDFLAGS)
2560AC_SUBST(CHECK_BUILD)
2561AC_SUBST(PRIVATE_LIBS)
2562
2563# This is used for the *-config script and *.pc data files.
2564CF_LD_SEARCHPATH
2565
2566AC_CONFIG_FILES([\
2567	include/MKterm.h.awk \
2568	include/curses.head:include/curses.h.in \
2569	include/ncurses_dll.h \
2570	include/nc_win32.h \
2571	include/termcap.h \
2572	include/unctrl.h \
2573	man/MKterminfo.tmp:man/MKterminfo.sh \
2574	man/man_db.renames \
2575	$SUB_MAKEFILES \
2576	Makefile])
2577AC_CONFIG_COMMANDS([default],[
2578if test "x$cf_with_tests" != xno ; then
2579	CF_PRG_RULES(["$srcdir/test/mk-test.awk" INSTALL=no ECHO_LINK="$ECHO_LD"], test)
2580fi
2581CF_LIB_RULES($SRC_SUBDIRS)
2582CF_OUTPUT_MANPAGE_RENAMES
2583
2584if test "x$cf_with_ada" = "xyes" && test "x$cf_cv_prog_gnat_correct" = "xyes"; then
2585if test -z "$USE_OLD_MAKERULES" ; then
2586	$AWK -f "$srcdir/Ada95/mk-1st.awk" <"$srcdir/Ada95/src/modules" >>Ada95/src/Makefile
2587fi
2588fi
2589],[
2590### Special initialization commands, used to pass information from the
2591### configuration-run into config.status
2592
2593ALTERNATE_SYMS="$ALTERNATE_SYMS"
2594AWK="$AWK"
2595CXX_NAME="$CXX_NAME"
2596DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
2597DFT_LWR_MODEL="$DFT_LWR_MODEL"
2598ECHO_LD="$ECHO_LD"
2599EXTRA_SUFFIX="$EXTRA_SUFFIX"
2600FORM_NAME="$FORM_NAME"
2601GLOB_FULLPATH_OTHER="$GLOB_FULLPATH_OTHER"
2602GLOB_FULLPATH_POSIX="$GLOB_FULLPATH_POSIX"
2603LDCONFIG="$LDCONFIG"
2604LIBTOOL_VERSION="$LIBTOOL_VERSION"
2605LIB_NAME="$LIB_NAME"
2606LIB_PREFIX="$LIB_PREFIX"
2607LIB_SUBSETS="$LIB_SUBSETS"
2608LIB_SUFFIX="$LIB_SUFFIX"
2609LIB_TRACING="$LIB_TRACING"
2610LN_S="$LN_S"
2611MAKE_TERMINFO="$MAKE_TERMINFO"
2612MANPAGE_RENAMES="$MANPAGE_RENAMES"
2613MENU_NAME="$MENU_NAME"
2614NCURSES_MAJOR="$NCURSES_MAJOR"
2615NCURSES_MINOR="$NCURSES_MINOR"
2616NCURSES_OSPEED="$NCURSES_OSPEED"
2617NCURSES_PATCH="$NCURSES_PATCH"
2618PANEL_NAME="$PANEL_NAME"
2619SRC_SUBDIRS="$SRC_SUBDIRS"
2620TERMINFO="$TERMINFO"
2621TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX"
2622TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX"
2623TICS_NAME="$TICS_NAME"
2624TICS_SUFFIX="$TICS_SUFFIX"
2625TIC_PATH="$TIC_PATH"
2626TINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX"
2627TINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX"
2628TINFO_NAME="$TINFO_NAME"
2629TINFO_SUFFIX="$TINFO_SUFFIX"
2630UNALTERED_SYMS="$UNALTERED_SYMS"
2631USE_ARG_SUFFIX="$USE_ARG_SUFFIX"
2632USE_CFG_SUFFIX="$USE_CFG_SUFFIX"
2633ABI_SUFFIX="$ABI_SUFFIX"
2634USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
2635WILDCARD_SYMS="$WILDCARD_SYMS"
2636WITH_CURSES_H="$with_curses_h"
2637WITH_ECHO="${enable_echo:=yes}"
2638WITH_OVERWRITE="$with_overwrite"
2639cf_LIST_MODELS="$cf_list_models"
2640cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
2641cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
2642cf_cv_abi_default="$cf_cv_abi_default"
2643cf_cv_abi_version="$cf_cv_abi_version"
2644cf_cv_do_relink="$cf_cv_do_relink"
2645cf_cv_do_reranlib="$cf_cv_do_reranlib"
2646cf_cv_do_symlinks="$cf_cv_do_symlinks"
2647cf_cv_enable_lp64="$cf_cv_enable_lp64"
2648cf_cv_enable_opaque="$cf_cv_enable_opaque"
2649cf_cv_make_PHONY="$cf_cv_make_PHONY"
2650cf_cv_prog_CC_c_o=$cf_cv_prog_CC_c_o
2651cf_cv_prog_CXX_c_o=$cf_cv_prog_CXX_c_o
2652cf_cv_prog_gnat_correct=$cf_cv_prog_gnat_correct
2653cf_cv_rel_version="$cf_cv_rel_version"
2654cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
2655cf_cv_shared_soname='$cf_cv_shared_soname'
2656cf_cv_shlib_version="$cf_cv_shlib_version"
2657cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
2658cf_cv_system_name="$cf_cv_system_name"
2659cf_cv_term_driver="$with_term_driver"
2660cf_with_ada="$cf_with_ada"
2661cf_with_cxx_binding="$cf_with_cxx_binding"
2662cf_with_db_install="$cf_with_db_install"
2663cf_with_manpages="$cf_with_manpages"
2664cf_with_tests="$cf_with_tests"
2665host="$host"
2666target="$target"
2667verbose="$verbose"
2668with_shared_cxx="$with_shared_cxx"
2669
2670])
2671AC_SETUP_DEFS([cat])
2672AC_OUTPUT
2673${MAKE:-make} preinstall
2674