snapshot of project "mawk", label t20210528

This commit is contained in:
Thomas E. Dickey 2021-05-29 00:17:26 +00:00
parent ccf03f93ad
commit fe3d01dda1
28 changed files with 2951 additions and 2418 deletions

View File

@ -1,4 +1,9 @@
-- $MawkId: CHANGES,v 1.322 2020/10/22 22:23:40 tom Exp $
-- $MawkId: CHANGES,v 1.324 2021/05/28 08:01:58 tom Exp $
20210528
+ add FreeBSD build-scripts, for test-builds
+ updated configure macros
+ update config.guess and config.sub
20201023
+ start work on experimental approach to interval-expressions which

View File

@ -1,4 +1,4 @@
MANIFEST for mawk, version t20201023
MANIFEST for mawk, version t20210528
--------------------------------------------------------------------------------
MANIFEST this file
ACKNOWLEDGMENT acknowledgements
@ -133,6 +133,10 @@ package/debian/source subdirectory
package/debian/source/format debian build script
package/debian subdirectory
package/debian/watch debian build-script
package/freebsd subdirectory
package/freebsd/Makefile FreeBSD build-script
package/freebsd/distinfo FreeBSD build-script
package/freebsd/pkg-descr FreeBSD build-script
package subdirectory
package/mawk.spec RPM script for mawk
test subdirectory

View File

@ -1,7 +1,7 @@
# $MawkId: Makefile.in,v 1.55 2020/09/24 22:08:12 tom Exp $
# $MawkId: Makefile.in,v 1.56 2021/05/28 22:49:07 tom Exp $
# Makefile-template for MAWK
###############################################################################
# copyright 2009-2016,2020 Thomas E. Dickey
# copyright 2009-2020,2021 Thomas E. Dickey
# copyright 2010, Guido Berhoerster
# copyright 2009, Jonathan Nieder
# copyright 2005, Aleksey Cheusov
@ -57,7 +57,7 @@ CTAGS = @CTAGS@
ETAGS = @ETAGS@
LINT = @LINT@
LINTOPTS =
LINTOPTS = @LINT_OPTS@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@

297
aclocal.m4 vendored
View File

