]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - configure.in
ncurses 5.9 - patch 20120421
[ncurses.git] / configure.in
index c5328db7b2ef8a1df4ccf98ae1dad50643289118..6593f59d3054ef8b96ccfe20c077356b751b5d7e 100644 (file)
@@ -1,5 +1,5 @@
 dnl***************************************************************************
-dnl Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
+dnl Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
 dnl                                                                          *
 dnl Permission is hereby granted, free of charge, to any person obtaining a  *
 dnl copy of this software and associated documentation files (the            *
@@ -28,14 +28,14 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: configure.in,v 1.527 2011/10/22 18:56:06 tom Exp $
+dnl $Id: configure.in,v 1.549 2012/04/01 00:09:52 tom Exp $
 dnl Process this file with autoconf to produce a configure script.
 dnl
 dnl See http://invisible-island.net/autoconf/ for additional information.
 dnl
 dnl ---------------------------------------------------------------------------
 AC_PREREQ(2.13.20020210)
-AC_REVISION($Revision: 1.527 $)
+AC_REVISION($Revision: 1.549 $)
 AC_INIT(ncurses/base/lib_initscr.c)
 AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
 
@@ -58,7 +58,18 @@ cf_user_CFLAGS="$CFLAGS"
 CF_CFG_DEFAULTS
 
 ###    Checks for programs.
-AC_PROG_CC
+AC_ARG_WITH(ada,
+       [  --without-ada           suppress check for Ada95, don't build demo],
+       [cf_with_ada=$withval],
+       [cf_with_ada=yes])
+if test x"$cf_with_ada" = xyes
+then
+       cf_PROG_CC="gnatgcc gcc cc"
+else
+       cf_PROG_CC="gcc cc"
+fi
+
+AC_PROG_CC($cf_PROG_CC)
 CF_GCC_VERSION
 
 AC_PROG_CPP
@@ -89,14 +100,16 @@ else
                cf_with_cxx=no; CXX=""; GXX="";])dnl
        AC_PROG_CXX
        popdef([AC_MSG_ERROR])dnl
-       # autoconf 2.5x removed the error - by hardcoding it to g++.
+       # autoconf 2.5x removed the error (hardcoding it to g++, or just blank)
        if test "$CXX" = "g++" ; then
                AC_PATH_PROG(CXX,g++)
        fi
-       if test "$CXX" = "g++" ; then
-               AC_MSG_WARN(ignoring hardcoded g++)
+       case "x$CXX" in #(vi
+       x|xg++)
+               AC_MSG_WARN([You don't have any C++ compiler, too bad])
                cf_with_cxx=no; CXX=""; GXX="";
-       fi
+               ;;
+       esac
 fi
 
 CF_GXX_VERSION
@@ -116,10 +129,6 @@ AC_ARG_WITH(cxx-binding,
 AC_MSG_RESULT($cf_with_cxx_binding)
 
 AC_MSG_CHECKING(if you want to build with Ada95)
-AC_ARG_WITH(ada,
-       [  --without-ada           suppress check for Ada95, don't build demo],
-       [cf_with_ada=$withval],
-       [cf_with_ada=yes])
 AC_MSG_RESULT($cf_with_ada)
 
 AC_MSG_CHECKING(if you want to install manpages)
@@ -301,9 +310,7 @@ AC_SUBST(LIB_NAME)
 LIB_DIR=../lib
 LIB_2ND=../../lib
 
-CF_LIB_PREFIX(cf_prefix)
-LIB_PREFIX=$cf_prefix
-AC_SUBST(LIB_PREFIX)
+CF_WITH_LIB_PREFIX(cf_prefix)
 
 LIB_SUFFIX=
 AC_SUBST(LIB_SUFFIX)
@@ -473,6 +480,26 @@ AC_MSG_RESULT($with_xterm_new)
 WHICH_XTERM=$with_xterm_new
 AC_SUBST(WHICH_XTERM)
 
+AC_MSG_CHECKING(if xterm backspace sends BS or DEL)
+AC_ARG_WITH(xterm-kbs,
+       [  --with-xterm-kbs=XXX     specify if xterm backspace sends BS or DEL],
+       [with_xterm_kbs=$withval],
+       [with_xterm_kbs=BS])
+case x$with_xterm_kbs in
+xyes|xno|xBS|xbs|x8)
+       with_xterm_kbs=BS
+       ;;
+xDEL|xdel|x127)
+       with_xterm_kbs=DEL
+       ;;
+*)
+       with_xterm_kbs=$withval
+       ;;
+esac
+AC_MSG_RESULT($with_xterm_kbs)
+XTERM_KBS=$with_xterm_kbs
+AC_SUBST(XTERM_KBS)
+
 MAKE_TERMINFO=
 if test "$use_database" = no ; then
        TERMINFO="${datadir}/terminfo"
@@ -700,14 +727,9 @@ AC_MSG_RESULT($with_widec)
 if test "$with_widec" = yes ; then
        LIB_SUFFIX="w${LIB_SUFFIX}"
        AC_DEFINE(USE_WIDEC_SUPPORT)
+       AC_DEFINE(NCURSES_WIDECHAR)
 
-       case "$CFLAGS $CPPFLAGS" in #(vi
-       *-D_XOPEN_SOURCE=500) #(vi
-               ;;
-       *)
-               CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED)
-               ;;
-       esac
+       CF_CHECK_WCHAR_H
 
        # with_overwrite=no
        NCURSES_CH_T=cchar_t
