"Fossies" - the Fresh Open Source Software Archive

Member "gawk-5.1.0/configure.ac" (14 Apr 2020, 12879 Bytes) of package /linux/misc/gawk-5.1.0.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 5.0.1_vs_5.1.0.

    1 dnl
    2 dnl configure.ac --- autoconf input file for gawk
    3 dnl
    4 dnl Copyright (C) 1995-2020 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],[5.1.0],[bug-gawk@gnu.org],[gawk])
   27 
   28 # This is a hack. Different versions of install on different systems
   29 # are just too different. Chuck it and use install-sh.
   30 #
   31 # If the user supplies $INSTALL, figure they know what they're doing.
   32 #
   33 # With Autoconf 2.5x, this needs to come very early on, but *after*
   34 # the INIT macro. Sigh.
   35 
   36 if test "$INSTALL" = ""
   37 then
   38 	INSTALL="$srcdir/install-sh -c"
   39 	export INSTALL
   40 fi
   41 
   42 AC_PREREQ([2.69])
   43 AM_INIT_AUTOMAKE([1.15 dist-xz dist-lzip])
   44 
   45 AC_CONFIG_MACRO_DIR([m4])
   46 
   47 AC_ARG_ENABLE([lint],
   48 	[AS_HELP_STRING([--disable-lint],[do not compile in gawk lint checking])],
   49 	if test "$enableval" = no
   50 	then
   51 		AC_DEFINE(NO_LINT, 1, [disable lint checks])
   52 	fi
   53 )
   54 AC_ARG_ENABLE([builtin-intdiv0],
   55 	[AS_HELP_STRING([--enable-builtin-intdiv0],[enable built-in intdiv0 function])],
   56 	if test "$enableval" = yes
   57 	then
   58 		AC_DEFINE(SUPPLY_INTDIV, 1, [enable built-in intdiv0 function])
   59 		sed '/^@set PATCHLEVEL/a\
   60 @set INTDIV' < "$srcdir"/doc/gawktexi.in > foo
   61 		cp foo "$srcdir"/doc/gawktexi.in
   62 		rm foo
   63 	fi
   64 )
   65 
   66 SKIP_MPFR=no
   67 AC_ARG_ENABLE([mpfr],
   68 	[AS_HELP_STRING([--disable-mpfr],[do not check for MPFR])],
   69 	if test "$enableval" = no
   70 	then
   71 		SKIP_MPFR=yes
   72 	fi
   73 )
   74 
   75 EXTENSIONDIR=
   76 AC_ARG_ENABLE([versioned-extension-dir],
   77 	[AS_HELP_STRING([--enable-versioned-extension-dir], [use a versioned directory for extensions])],
   78 	if test "$enableval" = yes
   79 	then
   80 		MAJOR=`awk '/define gawk_api_major_version/ { print $3 }' < $srcdir/gawkapi.h`
   81 		MINOR=`awk '/define gawk_api_minor_version/ { print $3 }' < $srcdir/gawkapi.h`
   82 
   83 		# note leading slash on the value
   84 		export EXTENSIONDIR=/ext-$MAJOR.$MINOR
   85 	fi
   86 )
   87 
   88 # set default shared library location
   89 AC_SUBST([pkgextensiondir], ['${pkglibdir}'${EXTENSIONDIR}])
   90 
   91 GAWK_CANONICAL_HOST
   92 AC_USE_SYSTEM_EXTENSIONS
   93 
   94 dnl checks for programs
   95 AC_PROG_EGREP
   96 AC_PROG_YACC
   97 AC_PROG_LN_S
   98 AC_PROG_CC_C99
   99 AC_PROG_CPP
  100 AC_PROG_RANLIB
  101 
  102 AC_OBJEXT
  103 AC_EXEEXT
  104 
  105 AC_PROG_INSTALL
  106 AC_PROG_MAKE_SET
  107 
  108 # This is mainly for my use during testing and development.
  109 # Yes, it's a bit of a hack.
  110 AC_MSG_CHECKING([for special development options])
  111 if test -f $srcdir/.developing
  112 then
  113 	# add other debug flags as appropriate, save GAWKDEBUG for emergencies
  114 	CFLAGS="$CFLAGS -DARRAYDEBUG -DYYDEBUG -DLOCALEDEBUG -DMEMDEBUG"
  115 
  116 	# turn on compiler warnings if we're doing development
  117 	# enable debugging using macros also
  118 	if test "$GCC" = yes
  119 	then
  120 		CFLAGS="$CFLAGS -Wall -fno-builtin -g3 -ggdb3"
  121 	fi
  122 	AC_MSG_RESULT([yes])
  123 else
  124 	AC_MSG_RESULT([no])
  125 	CFLAGS="$CFLAGS -DNDEBUG"	# turn off assertions
  126 fi
  127 
  128 AC_SUBST(CFLAGS)
  129 
  130 # shared library suffix for dynamic loading:
  131 AC_SUBST(acl_shlibext)
  132 
  133 dnl checks for systems
  134 AC_ZOS_USS
  135 AC_SEARCH_LIBS([strerror],[cposix])
  136 AC_SYS_LARGEFILE
  137 
  138 AC_MSG_CHECKING([if we are using EBCDIC])
  139 AC_EGREP_CPP([gnu_gawk_in_ebcdic],
  140 [#if 'a' == 0x81
  141 gnu_gawk_in_ebcdic
  142 #endif],
  143 [AC_DEFINE(USE_EBCDIC, 1, Define to 1 if the character set is EBCDIC)
  144  use_ebcdic=yes],
  145 [use_ebcdic=no])
  146 AC_MSG_RESULT([$use_ebcdic])
  147 if test "$use_ebcdic" = yes
  148 then
  149 	ZOS_FAIL='; echo Expect $@ to fail on z/OS.'
  150 fi
  151 AC_SUBST(ZOS_FAIL)
  152 
  153 dnl Set the programming language for checks. Fortunately,
  154 dnl this only needs to be set once, since everything is in C.
  155 AC_LANG([C])
  156 
  157 dnl initialize GNU gettext
  158 AM_GNU_GETTEXT([external])
  159 AM_GNU_GETTEXT_VERSION([0.19.8])
  160 AM_LANGINFO_CODESET
  161 gt_LC_MESSAGES
  162 
  163 dnl checks for header files
  164 AC_CHECK_HEADERS(arpa/inet.h fcntl.h locale.h libintl.h mcheck.h \
  165 	netdb.h netinet/in.h stddef.h string.h \
  166 	sys/ioctl.h sys/param.h sys/select.h sys/socket.h sys/time.h unistd.h \
  167 	termios.h stropts.h wchar.h wctype.h)
  168 AC_HEADER_STDC
  169 AC_HEADER_STDBOOL
  170 AC_HEADER_SYS_WAIT
  171 AC_HEADER_TIME
  172 
  173 if test "$ac_cv_header_string_h" = yes
  174 then
  175 	AC_CHECK_HEADERS(memory.h)
  176 else
  177 	AC_CHECK_HEADERS(strings.h)
  178 fi
  179 
  180 dnl Check cross compiling
  181 AM_CONDITIONAL([TEST_CROSS_COMPILE], [test "$build_alias" != "$host_alias"])
  182 
  183 dnl checks for typedefs
  184 AC_TYPE_PID_T
  185 AC_TYPE_SIZE_T
  186 AC_TYPE_GETGROUPS
  187 AC_TYPE_LONG_LONG_INT
  188 AC_TYPE_UNSIGNED_LONG_LONG_INT
  189 AC_TYPE_INTMAX_T
  190 AC_TYPE_UINTMAX_T
  191 AC_CHECK_TYPE(ssize_t, int)
  192 AC_CHECK_SIZEOF(unsigned int)
  193 AC_CHECK_SIZEOF(unsigned long)
  194 dnl see if time_t is defined in <sys/types.h>
  195 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], [[
  196 	time_t foo;
  197 	foo = 0;
  198 ]])],[AC_DEFINE(TIME_T_IN_SYS_TYPES_H, 1,
  199 		  some systems define this type here)],[])
  200 dnl check for wctype_t in <wctype.h>
  201 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <wctype.h>]], [[
  202 	wctype_t foo;
  203 	foo = 0;
  204 ]])],[AC_DEFINE(HAVE_WCTYPE_T, 1, systems should define this type here)],[])
  205 dnl check for wint_t in <wctype.h>
  206 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <wctype.h>]], [[
  207 	wint_t foo;
  208 	foo = 0;
  209 ]])],[AC_DEFINE(HAVE_WINT_T, 1, systems should define this type here)],[])
  210 dnl check for sockaddr_storage
  211 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
  212 #include <sys/socket.h>]], [[
  213 	struct sockaddr_storage foo;
  214 ]])],[AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, newer systems define this type here)],[])
  215 
  216 dnl Borrwed from rsync, thanks to to Jim Meyering.
  217 
  218 dnl Check for socklen_t: historically on BSD it is an int, and in
  219 dnl POSIX 1g it is a type of its own, but some platforms use different
  220 dnl types for the argument to getsockopt, getpeername, etc.  So we
  221 dnl have to test to find something that will work.
  222 
  223 dnl This is no good, because passing the wrong pointer on C compilers is
  224 dnl likely to only generate a warning, not an error.
  225 
  226 AC_DEFUN([TYPE_SOCKLEN_T],
  227 [
  228    AC_CHECK_TYPE([socklen_t], ,[
  229       AC_MSG_CHECKING([for socklen_t equivalent])
  230       AC_CACHE_VAL([rsync_cv_socklen_t_equiv],
  231       [
  232          # Systems have either "struct sockaddr *" or
  233          # "void *" as the second argument to getpeername
  234          rsync_cv_socklen_t_equiv=
  235          for arg2 in "struct sockaddr" void
  236 	 do
  237             for t in int size_t unsigned long "unsigned long"
  238 	    do
  239                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  240 #include <sys/types.h>
  241 #include <sys/socket.h>
  242 
  243                   int getpeername (int, $arg2 *, $t *);
  244                ]], [[
  245                   $t len;
  246                   getpeername(0,0,&len);
  247                ]])],[
  248                   rsync_cv_socklen_t_equiv="$t"
  249                   break
  250                ],[])
  251             done
  252          done
  253 
  254          if test "$rsync_cv_socklen_t_equiv" = ""
  255 	 then
  256 dnl		Some systems get this. Default to int.  -- ADR
  257 dnl            AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
  258 		rsync_cv_socklen_t_equiv=int
  259          fi
  260       ])
  261       AC_MSG_RESULT($rsync_cv_socklen_t_equiv)
  262       AC_DEFINE_UNQUOTED(socklen_t, $rsync_cv_socklen_t_equiv,
  263 			[type to use in place of socklen_t if not defined])],
  264       [#include <sys/types.h>
  265 #include <sys/socket.h>])
  266 ])
  267 TYPE_SOCKLEN_T
  268 
  269 dnl Check for C11 _Noreturn
  270 GAWK_AC_NORETURN
  271 
  272 dnl checks for functions
  273 AC_FUNC_MKTIME
  274 case "$ac_cv_func_working_mktime" in
  275 yes)	AC_DEFINE(HAVE_MKTIME, 1, [we have the mktime function])
  276 	;;
  277 esac
  278 
  279 AC_CHECK_FUNC(getaddrinfo, [AC_DEFINE(HAVE_GETADDRINFO, 1, [have getaddrinfo])],
  280 	      [AC_CHECK_LIB(socket, getaddrinfo,
  281 			    [AC_DEFINE(HAVE_GETADDRINFO, 1,
  282 				       [have getaddrinfo])])])
  283 
  284 AC_SEARCH_LIBS(fmod, m)
  285 AC_SEARCH_LIBS(isinf, m)
  286 AC_SEARCH_LIBS(ismod, m)
  287 dnl Don't look for libsigsegv on OSF/1, gives us severe headaches
  288 case $host_os in
  289 osf1)	: ;;
  290 *)
  291 	gl_LIBSIGSEGV
  292 	;;
  293 esac
  294 
  295 # Need the check for mkstemp and tmpfile for missing_d/snprintf.c.
  296 AC_CHECK_FUNCS(__etoa_l atexit btowc fmod gai_strerror \
  297 	getgrent getgroups grantpt \
  298 	fwrite_unlocked \
  299 	isascii isblank iswctype iswlower iswupper mbrlen \
  300 	memcmp memcpy memcpy_ulong memmove memset \
  301 	memset_ulong mkstemp posix_openpt setenv setlocale setsid sigprocmask \
  302 	snprintf strchr \
  303 	strerror strftime strcasecmp strncasecmp strcoll strtod strtoul \
  304 	system timegm tmpfile towlower towupper tzset usleep waitpid wcrtomb \
  305 	wcscoll wctype)
  306 dnl this check is for both mbrtowc and the mbstate_t type, which is good
  307 AC_FUNC_MBRTOWC
  308 
  309 dnl check for dynamic linking
  310 dnl This is known to be very primitive
  311 AC_ARG_ENABLE([extensions],
  312 	[AS_HELP_STRING([--disable-extensions], [disable dynamic extensions (default is detect)])])
  313 if test "$enable_extensions" != "no"
  314 then
  315 	extensions_supported=no
  316 
  317 	dnl On MirBSD (and probably other systems), don't even try.
  318 	case $host_os in
  319 	mirbsd* | openedition*)	# OS/390 z/OS POSIX layer
  320 		;;
  321 	*)
  322 	AC_CHECK_HEADER(dlfcn.h,
  323 		[
  324 		# Check this separately. Some systems have dlopen
  325 		# in libc. Notably freebsd and cygwin.
  326 		# HP-NSK has it in zrldsrl
  327 		AC_SEARCH_LIBS(dlopen, dl zrldsrl, gawk_have_dlopen=yes, gawk_have_dlopen=no)
  328 		# Only do DYNAMIC if we have the lib. z/OS (some versions) have
  329 		# the header but not the lib, apparently
  330 		if test "$gawk_have_dlopen" = yes
  331 		then
  332 			extensions_supported=yes
  333 			AC_DEFINE([DYNAMIC], 1, [dynamic loading is possible])
  334 		fi
  335 	])
  336 		;;
  337 	esac
  338 
  339 	if test "$enable_extensions$extensions_supported" = "yesno"
  340 	then
  341 		AC_MSG_ERROR([extension support requested, but unavailable])
  342 	fi
  343 	enable_extensions=$extensions_supported
  344 fi
  345 AM_CONDITIONAL([ENABLE_EXTENSIONS], [test "$enable_extensions" = "yes"])
  346 
  347 dnl check for how to use getpgrp
  348 dnl have to hardwire it for VMS POSIX. Sigh.
  349 dnl ditto for BeOS, OS/2, and MS-DOS.
  350 case $host_os in
  351 vms*|beos*|os2*|msdos)
  352 	AC_DEFINE(GETPGRP_VOID, 1,
  353 	  [Define to 1 if the getpgrp function requires zero arguments.])
  354 	;;
  355 *)	AC_FUNC_GETPGRP
  356 	;;
  357 esac
  358 
  359 dnl check for printf %F format
  360 AC_MSG_CHECKING([for printf %F format])
  361 AC_RUN_IFELSE([
  362 AC_LANG_SOURCE([
  363 #include <stdio.h>
  364 #include <string.h>
  365 
  366 int main()
  367 {
  368 	char buf[[100]];
  369 
  370 	sprintf(buf, "%F", 123.45);
  371 
  372 	if (strcmp(buf, "123.450000") == 0)
  373 		return 0;
  374 	else
  375 		return 1;
  376 }
  377 ])],
  378 	has_f_format=yes,
  379 	has_f_format=no,
  380 	has_f_format=no  dnl Cross-compiling, assuming the worst.
  381 )
  382 if test "$has_f_format" = yes
  383 then
  384 	AC_DEFINE(PRINTF_HAS_F_FORMAT, 1, [Define to 1 if *printf supports %F format])
  385 fi
  386 AC_MSG_RESULT($has_f_format)
  387 
  388 dnl check for printf %a format
  389 AC_MSG_CHECKING([for printf %a format])
  390 AC_RUN_IFELSE([
  391 AC_LANG_SOURCE([
  392 #include <stdio.h>
  393 #include <string.h>
  394 
  395 int main()
  396 {
  397 	char buf[[100]];
  398 
  399 	sprintf(buf, "%a", 8.0);
  400 
  401 	if (strncmp(buf, "0x", 2) == 0)
  402 		return 0;
  403 	else
  404 		return 1;
  405 }
  406 ])],
  407 	has_a_format=yes,
  408 	has_a_format=no,
  409 	has_a_format=no  dnl Cross-compiling, assuming the worst.
  410 )
  411 if test "$has_a_format" = yes
  412 then
  413 	AC_DEFINE(PRINTF_HAS_A_FORMAT, 1, [Define to 1 if *printf supports %a format])
  414 fi
  415 AC_MSG_RESULT($has_a_format)
  416 
  417 dnl check for sockets
  418 GAWK_AC_LIB_SOCKETS
  419 
  420 dnl check for readline support
  421 GAWK_CHECK_READLINE
  422 
  423 dnl check for mpfr support
  424 case `uname -m` in
  425 *'Power Macintosh'*)
  426 	: ;;
  427 *)
  428 	case $SKIP_MPFR in
  429 	no)	GNUPG_CHECK_MPFR
  430 		;;
  431 	esac
  432 	;;
  433 esac
  434 
  435 dnl checks for structure members
  436 AC_CHECK_MEMBERS([struct stat.st_blksize])
  437 AC_CHECK_MEMBERS([struct passwd.pw_passwd],,,[
  438 #include <sys/types.h>
  439 #include <pwd.h>
  440 ])
  441 AC_CHECK_MEMBERS([struct group.gr_passwd],,,[
  442 #include <sys/types.h>
  443 #include <grp.h>
  444 ])
  445 AC_STRUCT_TM
  446 AC_STRUCT_TIMEZONE
  447 
  448 dnl checks for compiler characteristics
  449 AC_C_CHAR_UNSIGNED
  450 AC_C_CONST
  451 AC_C_RESTRICT
  452 AC_C_INLINE
  453 AC_C_STRINGIZE
  454 
  455 AC_CONFIG_HEADERS([config.h:configh.in])
  456 AH_BOTTOM([#include "custom.h"])
  457 
  458 dnl Crude but small hack to make plug-ins work on Mac OS X
  459 dnl We should really use the libtool value for shrext_cmds, but that
  460 dnl is not available here, since we do not use libtool at the top level.
  461 case $acl_shlibext in
  462 dylib)	GAWKLIBEXT=so ;;	# MacOS uses .dylib for shared libraries, but libtool uses .so for modules
  463 *) GAWKLIBEXT=$acl_shlibext ;;
  464 esac
  465 AC_SUBST(GAWKLIBEXT)
  466 
  467 AC_CONFIG_FILES(Makefile
  468 	support/Makefile
  469 	awklib/Makefile
  470 	doc/Makefile
  471 	extras/Makefile
  472 	po/Makefile.in
  473 	test/Makefile)
  474 if test "$enable_extensions" = "yes"
  475 then
  476 	AC_CONFIG_SUBDIRS(extension)
  477 fi
  478 AC_OUTPUT
  479 if test "$GCC" = yes &&
  480    test -f $srcdir/.developing &&
  481    grep -i debug $srcdir/.developing > /dev/null
  482 then
  483 	for i in . support extension
  484 	do
  485 		sed '/-O2/s///' $i/Makefile > foo
  486 		mv foo $i/Makefile
  487 	done
  488 fi