@ -1,11 +1,11 @@
dnl $MawkId: aclocal.m4,v 1.97 2020/09/12 22:30:01 tom Exp $
dnl $MawkId: aclocal.m4,v 1.98 2021/05/01 21:49:36 tom Exp $
dnl custom mawk macros for autoconf
dnl
dnl The symbols beginning "CF_MAWK_" were originally written by Mike Brennan,
dnl renamed for consistency by Thomas E Dickey.
dnl
dnl ---------------------------------------------------------------------------
dnl Copyright: 2008-2019,2020 by Thomas E. Dickey
dnl Copyright: 2008-2020,2021 by Thomas E. Dickey
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the
@ -63,7 +63,7 @@ define([CF_ACVERSION_COMPARE],
[ifelse([$8], , ,[$8])],
[ifelse([$9], , ,[$9])])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ADD_CFLAGS version: 14 updated: 2020/04/04 16:16:13
dnl CF_ADD_CFLAGS version: 15 updated: 2020/12/31 10:54:15
dnl -------------
dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
dnl $1 = flags to add
@ -81,19 +81,19 @@ cf_new_extra_cppflags=
for cf_add_cflags in $1
do
case $cf_fix_cppflags in
case "$cf_fix_cppflags" in
(no)
case $cf_add_cflags in
case "$cf_add_cflags" in
(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
case "$cf_add_cflags" in
(-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
if test "$cf_fix_cppflags" = yes ; then
CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
@ -106,7 +106,7 @@ case $cf_fix_cppflags in
(*$cf_add_cflags)
;;
(*)
case $cf_add_cflags in
case "$cf_add_cflags" in
(-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
@ -124,7 +124,7 @@ case $cf_fix_cppflags in
(yes)
CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[[^"]]*"'\''//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
@ -231,7 +231,7 @@ ifelse([$3],,[ :]dnl
])dnl
])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_BUILD_CC version: 8 updated: 2018/01/04 20:31:04
dnl CF_BUILD_CC version: 9 updated: 2021/01/02 09:31:20
dnl -----------
dnl If we're cross-compiling, allow the user to override the tools and their
dnl options. The configure script is oriented toward identifying the host
@ -297,7 +297,7 @@ if test "$cross_compiling" = yes ; then
: ${BUILD_CC:='${CC}'}
if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
AC_MSG_ERROR([Cross-build requires two compilers.
Use --with-build-cc to specify the native compiler.])
fi
@ -323,7 +323,46 @@ AC_SUBST(BUILD_EXEEXT)
AC_SUBST(BUILD_OBJEXT)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CC_ENV_FLAGS version: 9 updated: 2018/07/29 18:03:26
dnl CF_C11_NORETURN version: 3 updated: 2021/03/28 11:36:23
dnl ---------------
AC_DEFUN([CF_C11_NORETURN],
[
AC_MSG_CHECKING(if you want to use C11 _Noreturn feature)
CF_ARG_ENABLE(stdnoreturn,
[ --enable-stdnoreturn enable C11 _Noreturn feature for diagnostics],
[enable_stdnoreturn=yes],
[enable_stdnoreturn=no])
AC_MSG_RESULT($enable_stdnoreturn)
if test $enable_stdnoreturn = yes; then
AC_CACHE_CHECK([for C11 _Noreturn feature], cf_cv_c11_noreturn,
[AC_TRY_COMPILE([
#include <stdio.h>
#include <stdlib.h>
#include <stdnoreturn.h>
static _Noreturn void giveup(void) { exit(0); }
],
[if (feof(stdin)) giveup()],
cf_cv_c11_noreturn=yes,
cf_cv_c11_noreturn=no)
])
else
cf_cv_c11_noreturn=no,
fi
if test "$cf_cv_c11_noreturn" = yes; then
AC_DEFINE(HAVE_STDNORETURN_H, 1,[Define if <stdnoreturn.h> header is available and working])
AC_DEFINE_UNQUOTED(STDC_NORETURN,_Noreturn,[Define if C11 _Noreturn keyword is supported])
HAVE_STDNORETURN_H=1
else
HAVE_STDNORETURN_H=0
fi
AC_SUBST(HAVE_STDNORETURN_H)
AC_SUBST(STDC_NORETURN)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CC_ENV_FLAGS version: 10 updated: 2020/12/31 18:40:20
dnl ---------------
dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
dnl into CC. This will not help with broken scripts that wrap the compiler
@ -338,7 +377,7 @@ dnl outweighs that limitation.
AC_DEFUN([CF_CC_ENV_FLAGS],
[
# This should have been defined by AC_PROG_CC
: ${CC:=cc}
: "${CC:=cc}"
AC_MSG_CHECKING(\$CFLAGS variable)
case "x$CFLAGS" in
@ -387,7 +426,7 @@ case "$CC" in
esac
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03
dnl CF_CHECK_CACHE version: 13 updated: 2020/12/31 10:54:15
dnl --------------
dnl Check if we're accidentally using a cache from a different machine.
dnl Derive the system name, as a check for reusing the autoconf cache.
@ -401,7 +440,7 @@ dnl Note: we would use $ac_config_sub, but that is one of the places where
dnl autoconf 2.5x broke compatibility with autoconf 2.13
AC_DEFUN([CF_CHECK_CACHE],
[
if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
ifelse([$1],,[AC_CANONICAL_HOST],[$1])
system_name="$host_os"
else
@ -476,7 +515,7 @@ fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CLANG_COMPILER version: 3 updated: 2020/08/28 04:10:22
dnl CF_CLANG_COMPILER version: 8 updated: 2021/01/01 13:31:04
dnl -----------------
dnl Check if the given compiler is really clang. clang's C driver defines
dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does
@ -495,25 +534,56 @@ ifelse([$2],,CLANG_COMPILER,[$2])=no
if test "$ifelse([$1],,[$1],GCC)" = yes ; then
AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler)
cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments"
AC_TRY_COMPILE([],[
#ifdef __clang__
#else
make an error
#endif
],[ifelse([$2],,CLANG_COMPILER,[$2])=yes
cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
],[])
ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2]))
fi
if test "x$CLANG_COMPILER" = "xyes" ; then
CF_APPEND_TEXT(CFLAGS,-Wno-error=implicit-function-declaration)
CLANG_VERSION=none
if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then
case "$CC" in
(c[[1-9]][[0-9]]|*/c[[1-9]][[0-9]])
AC_MSG_WARN(replacing broken compiler alias $CC)
CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
CC=clang
;;
esac
AC_MSG_CHECKING(version of $CC)
CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
AC_MSG_RESULT($CLANG_VERSION)
for cf_clang_opt in \
-Qunused-arguments \
-Wno-error=implicit-function-declaration
do
AC_MSG_CHECKING(if option $cf_clang_opt works)
cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $cf_clang_opt"
AC_TRY_LINK([
#include <stdio.h>],[
printf("hello!\\n");],[
cf_clang_optok=yes],[
cf_clang_optok=no])
AC_MSG_RESULT($cf_clang_optok)
CFLAGS="$cf_save_CFLAGS"
if test "$cf_clang_optok" = yes; then
CF_VERBOSE(adding option $cf_clang_opt)
CF_APPEND_TEXT(CFLAGS,$cf_clang_opt)
fi
done
fi
])
dnl ---------------------------------------------------------------------------
dnl CF_CONST_X_STRING version: 4 updated: 2020/03/10 18:53:47
dnl CF_CONST_X_STRING version: 6 updated: 2021/01/01 13:31:04
dnl -----------------
dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most
dnl character-strings.
@ -525,7 +595,7 @@ dnl did not take into account the use of const for telling the compiler that
dnl string literals would be in readonly memory.
dnl
dnl As a workaround, one could (starting with X11R5) define XTSTRINGDEFINES, to
dnl let the compiler decide how to represent Xt's strings which were #define'd.
dnl let the compiler decide how to represent Xt's strings which were #define'd.
dnl That does not solve the problem of using the block of Xt's strings which
dnl are compiled into the library (and is less efficient than one might want).
dnl
@ -561,7 +631,7 @@ AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[
CF_RESTORE_XTRA_FLAGS([CF_CONST_X_STRING])
case $cf_cv_const_x_string in
case "$cf_cv_const_x_string" in
(no)
CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES)
;;
@ -610,7 +680,7 @@ AC_SUBST(SHOW_CC)
AC_SUBST(ECHO_CC)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_DISABLE_LEAKS version: 7 updated: 2012/10/02 20:55:03
dnl CF_DISABLE_LEAKS version: 9 updated: 2021/04/03 16:41:50
dnl ----------------
dnl Combine no-leak checks with the libraries or tools that are used for the
dnl checks.
@ -623,11 +693,13 @@ AC_REQUIRE([CF_WITH_VALGRIND])
AC_MSG_CHECKING(if you want to perform memory-leak testing)
AC_ARG_ENABLE(leaks,
[ --disable-leaks test: free permanent memory, analyze leaks],
[if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi],
: ${with_no_leaks:=no})
[enable_leaks=$enableval],
[enable_leaks=yes])
dnl with_no_leaks is more readable...
if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
AC_MSG_RESULT($with_no_leaks)
if test "$with_no_leaks" = yes ; then
if test "$enable_leaks" = no ; then
AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.])
AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.])
fi
@ -648,7 +720,7 @@ then
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ENABLE_WARNINGS version: 7 updated: 2020/08/29 09:05:21
dnl CF_ENABLE_WARNINGS version: 9 updated: 2021/01/05 19:40:50
dnl ------------------
dnl Configure-option to enable gcc warnings
dnl
@ -658,7 +730,7 @@ dnl warnings are enabled. For other values:
dnl yes: always do this, e.g., to use in generated library-headers
dnl no: never do this
AC_DEFUN([CF_ENABLE_WARNINGS],[
if ( test "$GCC" = yes || test "$GXX" = yes )
if test "$GCC" = yes || test "$GXX" = yes
then
CF_FIX_WARNINGS(CFLAGS)
CF_FIX_WARNINGS(CPPFLAGS)
@ -666,10 +738,10 @@ CF_FIX_WARNINGS(LDFLAGS)
AC_MSG_CHECKING(if you want to turn on gcc warnings)
CF_ARG_ENABLE(warnings,
[ --enable-warnings test: turn on gcc compiler warnings],
[with_warnings=yes],
[with_warnings=no])
AC_MSG_RESULT($with_warnings)
if test "$with_warnings" = "yes"
[enable_warnings=yes],
[enable_warnings=no])
AC_MSG_RESULT($enable_warnings)
if test "$enable_warnings" = "yes"
then
ifelse($2,,[CF_GCC_ATTRIBUTES])
CF_GCC_WARNINGS($1)
@ -678,7 +750,7 @@ ifelse($2,yes,[CF_GCC_ATTRIBUTES])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_FIX_WARNINGS version: 2 updated: 2020/08/28 15:08:28
dnl CF_FIX_WARNINGS version: 3 updated: 2020/12/31 18:40:20
dnl ---------------
dnl Warning flags do not belong in CFLAGS, CPPFLAGS, etc. Any of gcc's
dnl "-Werror" flags can interfere with configure-checks. Those go into
@ -686,7 +758,7 @@ dnl EXTRA_CFLAGS.
dnl
dnl $1 = variable name to repair
define([CF_FIX_WARNINGS],[
if ( test "$GCC" = yes || test "$GXX" = yes )
if test "$GCC" = yes || test "$GXX" = yes
then
case [$]$1 in
(*-Werror=*)
@ -696,10 +768,10 @@ then
do
case "x$cf_temp_scan" in
(x-Werror=*)
CF_APPEND_TEXT(EXTRA_CFLAGS,"$cf_temp_scan")
CF_APPEND_TEXT(EXTRA_CFLAGS,$cf_temp_scan)
;;
(*)
CF_APPEND_TEXT(cf_temp_flags,"$cf_temp_scan")
CF_APPEND_TEXT(cf_temp_flags,$cf_temp_scan)
;;
esac
done
@ -712,14 +784,16 @@ fi
AC_SUBST(EXTRA_CFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_GCC_ATTRIBUTES version: 19 updated: 2020/08/29 09:05:21
dnl CF_GCC_ATTRIBUTES version: 24 updated: 2021/03/20 12:00:25
dnl -----------------
dnl Test for availability of useful gcc __attribute__ directives to quiet
dnl compiler warnings. Though useful, not all are supported -- and contrary
dnl to documentation, unrecognized directives cause older compilers to barf.
AC_DEFUN([CF_GCC_ATTRIBUTES],
[
if ( test "$GCC" = yes || test "$GXX" = yes )
[AC_REQUIRE([AC_PROG_FGREP])dnl
AC_REQUIRE([CF_C11_NORETURN])dnl
if test "$GCC" = yes || test "$GXX" = yes
then
cat > conftest.i <<EOF
#ifndef GCC_PRINTF
@ -738,7 +812,7 @@ EOF
if test "$GCC" = yes
then
AC_CHECKING([for $CC __attribute__ directives])
cat > conftest.$ac_ext <<EOF
cat > "conftest.$ac_ext" <<EOF
#line __oline__ "${as_me:-configure}"
#include "confdefs.h"
#include "conftest.h"
@ -754,8 +828,8 @@ cat > conftest.$ac_ext <<EOF
#define GCC_SCANFLIKE(fmt,var) /*nothing*/
#endif
extern void wow(char *,...) GCC_SCANFLIKE(1,2);
extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
extern void foo(void) GCC_NORETURN;
extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
extern GCC_NORETURN void foo(void);
int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
EOF
cf_printf_attribute=no
@ -766,7 +840,7 @@ EOF
cf_directive="__attribute__(($cf_attribute))"
echo "checking for $CC $cf_directive" 1>&AC_FD_CC
case $cf_attribute in
case "$cf_attribute" in
(printf)
cf_printf_attribute=yes
cat >conftest.h <<EOF
@ -789,7 +863,7 @@ EOF
if AC_TRY_EVAL(ac_compile); then
test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
cat conftest.h >>confdefs.h
case $cf_attribute in
case "$cf_attribute" in
(noreturn)
AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc])
;;
@ -816,9 +890,9 @@ EOF
fi
done
else
fgrep define conftest.i >>confdefs.h
${FGREP-fgrep} define conftest.i >>confdefs.h
fi
rm -rf conftest*
rm -rf ./conftest*
fi
])dnl
dnl ---------------------------------------------------------------------------
@ -839,7 +913,7 @@ CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_GCC_WARNINGS version: 38 updated: 2020/08/28 15:08:28
dnl CF_GCC_WARNINGS version: 41 updated: 2021/01/01 16:53:59
dnl ---------------
dnl Check if the compiler supports useful warning options. There's a few that
dnl we don't use, simply because they're too noisy:
@ -863,7 +937,7 @@ AC_DEFUN([CF_GCC_WARNINGS],
[
AC_REQUIRE([CF_GCC_VERSION])
if test "x$have_x" = xyes; then CF_CONST_X_STRING fi
cat > conftest.$ac_ext <<EOF
cat > "conftest.$ac_ext" <<EOF
#line __oline__ "${as_me:-configure}"
int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
EOF
@ -927,16 +1001,16 @@ then
CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
if AC_TRY_EVAL(ac_compile); then
test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
case $cf_opt in
case "$cf_opt" in
(Winline)
case $GCC_VERSION in
case "$GCC_VERSION" in
([[34]].*)
CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
continue;;
esac
;;
(Wpointer-arith)
case $GCC_VERSION in
case "$GCC_VERSION" in
([[12]].*)
CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
continue;;
@ -948,7 +1022,7 @@ then
done
CFLAGS="$cf_save_CFLAGS"
fi
rm -rf conftest*
rm -rf ./conftest*
AC_SUBST(EXTRA_CFLAGS)
])dnl
@ -1072,7 +1146,7 @@ AC_DEFUN([CF_HELP_MESSAGE],
AC_DIVERT_HELP($1)])dnl
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_INTEL_COMPILER version: 7 updated: 2015/04/12 15:39:00
dnl CF_INTEL_COMPILER version: 8 updated: 2021/01/01 16:53:59
dnl -----------------
dnl Check if the given compiler is really the Intel compiler for Linux. It
dnl tries to imitate gcc, but does not return an error when it finds a mismatch
@ -1090,7 +1164,7 @@ AC_REQUIRE([AC_CANONICAL_HOST])
ifelse([$2],,INTEL_COMPILER,[$2])=no
if test "$ifelse([$1],,[$1],GCC)" = yes ; then
case $host_os in
case "$host_os" in
(linux*|gnu*)
AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler)
cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
@ -1160,7 +1234,7 @@ ifdef([AC_FUNC_FSEEKO],[
])
])
dnl ---------------------------------------------------------------------------
dnl CF_LOCALE version: 5 updated: 2012/10/06 11:17:15
dnl CF_LOCALE version: 6 updated: 2021/01/02 09:31:20
dnl ---------
dnl Check if we have setlocale() and its header, <locale.h>
dnl The optional parameter $1 tells what to do if we do have locale support.
@ -1174,17 +1248,18 @@ AC_TRY_LINK([#include <locale.h>],
[cf_cv_locale=no])
])
AC_MSG_RESULT($cf_cv_locale)
test $cf_cv_locale = yes && { ifelse($1,,AC_DEFINE(LOCALE,1,[Define to 1 if we have locale support]),[$1]) }
test "$cf_cv_locale" = yes && { ifelse($1,,AC_DEFINE(LOCALE,1,[Define to 1 if we have locale support]),[$1]) }
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MAKEFLAGS version: 18 updated: 2018/02/21 21:26:03
dnl CF_MAKEFLAGS version: 20 updated: 2021/01/03 19:29:49
dnl ------------
dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make'
dnl options to lower-levels. It's very useful for "make -n" -- if we have it.
dnl (GNU 'make' does both, something POSIX 'make', which happens to make the
dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-)
AC_DEFUN([CF_MAKEFLAGS],
[
[AC_REQUIRE([AC_PROG_FGREP])dnl
AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[
cf_cv_makeflags=''
for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
@ -1194,10 +1269,10 @@ SHELL = $SHELL
all :
@ echo '.$cf_option'
CF_EOF
cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[[ ]]*$,,'`
cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[[ ]]*$,,'`
case "$cf_result" in
(.*k|.*kw)
cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
case "$cf_result" in
(.*CC=*) cf_cv_makeflags=
;;
@ -1219,7 +1294,7 @@ CF_EOF
AC_SUBST(cf_cv_makeflags)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MAKE_PHONY version: 1 updated: 2020/09/08 21:08:52
dnl CF_MAKE_PHONY version: 3 updated: 2021/01/08 16:08:21
dnl -------------
dnl Check if the make-program handles a ".PHONY" target, e.g,. a target which
dnl acts as a placeholder.
@ -1279,19 +1354,19 @@ CF_EOF
echo "no (case 4)" > ../conftest.tmp
diff always.out once.out
else
cf_check=`cat always.out`
cf_check="`cat always.out`"
if test "x$cf_check" != "x$cf_data" ; then
echo "no (case 5)" > ../conftest.tmp
else
echo yes > ../conftest.tmp
rm -f *.out
rm -f ./*.out
continue
fi
fi
break
done
) >&AC_FD_CC 2>&1
cf_cv_make_PHONY=`cat conftest.tmp`
cf_cv_make_PHONY="`cat conftest.tmp`"
rm -rf conftest*
])
MAKE_NO_PHONY="#"
@ -1688,7 +1763,7 @@ LIBS="$cf_FPE_LIBS"
rm -f conftest.$ac_ext fpe_check$ac_exeext # whew!!
])
dnl ---------------------------------------------------------------------------
dnl CF_MIXEDCASE_FILENAMES version: 7 updated: 2015/04/12 15:39:00
dnl CF_MIXEDCASE_FILENAMES version: 9 updated: 2021/01/01 16:53:59
dnl ----------------------
dnl Check if the file-system supports mixed-case filenames. If we're able to
dnl create a lowercase name and see it as uppercase, it doesn't support that.
@ -1696,8 +1771,8 @@ AC_DEFUN([CF_MIXEDCASE_FILENAMES],
[
AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
if test "$cross_compiling" = yes ; then
case $target_alias in
(*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
case "$target_alias" in
(*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
cf_cv_mixedcase=no
;;
(*)
@ -1726,7 +1801,7 @@ AC_DEFUN([CF_MSG_LOG],[
echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_NO_LEAKS_OPTION version: 6 updated: 2015/04/12 15:39:00
dnl CF_NO_LEAKS_OPTION version: 8 updated: 2021/01/05 20:05:09
dnl ------------------
dnl see CF_WITH_NO_LEAKS
AC_DEFUN([CF_NO_LEAKS_OPTION],[
@ -1736,13 +1811,13 @@ AC_ARG_WITH($1,
[AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[
$4
])
: ${with_cflags:=-g}
: ${with_no_leaks:=yes}
: "${with_cflags:=-g}"
: "${enable_leaks:=no}"
with_$1=yes],
[with_$1=])
AC_MSG_RESULT(${with_$1:-no})
case .$with_cflags in
case ".$with_cflags" in
(.*-g*)
case .$CFLAGS in
(.*-g*)
@ -1755,7 +1830,7 @@ case .$with_cflags in
esac
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_PATH_SYNTAX version: 16 updated: 2015/04/18 08:56:57
dnl CF_PATH_SYNTAX version: 18 updated: 2020/12/31 18:40:20
dnl --------------
dnl Check the argument to see that it looks like a pathname. Rewrite it if it
dnl begins with one of the prefix/exec_prefix variables, and then again if the
@ -1775,16 +1850,16 @@ case ".[$]$1" in
;;
(.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX
;;
(.\[$]{*prefix}*|.\[$]{*dir}*)
(.\[$]\{*prefix\}*|.\[$]\{*dir\}*)
eval $1="[$]$1"
case ".[$]$1" in
(.NONE/*)
$1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
$1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%`
;;
esac
;;
(.no|.NONE/*)
$1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
$1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%`
;;
(*)
ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
@ -1948,7 +2023,7 @@ esac
AC_SUBST(LINT_OPTS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_REGEX version: 15 updated: 2020/09/12 18:30:01
dnl CF_REGEX version: 18 updated: 2021/01/01 16:53:59
dnl --------
dnl Attempt to determine if we've got one of the flavors of regular-expression
dnl code that we can support.
@ -1957,7 +2032,7 @@ AC_DEFUN([CF_REGEX],
cf_regex_func=no
cf_regex_libs=
case $host_os in
case "$host_os" in
(mingw*)
# -lsystre -ltre -lintl -liconv
AC_CHECK_LIB(systre,regcomp,[
@ -1967,7 +2042,9 @@ case $host_os in
CF_ADD_LIB(systre)
cf_regex_func=regcomp
],[
AC_CHECK_LIB(gnurx,regcomp,cf_regex_func=regcomp)
AC_CHECK_LIB(gnurx,regcomp,[
CF_ADD_LIB(gnurx)
cf_regex_func=regcomp])
])
;;
(*)
@ -1998,7 +2075,7 @@ fi
AC_CACHE_CHECK(for regular-expression headers,cf_cv_regex_hdrs,[
cf_cv_regex_hdrs=no
case $cf_regex_func in
case "$cf_regex_func" in
(compile)
for cf_regex_hdr in regexp.h regexpr.h
do
@ -2034,7 +2111,7 @@ esac
])
case $cf_cv_regex_hdrs in
case "$cf_cv_regex_hdrs" in
(no) AC_MSG_WARN(no regular expression header found) ;;
(regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS,1,[Define to 1 to include regex.h for regular expressions]) ;;
(regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS,1,[Define to 1 to include regexp.h for regular expressions]) ;;
@ -2128,7 +2205,7 @@ then
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_SRAND version: 14 updated: 2020/07/30 16:32:36
dnl CF_SRAND version: 15 updated: 2021/01/02 09:31:20
dnl --------
dnl Check for functions similar to srand() and rand(). lrand48() and random()
dnl return a 31-bit value, while rand() returns a value less than RAND_MAX
@ -2161,7 +2238,7 @@ done
])
if test "$cf_cv_srand_func" != unknown ; then
AC_CACHE_CHECK(for range of random-integers, cf_cv_rand_max,[
case $cf_cv_srand_func in
case "$cf_cv_srand_func" in
(srand/rand)
cf_cv_rand_max=RAND_MAX
cf_rand_max=16
@ -2186,7 +2263,7 @@ if test "$cf_cv_srand_func" != unknown ; then
[cf_cv_rand_max="(1UL<<$cf_rand_max)-1"])
])
case $cf_cv_srand_func in
case "$cf_cv_srand_func" in
(*/arc4random)
AC_MSG_CHECKING(if <bsd/stdlib.h> should be included)
AC_TRY_COMPILE([#include <bsd/stdlib.h>],
@ -2332,7 +2409,7 @@ if test "$with_dmalloc" = yes ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_WITH_MAN2HTML version: 8 updated: 2018/06/27 18:44:03
dnl CF_WITH_MAN2HTML version: 12 updated: 2021/01/03 18:30:50
dnl ----------------
dnl Check for man2html and groff. Prefer man2html over groff, but use groff
dnl as a fallback. See
@ -2345,7 +2422,8 @@ dnl We name that "man2html.tmp".
dnl
dnl The shell script can be removed later, e.g., using "make distclean".
AC_DEFUN([CF_WITH_MAN2HTML],[
AC_REQUIRE([CF_PROG_GROFF])
AC_REQUIRE([CF_PROG_GROFF])dnl
AC_REQUIRE([AC_PROG_FGREP])dnl
case "x${with_man2html}" in
(xno)
@ -2418,6 +2496,7 @@ export GROFF_NO_SGR
CF_EOF
NROFF_OPTS=
if test "x$cf_with_groff" = xyes
then
MAN2HTML_NOTE="$GROFF_NOTE"
@ -2426,6 +2505,16 @@ then
$SHELL -c "$TBL_PATH \${ROOT}.\${TYPE} | $GROFF_PATH -P -o0 -I\${ROOT}_ -Thtml -\${MACS}"
CF_EOF
else
# disable hyphenation if this is groff
if test "x$GROFF_PATH" != xno
then
AC_MSG_CHECKING(if nroff is really groff)
cf_check_groff="`$NROFF_PATH --version 2>/dev/null | grep groff`"
test -n "$cf_check_groff" && cf_check_groff=yes
test -n "$cf_check_groff" || cf_check_groff=no
AC_MSG_RESULT($cf_check_groff)
test "x$cf_check_groff" = xyes && NROFF_OPTS="-rHY=0"
fi
MAN2HTML_NOTE=""
CF_PATH_SYNTAX(cf_man2html)
MAN2HTML_PATH="$cf_man2html"
@ -2440,10 +2529,10 @@ CF_EOF
LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man conftest.in >conftest.out
cf_man2html_1st=`fgrep -n MARKER conftest.out |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`
cf_man2html_top=`expr $cf_man2html_1st - 2`
cf_man2html_bot=`wc -l conftest.out |sed -e 's/[[^0-9]]//g'`
cf_man2html_bot=`expr $cf_man2html_bot - 2 - $cf_man2html_top`
cf_man2html_1st="`${FGREP-fgrep} -n MARKER conftest.out |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`"
cf_man2html_top=`expr "$cf_man2html_1st" - 2`
cf_man2html_bot="`wc -l conftest.out |sed -e 's/[[^0-9]]//g'`"
cf_man2html_bot=`expr "$cf_man2html_bot" - 2 - "$cf_man2html_top"`
cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot"
AC_MSG_RESULT($cf_man2html_top_bot)
@ -2467,7 +2556,7 @@ CF_EOF
done
LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man conftest.in >conftest.out
cf_man2html_page=`fgrep -n HEAD1 conftest.out |sed -n '$p' |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`
cf_man2html_page="`${FGREP-fgrep} -n HEAD1 conftest.out |sed -n '$p' |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`"
test -z "$cf_man2html_page" && cf_man2html_page=99999
test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999
@ -2476,13 +2565,13 @@ CF_EOF
cat >>$MAN2HTML_TEMP <<CF_EOF
: \${MAN2HTML_PATH=$MAN2HTML_PATH}
MAN2HTML_OPTS="\$MAN2HTML_OPTS -index -title="\$ROOT\(\$TYPE\)" -compress -pgsize $cf_man2html_page"
MAN2HTML_OPTS="\$MAN2HTML_OPTS -index -title=\"\$ROOT(\$TYPE)\" -compress -pgsize $cf_man2html_page"
case \${TYPE} in
(ms)
$TBL_PATH \${ROOT}.\${TYPE} | $NROFF_PATH -\${MACS} | \$MAN2HTML_PATH -topm=0 -botm=0 \$MAN2HTML_OPTS
$TBL_PATH \${ROOT}.\${TYPE} | $NROFF_PATH $NROFF_OPTS -\${MACS} | \$MAN2HTML_PATH -topm=0 -botm=0 \$MAN2HTML_OPTS
;;
(*)
$TBL_PATH \${ROOT}.\${TYPE} | $NROFF_PATH -\${MACS} | \$MAN2HTML_PATH $cf_man2html_top_bot \$MAN2HTML_OPTS
$TBL_PATH \${ROOT}.\${TYPE} | $NROFF_PATH $NROFF_OPTS -\${MACS} | \$MAN2HTML_PATH $cf_man2html_top_bot \$MAN2HTML_OPTS
;;
esac
CF_EOF
@ -2503,7 +2592,7 @@ CF_NO_LEAKS_OPTION(valgrind,
[USE_VALGRIND])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_XOPEN_SOURCE version: 55 updated: 2018/12/31 20:46:17
dnl CF_XOPEN_SOURCE version: 58 updated: 2021/05/01 17:49:36
dnl ---------------
dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
dnl or adapt to the vendor's definitions to get equivalent functionality,
@ -2522,7 +2611,7 @@ cf_XOPEN_SOURCE=ifelse([$1],,500,[$1])
cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2])
cf_xopen_source=
case $host_os in
case "$host_os" in
(aix[[4-7]]*)
cf_xopen_source="-D_ALL_SOURCE"
;;
@ -2568,7 +2657,15 @@ case $host_os in
(netbsd*)
cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
;;
(openbsd[[4-9]]*)
(openbsd[[6-9]]*)
# OpenBSD 6.x has broken locale support, both compile-time and runtime.
# see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
# Abusing the conformance level is a workaround.
AC_MSG_WARN(this system does not provide usable locale support)
cf_xopen_source="-D_BSD_SOURCE"
cf_XOPEN_SOURCE=700
;;
(openbsd[[4-5]]*)
# setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
cf_xopen_source="-D_BSD_SOURCE"
cf_XOPEN_SOURCE=600
@ -2615,7 +2712,7 @@ make an error
[cf_XOPEN_SOURCE_set=yes],
[cf_XOPEN_SOURCE_set=no])
AC_MSG_RESULT($cf_XOPEN_SOURCE_set)
if test $cf_XOPEN_SOURCE_set = yes
if test "$cf_XOPEN_SOURCE_set" = yes
then
AC_TRY_COMPILE([#include <stdlib.h>],[
#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
@ -2623,7 +2720,7 @@ make an error
#endif],
[cf_XOPEN_SOURCE_set_ok=yes],
[cf_XOPEN_SOURCE_set_ok=no])
if test $cf_XOPEN_SOURCE_set_ok = no
if test "$cf_XOPEN_SOURCE_set_ok" = no
then
AC_MSG_WARN(_XOPEN_SOURCE is lower than requested)
fi

View File

@ -1,8 +1,8 @@
/* array.c */
/*
$MawkId: array.c,v 1.25 2020/08/01 09:30:48 tom Exp $
$MawkId: array.c,v 1.26 2021/05/28 23:59:47 tom Exp $
copyright 2009-2019,2020 Thomas E. Dickey
copyright 2009-2020,2021 Thomas E. Dickey
copyright 1991-1996,2014 Michael D. Brennan
This is a source file for mawk, an implementation of
@ -274,9 +274,9 @@ array_loop_vector(
ARRAY A,
size_t *sizep)
{
STRING **ret;
*sizep = A->size;
if (A->size > 0) {
STRING **ret;
if (!(A->type & AY_STR))
add_string_associations(A);
ret = (STRING **) zmalloc(A->size * sizeof(STRING *));

View File

@ -1,6 +1,6 @@
/********************************************
bi_funct.c
copyright 2008-2016,2020, Thomas E. Dickey
copyright 2008-2020,2021, Thomas E. Dickey
copyright 1991-1995,1996, Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: bi_funct.c,v 1.113 2020/08/28 08:20:21 tom Exp $
* $MawkId: bi_funct.c,v 1.114 2021/05/28 23:38:12 tom Exp $
*/
#include <mawk.h>
@ -193,7 +193,6 @@ bi_index(CELL *sp)
{
size_t idx;
size_t len;
const char *p;
TRACE_FUNC("bi_index", sp);
@ -202,6 +201,7 @@ bi_index(CELL *sp)
cast2_to_s(sp);
if ((len = string(sp + 1)->len)) {
const char *p;
idx = (size_t) ((p = str_str(string(sp)->str,
string(sp)->len,
string(sp + 1)->str,
@ -1060,8 +1060,8 @@ bi_sub(CELL *sp)
CELL *cp; /* pointer to the replacement target */
CELL tc; /* build the new string here */
CELL sc; /* copy of the target CELL */
char *front, *middle, *back; /* pieces */
size_t front_len, middle_len, back_len;
char *front, *middle; /* pieces */
size_t middle_len;
TRACE_FUNC("bi_sub", sp);
@ -1085,9 +1085,9 @@ bi_sub(CELL *sp)
0);
if (middle != 0) {
front_len = (size_t) (middle - front);
back = middle + middle_len;
back_len = string(&sc)->len - front_len - middle_len;
size_t front_len = (size_t) (middle - front);
char *back = middle + middle_len;
size_t back_len = string(&sc)->len - front_len - middle_len;
if ((sp + 1)->type == C_REPLV) {
STRING *sval = new_STRING0(middle_len);
@ -1146,7 +1146,6 @@ gsub3(PTR re, CELL *repl, CELL *target)
int skip0 = -1;
size_t howmuch;
char *where;
TRACE(("called gsub3\n"));
@ -1163,11 +1162,11 @@ gsub3(PTR re, CELL *repl, CELL *target)
output = new_STRING0(limit);
for (j = 0; j <= (int) input->len; ++j) {
where = REmatch(input->str + j,
input->len - (size_t) j,
cast_to_re(re),
&howmuch,
(j != 0));
char *where = REmatch(input->str + j,
input->len - (size_t) j,
cast_to_re(re),
&howmuch,
(j != 0));
/*
* REmatch returns a non-null pointer if it found a match. But
* that can be an empty string, e.g., for "*" or "?". The length

8
cast.c
View File

@ -1,6 +1,6 @@
/********************************************
cast.c
copyright 2009-2016,2020, Thomas E. Dickey
copyright 2009-2020,2021, Thomas E. Dickey
copyright 1991-1995,1996, Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: cast.c,v 1.28 2020/09/11 23:36:20 tom Exp $
* $MawkId: cast.c,v 1.29 2021/05/28 23:45:04 tom Exp $
*/
/* cast.c */
@ -263,14 +263,13 @@ cast_for_split(CELL *cp)
#else
static const char meta[] = "^$.*+?|[]()";
#endif
static char xbuff[] = "\\X";
int c;
size_t len;
if (cp->type < C_STRING)
cast1_to_s(cp);
if ((len = string(cp)->len) == 1) {
int c;
if ((c = string(cp)->str[0]) == ' ') {
free_STRING(string(cp));
cp->type = C_SPACE;
@ -295,6 +294,7 @@ cast_for_split(CELL *cp)
return;
#endif
} else if ((strchr) (meta, c)) {
static char xbuff[] = "\\X";
xbuff[1] = (char) c;
free_STRING(string(cp));
cp->ptr = (PTR) new_STRING(xbuff);

95
config.guess vendored
View File

@ -1,8 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2020 Free Software Foundation, Inc.
# Copyright 2021 Thomas E. Dickey
# Copyright 1992-2021 Free Software Foundation, Inc.
timestamp='2020-04-26'
timestamp='2021-04-21'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -27,7 +28,7 @@ timestamp='2020-04-26'
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
#
# Please send patches to <config-patches@gnu.org>.
@ -50,7 +51,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2020 Free Software Foundation, Inc.
Copyright 1992-2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -133,14 +134,12 @@ fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "$UNAME_SYSTEM" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
LIBC=unknown
set_cc_for_build
cat <<-EOF > "$dummy.c"
@ -149,17 +148,29 @@ Linux|GNU|GNU/*)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#else
#elif defined(__GLIBC__)
LIBC=gnu
#else
#include <stdarg.h>
/* First heuristic to detect musl libc. */
#ifdef __DEFINED_va_list
LIBC=musl
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
# If ldd exists, use it to detect musl libc.
if command -v ldd >/dev/null && \
ldd --version 2>&1 | grep -q ^musl
then
LIBC=musl
# Second heuristic to detect musl libc.
if [ "$LIBC" = unknown ] &&
command -v ldd >/dev/null &&
ldd --version 2>&1 | grep -q ^musl; then
LIBC=musl
fi
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
if [ "$LIBC" = unknown ]; then
LIBC=gnu
fi
;;
esac
@ -178,12 +189,12 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
"/sbin/$sysctl" 2>/dev/null || \
"/usr/sbin/$sysctl" 2>/dev/null || \
/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
/usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
echo unknown)`
case "$UNAME_MACHINE_ARCH" in
aarch64eb) machine=aarch64_be-unknown ;;
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
@ -251,6 +262,10 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
exit ;;
*:SecBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
echo "$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE"
exit ;;
*:LibertyBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
@ -404,7 +419,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
@ -544,10 +559,10 @@ EOF
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
[ "$TARGET_BINARY_INTERFACE"x = x ]
if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
test "$TARGET_BINARY_INTERFACE"x = x
then
echo m88k-dg-dgux"$UNAME_RELEASE"
else
@ -575,12 +590,12 @@ EOF
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
if test -x /usr/bin/oslevel ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
@ -620,7 +635,7 @@ EOF
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/lslpp ] ; then
if test -x /usr/bin/lslpp ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
@ -655,7 +670,7 @@ EOF
9000/31?) HP_ARCH=m68000 ;;
9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
if test -x /usr/bin/getconf; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "$sc_cpu_version" in
@ -669,7 +684,7 @@ EOF
esac ;;
esac
fi
if [ "$HP_ARCH" = "" ]; then
if test "$HP_ARCH" = ""; then
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
@ -708,7 +723,7 @@ EOF
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ "$HP_ARCH" = hppa2.0w ]
if test "$HP_ARCH" = hppa2.0w
then
set_cc_for_build
@ -782,7 +797,7 @@ EOF
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
if test -x /usr/sbin/sysversion ; then
echo "$UNAME_MACHINE"-unknown-osf1mk
else
echo "$UNAME_MACHINE"-unknown-osf1
@ -939,7 +954,7 @@ EOF
if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arm*:Linux:*:*)
@ -985,6 +1000,9 @@ EOF
k1om:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m32r*:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
@ -1073,7 +1091,7 @@ EOF
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-"$LIBC"
exit ;;
riscv32:Linux:*:* | riscv64:Linux:*:*)
riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
@ -1097,7 +1115,7 @@ EOF
x86_64:Linux:*:*)
set_cc_for_build
LIBCABI=$LIBC
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_X32 >/dev/null
@ -1294,7 +1312,7 @@ EOF
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
if test -d /usr/nec; then
echo mips-nec-sysv"$UNAME_RELEASE"
else
echo mips-unknown-sysv"$UNAME_RELEASE"
@ -1342,6 +1360,9 @@ EOF
*:Rhapsody:*:*)
echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
exit ;;
arm64:Darwin:*:*)
echo aarch64-apple-darwin"$UNAME_RELEASE"
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
@ -1356,7 +1377,7 @@ EOF
else
set_cc_for_build
fi
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
@ -1466,8 +1487,8 @@ EOF
i*86:rdos:*:*)
echo "$UNAME_MACHINE"-pc-rdos
exit ;;
i*86:AROS:*:*)
echo "$UNAME_MACHINE"-pc-aros
*:AROS:*:*)
echo "$UNAME_MACHINE"-unknown-aros
exit ;;
x86_64:VMkernel:*:*)
echo "$UNAME_MACHINE"-unknown-esx
@ -1636,9 +1657,9 @@ This script (version $timestamp), has failed to recognize the
operating system you are using. If your script is old, overwrite *all*
copies of config.guess and config.sub with the latest versions from:
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
and
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
EOF
year=`echo $timestamp | sed 's,-.*,,'`

59
config.sub vendored
View File

@ -1,8 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2020 Free Software Foundation, Inc.
# Copyright 2021 Thomas E. Dickey
# Copyright 1992-2021 Free Software Foundation, Inc.
timestamp='2020-06-28'
timestamp='2021-04-30'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -33,7 +34,7 @@ timestamp='2020-06-28'
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@ -67,7 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2020 Free Software Foundation, Inc.
Copyright 1992-2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -1104,6 +1105,9 @@ case $cpu-$vendor in
xscale-* | xscalee[bl]-*)
cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;;
arm64-*)
cpu=aarch64
;;
# Recognize the canonical CPU Types that limit and/or modify the
# company names they are paired with.
@ -1162,8 +1166,8 @@ case $cpu-$vendor in
| alphapca5[67] | alpha64pca5[67] \
| am33_2.0 \
| amdgcn \
| arc | arceb \
| arm | arm[lb]e | arme[lb] | armv* \
| arc | arceb | arc64 \
| arm | arm[lb]e | arme[lb] | armv* \
| avr | avr32 \
| asmjs \
| ba \
@ -1182,6 +1186,7 @@ case $cpu-$vendor in
| k1om \
| le32 | le64 \
| lm32 \
| loongarch32 | loongarch64 | loongarchx32 \
| m32c | m32r | m32rle \
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
@ -1200,9 +1205,13 @@ case $cpu-$vendor in
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa32r3 | mipsisa32r3el \
| mipsisa32r5 | mipsisa32r5el \
| mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64r3 | mipsisa64r3el \
| mipsisa64r5 | mipsisa64r5el \
| mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
@ -1226,7 +1235,7 @@ case $cpu-$vendor in
| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
| pru \
| pyramid \
| riscv | riscv32 | riscv64 \
| riscv | riscv32 | riscv32be | riscv64 | riscv64be \
| rl78 | romp | rs6000 | rx \
| s390 | s390x \
| score \
@ -1238,6 +1247,7 @@ case $cpu-$vendor in
| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
| spu \
| tahoe \
| thumbv7* \
| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
| tron \
| ubicom32 \
@ -1275,7 +1285,7 @@ esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x$basic_os != x ]
if test x$basic_os != x
then
# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
@ -1285,6 +1295,10 @@ case $basic_os in
kernel=linux
os=`echo $basic_os | sed -e 's|gnu/linux|gnu|'`
;;
os2-emx)
kernel=os2
os=`echo $basic_os | sed -e 's|os2-emx|emx|'`
;;
nto-qnx*)
kernel=nto
os=`echo $basic_os | sed -e 's|nto-qnx|qnx|'`
@ -1364,13 +1378,7 @@ case $os in
os=psos
;;
qnx*)
case $cpu in
x86 | i*86)
;;
*)
os=nto-$os
;;
esac
os=qnx
;;
hiux*)
os=hiuxwe2
@ -1680,11 +1688,14 @@ fi
# Now, validate our (potentially fixed-up) OS.
case $os in
# Sometimes we do "kernel-abi", so those need to count as OSes.
# Sometimes we do "kernel-libc", so those need to count as OSes.
musl* | newlib* | uclibc*)
;;
# Likewise for "kernel-libc"
eabi | eabihf | gnueabi | gnueabihf)
# Likewise for "kernel-abi"
eabi* | gnueabi*)
;;
# VxWorks passes extra cpu info in the 4th filed.
simlinux | simwindows | spe)
;;
# Now accept the basic system types.
# The portable systems comes first.
@ -1701,12 +1712,12 @@ case $os in
| nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
| clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
| mirbsd* | netbsd* | dicos* | openedition* | ose* \
| bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
| bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
| ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
| bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
| ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
| udi* | lites* | ieee* | go32* | aux* | hcos* \
| chorusrdb* | cegcc* | glidix* \
| chorusrdb* | cegcc* | glidix* | serenity* \
| cygwin* | msys* | pe* | moss* | proelf* | rtems* \
| midipix* | mingw32* | mingw64* | mint* \
| uxpv* | beos* | mpeix* | udk* | moxiebox* \
@ -1719,7 +1730,7 @@ case $os in
| skyos* | haiku* | rdos* | toppers* | drops* | es* \
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
| nsk* | powerunix* | genode* | zvmoe* )
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*)
;;
# This one is extra strict with allowed versions
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
@ -1738,6 +1749,8 @@ esac
case $kernel-$os in
linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* )
;;
uclinux-uclibc* )
;;
-dietlibc* | -newlib* | -musl* | -uclibc* )
# These are just libc implementations, not actual OSes, and thus
# require a kernel.
@ -1746,8 +1759,12 @@ case $kernel-$os in
;;
kfreebsd*-gnu* | kopensolaris*-gnu*)
;;
vxworks-simlinux | vxworks-simwindows | vxworks-spe)
;;
nto-qnx*)
;;
os2-emx)
;;
*-eabi* | *-gnueabi*)
;;
-*)

4669
configure vendored

File diff suppressed because it is too large Load Diff

6
da.c
View File

@ -1,6 +1,6 @@
/********************************************
da.c
copyright 2008-2019,2020, Thomas E. Dickey
copyright 2008-2020,2021, Thomas E. Dickey
copyright 1991-1994,1995, Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: da.c,v 1.29 2020/08/24 08:26:08 tom Exp $
* $MawkId: da.c,v 1.30 2021/05/29 00:00:01 tom Exp $
*/
/* da.c */
@ -153,7 +153,6 @@ INST *
da_this(INST * p, INST * start, FILE *fp)
{
CELL *cp;
const char *name;
/* print the relative code address (label) */
fprintf(fp, "%03ld ", (long) (p - start));
@ -225,6 +224,7 @@ da_this(INST * p, INST * start, FILE *fp)
else if (cp == &fs_shadow)
fprintf(fp, "pushi\t@fs_shadow\n");
else {
const char *name;
if (cp > NF && cp <= LAST_PFIELD)
name = reverse_find(ST_FIELD, &cp);
else

12
field.c
View File

@ -1,6 +1,6 @@
/********************************************
field.c
copyright 2008-2016,2020 Thomas E. Dickey
copyright 2008-2020,2021 Thomas E. Dickey
copyright 1991-1995,2014 Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: field.c,v 1.38 2020/09/07 12:12:20 tom Exp $
* $MawkId: field.c,v 1.39 2021/05/29 00:00:11 tom Exp $
*/
/* field.c */
@ -517,8 +517,8 @@ build_field0(void)
STRING *ofs, *tail;
size_t len;
register CELL *cp;
register char *p, *q;
int cnt;
register char *p;
CELL **fbp, *cp_limit;
cast1_to_s(cellcpy(&c, OFS));
@ -571,7 +571,10 @@ build_field0(void)
fbp = fbankv;
cp = field + 1;
cp_limit = field + FBANK_SZ;
while (cnt-- > 0) {
register char *q;
memcpy(p, string(cp)->str, string(cp)->len);
p += string(cp)->len;
/* if not really string, free temp use of ptr */
@ -612,11 +615,12 @@ slow_cell_assign(CELL *target, CELL *source)
size_t i;
for (i = 1; i < fbankv_num_chunks * FBANKV_CHUNK_SIZE; i++) {
CELL *bank_start = fbankv[i];
CELL *bank_end = bank_start + FBANK_SZ;
CELL *bank_end;
if (bank_start == 0)
break;
bank_end = bank_start + FBANK_SZ;
if (bank_start <= target && target < bank_end) {
/* it is a field */
field_assign(target, source);

7
fin.c
View File

@ -1,6 +1,6 @@
/********************************************
fin.c
copyright 2008-2018,2020. Thomas E. Dickey
copyright 2008-2020,2021. Thomas E. Dickey
copyright 1991-1995,1996. Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: fin.c,v 1.47 2020/01/20 01:56:30 tom Exp $
* $MawkId: fin.c,v 1.48 2021/05/28 23:59:35 tom Exp $
*/
/* fin.c */
@ -461,7 +461,6 @@ open_main(void)
static FIN *
next_main(int open_flag) /* called by open_main() if on */
{
register CELL *cp;
CELL argc; /* copy of ARGC */
CELL c_argi; /* cell copy of argi */
CELL argval; /* copy of ARGV[c_argi] */
@ -482,6 +481,8 @@ next_main(int open_flag) /* called by open_main() if on */
cast1_to_d(&argc);
while (argi < argc.dval) {
register CELL *cp;
c_argi.dval = argi;
argi += 1.0;

19
hash.c
View File

@ -1,6 +1,6 @@
/********************************************
hash.c
copyright 2008-2010,2012, Thomas E. Dickey
copyright 2008-2012,2021, Thomas E. Dickey
copyright 1991-1993,1994, Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,20 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: hash.c,v 1.19 2012/11/02 00:39:27 tom Exp $
* @Log: hash.c,v @
* Revision 1.3 1994/10/08 19:15:43 mike
* remove SM_DOS
*
* Revision 1.2 1993/07/16 00:17:35 mike
* cleanup
*
* Revision 1.1.1.1 1993/07/03 18:58:14 mike
* move source to cvs
*
* Revision 5.1 1991/12/05 07:56:05 brennan
* 1.1 pre-release
*
* $MawkId: hash.c,v 1.20 2021/05/28 23:59:20 tom Exp $
*/
/* hash.c */
@ -209,11 +196,11 @@ void
restore_ids(void)
{
register HASHNODE *p, *q;
register unsigned h;
q = save_list;
save_list = (HASHNODE *) 0;
while (q) {
register unsigned h;
p = q;
q = q->link;
free_hashnode(p);

12
init.c
View File

@ -1,6 +1,6 @@
/********************************************
init.c
copyright 2008-2017,2020, Thomas E. Dickey
copyright 2008-2020,2021, Thomas E. Dickey
copyright 1991-1994,1995, Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: init.c,v 1.73 2020/09/25 20:55:05 tom Exp $
* $MawkId: init.c,v 1.74 2021/05/29 00:00:53 tom Exp $
*/
/* init.c */
@ -197,7 +197,6 @@ static W_OPTIONS
parse_w_opt(char *source, char **next, int *args)
{
W_OPTIONS result = W_UNKNOWN;
int n;
int match = -1;
const char *first;
@ -210,6 +209,7 @@ parse_w_opt(char *source, char **next, int *args)
first = source;
if (*source != '\0') {
int n;
char mark;
while (*source != '\0' && *source != ',' && *source != '=') {
++source;
@ -702,14 +702,16 @@ load_environ(ARRAY ENV)
{
CELL c;
register char **p = environ; /* walks environ */
char *s; /* looks for the '=' */
CELL *cp; /* pts at ENV[&c] */
c.type = C_STRING;
while (*p) {
char *s; /* looks for the '=' */
if ((s = strchr(*p, '='))) { /* shouldn't fail */
CELL *cp; /* pts at ENV[&c] */
size_t len = (size_t) (s - *p);
c.ptr = (PTR) new_STRING0(len);
memcpy(string(&c)->str, *p, len);
s++;

37
jmp.c
View File

@ -1,6 +1,6 @@
/********************************************
jmp.c
copyright 2009,2010, Thomas E. Dickey
copyright 2009-2010,2021, Thomas E. Dickey
copyright 1991-1993,1995, Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,28 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: jmp.c,v 1.6 2010/12/10 17:00:00 tom Exp $
* @Log: jmp.c,v @
* Revision 1.4 1995/06/18 19:42:19 mike
* Remove some redundant declarations and add some prototypes
*
* Revision 1.3 1995/04/21 14:20:16 mike
* move_level variable to fix bug in arglist patching of moved code.
*
* Revision 1.2 1993/07/14 13:17:49 mike
* rm SIZE_T and run thru indent
*
* Revision 1.1.1.1 1993/07/03 18:58:15 mike
* move source to cvs
*
* Revision 5.3 1993/01/09 19:03:44 mike
* code_pop checks if the resolve_list needs relocation
*
* Revision 5.2 1993/01/07 02:50:33 mike
* relative vs absolute code
*
* Revision 5.1 1991/12/05 07:56:10 brennan
* 1.1 pre-release
* $MawkId: jmp.c,v 1.7 2021/05/29 00:17:15 tom Exp $
*/
/* this module deals with back patching jumps, breaks and continues,
@ -87,10 +66,10 @@ code_jmp(int jtype, INST * target)
void
patch_jmp(INST * target)
{
register JMP *p;
register INST *source; /* jmp starts here */
if (!error_state) {
register JMP *p;
register INST *source; /* jmp starts here */
#ifdef DEBUG
if (!jmp_top)
bozo("jmp stack underflow");
@ -147,8 +126,7 @@ BC_insert(int type, INST * address)
void
BC_clear(INST * B_address, INST * C_address)
{
register BC *p, *q;
INST *source;
register BC *p;
if (error_state)
return;
@ -156,6 +134,9 @@ BC_clear(INST * B_address, INST * C_address)
p = bc_top;
/* pop down to the mark node */
while (p->type) {
INST *source;
register BC *q;
source = code_base + p->source_offset;
source->op = (int) ((p->type == 'B' ? B_address : C_address)
- source);

7
kw.c
View File

@ -1,6 +1,6 @@
/********************************************
kw.c
copyright 2008-2016,2020, Thomas E. Dickey
copyright 2008-2020,2021, Thomas E. Dickey
copyright 1991-1993, Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: kw.c,v 1.8 2020/08/25 20:33:33 tom Exp $
* $MawkId: kw.c,v 1.9 2021/05/29 00:17:26 tom Exp $
*/
/* kw.c */
@ -60,9 +60,10 @@ void
kw_init(void)
{
register const struct kw *p = keywords;
register SYMTAB *q;
while (p->text[0]) {
register SYMTAB *q;
q = insert(p->text);
q->type = ST_KEYWORD;
q->stval.kw = p++->kw;

16
mawk.h
View File

@ -1,6 +1,6 @@
/********************************************
mawk.h
copyright 2008-2019,2020 Thomas E. Dickey
copyright 2008-2020,2021 Thomas E. Dickey
copyright 1991-1995,1996 Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: mawk.h,v 1.60 2020/09/25 20:54:52 tom Exp $
* $MawkId: mawk.h,v 1.62 2021/05/28 22:02:11 tom Exp $
*/
/* mawk.h */
@ -32,6 +32,12 @@ the GNU General Public License, version 2, 1991.
#include "types.h"
#ifdef HAVE_STDNORETURN_H
#include <stdnoreturn.h>
#undef GCC_NORETURN
#define GCC_NORETURN STDC_NORETURN
#endif
#ifndef GCC_NORETURN
#define GCC_NORETURN /* nothing */
#endif
@ -149,8 +155,8 @@ extern CELL *repl_cpy(CELL *, CELL *);
extern void DB_cell_destroy(CELL *);
extern void overflow(const char *, unsigned);
extern void rt_overflow(const char *, unsigned);
extern void rt_error(const char *,...) GCC_NORETURN GCC_PRINTFLIKE(1,2);
extern void mawk_exit(int) GCC_NORETURN;
extern GCC_NORETURN void rt_error(const char *,...) GCC_PRINTFLIKE(1,2);
extern GCC_NORETURN void mawk_exit(int);
extern void da(INST *, FILE *);
extern INST *da_this(INST *, INST *, FILE *);
extern char *rm_escape(char *, size_t *);
@ -169,7 +175,7 @@ extern int yylex(void);
#endif
extern void yyerror(const char *);
extern void bozo(const char *) GCC_NORETURN;
extern GCC_NORETURN void bozo(const char *);
extern void errmsg(int, const char *,...) GCC_PRINTFLIKE(2,3);
extern void compile_error(const char *,...) GCC_PRINTFLIKE(1,2);

View File

@ -1,3 +1,9 @@
mawk-cur (1.3.4-20210528) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 28 May 2021 03:58:39 -0400
mawk-cur (1.3.4-20201023) unstable; urgency=low
* maintenance updates

View File

@ -5,7 +5,7 @@ Current maintainer: Thomas Dickey <dickey@invisible-island.net>
-------------------------------------------------------------------------------
mawk 1.3.4 and updates,
Copyright: 2008-2020 by Thomas E. Dickey
Copyright: 2008-2020,2021 by Thomas E. Dickey
mawk 1.3.4 includes substantial work by others:
Copyright 2009-2010 by Jonathan Nieder
Copyright 2005 by Aleksey Cheusov
@ -18,7 +18,7 @@ the GNU General Public License, version 2, 1991.
Files: aclocal.m4
Licence: other-BSD
Copyright: 2008-2019,2020 by Thomas E. Dickey
Copyright: 2008-2019,2021 by Thomas E. Dickey
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including

20
package/freebsd/Makefile Normal file
View File

@ -0,0 +1,20 @@
# Created by: Pedro F. Giffuni <giffunip@asme.org>
# $FreeBSD: head/lang/mawk/Makefile 516890 2019-11-06 14:17:48Z wen $
PORTNAME= mawk
DISTVERSION= 1.3.4-20190203
CATEGORIES= lang
MASTER_SITES= ftp://ftp.invisible-island.net/${PORTNAME}/
MAINTAINER= wen@FreeBSD.org
COMMENT= Interpreter for the AWK Programming Language
LICENSE= GPLv2
GNU_CONFIGURE= yes
USES= tar:tgz
PLIST_FILES= bin/mawk \
man/man1/mawk.1.gz
.include <bsd.port.mk>

3
package/freebsd/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1573049632
SHA256 (mawk-1.3.4-20190203.tgz) = daacb314029185bbef86b0df5627ad8591378d420fc32236f99f15a9a8a6b840
SIZE (mawk-1.3.4-20190203.tgz) = 466481

10
package/freebsd/pkg-descr Normal file
View File

@ -0,0 +1,10 @@
mawk is an interpreter for the AWK Programming Language. The AWK language is
useful for manipulation of data files, text retrieval and processing, and for
prototyping and experimenting with algorithms. mawk is a new awk meaning it
implements the AWK language as defined in Aho, Kernighan and Weinberger, The
AWK Programming Language, Addison-Wesley Publishing, 1988 (hereafter referred
to as the AWK book.) mawk conforms to the Posix 1003.2 (draft 11.3) definition
of the AWK language which contains a few features not described in the AWK
book, and mawk provides a small number of extensions.
WWW: https://invisible-island.net/mawk/

View File

@ -1,8 +1,8 @@
Summary: mawk - pattern scanning and text processing language
%define AppProgram mawk
%define AppVersion 1.3.4
%define AppRelease 20201023
# $MawkId: mawk.spec,v 1.90 2020/10/17 08:19:38 tom Exp $
%define AppRelease 20210528
# $MawkId: mawk.spec,v 1.91 2021/05/28 07:58:39 tom Exp $
Name: %{AppProgram}
Version: %{AppVersion}
Release: %{AppRelease}

View File

@ -1,6 +1,6 @@
/*
patchlev.h
copyright 2009-2019,2020, Thomas E. Dickey
copyright 2009-2020,2021, Thomas E. Dickey
copyright 1991-1996,2014, Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,9 +11,9 @@ the GNU General Public License, version 2, 1991.
*/
/*
* $MawkId: patchlev.h,v 1.116 2020/10/17 08:19:38 tom Exp $
* $MawkId: patchlev.h,v 1.118 2021/05/28 08:06:27 tom Exp $
*/
#define PATCH_BASE 1
#define PATCH_LEVEL 3
#define PATCH_STRING ".4"
#define DATE_STRING "20201023"
#define DATE_STRING "20210528"

View File

@ -1,6 +1,6 @@
/********************************************
print.c
copyright 2008-2016,2020. Thomas E. Dickey
copyright 2008-2020,2021. Thomas E. Dickey
copyright 1991-1996,2014. Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: print.c,v 1.39 2020/09/13 17:31:07 tom Exp $
* $MawkId: print.c,v 1.40 2021/05/29 00:00:22 tom Exp $
*/
#include "mawk.h"
@ -180,7 +180,6 @@ make_sfmt(const char *format,
int *prec,
int *flags)
{
int ch;
int parts = 0;
int digits = 0;
int value = 0;
@ -217,6 +216,7 @@ make_sfmt(const char *format,
}
while (*format != '\0' && success) {
int ch;
switch (ch = *format++) {
case '0':
case '1':

8
rexp.h
View File

@ -1,6 +1,6 @@
/********************************************
rexp.h
copyright 2008-2016,2020, Thomas E. Dickey
copyright 2008-2020,2021, Thomas E. Dickey
copyright 2010, Jonathan Nieder
copyright 1991,2014, Michael D. Brennan
@ -12,7 +12,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: rexp.h,v 1.38 2020/10/22 22:57:48 tom Exp $
* $MawkId: rexp.h,v 1.39 2021/05/28 08:23:39 tom Exp $
*/
#ifndef REXP_H
@ -21,7 +21,7 @@ the GNU General Public License, version 2, 1991.
#include "nstd.h"
#include "types.h"
#include <stdio.h>
#include <setjmp.h>
#include <setjmp.h>
extern PTR RE_malloc(size_t);
extern PTR RE_realloc(void *, size_t);
@ -165,7 +165,7 @@ extern void RE_or(MACHINE *, MACHINE *);
extern STATE *RE_close(MACHINE *);
extern STATE *RE_poscl(MACHINE *);
extern void RE_01(MACHINE *);
extern void RE_panic(const char *, ...) GCC_NORETURN GCC_PRINTFLIKE(1,2);
extern GCC_NORETURN void RE_panic(const char *, ...) GCC_PRINTFLIKE(1,2);
#ifndef NO_INTERVAL_EXPR
extern void RE_close_limit(MACHINE *, Int, Int);

View File

@ -1,6 +1,6 @@
/********************************************
version.c
copyright 2008-2019,2020 Thomas E. Dickey
copyright 2008-2020,2021 Thomas E. Dickey
copyright 1991-1996,2014 Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: version.c,v 1.31 2020/08/26 00:50:58 tom Exp $
* $MawkId: version.c,v 1.33 2021/05/28 23:30:56 tom Exp $
*/
#include "mawk.h"
@ -20,7 +20,7 @@ the GNU General Public License, version 2, 1991.
#define VERSION_STRING \
"mawk %d.%d%s %s\n\
Copyright 2008-2019,2020, Thomas E. Dickey\n\
Copyright 2008-2020,2021, Thomas E. Dickey\n\
Copyright 1991-1996,2014, Michael D. Brennan\n\n"
#define FMT_N "%-20s%.0f\n"