diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 95 |
1 files changed, 57 insertions, 38 deletions
diff --git a/configure.ac b/configure.ac index 9f2878b0..d865ebe4 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl dnl configure.ac --- autoconf input file for gawk dnl -dnl Copyright (C) 1995-2013 the Free Software Foundation, Inc. +dnl Copyright (C) 1995-2014 the Free Software Foundation, Inc. dnl dnl This file is part of GAWK, the GNU implementation of the dnl AWK Programming Language. @@ -23,7 +23,7 @@ dnl dnl Process this file with autoconf to produce a configure script. -AC_INIT([GNU Awk], 4.1.0, bug-gawk@gnu.org, gawk) +AC_INIT([GNU Awk], 4.1.60, bug-gawk@gnu.org, gawk) # This is a hack. Different versions of install on different systems # are just too different. Chuck it and use install-sh. @@ -59,6 +59,7 @@ AC_ARG_ENABLE([lint], [ --disable-lint Disable gawk lint checking], fi ) +AC_CANONICAL_HOST AC_USE_SYSTEM_EXTENSIONS dnl checks for programs @@ -119,8 +120,8 @@ dnl need -D_SYSV3 for ISC fi dnl check for systems where libc is borked for regex handling -case `uname` in -MirBSD | MirOS) +case $host_os in +mirbsd*) AC_DEFINE([LIBC_IS_BORKED], 1, [libc is broken for regex handling]) ;; esac @@ -136,14 +137,14 @@ AM_LANGINFO_CODESET gt_LC_MESSAGES dnl checks for header files -AC_HEADER_STDC -AC_HEADER_STDBOOL -AC_HEADER_SYS_WAIT -AC_HEADER_TIME AC_CHECK_HEADERS(arpa/inet.h fcntl.h limits.h locale.h libintl.h mcheck.h \ netdb.h netinet/in.h stdarg.h stddef.h string.h \ sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h \ termios.h stropts.h wchar.h wctype.h) +AC_HEADER_STDC +AC_HEADER_STDBOOL +AC_HEADER_SYS_WAIT +AC_HEADER_TIME if test "$ac_cv_header_string_h" = yes then @@ -247,7 +248,6 @@ dnl Check for C11 _Noreturn GAWK_AC_NORETURN dnl checks for functions -AC_FUNC_VPRINTF AC_FUNC_MKTIME case "$ac_cv_func_working_mktime" in yes) AC_DEFINE(HAVE_MKTIME, 1, [we have the mktime function]) @@ -263,8 +263,8 @@ AC_CHECK_LIB(m, fmod) AC_CHECK_LIB(m, isinf) AC_CHECK_LIB(m, ismod) dnl Don't look for libsigsegv on OSF/1, gives us severe headaches -case `uname` in -OSF1) : ;; +case $host_os in +osf1) : ;; *) gl_LIBSIGSEGV ;; @@ -284,38 +284,56 @@ AC_FUNC_MBRTOWC dnl check for dynamic linking dnl This is known to be very primitive -dnl On MirBSD (and probably other systems), don't even try. -case `uname` in -MirBSD | MirOS) - : ;; -*) -AC_CHECK_HEADER(dlfcn.h, - [ - # Check this separately. Some systems have dlopen - # in libc. Notably freebsd and cygwin. - # HP-NSK has it in zrldsrl - AC_SEARCH_LIBS(dlopen, dl zrldsrl, gawk_have_dlopen=yes, gawk_have_dlopen=no) - # Only do DYNAMIC if we have the lib. z/OS (some versions) have - # the header but not the lib, apparently - if test "$gawk_have_dlopen" = yes - then - AC_DEFINE([DYNAMIC], 1, [dynamic loading is possible]) - # Add -export-dynamic for old extensions. Only works for GCC - if test "$GCC" = yes && - uname | $EGREP -i 'linux|freebsd' > /dev/null +AC_ARG_ENABLE([extensions], + [AS_HELP_STRING([--disable-extensions], [disable dynamic extensions (default is detect)])]) +if test "x$enable_extensions" != "xno"; then + extensions_supported=no + + dnl On MirBSD (and probably other systems), don't even try. + case $host_os in + mirbsd* | openedition*) # OS/390 z/OS POSIX layer + cat << \EOF > extension/Makefile +all dist check clean distclean install uninstall distcheck: + @exit 0 +EOF + ;; + *) + AC_CHECK_HEADER(dlfcn.h, + [ + # Check this separately. Some systems have dlopen + # in libc. Notably freebsd and cygwin. + # HP-NSK has it in zrldsrl + AC_SEARCH_LIBS(dlopen, dl zrldsrl, gawk_have_dlopen=yes, gawk_have_dlopen=no) + # Only do DYNAMIC if we have the lib. z/OS (some versions) have + # the header but not the lib, apparently + if test "$gawk_have_dlopen" = yes then - LDFLAGS="$LDFLAGS -export-dynamic" + extensions_supported=yes + AC_DEFINE([DYNAMIC], 1, [dynamic loading is possible]) + # Add -export-dynamic for old extensions. Only works for GCC + if test "$GCC" = yes; then + case $host_os in + linux*|freebsd*) + LDFLAGS="$LDFLAGS -export-dynamic" + ;; + esac + fi fi + ]) + ;; + esac + + if test "x$enable_extensions$extensions_supported" = "xyesno"; then + AC_MSG_ERROR([extension support requested, but unavailable]) fi -]) - ;; -esac + enable_extensions=$extensions_supported +fi dnl check for how to use getpgrp dnl have to hardwire it for VMS POSIX. Sigh. dnl ditto for BeOS, OS/2, and MS-DOS. -case `(uname) 2> /dev/null` in -*VMS*|*BeOS*|*OS/2*|*MS-DOS*) +case $host_os in +vms*|beos*|os2*|msdos) AC_DEFINE(GETPGRP_VOID, 1, [Define to 1 if the getpgrp function requires zero arguments.]) ;; @@ -361,7 +379,6 @@ GNUPG_CHECK_MPFR dnl checks for structure members AC_CHECK_MEMBERS([struct stat.st_blksize]) -AC_HEADER_TIME AC_STRUCT_TM AC_STRUCT_TIMEZONE @@ -389,5 +406,7 @@ AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in test/Makefile) -AC_CONFIG_SUBDIRS(extension) +if test "x$enable_extensions" = "xyes"; then + AC_CONFIG_SUBDIRS(extension) +fi AC_OUTPUT |