@@ -838,6 +860,15 @@ AC_ARG_WITH(ccharw-max,
 AC_MSG_RESULT($NCURSES_CCHARW_MAX)
 AC_SUBST(NCURSES_CCHARW_MAX)
 
+###   use option --with-tparm-arg to override tparm's argument type
+AC_MSG_CHECKING(for type of tparm args)
+AC_ARG_WITH(tparm-arg,
+       [  --with-tparm-arg=TYPE   override parameter type of tparm],
+       [NCURSES_TPARM_ARG="$withval"],
+       [NCURSES_TPARM_ARG=long])
+AC_MSG_RESULT($NCURSES_TPARM_ARG)
+AC_SUBST(NCURSES_TPARM_ARG)
+
 ### Enable compiling-in rcs id's
 AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
 AC_ARG_WITH(rcs-ids,
@@ -1193,19 +1224,14 @@ test "$with_wgetch_events" = yes && AC_DEFINE(NCURSES_WGETCH_EVENTS)
 CF_HELP_MESSAGE(Testing/development Options:)
 
 ###    use option --disable-echo to suppress full display compiling commands
-AC_MSG_CHECKING(if you want to display full commands during build)
-AC_ARG_ENABLE(echo,
-       [  --enable-echo           build: display "compiling" commands (default)],
-       [with_echo=$enableval],
-       [with_echo=yes])
-if test "$with_echo" = yes; then
+CF_DISABLE_ECHO
+if test "$enable_echo" = yes; then
        ECHO_LINK=
 else
        ECHO_LINK='@ echo linking $@ ... ;'
        test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent"
        test -n "$LIBTOOL_CXX" && LIBTOOL_CXX="$LIBTOOL_CXX --silent"
 fi
-AC_MSG_RESULT($with_echo)
 AC_SUBST(ECHO_LINK)
 
 ###    use option --enable-warnings to turn on all gcc warnings
@@ -1223,6 +1249,7 @@ if test "x$with_warnings" = "xyes"; then
        fi
 fi
 CF_GCC_ATTRIBUTES
+CF_ENABLE_STRING_HACKS
 
 ###    use option --enable-assertions to turn on generation of assertion code
 AC_MSG_CHECKING(if you want to enable runtime assertions)
@@ -1411,6 +1438,7 @@ else
        AC_FUNC_SETVBUF_REVERSED
 fi
 AC_TYPE_SIGNAL
+AC_CHECK_TYPE(intptr_t, long)
 CF_TYPE_SIGACTION
 CF_SIZECHANGE
 CF_FUNC_MEMMOVE
@@ -1462,50 +1490,14 @@ if test -n "$CXX" ; then
                ;;
        esac
 
-       AC_CHECK_HEADERS(iostream typeinfo)
-
-    if test x"$ac_cv_header_iostream" = xyes ; then
-        AC_MSG_CHECKING(if iostream uses std-namespace)
-        AC_TRY_COMPILE([
-#include <iostream>
-using std::endl;
-using std::cerr;],[
-cerr << "testing" << endl;
-],[cf_iostream_namespace=yes],[cf_iostream_namespace=no])
-        AC_MSG_RESULT($cf_iostream_namespace)
-        if test "$cf_iostream_namespace" = yes ; then
-            AC_DEFINE(IOSTREAM_NAMESPACE)
-        fi
-    fi
-
+       AC_CHECK_HEADERS(typeinfo)
+       CF_CXX_IOSTREAM_NAMESPACE
        CF_BOOL_DECL
        CF_BOOL_SIZE
        CF_ETIP_DEFINES
        CF_CPP_PARAM_INIT
        CF_CPP_STATIC_CAST
-
-       CXX_AR='$(AR)'
-       CXX_ARFLAGS='$(ARFLAGS)'
-       case $cf_cv_system_name in #(vi
-       irix*) #(vi
-           if test "$GXX" != yes ; then
-               CXX_AR='$(CXX)'
-               CXX_ARFLAGS='-ar -o'
-           fi
-           ;;
-       sco3.2v5*) #(vi
-           CXXLDFLAGS="-u main"
-           ;;
-       solaris2*)
-           if test "$GXX" != yes ; then
-               CXX_AR='$(CXX)'
-               CXX_ARFLAGS='-xar -o'
-           fi
-           ;;
-       esac
-       AC_SUBST(CXXLDFLAGS)
-       AC_SUBST(CXX_AR)
-       AC_SUBST(CXX_ARFLAGS)
+       CF_CXX_AR_FLAGS
 else
        cf_cxx_library=no
        cf_cv_builtin_bool=1
