]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - configure.in
ncurses 6.1 - patch 20190112
[ncurses.git] / configure.in
index 191d7d7ac3989e52fcf2d9d985cce1521ff15842..b2a55082be132fad024c432133c53eb2695d8010 100644 (file)
@@ -28,14 +28,14 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: configure.in,v 1.656 2018/02/10 18:19:38 tom Exp $
+dnl $Id: configure.in,v 1.672 2018/11/24 22:37:01 tom Exp $
 dnl Process this file with autoconf to produce a configure script.
 dnl
 dnl See https://invisible-island.net/autoconf/ for additional information.
 dnl
 dnl ---------------------------------------------------------------------------
 AC_PREREQ(2.52.20170501)
-AC_REVISION($Revision: 1.656 $)
+AC_REVISION($Revision: 1.672 $)
 AC_INIT(ncurses/base/lib_initscr.c)
 AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
 
@@ -61,14 +61,14 @@ 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"
+       cf_prog_cc="gnatgcc gcc cc"
 else
-       cf_PROG_CC="gcc cc"
+       cf_prog_cc="gcc cc"
 fi
-
-CF_PROG_CC($cf_PROG_CC)
+CF_PROG_CC($cf_prog_cc)
 
 AC_PROG_CPP
 AC_PROG_GCC_TRADITIONAL
@@ -423,36 +423,6 @@ AC_ARG_WITH(ticlib,
        [with_ticlib=no])
 AC_MSG_RESULT($with_ticlib)
 
