+test "x$with_colorfgbg" = xyes && AC_DEFINE(USE_COLORFGBG,1,[Define to 1 to compile-in experimental $COLORFGBG code])
+
+### use option --enable-interop to turn on use of bindings used for interop
+AC_MSG_CHECKING(if you want interop bindings)
+AC_ARG_ENABLE(interop,
+ [ --enable-interop compile-in experimental interop bindings],
+ [with_exp_interop=$enableval],
+ [with_exp_interop=no])
+AC_MSG_RESULT($with_exp_interop)
+
+NCURSES_INTEROP_FUNCS=0
+test "x$with_exp_interop" = xyes && NCURSES_INTEROP_FUNCS=1
+AC_SUBST(NCURSES_INTEROP_FUNCS)
+
+# This is still experimental (20080329), but should ultimately be moved to
+# the script-block --with-normal, etc.
+CF_WITH_PTHREAD
+
+if test "x$with_pthread" != xno; then
+ AC_CHECK_FUNC(pthread_kill,[
+ AC_MSG_CHECKING(if you want to allow EINTR in wgetch with pthreads)
+ AC_ARG_ENABLE(pthreads-eintr,
+ [ --enable-pthreads-eintr enable EINTR in wgetch with pthreads],
+ [use_pthreads_eintr=$enableval],
+ [use_pthreads_eintr=no])
+ AC_MSG_RESULT($use_pthreads_eintr)
+ if test "x$use_pthreads_eintr" = xyes ; then
+ AC_DEFINE(USE_PTHREADS_EINTR,1,[Define to 1 to enable EINTR in wgetch with pthreads])
+ fi])
+
+ AC_MSG_CHECKING(if you want to use weak-symbols for pthreads)
+ AC_ARG_ENABLE(weak-symbols,
+ [ --enable-weak-symbols enable weak-symbols for pthreads],
+ [use_weak_symbols=$enableval],
+ [use_weak_symbols=no])
+ AC_MSG_RESULT($use_weak_symbols)
+ if test "x$use_weak_symbols" = xyes ; then
+ CF_WEAK_SYMBOLS
+ else
+ cf_cv_weak_symbols=no
+ fi
+
+ if test "x$cf_cv_weak_symbols" = xyes ; then
+ AC_DEFINE(USE_WEAK_SYMBOLS,1,[Define to 1 to enable weak-symbols for pthreads])
+ fi
+fi
+
+PTHREAD=
+if test "x$with_pthread" = "xyes" ; then
+ AC_DEFINE(USE_PTHREADS,1,[Define to 1 to use pthreads feature])
+ enable_reentrant=yes
+ if test "x$cf_cv_weak_symbols" = xyes ; then
+ PTHREAD=-lpthread
+ fi
+fi
+AC_SUBST(PTHREAD)
+
+# Reentrant code has to be opaque; there's little advantage to making ncurses
+# opaque outside of that, so there is no --enable-opaque option. We can use
+# this option without --with-pthreads, but this will be always set for
+# pthreads.
+AC_MSG_CHECKING(if you want experimental reentrant code)
+AC_ARG_ENABLE(reentrant,
+ [ --enable-reentrant compile with experimental reentrant code],
+ [with_reentrant=$enableval],
+ [with_reentrant=no])
+AC_MSG_RESULT($with_reentrant)
+if test "x$with_reentrant" = xyes ; then
+ cf_cv_enable_reentrant=1
+ cf_cv_enable_opaque="NCURSES_INTERNALS"
+ NCURSES_OPAQUE=1
+ NCURSES_SIZE_T=int
+ if test "x$cf_cv_weak_symbols" = xyes ; then
+ CF_REMOVE_LIB(LIBS,$LIBS,pthread)
+ CF_ADD_LIB(pthread,TEST_LIBS)
+ CF_ADD_LIB(pthread,TEST_LIBS2)
+ else
+ # when not using weak symbols but with_reentrant,
+ # add 't' to the library suffix on all platforms
+ # except cygwin, where we only do that if ALSO
+ # compiling with full thread support.
+ case "$host" in
+ *cygwin* | *msys*)
+ if test "$with_pthread" = "yes" ; then
+ LIB_SUFFIX="t${LIB_SUFFIX}"
+ fi ;;
+ * ) LIB_SUFFIX="t${LIB_SUFFIX}" ;;
+ esac
+ fi
+ AC_DEFINE(USE_REENTRANT,1,[Define to 1 to use experimental reentrant feature])
+ CF_NCURSES_ABI_6
+else
+ cf_cv_enable_reentrant=0
+ cf_cv_enable_opaque="NCURSES_OPAQUE"
+ NCURSES_OPAQUE=0
+ NCURSES_SIZE_T=short
+fi
+AC_SUBST(cf_cv_enable_reentrant)
+AC_SUBST(cf_cv_enable_opaque)
+AC_SUBST(NCURSES_OPAQUE)
+AC_SUBST(NCURSES_SIZE_T)
+
+### Allow using a different wrap-prefix
+if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
+ AC_MSG_CHECKING(for prefix used to wrap public variables)
+ AC_ARG_WITH(wrap-prefix,
+ [ --with-wrap-prefix=XXX override prefix used for public variables],
+ [NCURSES_WRAP_PREFIX=$withval],
+ [NCURSES_WRAP_PREFIX=_nc_])
+ AC_MSG_RESULT($NCURSES_WRAP_PREFIX)
+else
+ NCURSES_WRAP_PREFIX=_nc_
+fi
+AC_SUBST(NCURSES_WRAP_PREFIX)
+AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX",[Define to override _nc_ prefix])