mawk/configure.in
2024-12-14 11:29:56 +00:00

157 lines
4.2 KiB
Plaintext

dnl $MawkId: configure.in,v 1.77 2024/12/14 00:43:08 tom Exp $
dnl configure.in for mawk
dnl ###########################################################################
dnl copyright 2008-2023,2024, Thomas E. Dickey
dnl copyright 1991-1994,1995, Michael D. Brennan
dnl
dnl This is a source file for mawk, an implementation of
dnl the AWK programming language.
dnl
dnl Mawk is distributed without warranty under the terms of
dnl the GNU General Public License, version 2, 1991.
dnl ###########################################################################
dnl
AC_PREREQ(2.52.20230114)
AC_INIT(mawk.h)
AC_CONFIG_HEADER(config.h:config_h.in)
CF_CHECK_CACHE
AC_ARG_PROGRAM
AC_DEFUN([AC_PATH_XTRA],[])
CF_PROG_CC
AC_PROG_MAKE_SET
CF_MAKEFLAGS
CF_MAKE_PHONY
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_YACC
CF_PROG_LINT
CF_MAKE_TAGS
CF_XOPEN_SOURCE
CF_LARGEFILE
AC_CHECK_DECL(exit)
CF_HELP_MESSAGE(Cross-compiling)
CF_BUILD_CC
CF_MAWK_MATHLIB
CF_HELP_MESSAGE(Miscellaneous options)
CF_DISABLE_ECHO
CF_ENABLE_WARNINGS
CF_WITH_MAN2HTML
###############################################################################
AC_MSG_CHECKING(if you want to use mawk's own regular-expressions engine)
AC_ARG_WITH([builtin-regex],
[ --without-builtin-regex do not use mawk's own regular-expressions engine],
[
with_builtin_regex=$withval
])
if test "x${with_builtin_regex}" != xno; then
with_builtin_regex=yes
AC_DEFINE(LOCAL_REGEXP,1,[define to 1 to use mawk's own regular-expressions engine])
fi
AC_MSG_RESULT($with_builtin_regex)
if test "x${with_builtin_regex}" = xno; then
CF_REGEX
fi
###############################################################################
AC_MSG_CHECKING(if you want to use mawk's own srand/rand functions)
CF_ARG_ENABLE([builtin-srand],
[ --enable-builtin-srand use mawk's own srand/rand functions],
[with_builtin_srand=yes],
[with_builtin_srand=no])
if test "x${with_builtin_srand}" != xno; then
with_builtin_srand=yes
fi
AC_MSG_RESULT($with_builtin_srand)
if test "x${with_builtin_srand}" = xno; then
CF_SRAND(mawk_,no)
AC_DEFINE_UNQUOTED(NAME_RANDOM, "$cf_cv_srand_func", [Define to the name of the random-function])
fi
###############################################################################
AC_MSG_CHECKING(if you want mawk to initialize random numbers at startup)
CF_ARG_DISABLE([init-srand],
[ --disable-init-srand suppress automatic initialization of random numbers],
[with_init_srand=no],
[with_init_srand=yes])
if test "x${with_init_srand}" != xno; then
with_init_srand=yes
else
AC_DEFINE(NO_INIT_SRAND,1,[define to 1 to suppress automatic initialization of random numbers])
fi
AC_MSG_RESULT($with_init_srand)
###############################################################################
AC_MSG_CHECKING(if you want mawk to support regex interval expressions {m[,]n})
CF_ARG_DISABLE([interval-expr],
[ --disable-interval-expr suppress regex interval expressions {m,n}],
[with_interval_expr=no],
[with_interval_expr=yes])
if test "x${with_interval_expr}" != xno; then
with_interval_expr=yes
else
AC_DEFINE(NO_INTERVAL_EXPR,1,[define to 1 to suppress regex interval expressions {m,n}])
fi
AC_MSG_RESULT($with_interval_expr)
###############################################################################
CF_HELP_MESSAGE(Testing-options)
CF_DISABLE_LEAKS
CF_ENABLE_TRACE
if test "x$with_trace" = xyes
then
EXTRAOBJS="$EXTRAOBJS trace\$o"
fi
AC_SUBST(EXTRAOBJS)
AC_CHECK_HEADERS(errno.h fcntl.h sys/time.h sys/wait.h)
AC_CHECK_TYPES([int64_t, uint64_t, long long])
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(int64_t)
AC_CHECK_SIZEOF(long long)
CF_MAWK_FIND_SIZE_T
CF_LOCALE
CF_CHECK_ENVIRON(environ)
AC_CHECK_FUNCS(fork fstat matherr mktime pipe strftime tsearch wait)
CF_FUNC_GETTIME
### Checks for libraries.
case $cf_cv_system_name in
(*mingw32*)
CPPFLAGS="$CPPFLAGS -DWINVER=0x0501"
# LIBS=" -lpsapi $LIBS"
;;
esac
test "$ac_cv_func_fork" = yes && \
test "$ac_cv_func_pipe" = yes && \
test "$ac_cv_func_wait" = yes && \
AC_DEFINE(HAVE_REAL_PIPES,1,[Define to 1 if we have functions needed to setup Unix pipes])
CF_SET_MATH_LIB_VERSION
CF_MAWK_FIND_MAX_INT
CF_MAWK_RUN_FPE_TESTS
AC_CONFIG_FILES([Makefile man/Makefile])
AC_OUTPUT