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