]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - configure.in
ncurses 6.2 - patch 20201227
[ncurses.git] / configure.in
index 7454c9aeaf63e1f7df3b13c2061c22ac25e0011f..4876fae6ed2e46aa339fefdeafbe1daa87be9a16 100644 (file)
@@ -29,7 +29,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: configure.in,v 1.709 2020/05/31 20:04:09 tom Exp $
+dnl $Id: configure.in,v 1.726 2020/12/05 21:29:46 tom Exp $
 dnl Process this file with autoconf to produce a configure script.
 dnl
 dnl For additional information, see
@@ -38,7 +38,7 @@ dnl     https://invisible-island.net/autoconf/my-autoconf.html
 dnl
 dnl ---------------------------------------------------------------------------
 AC_PREREQ(2.52.20200111)
-AC_REVISION($Revision: 1.709 $)
+AC_REVISION($Revision: 1.726 $)
 AC_INIT(ncurses/base/lib_initscr.c)
 AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
 
@@ -311,6 +311,14 @@ CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-c
 # If we're cross-compiling, allow the user to override the tools and their
 # options.  The configure script is oriented toward identifying the host
 # compiler, etc., but we need a build compiler to generate parts of the source.
+
+case $cf_cv_system_name in
+(*-msvc*)
+       LDFLAGS="$LDFLAGS user32.lib"
+       export LDFLAGS
+       ;;
+esac
+
 CF_BUILD_CC
 
 ###############################################################################
@@ -646,27 +654,32 @@ case ".$with_fallback" in
        ;;
 esac
 
-USE_FALLBACKS=
-test -z "$FALLBACK_LIST" && USE_FALLBACKS="#"
-AC_SUBST(FALLBACK_LIST)
-AC_SUBST(USE_FALLBACKS)
-
 # The fallback feature in ncurses relies upon tic/infocmp outside the build
 # tree for generating the terminal descriptions that will be compiled into the
 # library.  If your toolchain is old, it may not handle current terminal
 # databases.  Use configure-options to point to the tools which will be used,
 # rather than the first ones found on the $PATH.
+AC_CHECK_TOOL(TIC, tic)
+AC_CHECK_TOOL(INFOCMP, infocmp)
 if test -n "$FALLBACK_LIST"
 then
        CF_WITH_PATH_PROG(TIC,     tic,     [for fallbacks], $PATH:/usr/local/ncurses/bin)
        CF_WITH_PATH_PROG(INFOCMP, infocmp, [for fallbacks], $PATH:/usr/local/ncurses/bin)
-else
-       : ${TIC:=tic}
-       : ${INFOCMP:=infocmp}
+       test -z "$TIC" && FALLBACK_LIST=
+       test -z "$INFOCMP" && FALLBACK_LIST=
+       if test -z "$FALLBACK_LIST"
+       then
+               AC_MSG_WARN(ignoring fallback option because tic/infocmp are not available)
+       fi
 fi
 AC_SUBST(TIC)
 AC_SUBST(INFOCMP)
 
