]> ncurses.scripts.mit.edu Git - ncurses.git/blob - configure.in
ncurses 4.1
[ncurses.git] / configure.in
1 dnl*****************************************************************************
2 dnl Copyright 1996,1997 by Thomas E. Dickey <dickey@clark.net>                 *
3 dnl All Rights Reserved.                                                       *
4 dnl                                                                            *
5 dnl Permission to use, copy, modify, and distribute this software and its      *
6 dnl documentation for any purpose and without fee is hereby granted, provided  *
7 dnl that the above copyright notice appear in all copies and that both that    *
8 dnl copyright notice and this permission notice appear in supporting           *
9 dnl documentation, and that the name of the above listed copyright holder(s)   *
10 dnl not be used in advertising or publicity pertaining to distribution of the  *
11 dnl software without specific, written prior permission. THE ABOVE LISTED      *
12 dnl COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,  *
13 dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO     *
14 dnl EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY         *
15 dnl SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER       *
16 dnl RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF       *
17 dnl CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN        *
18 dnl CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.                   *
19 dnl*****************************************************************************
20 dnl $Id: configure.in,v 1.64 1997/05/10 15:26:07 tom Exp $
21 dnl Process this file with autoconf to produce a configure script.
22 AC_PREREQ(2.12)
23 AC_REVISION($Revision: 1.64 $)
24 AC_INIT(ncurses/lib_initscr.c)
25
26 NC_VERSION
27 NC_SYSTYPE
28
29 # We need a configure script only when compiling as part of GNU C library.
30 # Here we have to generate one of the files we need while compiling.
31 #
32 # The only problem is that users of the package might think they have to
33 # run configure themself and find it irritating when nothing happens.
34 #
35 # So we try here to find out whether we are called from the glibc configure
36 # or by a user.
37 #
38 dnl Check if we are a drop-in addition to glibc.
39 AC_ARG_ENABLE(add-ons, dnl
40 [  --enable-add-ons=DIR... used to check if we are a glibc add-on.],
41                 [glibc_add_on=yes],
42                 [glibc_add_on=])
43
44 dnl We need to use [ and ] for other purposes for a while now.
45 changequote(,)dnl
46 if test x"$glibc_add_on" = "xyes" ; then
47 if test -f $srcdir/../glibcbug.in; then
48   rm -f $srcdir/Banner
49   # We are in glibc.
50   rm -f $srcdir/Makefile
51   cp $srcdir/Makefile.glibc $srcdir/Makefile
52   echo "ncurses `grep \"^[      ]*ncurses-version[      ]*=.*$\" \
53                 $srcdir/Makefile | sed -e \
54                 's/^[   ]*ncurses-version[      ]*=[    ]*\([^  ^ ]*\)[         ]*$/\1/'`" > $srcdir/Banner
55   exit 0
56 fi
57 fi
58 changequote([,])dnl
59
60 ###     Save the given $CFLAGS to allow user-override.
61 nc_user_CFLAGS="$CFLAGS"
62
63 ###     Derive the system name, as a check for reusing the autoconf cache
64 system_name="`(uname -s -r || hostname || echo unknown) 2>/dev/null`"
65 if test -n "$system_name" ; then
66         AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
67 else
68         system_name="`(hostname) 2>/dev/null`"
69 fi
70 AC_CACHE_VAL(nc_cv_system_name,[nc_cv_system_name="$system_name"])
71 test -z "$system_name" && system_name="$nc_cv_system_name"
72 test -n "$nc_cv_system_name" && AC_MSG_RESULT("Configuring for $nc_cv_system_name")
73
74 if test ".$system_name" != ".$nc_cv_system_name" ; then
75         AC_MSG_RESULT("Cached system name does not agree with actual")
76         AC_ERROR("Please remove config.cache and try again.")
77 fi
78
79 ###     Default install-location
80 NC_CFG_DEFAULTS
81
82 ###     Checks for programs.
83 AC_PROG_CC
84 if test -n "$GCC" ; then
85 AC_MSG_CHECKING(version of gcc)
86 eval "$CC --version"
87 fi
88 AC_PROG_CPP
89 AC_PROG_GCC_TRADITIONAL
90 AC_ISC_POSIX
91
92 dnl DEFECT in autoconf 2.12:    an attempt to set policy, this breaks the
93 dnl                             configure script by not letting us test if C++
94 dnl                             is present, making this option necessary.
95 AC_ARG_WITH(cxx,
96         [  --without-cxx           suppress check for C++])
97 if test "X$withval" != Xno ; then
98 AC_PROG_CXX
99 fi
100 changequote(,)dnl
101 if test -n "$GXX" ; then case "`${CXX-g++} --version`" in 1*|2.[0-6]*) GXX=""; CXX=""; ac_cv_prog_gxx=no; nc_cxx_library=no ; echo No: templates do not work;; esac; fi
102 changequote([,])dnl
103 AC_PROG_AWK
104 AC_PROG_MAKE_SET
105 NC_PROG_INSTALL
106 AC_PROG_LN_S
107 AC_PROG_RANLIB
108 AC_CHECK_PROGS(LINT, tdlint lint alint)
109 AC_CHECK_PROGS(MAN, man man_db)
110 AC_SUBST(LINT_OPTS)
111
112 dnl These are standard among *NIX systems, but not when cross-compiling
113 NC_SUBST(loader,LD,ld)
114 NC_SUBST(archiver,AR,ar)
115 NC_SUBST(archiver options,AR_OPTS,rv)
116
117 NC_MAKEFLAGS
118 NC_MAN_PAGES
119
120 dnl Special option for use by system-builders: the install-prefix is used to
121 dnl adjust the location into which the actual install is done, so that an
122 dnl archive can be built without modifying the host system's configuration.
123 AC_ARG_WITH(install-prefix,
124         [  --with-install-prefix   prefixes actual install-location],
125         [case "$withval" in #(vi
126         yes|no) #(vi
127                 ;;
128         *)      INSTALL_PREFIX="$withval"
129                 ;;
130         esac])
131 AC_SUBST(INSTALL_PREFIX)
132
133 ### Options to allow the user to specify the set of libraries which are used.
134 ### Use "--without-normal --with-shared" to allow the default model to be
135 ### shared, for example.
136 nc_list_models=""
137 AC_ARG_WITH(shared,
138         [  --with-shared           generate shared-libraries],
139         [test "$withval" = "yes" && nc_list_models="$nc_list_models shared"])
140 AC_ARG_WITH(normal,
141         [  --with-normal           generate normal-libraries (default)],
142         [test "$withval" = "yes" && nc_list_models="$nc_list_models normal"],
143         [nc_list_models="$nc_list_models normal"])
144 AC_ARG_WITH(debug,
145         [  --with-debug            generate debug-libraries (default)],
146         [test "$withval" = "yes" && nc_list_models="$nc_list_models debug"],
147         [nc_list_models="$nc_list_models debug"])
148 AC_ARG_WITH(profile,
149         [  --with-profile          generate profile-libraries],
150         [test "$withval" = "yes" && nc_list_models="$nc_list_models profile"])
151
152 ### Checks for special libraries, must be done up-front.
153 AC_ARG_WITH(dbmalloc,
154         [  --with-dbmalloc         test: use Conor Cahill's dbmalloc library],
155         [AC_CHECK_LIB(dbmalloc,debug_malloc)])
156 AC_ARG_WITH(dmalloc,
157         [  --with-dmalloc          test: use Gray Watson's dmalloc library],
158         [AC_CHECK_LIB(dmalloc,dmalloc_debug)])
159 AC_ARG_WITH(gpm,
160         [  --with-gpm              use Alessandro Rubini's GPM library],
161         [AC_CHECK_LIB(gpm,Gpm_Open,[
162                 EXTRA_LIBS="$EXTRA_LIBS -lgpm -lncurses"
163                 AC_DEFINE(HAVE_LIBGPM)
164                 AC_CHECK_HEADERS(gpm.h)
165         ],,-lcurses -ltermcap)])
166
167 AC_SUBST(EXTRA_LIBS)
168
169 AC_MSG_CHECKING(for specified models)
170 test -z "$nc_list_models" && nc_list_models=normal
171 AC_MSG_RESULT($nc_list_models)
172
173 ### Use the first model as the default, and save its suffix for use in building
174 ### up test-applications.
175 DFT_LWR_MODEL=`echo $nc_list_models | $AWK '{print $1}'`
176 NC_UPPERCASE($DFT_LWR_MODEL,DFT_UPR_MODEL)dnl
177 NC_LIB_SUFFIX($DFT_LWR_MODEL,DFT_DEP_SUFFIX)dnl
178 NC_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
179 NC_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
180 AC_SUBST(DFT_OBJ_SUBDIR)dnl     the default object-directory ("obj")
181 AC_SUBST(DFT_LWR_MODEL)dnl      the default model ("normal")
182 AC_SUBST(DFT_UPR_MODEL)dnl      the default model ("NORMAL")
183 AC_SUBST(DFT_DEP_SUFFIX)dnl     the corresponding library-suffix (".a")
184 AC_SUBST(DFT_ARG_SUFFIX)dnl     the string to append to "-lncurses" ("")
185 AC_SUBST(nc_list_models)dnl     the complete list of models ("normal debug")
186
187 LIB_NAME=ncurses
188 AC_SUBST(LIB_NAME)
189
190 LIB_DIR=../lib
191 LIB_PREFIX=$LIB_DIR/lib
192 AC_SUBST(LIB_PREFIX)
193
194 dnl Not all ports of gcc support the -g option
195 dnl autoconf 2.12 uses different symbol for -g option than autoconf 2.10, etc.
196
197 if test X"$CC_G_OPT" = X"" ; then
198         CC_G_OPT='-g'
199         test -n "$GCC" && test "${ac_cv_prog_cc_g}${ac_cv_prog_gcc_g}" != yes && CC_G_OPT=''
200 fi
201 AC_SUBST(CC_G_OPT)
202
203 if test X"$CXX_G_OPT" = X"" ; then
204         CXX_G_OPT='-g'
205         test -n "$GXX" && test "${ac_cv_prog_cxx_g}${ac_cv_prog_gxx_g}" != yes && CXX_G_OPT=''
206 fi
207 AC_SUBST(CXX_G_OPT)
208
209 case $DFT_LWR_MODEL in
210 normal)  LD_MODEL=''   ;;
211 debug)   LD_MODEL=$CC_G_OPT ;;
212 profile) LD_MODEL='-pg';;
213 shared)  LD_MODEL=''   ;;
214 esac
215 AC_SUBST(LD_MODEL)dnl           the type of link (e.g., -g or -pg)
216 NC_SHARED_OPTS
217
218 if test "$CC_SHARED_OPTS" = "unknown"; then
219         for model in $nc_list_models; do
220                 if test "$model" = "shared"; then
221                         echo '** Shared libraries are not supported in this version'
222                         exit 1
223                 fi
224         done
225 fi
226
227 ###     use option --disable-overwrite to leave out the link to -lcurses
228 AC_MSG_CHECKING(include directory)
229 AC_ARG_ENABLE(overwrite,
230         [  --disable-overwrite     leave out the link to -lcurses],
231         [with_overwrite=$enableval
232          test "$with_overwrite" = no && \
233          test "x$includedir" = 'x${prefix}/include' && \
234                 includedir='$(prefix)/include/ncurses'
235         ],
236         [with_overwrite=yes])
237 AC_MSG_RESULT($includedir)
238
239 ###     use option --enable-big-core to make tic run faster on big machines
240 AC_MSG_CHECKING(if big-core option selected)
241 AC_ARG_ENABLE(big-core,
242         [  --enable-big-core       assume machine has lots of memory],
243         [with_big_core=$enableval],
244         [with_big_core=no])
245 AC_MSG_RESULT($with_big_core)
246 test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
247
248 ###     use option --enable-termcap to compile in the termcap fallback support
249 AC_MSG_CHECKING(if termcap-fallback support is needed)
250 AC_ARG_ENABLE(termcap,
251         [  --enable-termcap        compile in termcap fallback support],
252         [with_termcap=$enableval],
253         [with_termcap=no])
254 AC_MSG_RESULT($with_termcap)
255
256 if test "$with_termcap" != "yes" ; then
257         AC_DEFINE(PURE_TERMINFO)
258 else
259
260 ###     use option --enable-getcap to use a hacked getcap for reading termcaps
261 AC_MSG_CHECKING(if fast termcap-loader is needed)
262 AC_ARG_ENABLE(getcap,
263         [  --enable-getcap         fast termcap load, no xrefs to terminfo],
264         [with_getcap=$enableval],
265         [with_getcap=no])
266 AC_MSG_RESULT($with_getcap)
267 test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP)
268
269 AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
270 AC_ARG_ENABLE(getcap-cache,
271         [  --enable-getcap-cache   cache translated termcaps in ~/.terminfo],
272         [with_getcap_cache=$enableval],
273         [with_getcap_cache=no])
274 AC_MSG_RESULT($with_getcap_cache)
275 test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE)
276
277 fi
278
279 ###   use option --enable-symlinks to make tic use symlinks, not hard links
280 AC_MSG_CHECKING(if tic should use symbolic links)
281 AC_ARG_ENABLE(symlinks,
282         [  --enable-symlinks       make tic use symbolic links not hard links],
283         [with_symlinks=$enableval],
284         [with_symlinks=no])
285 AC_MSG_RESULT($with_symlinks)
286 test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS)
287
288 ###   use option --enable-bsdpad to have tputs process BSD-style prefix padding
289 AC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
290 AC_ARG_ENABLE(bsdpad,
291         [  --enable-bsdpad         recognize BSD-style prefix padding],
292         [with_bsdpad=$enableval],
293         [with_bsdpad=no])
294 AC_MSG_RESULT($with_bsdpad)
295 test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS)
296
297 ###   use option --enable-const to turn on use of const beyond that in XSI.
298 AC_MSG_CHECKING(for extended use of const keyword)
299 AC_ARG_ENABLE(const,
300         [  --enable-const          compile with extra/non-standard const],
301         [with_ext_const=$enableval],
302         [with_ext_const=no])
303 AC_MSG_RESULT($with_ext_const)
304 test "$with_ext_const" = yes && AC_DEFINE(NCURSES_CONST,const)
305
306 ### Enable compiling-in rcs id's
307 AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
308 AC_ARG_WITH(rcs-ids,
309         [  --with-rcs-ids          build: compile-in RCS identifiers],
310         [with_rcs_ids=$enableval],
311         [with_rcs_ids=no])
312 AC_MSG_RESULT($with_rcs_ids)
313 test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
314
315 ###     use option --disable-echo to suppress full display compiling commands
316 AC_ARG_ENABLE(echo,
317         [  --enable-echo           build: display \"compiling\" commands (default)],
318         [with_echo=$enableval],
319         [with_echo=yes])
320 if test "$with_echo" = yes; then
321         ECHO_LINK=
322 else
323         ECHO_LINK='@ echo linking $@ ... ;'
324 fi
325 AC_SUBST(ECHO_LINK)
326
327 ###     use option --enable-warnings to turn on all gcc warnings
328 AC_ARG_ENABLE(warnings,
329         [  --enable-warnings       build: turn on GCC compiler warnings],
330         [with_warnings=$enableval])
331 if test -n "$with_warnings"; then
332         ADAFLAGS="$ADAFLAGS -gnatg"
333         NC_GCC_WARNINGS
334 fi
335 NC_GCC_ATTRIBUTES
336
337 ###     use option --enable-assertions to turn on generation of assertion code
338 AC_ARG_ENABLE(assertions,
339         [  --enable-assertions     test: turn on generation of assertion code],
340         [with_assertions=$enableval])
341 if test -n "$GCC"
342 then
343         if test -z "$with_assertions"
344         then
345                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
346         else
347                 ADAFLAGS="$ADAFLAGS -gnata"
348         fi
349 fi
350
351 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
352 AC_ARG_ENABLE(leaks,
353         [  --disable-leaks         test: suppress permanent memory-leaks],
354         [test $enableval = no && AC_DEFINE(NO_LEAKS)])
355 AC_DEFINE(HAVE_NC_ALLOC_H)
356
357 ###     use option --enable-expanded to generate certain macros as functions
358 AC_ARG_ENABLE(expanded,
359         [  --enable-expanded       test: generate functions for certain macros],
360         [test $enableval = yes && AC_DEFINE(NCURSES_EXPANDED)])
361
362 ###     use option --disable-macros to suppress macros in favor of functions
363 AC_ARG_ENABLE(macros,
364         [  --disable-macros        test: use functions rather than macros],
365         [test $enableval = no && AC_DEFINE(NCURSES_NOMACROS)])
366
367 ###     Checks for libraries.
368 AC_CHECK_FUNC(gettimeofday,
369         AC_DEFINE(HAVE_GETTIMEOFDAY),[
370 AC_CHECK_LIB(bsd, gettimeofday,
371         AC_DEFINE(HAVE_GETTIMEOFDAY)
372         LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
373
374 ###     Checks for header files.
375 AC_STDC_HEADERS
376 AC_HEADER_DIRENT
377 NC_REGEX
378
379 dnl These are some other potentially nonportable headers.
380 AC_CHECK_HEADERS( \
381 fcntl.h \
382 getopt.h \
383 libc.h \
384 limits.h \
385 locale.h \
386 sys/bsdtypes.h \
387 sys/ioctl.h \
388 sys/param.h \
389 poll.h \
390 sys/select.h \
391 sys/stropts.h \
392 sys/time.h \
393 sys/times.h \
394 termio.h \
395 termios.h \
396 ttyent.h \
397 unistd.h \
398 values.h \
399 )
400
401 # check for HPUX's ANSI compiler
402 if test $nc_cv_systype = HP_UX; then
403 if test -z "$GCC"; then
404         AC_MSG_CHECKING([for HP/UX ANSI compiler])
405         nc_save_CFLAGS="$CFLAGS"
406         CFLAGS="$CFLAGS -Aa"
407         AC_TRY_COMPILE([],[void (*f)(void)=0],[nc_hpux_cc=yes],[nc_hpux_cc=no])
408         AC_MSG_RESULT($nc_hpux_cc)
409         if test $nc_hpux_cc = yes; then
410                 AC_DEFINE(_HPUX_SOURCE)
411         else
412                 CFLAGS="$nc_save_CFLAGS"
413         fi
414 fi;fi
415
416 # check for ISC (this may also define _POSIX_SOURCE)
417 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
418 if test "$ISC" = yes ; then
419         AC_CHECK_LIB(cposix,main)
420         AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
421         AC_CHECK_HEADERS( sys/termio.h )
422 fi
423
424 # check for SCO.  this is a hack, and should be split into individual
425 # features -- the sys/time.h and select.h conflict, and the need for
426 # ptem.h due to winsize struct.
427 AC_CHECKING([for SCO by checking on /usr/bin/scosh])
428 AC_PROGRAM_CHECK(COULD_BE_SCO, [scosh], maybe, maybenot)
429 if test "$COULD_BE_SCO" = "maybe"
430 then
431         AC_DEFINE(SYSTEM_LOOKS_LIKE_SCO)
432 fi
433
434 ###     checks for compiler characteristics
435 AC_LANG_C
436 AC_C_CONST
437 AC_C_INLINE
438 test $ac_cv_c_inline != no && AC_DEFINE(CC_HAS_INLINE_FUNCS)
439
440 ###     Checks for external-data
441 NC_ERRNO
442 NC_SYS_ERRLIST
443 NC_LINK_DATAONLY
444 NC_SPEED_TYPE
445
446 ###     Checks for library functions.
447 AC_CHECK_FUNCS( \
448 getttynam \
449 memccpy \
450 poll \
451 select \
452 setbuf \
453 setbuffer \
454 setvbuf \
455 sigaction \
456 sigvec \
457 strdup \
458 tcgetattr \
459 times \
460 usleep \
461 vfscanf \
462 vsscanf \
463 )
464
465 if test $ac_cv_func_sigaction = yes; then
466 AC_MSG_CHECKING(whether sigaction needs _POSIX_SOURCE)
467 AC_TRY_COMPILE([#include <sys/types.h>
468 #include <signal.h>], [struct sigaction act;],
469   sigact_bad=no, sigact_bad=yes AC_DEFINE(SVR4_ACTION))
470 AC_MSG_RESULT($sigact_bad)
471 fi
472
473 # some machines require _POSIX_SOURCE to completely define struct termios
474 if test $ac_cv_header_termios_h = yes ; then
475         case "$CFLAGS" in
476         *-D_POSIX_SOURCE*)
477                 termios_bad=dunno ;;
478         *)      termios_bad=maybe ;;
479         esac
480         if test $termios_bad = maybe ; then
481         AC_MSG_CHECKING(whether termios.h needs _POSIX_SOURCE)
482         AC_TRY_COMPILE([#include <termios.h>],
483                 [struct termios foo; int x = foo.c_iflag],
484                 termios_bad=no, [
485                 AC_TRY_COMPILE([
486 #define _POSIX_SOURCE
487 #include <termios.h>],
488                         [struct termios foo; int x = foo.c_iflag],
489                         termios_bad=unknown,
490                         termios_bad=yes AC_DEFINE(SVR4_TERMIO))
491                         ])
492         AC_MSG_RESULT($termios_bad)
493         fi
494 fi
495
496 dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
497 if test "$cross_compiling" = yes ; then
498         AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
499 else
500         AC_FUNC_SETVBUF_REVERSED
501 fi
502 AC_TYPE_SIGNAL
503 NC_TYPE_SIGACTION
504 NC_TIOCGWINSZ
505
506 dnl FIXME checks we don't do (but neither does the old Configure script):
507 case "$nc_cv_systype" in
508 Linux)
509         AC_DEFINE(GOOD_SELECT)
510         ;;
511 esac
512
513 dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
514 if test -z "$nc_user_CFLAGS" ; then
515         NC_STRIP_G_OPT(CFLAGS)
516         NC_STRIP_G_OPT(CXXFLAGS)
517 fi
518
519 dnl Check for C++ compiler characteristics (and ensure that it's there!)
520 if test -n "$CXX" ; then
521         AC_CHECK_PROG(CXX_EXISTS, $CXX, yes, no)
522 else
523         ac_cv_prog_CXX_EXISTS=no
524 fi
525 if test "$ac_cv_prog_CXX_EXISTS" = yes; then
526         AC_LANG_CPLUSPLUS
527         NC_CXX_LIBRARY
528         AC_CHECK_HEADERS(builtin.h typeinfo)
529         NC_BOOL_DECL
530         NC_BOOL_SIZE
531 else
532         nc_cxx_library=no
533         AC_CACHE_VAL(nc_cv_builtin_bool,[nc_cv_builtin_bool=0])
534         AC_CACHE_VAL(nc_cv_sizeof_bool,[nc_cv_sizeof_bool=int])
535 fi
536 AC_SUBST(CXXLIBS)
537
538 dnl Check for availability of GNU Ada Translator (GNAT).
539 dnl At the moment we support no other Ada95 compiler.
540 nc_ada_make=gnatmake
541 AC_CHECK_PROG(gnat_exists, $nc_ada_make, yes, no)
542 if test "$ac_cv_prog_gnat_exists" = no; then
543    nc_ada_make=
544 else
545    NC_GNAT_VERSION
546    AC_CHECK_PROG(m4_exists, m4, yes, no)
547    if test "$ac_cv_prog_m4_exists" = no; then
548       ac_cv_prog_gnat_correct=no
549       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
550    fi
551 fi
552 if test "$ac_cv_prog_gnat_correct" = yes; then
553    nc_ada_compiler=gcc
554    nc_ada_package=terminal_interface
555    AC_SUBST(nc_ada_make)
556    AC_SUBST(nc_ada_compiler)
557    AC_SUBST(nc_ada_package)
558    AC_SUBST(ADAFLAGS)
559 fi
560
561 ### It's not possible to appease gcc 2.6.3's conversion-warnings if we're
562 ### using a 'char' for bools.  gcc 2.7.0's conversion-warnings are broken too
563 ### badly to consider using for development purposes, but 2.5.8 is okay.
564 if test -n "$with_warnings"; then
565         if test -n "$GCC"; then
566                 case "`$CC --version`" in
567                 2.6.3)
568                         if test "$nc_cv_sizeof_bool" != "char"; then
569                                 nc_warn_CFLAGS="$nc_warn_CFLAGS -Wconversion"
570                         fi
571                         ;;
572                 2.5*)
573                         nc_warn_CFLAGS="$nc_warn_CFLAGS -Wconversion"
574                         ;;
575                 esac
576         fi
577 fi
578
579 ### Construct the list of include-directories to be generated
580 NC_INCLUDE_DIRS
581 NC_ADA_INCLUDE_DIRS
582
583 ### Construct the list of subdirectories for which we'll customize makefiles
584 ### with the appropriate compile-rules.
585 NC_SRC_MODULES(ncurses progs panel menu form)
586 NC_DIRS_TO_MAKE
587
588 ### Now that we're done running tests, add the compiler-warnings, if any
589 CFLAGS="$CFLAGS $nc_warn_CFLAGS"
590
591 ################################################################################
592 changequote({,})dnl
593 AC_OUTPUT(include/config_h \
594         include/MKterm.h.awk \
595         include/curses.h \
596         include/termcap.h \
597         include/unctrl.h \
598         $SUB_MAKEFILES \
599         Makefile,{
600
601 NC_LIB_RULES
602
603 ### Special editing.  We generate ncurses_cfg.h directly to allow all filenames
604 ### to be MSDOS-compatible, as well as to make the list of definitions be
605 ### dynamically determined by the configuration script -- a consideration when
606 ### doing type-clean development testing.
607
608 echo creating include/ncurses_cfg.h
609 rm -f include/ncurses_cfg.h
610 echo "/* generated by configure-script
611  * On host: $SYS_NAME
612  */
613 #ifndef NC_CONFIG_H
614 #define NC_CONFIG_H" >include/ncurses_cfg.h
615 sed     -e '/^ -D/!d' \
616         -e 's/ -D/\
617 #define /g' \
618         -e 's/\(#define [A-Za-z_][A-Za-z0-9_]*\)=/\1    /g' \
619         -e 's/\\//g' \
620         include/config_h | sort >>include/ncurses_cfg.h
621 echo "
622         /* The C compiler may not treat these properly, but C++ has to */
623 #ifdef __cplusplus
624 #undef const
625 #undef inline
626 #else
627 #if defined(lint) || defined(TRACE)
628 #undef inline
629 #define inline /* nothing */
630 #endif
631 #endif
632
633 #endif /* NC_CONFIG_H */" >> include/ncurses_cfg.h
634 echo removing include/config_h
635 rm include/config_h
636 },{
637 ### Special initialization commands, used to pass information from the
638 ### configuration-run into config.status
639
640 SYS_NAME="`(uname -a || hostname) 2>/dev/null | sed 1q`"
641 if test -z "\$SYS_NAME"; then SYS_NAME=unknown;fi
642
643 AWK=$AWK
644 DFT_LWR_MODEL="$DFT_LWR_MODEL"
645 NC_LIST_MODELS="$nc_list_models"
646 WITH_ECHO="$with_echo"
647 WITH_OVERWRITE="$with_overwrite"
648 SRC_SUBDIRS="$SRC_SUBDIRS"
649 nc_cxx_library="$nc_cxx_library"
650 nc_cv_systype="$nc_cv_systype"
651 nc_cv_rel_version="$nc_cv_rel_version"
652 nc_cv_abi_version="$nc_cv_abi_version"
653 nc_cv_do_symlinks="$nc_cv_do_symlinks"
654 nc_cv_rm_so_locs="$nc_cv_rm_so_locs"
655
656 })dnl
657 changequote([,])dnl
658 make preinstall