| 1 |
dnl |
| 2 |
dnl configure.ac --- autoconf input file for gawk |
| 3 |
dnl |
| 4 |
dnl Copyright (C) 2012-2021, 2023-2025 the Free Software Foundation, Inc. |
| 5 |
dnl |
| 6 |
dnl This file is part of GAWK, the GNU implementation of the |
| 7 |
dnl AWK Programming Language. |
| 8 |
dnl |
| 9 |
dnl GAWK is free software; you can redistribute it and/or modify |
| 10 |
dnl it under the terms of the GNU General Public License as published by |
| 11 |
dnl the Free Software Foundation; either version 3 of the License, or |
| 12 |
dnl (at your option) any later version. |
| 13 |
dnl |
| 14 |
dnl GAWK is distributed in the hope that it will be useful, |
| 15 |
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 |
dnl GNU General Public License for more details. |
| 18 |
dnl |
| 19 |
dnl You should have received a copy of the GNU General Public License |
| 20 |
dnl along with this program; if not, write to the Free Software |
| 21 |
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
| 22 |
dnl |
| 23 |
|
| 24 |
dnl Process this file with autoconf to produce a configure script. |
| 25 |
|
| 26 |
AC_INIT([GNU Awk Bundled Extensions],[5.3.2],[[email protected]],[gawk-extensions]) |
| 27 |
|
| 28 |
AC_PREREQ([2.71]) |
| 29 |
|
| 30 |
AC_CONFIG_MACRO_DIR([../m4]) |
| 31 |
AC_CONFIG_AUX_DIR([../build-aux]) |
| 32 |
|
| 33 |
AM_INIT_AUTOMAKE([1.16 -Wall -Werror]) |
| 34 |
|
| 35 |
SKIP_PERSIST_MALLOC=no |
| 36 |
AC_ARG_ENABLE([pma], |
| 37 |
[AS_HELP_STRING([--disable-pma],[do not build gawk with the persistent memory allocator])], |
| 38 |
if test "$enableval" = no |
| 39 |
then |
| 40 |
SKIP_PERSIST_MALLOC=yes |
| 41 |
fi |
| 42 |
) |
| 43 |
|
| 44 |
GAWK_CANONICAL_HOST |
| 45 |
AC_USE_SYSTEM_EXTENSIONS |
| 46 |
AC_ZOS_USS |
| 47 |
|
| 48 |
INSTALL="$ac_aux_dir/install-sh -c" |
| 49 |
export INSTALL |
| 50 |
|
| 51 |
SKIP_MPFR=no |
| 52 |
AC_ARG_ENABLE([mpfr], |
| 53 |
[AS_HELP_STRING([--disable-mpfr],[do not check for MPFR])], |
| 54 |
if test "$enableval" = no |
| 55 |
then |
| 56 |
SKIP_MPFR=yes |
| 57 |
fi |
| 58 |
) |
| 59 |
|
| 60 |
dnl Set the programming language for checks. Fortunately, |
| 61 |
dnl this only needs to be set once, since everything is in C. |
| 62 |
AC_LANG([C]) |
| 63 |
|
| 64 |
dnl initialize GNU gettext |
| 65 |
dnl this seems to help with finding MPFR on some systems, too. |
| 66 |
AM_GNU_GETTEXT([external]) |
| 67 |
AM_GNU_GETTEXT_VERSION([0.20.2]) |
| 68 |
AM_LANGINFO_CODESET |
| 69 |
gt_LC_MESSAGES |
| 70 |
|
| 71 |
dnl checks for structure members |
| 72 |
AC_CHECK_MEMBERS([struct stat.st_blksize]) |
| 73 |
|
| 74 |
AM_PROG_AR |
| 75 |
AC_SYS_LARGEFILE |
| 76 |
GAWK_USE_PERSISTENT_MALLOC |
| 77 |
LT_INIT([win32-dll disable-static]) |
| 78 |
dnl AC_PROG_INSTALL |
| 79 |
|
| 80 |
dnl use the same definition as the main configure script. |
| 81 |
dnl EXTENSIONDIR is exported if it was set there. |
| 82 |
dnl N.B. We must use ${libdir}/gawk instead of $pkglibdir because $pkglibdir |
| 83 |
dnl is set to ${libdir}/gawk-extensions, which is not what we want. |
| 84 |
AC_SUBST([pkgextensiondir], ['${libdir}/gawk'${EXTENSIONDIR}]) |
| 85 |
|
| 86 |
if test "$GCC" = yes |
| 87 |
then |
| 88 |
CFLAGS="$CFLAGS -Wall" # Don't add -Wextra, hurts older gcc |
| 89 |
fi |
| 90 |
|
| 91 |
AC_MSG_CHECKING([for special development options]) |
| 92 |
if test -f $srcdir/../.developing |
| 93 |
then |
| 94 |
if test "$GCC" = yes |
| 95 |
then |
| 96 |
CFLAGS="$CFLAGS -Wall -fno-builtin" |
| 97 |
fi |
| 98 |
AC_MSG_RESULT([yes]) |
| 99 |
else |
| 100 |
AC_MSG_RESULT([no]) |
| 101 |
CFLAGS="$CFLAGS -DNDEBUG" # turn off assertions |
| 102 |
fi |
| 103 |
|
| 104 |
AC_CHECK_HEADERS(fnmatch.h limits.h sys/mkdev.h sys/param.h sys/select.h \ |
| 105 |
sys/statvfs.h sys/sysmacros.h sys/time.h) |
| 106 |
|
| 107 |
AC_HEADER_DIRENT |
| 108 |
AC_CHECK_HEADERS_ONCE([sys/time.h]) |
| 109 |
|
| 110 |
|
| 111 |
dnl check for mpfr support |
| 112 |
case $SKIP_MPFR in |
| 113 |
no) GNUPG_CHECK_MPFR |
| 114 |
;; |
| 115 |
esac |
| 116 |
|
| 117 |
AC_SEARCH_LIBS(fmod, m) |
| 118 |
AC_CHECK_FUNCS(fdopendir fmod fnmatch getdtablesize \ |
| 119 |
clock_gettime gettimeofday \ |
| 120 |
nanosleep select statvfs \ |
| 121 |
GetSystemTimeAsFileTime strptime) |
| 122 |
|
| 123 |
GAWK_FUNC_DIRFD |
| 124 |
GAWK_PREREQ_DIRFD |
| 125 |
|
| 126 |
dnl checks for compiler characteristics |
| 127 |
AC_C_INLINE |
| 128 |
|
| 129 |
AC_CONFIG_HEADERS([config.h:configh.in]) |
| 130 |
AH_BOTTOM([#include "ext_custom.h"]) |
| 131 |
|
| 132 |
AC_CONFIG_FILES(Makefile po/Makefile.in) |
| 133 |
AC_OUTPUT |
| 134 |
if test "$GCC" = yes && |
| 135 |
test -f $srcdir/../.developing && |
| 136 |
grep -i debug $srcdir/../.developing > /dev/null |
| 137 |
then |
| 138 |
sed -e '/-O2/s///' -e '/^CFLAGS = /s//&${DEBUG} /' Makefile > foo |
| 139 |
mv foo Makefile |
| 140 |
fi |