+USE_FALLBACKS=
+test -z "$FALLBACK_LIST" && USE_FALLBACKS="#"
+AC_SUBST(FALLBACK_LIST)
+AC_SUBST(USE_FALLBACKS)
+
 AC_MSG_CHECKING(if you want modern xterm or antique)
 AC_ARG_WITH(xterm-new,
        [  --without-xterm-new     specify if xterm terminfo should be old version],
@@ -1534,7 +1547,39 @@ AC_ARG_ENABLE(wgetch-events,
        [with_wgetch_events=$enableval],
        [with_wgetch_events=no])
 AC_MSG_RESULT($with_wgetch_events)
-test "x$with_wgetch_events" = xyes && AC_DEFINE(NCURSES_WGETCH_EVENTS,1,[Define to 1 to compile with wgetch-events code])
+if test "x$with_wgetch_events" = xyes ; then
+       AC_DEFINE(NCURSES_WGETCH_EVENTS,1,[Define to 1 to compile with wgetch-events code])
+       NCURSES_WGETCH_EVENTS=1
+else
+       NCURSES_WGETCH_EVENTS=0
+fi
+AC_SUBST(NCURSES_WGETCH_EVENTS)
+
+case $cf_cv_system_name in
+(*mingw32*|*mingw64*|*-msvc*)
+       AC_MSG_CHECKING(if you want experimental-Windows driver)
+       AC_ARG_ENABLE(exp-win32,
+               [  --enable-exp-win32      compile with experimental-Windows driver],
+               [with_exp_win32=$enableval],
+               [with_exp_win32=no])
+       AC_MSG_RESULT($with_exp_win32)
+       if test "x$with_exp_win32" = xyes
+       then
+               AC_DEFINE(EXP_WIN32_DRIVER,1,[Define to 1 to compile with experimental win32 driver])
+               EXP_WIN32_DRIVER=1
+               INTERNALS_HDR='[$](INCDIR)/nc_win32.h'
+       else
+               INTERNALS_HDR='[$](INCDIR)/nc_mingw.h'
+               EXP_WIN32_DRIVER=0
+       fi
+       ;;
+(*)
+       EXP_WIN32_DRIVER=0
+       INTERNALS_HDR=
+       ;;
+esac
+AC_SUBST(EXP_WIN32_DRIVER)
+AC_SUBST(INTERNALS_HDR)
 
 ###############################################################################
 CF_HELP_MESSAGE(Testing/development Options:)
@@ -1569,20 +1614,14 @@ fi
 AC_SUBST(INSTALL_OPT_P)
 
 ###    use option --enable-warnings to turn on all gcc warnings
-AC_MSG_CHECKING(if you want to see compiler warnings)
-AC_ARG_ENABLE(warnings,
-       [  --enable-warnings       build: turn on GCC compiler warnings],
-       [with_warnings=$enableval])
-AC_MSG_RESULT($with_warnings)
+CF_ENABLE_WARNINGS(Wno-unknown-pragmas Wswitch-enum,yes)
 
 if test "x$with_warnings" = "xyes"; then
        CF_ADD_ADAFLAGS(-gnatg)
-       CF_GCC_WARNINGS(Wno-unknown-pragmas Wswitch-enum)
        if test "x$cf_with_cxx" = xyes ; then
                CF_GXX_WARNINGS(Wno-unused)
        fi
 fi
-CF_GCC_ATTRIBUTES
 CF_ENABLE_STRING_HACKS
 
 ###    use option --enable-assertions to turn on generation of assertion code
@@ -1649,7 +1688,11 @@ CF_DISABLE_GNAT_PROJECTS
 ###    Checks for libraries.
 case $cf_cv_system_name in
 (*mingw32*|*mingw64*)
+       if test "x$with_exp_win32" = xyes ; then
+       CPPFLAGS="$CPPFLAGS -DWINVER=0x0600 -DWIN32_LEAN_AND_MEAN"
+       else
        CPPFLAGS="$CPPFLAGS -DWINVER=0x0501 -DWIN32_LEAN_AND_MEAN"
+       fi
        # Note: WINVER may be a problem with Windows 10
        ;;
 (*)
@@ -1679,7 +1722,6 @@ limits.h \
 locale.h \
 math.h \
 poll.h \
-sys/bsdtypes.h \
 sys/ioctl.h \
 sys/param.h \
 sys/poll.h \
@@ -1701,13 +1743,6 @@ then
        AC_MSG_WARN(The NCURSES_TRACE environment variable is not supported with this configuration)
 fi
 
-# check for ISC (this may also define _POSIX_SOURCE)
-# Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
-if test "x$ISC" = xyes ; then
-       AC_CHECK_LIB(cposix,main)
-       AC_CHECK_LIB(inet,bzero,CF_ADD_LIB(inet))dnl also 'select()'
-fi
-
 CF_SYS_TIME_SELECT
 
 ###    checks for compiler characteristics
@@ -2020,13 +2055,25 @@ if test "$with_term_driver" != no ; then
        LIB_SUBSETS="${LIB_SUBSETS}+port_drivers"
        case $cf_cv_system_name in
        (*mingw32*|*mingw64*)
-               LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con"
+               if test "x$with_exp_win32" = xyes ; then
+                       LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32"
+               else
+                       LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con"
+               fi
                CPPFLAGS="$CPPFLAGS -DUSE_WIN32CON_DRIVER"
                ;;
        (*)
                LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo"
                ;;
        esac
+elif test "x$with_exp_win32" = xyes ; then
+       case $cf_cv_system_name in
+       (*mingw32*|*mingw64*)
+               LIB_SUBSETS="${LIB_SUBSETS}+port_win32"
+               ;;
+       (*)
+               ;;
+       esac
 fi
 
 test "x$with_widec"     = xyes && LIB_SUBSETS="${LIB_SUBSETS}+widechar"
@@ -2231,6 +2278,17 @@ fi
 fi
 WITH_OVERWRITE=$with_overwrite
 
+### At least on MinGW a shared library build without libtool
+### requires adding the additional libs to the link list.
+case $cf_cv_system_name in
+(*mingw32*|*mingw64*)
+       if test "$DFT_LWR_MODEL" != "libtool"; then
+          SHLIB_LIST="$SHLIB_LIST ${LIBS}"
+       fi
+       ;;
+*)     ;;
+esac
+
 AC_SUBST(WITH_OVERWRITE)
 AC_SUBST(TICS_LIST)
 AC_SUBST(TINFO_LIST)
@@ -2271,9 +2329,6 @@ AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR',[Define to override ':' as
 
 AC_DEFINE_UNQUOTED(NCURSES_VERSION_STRING, "${NCURSES_MAJOR}.${NCURSES_MINOR}.${NCURSES_PATCH}",[Define to 1 if machine has ample memory for tic])
 
-### Now that we're done running tests, add the compiler-warnings, if any
-CF_ADD_CFLAGS($EXTRA_CFLAGS)
-
 ### Define substitutions for header files to avoid name-pollution
 CF_SUBST_IF(["x$cf_cv_have_tcgetattr" = xyes], HAVE_TCGETATTR, 1, 0)
 CF_SUBST_IF(["x$ac_cv_header_stdint_h" = xyes], HAVE_STDINT_H, 1, 0)
@@ -2502,6 +2557,8 @@ WITH_CURSES_H="$with_curses_h"
 WITH_ECHO="${enable_echo:=yes}"
 WITH_OVERWRITE="$with_overwrite"
 cf_LIST_MODELS="$cf_list_models"
+cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
+cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
 cf_cv_abi_version="$cf_cv_abi_version"
 cf_cv_do_relink="$cf_cv_do_relink"
 cf_cv_do_reranlib="$cf_cv_do_reranlib"