]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - configure.in
ncurses 6.3 - patch 20220122
[ncurses.git] / configure.in
index f2013a9fbbe958df4790ed4df72d5f9fbd31b4f9..b27e83cef958ec8212d8f423ea212daaf90aeda0 100644 (file)
@@ -1,5 +1,5 @@
 dnl***************************************************************************
-dnl Copyright 2018-2020,2021 Thomas E. Dickey                                *
+dnl Copyright 2018-2021,2022 Thomas E. Dickey                                *
 dnl Copyright 1998-2017,2018 Free Software Foundation, Inc.                  *
 dnl                                                                          *
 dnl Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -29,7 +29,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: configure.in,v 1.729 2021/01/09 11:20:52 tom Exp $
+dnl $Id: configure.in,v 1.741 2022/01/23 00:11:08 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.20210101)
-AC_REVISION($Revision: 1.729 $)
+AC_REVISION($Revision: 1.741 $)
 AC_INIT(ncurses/base/lib_initscr.c)
 AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
 
@@ -280,6 +280,7 @@ fi
 
 # do this after mixed-case option (tags/TAGS is not as important as tic).
 AC_PROG_MAKE_SET
+CF_MAKE_PHONY
 CF_MAKE_TAGS
 CF_MAKEFLAGS
 
@@ -553,7 +554,7 @@ fi
 ### Depending on the system, someone may use rpath to build ncurses but not
 # want users of the package to rely upon that feature.  Give those people an
 # option to suppress that detail from EXTRA_LDFLAGS.
-EXTRA_PKG_LDFLAGS="$EXTRA_LDFLAGS"
+EXTRA_PKG_LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
 if test -n "$EXTRA_PKG_LDFLAGS"
 then
        AC_MSG_CHECKING(if you want to disable extra LDFLAGS for package-scripts)
@@ -844,13 +845,21 @@ AC_ARG_ENABLE(home-terminfo,
 AC_MSG_RESULT($with_home_terminfo)
 test "x$with_home_terminfo" = "xyes" && AC_DEFINE(USE_HOME_TERMINFO,1,[Define to 1 if $HOME/.terminfo feature is wanted])
 
-AC_MSG_CHECKING(if you want to use restricted environment when running as root)
+AC_MSG_CHECKING(if you want to permit root to use ncurses environment variables)
 AC_ARG_ENABLE(root-environ,
-       [  --disable-root-environ  restrict environment when running as root],
+       [  --disable-root-environ  restrict root use of ncurses environment variables],
        [with_root_environ=$enableval],
        [with_root_environ=yes])
 AC_MSG_RESULT($with_root_environ)
-test "x$with_root_environ" = xyes && AC_DEFINE(USE_ROOT_ENVIRON,1,[Define to 1 if environment should be restricted for root user])
+test "x$with_root_environ" = xyes && AC_DEFINE(USE_ROOT_ENVIRON,1,[Define to 1 if root is allowed to use ncurses environment])
+
+AC_MSG_CHECKING(if you want to permit setuid programs to access all files)
+AC_ARG_ENABLE(root-environ,
+       [  --disable-root-access   restrict file-access when running setuid],
+       [with_root_access=$enableval],
+       [with_root_access=yes])
+AC_MSG_RESULT($with_root_access)
+test "x$with_root_access" = xyes && AC_DEFINE(USE_ROOT_ACCESS,1,[Define to 1 if setuid is allowed all file-access])
 
 ###   Use option --enable-symlinks to make tic use symlinks, not hard links
 ###   to reduce storage requirements for the terminfo database.
@@ -1010,18 +1019,18 @@ else
        with_tic_depends=no
 fi
 
-###   use option --disable-wattr-macros to suppress wattr* macros from curses.h
-AC_MSG_CHECKING(if you want to suppress wattr* macros to help with ncurses5/ncurses6 transition)
+###   use option --enable-wattr-macros to enable wattr* macros in curses.h
+AC_MSG_CHECKING(if you want to enable wattr* macros)
 AC_ARG_ENABLE(wattr-macros,
-       [  --disable-wattr-macros  suppress wattr* macros to help with ncurses5/ncurses6 transition],
+       [  --enable-wattr-macros   enable wattr* macros],
        [with_wattr_macros=$enableval],
-       [with_wattr_macros=yes])
+       [with_wattr_macros=no])
 if [[ "x$with_wattr_macros" != xyes ]]; then
        NCURSES_WATTR_MACROS=0
-       AC_MSG_RESULT(yes)
+       AC_MSG_RESULT(no)
 else
        NCURSES_WATTR_MACROS=1
-       AC_MSG_RESULT(no)
+       AC_MSG_RESULT(yes)
 fi
 AC_SUBST(NCURSES_WATTR_MACROS)
 
@@ -1041,7 +1050,11 @@ AC_ARG_WITH(caps,
        [  --with-caps=alt         compile with alternate Caps file],
        [TERMINFO_CAPS=Caps.$withval],
        [TERMINFO_CAPS=Caps])
-test -f "${srcdir}/include/${TERMINFO_CAPS}" || TERMINFO_CAPS=Caps
+if test ! -f "${srcdir}/include/${TERMINFO_CAPS}"
+then
+       AC_MSG_WARN(file not found: "${srcdir}/include/${TERMINFO_CAPS}")
+       TERMINFO_CAPS=Caps
+fi
 AC_MSG_RESULT($TERMINFO_CAPS)
 AC_SUBST(TERMINFO_CAPS)
 