@@ -1579,18 +1571,7 @@ dnl At the moment we support no other Ada95 compiler.
                CF_PROG_GNAT
                if test "$cf_cv_prog_gnat_correct" = yes; then
                        CF_ADD_ADAFLAGS(-gnatpn)
-
-                       # make ADAFLAGS consistent with CFLAGS
-                       case "$CFLAGS" in
-                       *-g*)
-                               CF_ADD_ADAFLAGS(-g)
-                               ;;
-                       esac
-                       case "$CFLAGS" in
-                       *-O*)
-                               CF_ADD_ADAFLAGS(-O3)
-                               ;;
-                       esac
+                       CF_FIXUP_ADAFLAGS
 
                        CF_GNAT_GENERICS
                        CF_GNAT_SIGINT
@@ -1762,9 +1743,15 @@ if test "$with_termlib" != no ; then
        else
                TEST_ARGS="-l${TINFO_ARG_SUFFIX}"
                TEST_ARG2="-l${TINFO_ARG_SUFFIX}"
-               TICS_LIST="$SHLIB_LIST -l${TINFO_LIB_SUFFIX}"
+               if test "x$with_term_driver" != xno ; then
+                       TICS_LIST="$SHLIB_LIST -l${LIB_NAME}${DFT_ARG_SUFFIX}"
+                       TICS_LIBS="$TICS_LIBS -l${LIB_NAME}${DFT_ARG_SUFFIX}"
+                       TINFO_LIBS="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARGS"
+               else
+                       TICS_LIST="$SHLIB_LIST -l${TINFO_LIB_SUFFIX}"
+                       TINFO_LIBS="$TEST_ARGS"
+               fi
                TINFO_LDFLAGS="-L${LIB_DIR}"
-               TINFO_LIBS="$TEST_ARGS"
                SHLIB_LIST="$SHLIB_LIST -l${TINFO_LIB_SUFFIX}"
        fi
 else
@@ -1909,11 +1896,6 @@ ADAHTML_DIR=../../doc/html/ada
 AC_SUBST(ADAHTML_DIR)
 
 SUB_SCRIPTS=
-case $cf_cv_system_name in #(vi
-*mingw32*) #(vi
-       SUB_SCRIPTS="mk-dlls.sh"
-       ;;
-esac
 
 AC_OUTPUT( \
        include/MKterm.h.awk \
@@ -1925,7 +1907,7 @@ AC_OUTPUT( \
        $SUB_MAKEFILES \
        Makefile,[
 if test "x$cf_with_tests" != xno ; then
-       CF_PRG_RULES([$srcdir/test/mk-test.awk INSTALL=no ECHO_LINK="$ECHO_LINK"], test)
+       CF_PRG_RULES([$srcdir/test/mk-test.awk INSTALL=no ECHO_LINK="$ECHO_LD"], test)
 fi
 CF_LIB_RULES($SRC_SUBDIRS)
 
@@ -1941,10 +1923,11 @@ fi
 AWK="$AWK"
 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
 DFT_LWR_MODEL="$DFT_LWR_MODEL"
-ECHO_LINK="$ECHO_LINK"
+ECHO_LD="$ECHO_LD"
 LDCONFIG="$LDCONFIG"
 LIBTOOL_VERSION="$LIBTOOL_VERSION"
 LIB_NAME="$LIB_NAME"
+LIB_PREFIX="$LIB_PREFIX"
 LIB_SUBSETS="$LIB_SUBSETS"
 LIB_SUFFIX="$LIB_SUFFIX"
 LIB_TRACING="$LIB_TRACING"
@@ -1976,12 +1959,14 @@ cf_cv_enable_lp64="$cf_cv_enable_lp64"
 cf_cv_enable_opaque="$cf_cv_enable_opaque"
 cf_cv_prog_CC_c_o=$cf_cv_prog_CC_c_o
 cf_cv_prog_CXX_c_o=$cf_cv_prog_CXX_c_o
+cf_cv_prog_gnat_correct=$cf_cv_prog_gnat_correct
 cf_cv_rel_version="$cf_cv_rel_version"
 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
 cf_cv_shared_soname='$cf_cv_shared_soname'
 cf_cv_shlib_version="$cf_cv_shlib_version"
 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
 cf_cv_system_name="$cf_cv_system_name"
+cf_cv_term_driver="$with_term_driver"
 cf_with_ada="$cf_with_ada"
 cf_with_cxx_binding="$cf_with_cxx_binding"
 cf_with_manpages="$cf_with_manpages"