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