@@ -1075,7 +1088,7 @@ AC_MSG_CHECKING(for size CCHARW_MAX)
 AC_ARG_WITH(ccharw-max,
        [  --with-ccharw-max=XXX   override size CCHARW_MAX],
        [NCURSES_CCHARW_MAX="$withval"],
-       [NCURSES_CCHARW_MAX=5])
+       [NCURSES_CCHARW_MAX=$cf_dft_ccharw_max])
 AC_MSG_RESULT($NCURSES_CCHARW_MAX)
 AC_SUBST(NCURSES_CCHARW_MAX)
 
@@ -1089,7 +1102,7 @@ AC_MSG_CHECKING(if you want to use signed Boolean array in term.h)
 AC_ARG_ENABLE(signed-char,
        [  --enable-signed-char    compile using signed Boolean's in term.h],
        [with_signed_char=$enableval],
-       [with_signed_char=no])
+       [with_signed_char=$cf_dft_signed_char])
 AC_MSG_RESULT($with_signed_char)
 test "x$with_signed_char" != xyes && NCURSES_SBOOL="char"
 AC_SUBST(NCURSES_SBOOL)
@@ -1225,11 +1238,22 @@ AC_ARG_ENABLE(ext-mouse,
        [with_ext_mouse=$enableval],
        [with_ext_mouse=$cf_dft_ext_mouse])
 AC_MSG_RESULT($with_ext_mouse)
-NCURSES_MOUSE_VERSION=1
 if test "x$with_ext_mouse" = xyes ; then
-       NCURSES_MOUSE_VERSION=2
        CF_NCURSES_ABI_6
 fi
+
+case $cf_cv_abi_version in
+(5)
+       NCURSES_MOUSE_VERSION=1
+       ;;
+(6)
+       NCURSES_MOUSE_VERSION=2
+       ;;
+([789])
+       NCURSES_MOUSE_VERSION=3
+       ;;
+esac
+
 AC_SUBST(NCURSES_MOUSE_VERSION)
 
 ###   use option --enable-ext-putwin to turn on extended screendumps
@@ -1358,7 +1382,7 @@ if test "x$with_reentrant" = xyes ; then
 else
        cf_cv_enable_reentrant=0
        cf_cv_enable_opaque="NCURSES_OPAQUE"
-       NCURSES_SIZE_T=short
+       NCURSES_SIZE_T=$cf_dft_ordinate_type
 fi
 AC_SUBST(cf_cv_enable_reentrant)
 AC_SUBST(cf_cv_enable_opaque)
@@ -1370,7 +1394,7 @@ CF_ARG_ENABLE(opaque-curses,
        [  --enable-opaque-curses  make curses WINDOW, etc., "opaque"],
        [enable_opaque_curses=yes],[
         test "$cf_cv_enable_reentrant" = 1 && enable_opaque_curses=yes
-        test "$cf_cv_enable_reentrant" = 1 || enable_opaque_curses=no
+        test "$cf_cv_enable_reentrant" = 1 || enable_opaque_curses=$cf_dft_opaque_curses
        ])
 AC_MSG_RESULT($enable_opaque_curses)
 
@@ -1687,12 +1711,13 @@ CF_DISABLE_GNAT_PROJECTS
 ###    Checks for libraries.
 case "$cf_cv_system_name" in
 (*mingw32*|*mingw64*)
+       # Note: WINVER may be a problem with Windows 10
        if test "x$with_exp_win32" = xyes ; then
-       CPPFLAGS="$CPPFLAGS -DWINVER=0x0600 -DWIN32_LEAN_AND_MEAN"
+               CPPFLAGS="$CPPFLAGS -DWINVER=0x0600 -DWIN32_LEAN_AND_MEAN"
        else
-       CPPFLAGS="$CPPFLAGS -DWINVER=0x0501 -DWIN32_LEAN_AND_MEAN"
+               CPPFLAGS="$CPPFLAGS -DWINVER=0x0501 -DWIN32_LEAN_AND_MEAN"
        fi
-       # Note: WINVER may be a problem with Windows 10
+       CF_CHECK_LIBSSP
        ;;
 (*)
 AC_CHECK_FUNC(gettimeofday,
@@ -1727,7 +1752,6 @@ sys/poll.h \
 sys/select.h \
 sys/time.h \
 sys/times.h \
-ttyent.h \
 unistd.h \
 wctype.h \
 )
@@ -1782,7 +1806,6 @@ getcwd \
 getegid \
 geteuid \
 getopt \
-getttynam \
 issetugid \
 localeconv \
 poll \
@@ -1792,6 +1815,7 @@ select \
 setbuf \
 setbuffer \
 setenv \
+setfsuid \
 setvbuf \
 sigaction \
 sigvec \
@@ -1805,6 +1829,8 @@ tsearch \
 vsnprintf \
 )
 
+CF_FUNC_GETTTYNAM
+
 if test "x$ac_cv_func_getopt" = xno && \
    test "x$cf_with_progs$cf_with_tests" != xnono; then
        AC_MSG_ERROR(getopt is required for building programs)
@@ -2564,6 +2590,7 @@ cf_cv_do_reranlib="$cf_cv_do_reranlib"
 cf_cv_do_symlinks="$cf_cv_do_symlinks"
 cf_cv_enable_lp64="$cf_cv_enable_lp64"
 cf_cv_enable_opaque="$cf_cv_enable_opaque"
+cf_cv_make_PHONY="$cf_cv_make_PHONY"
 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