-### Checks for special libraries, must be done up-front.
-SHLIB_LIST=""
-CF_WITH_GPM
-if test "$with_gpm" != no ; then
-       AC_MSG_CHECKING(if you want to load GPM dynamically)
-       AC_ARG_WITH(dlsym,
-               [  --without-dlsym         do not use dlsym() to load GPM dynamically],
-               [with_dlsym=$withval],
-               [with_dlsym=yes])
-       AC_MSG_RESULT($with_dlsym)
-       if test "x$with_dlsym" = xyes ; then
-               CF_FUNC_DLSYM
-               if test "x$with_gpm" != xyes ; then
-                       CF_VERBOSE(assuming soname for gpm is $with_gpm)
-                       cf_cv_gpm_soname="$with_gpm"
-               else
-                       CF_LIB_SONAME([#include <gpm.h>],[if (Gpm_Open(0,0)) Gpm_Close();],gpm)
-               fi
-               test "$cf_cv_gpm_soname" != "unknown" && AC_DEFINE_UNQUOTED(LIBGPM_SONAME,"$cf_cv_gpm_soname",[Define as needed to set the gpm share library soname])
-               SHLIB_LIST="-ldl $SHLIB_LIST"
-       else
-               SHLIB_LIST="-lgpm $SHLIB_LIST"
-               CF_ADD_LIB(gpm,TEST_LIBS)
-       fi
-       AC_DEFINE(HAVE_LIBGPM,1,[Define to 1 if we have the gpm library])
-       CF_CHECK_GPM_WGETCH
-fi
-
-CF_WITH_SYSMOUSE
-
 dnl Not all ports of gcc support the -g option
 
 if test X"$CC_G_OPT" = X"" ; then
@@ -521,6 +491,39 @@ for model in $cf_list_models; do
        esac
 done
 
+### Checks for special libraries, must be done up-front.
+SHLIB_LIST=""
+CF_WITH_GPM
+if test "$with_gpm" != no ; then
+       AC_MSG_CHECKING(if you want to load GPM dynamically)
+       AC_ARG_WITH(dlsym,
+               [  --without-dlsym         do not use dlsym() to load GPM dynamically],
+               [with_dlsym=$withval],
+               [with_dlsym=yes])
+       AC_MSG_RESULT($with_dlsym)
+       if test "x$with_dlsym" = xyes ; then
+               CF_FUNC_DLSYM
+               if test "x$with_gpm" != xyes ; then
+                       CF_VERBOSE(assuming soname for gpm is $with_gpm)
+                       cf_cv_gpm_soname="$with_gpm"
+               else
+                       CF_LIB_SONAME([#include <gpm.h>],[if (Gpm_Open(0,0)) Gpm_Close();],gpm)
+               fi
+               test "$cf_cv_gpm_soname" != "unknown" && AC_DEFINE_UNQUOTED(LIBGPM_SONAME,"$cf_cv_gpm_soname",[Define as needed to set the gpm share library soname])
+               SHLIB_LIST="-ldl $SHLIB_LIST"
+               CF_ADD_LIB(dl,PRIVATE_LIBS)
+       else
+               SHLIB_LIST="-lgpm $SHLIB_LIST"
+               CF_ADD_LIB(gpm,TEST_LIBS)
+               CF_ADD_LIB(gpm,PRIVATE_LIBS)
+       fi
+       AC_DEFINE(HAVE_LIBGPM,1,[Define to 1 if we have the gpm library])
+       CF_CHECK_GPM_WGETCH
+fi
+
+CF_WITH_PCRE2
+CF_WITH_SYSMOUSE
+
 # pretend that ncurses==ncursesw==ncursest
 AC_MSG_CHECKING(if you want to disable library suffixes)
 CF_ARG_DISABLE(lib-suffixes,
@@ -531,7 +534,7 @@ CF_ARG_DISABLE(lib-suffixes,
 AC_MSG_RESULT($disable_lib_suffixes)
 
 ### If we're building with rpath, try to link non-standard libs that way too.
-if test "$DFT_LWR_MODEL" = "shared"; then
+if test "$DFT_LWR_MODEL" = "shared" && test "x$cf_cv_enable_rpath" != xno; then
        CF_DISABLE_RPATH_HACK
 fi
 
@@ -608,8 +611,23 @@ AC_ARG_WITH(fallbacks,
        [with_fallback=$withval],
        [with_fallback=])
 AC_MSG_RESULT($with_fallback)
-FALLBACK_LIST=`test "$with_fallback" != no && echo "$with_fallback" | sed -e 's/,/ /g'`
+
+case ".$with_fallback" in
+(.|.no)
+       FALLBACK_LIST=
+       ;;
+(.yes)
+       AC_MSG_WARN(expected a list of terminal descriptions)
+       ;;
+(*)
+       FALLBACK_LIST=`echo "$with_fallback" | sed -e 's/,/ /g'`
+       ;;
+esac
+
+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,
@@ -659,6 +677,13 @@ CF_WITH_PATHLIST(terminfo-dirs,
 AC_MSG_RESULT($TERMINFO_DIRS)
 test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS",[Define as needed to predefine the TERMINFO_DIR searchlist])
 
+case "x$TERMINFO" in
+x???:*)
+       AC_MSG_WARN(ignoring non-directory/file TERMINFO value)
+       unset TERMINFO
+       ;;
+esac
+
 AC_MSG_CHECKING(for default terminfo directory)
 CF_WITH_PATH(default-terminfo-dir,
        [  --with-default-terminfo-dir=DIR default terminfo directory],
@@ -853,7 +878,7 @@ NCURSES_WINT_T=0
 
 # Check to define _XOPEN_SOURCE "automatically"
 CPPFLAGS_before_XOPEN="$CPPFLAGS"
-CF_XOPEN_SOURCE(500)
+CF_XOPEN_SOURCE(600)
 CPPFLAGS_after_XOPEN="$CPPFLAGS"
 
 # Work around breakage on OS X
@@ -1255,6 +1280,7 @@ if test "x$with_pthread" = "xyes" ; then
        enable_reentrant=yes
        if test "x$cf_cv_weak_symbols" = xyes ; then
                PTHREAD=-lpthread
+               CF_ADD_LIB(pthread,PRIVATE_LIBS)
        fi
 fi
 AC_SUBST(PTHREAD)
@@ -1277,6 +1303,7 @@ if test "x$with_reentrant" = xyes ; then
                CF_REMOVE_LIB(LIBS,$LIBS,pthread)
                CF_ADD_LIB(pthread,TEST_LIBS)
                CF_ADD_LIB(pthread,TEST_LIBS2)
+               CF_ADD_LIB(pthread,PRIVATE_LIBS)
        else
                # when not using weak symbols but with_reentrant,
                # add 't' to the library suffix on all platforms
@@ -1476,6 +1503,21 @@ AC_SUBST(ECHO_LINK)
 # --disable-stripping is used for debugging
 CF_INSTALL_OPTS
 
+# If we're avoiding relinking of shared libraries during install, that is to
+# avoid modifying the build-tree.  For the same reason, avoid doing ranlib if
+# the install program has "-p" (for preserving timestamps).
+cf_cv_do_reranlib=yes
+if test "x$cf_cv_install_p" = xyes
+then
+       if test "x$cf_cv_do_relink" != xyes
+       then
+               cf_cv_do_reranlib=no
+               INSTALL_OPT_P="-p"
+               INSTALL_LIB="$INSTALL_LIB $INSTALL_OPT_P"
+       fi
+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,
@@ -1662,6 +1704,7 @@ sigaction \
 sigvec \
 strdup \
 strstr \
+sysconf \
 tcgetpgrp \
 tdestroy \
 times \
@@ -2322,6 +2365,7 @@ else
 fi
 AC_SUBST(ADAGEN_LDFLAGS)
 AC_SUBST(CHECK_BUILD)
+AC_SUBST(PRIVATE_LIBS)
 
 AC_DEFINE(HAVE_CURSES_DATA_BOOLNAMES,1,[definition needed for in-tree build of tack])
 
@@ -2390,6 +2434,7 @@ WITH_OVERWRITE="$with_overwrite"
 cf_LIST_MODELS="$cf_list_models"
 cf_cv_abi_version="$cf_cv_abi_version"
 cf_cv_do_relink="$cf_cv_do_relink"
+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"