aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rw-r--r--Makefile.am6
-rw-r--r--Makefile.in6
-rw-r--r--configh.in3
-rwxr-xr-xconfigure14
-rw-r--r--configure.ac14
-rw-r--r--extension/ChangeLog7
-rw-r--r--extension/Makefile.am12
-rw-r--r--extension/Makefile.in12
-rw-r--r--regcomp.c12
10 files changed, 97 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 534b1242..88047c4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,21 @@
regexp smarter. Thanks to Ed Morton <mortoneccc@comcast.net>
for reporting the bug.
+2013-03-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ Don't build extensions if API isn't supported:
+
+ * Makefile.am (SUBDIRS): Move extension directory to last in case
+ building the extensions is not supported.
+ * configure.ac: Add check for MirBSD and don't even try to run the
+ checks for DYNAMIC if so.
+
+ Check for systems (MirBSD) where libc doesn't understand not
+ to use UTF-8 for LC_ALL=C.
+
+ * configure.ac (LIBC_IS_BORKED): AC_DEFINE if needed.
+ * regcomp.c (init_dfa): Change logic as needed if LIBC_IS_BORKED.
+
2013-02-28 Arnold D. Robbins <arnold@skeeve.com>
Cause profiling / pretty printing to include a list of
diff --git a/Makefile.am b/Makefile.am
index 1f1929a9..844fa2cf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,13 +67,15 @@ distcleancheck_listfiles = \
# The order to do things in.
# Build explicitly in "." in order to build gawk first, so
# that `make check' without a prior `make' works.
+#
+# Put 'extension' last, in case building the extensions is not supported.
SUBDIRS = \
. \
awklib \
doc \
po \
- extension \
- test
+ test \
+ extension
# what to make and install
bin_PROGRAMS = gawk
diff --git a/Makefile.in b/Makefile.in
index 3b9963da..0e6723ce 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -398,13 +398,15 @@ distcleancheck_listfiles = \
# The order to do things in.
# Build explicitly in "." in order to build gawk first, so
# that `make check' without a prior `make' works.
+#
+# Put 'extension' last, in case building the extensions is not supported.
SUBDIRS = \
. \
awklib \
doc \
po \
- extension \
- test
+ test \
+ extension
include_HEADERS = gawkapi.h
diff --git a/configh.in b/configh.in
index 350aac5f..661b117a 100644
--- a/configh.in
+++ b/configh.in
@@ -324,6 +324,9 @@
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
+/* libc is broken for regex handling */
+#undef LIBC_IS_BORKED
+
/* disable lint checks */
#undef NO_LINT
diff --git a/configure b/configure
index c4c89138..689b01fa 100755
--- a/configure
+++ b/configure
@@ -5875,6 +5875,14 @@ then
CFLAGS="$CFLAGS -D_SYSV3"
fi
+case `uname` in
+MirBSD | MirOS)
+
+$as_echo "#define LIBC_IS_BORKED 1" >>confdefs.h
+
+ ;;
+esac
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -10026,6 +10034,10 @@ $as_echo "#define HAVE_MBRTOWC 1" >>confdefs.h
fi
+case `uname` in
+MirBSD | MirOS)
+ : ;;
+*)
ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default"
if test "x$ac_cv_header_dlfcn_h" = xyes; then :
@@ -10108,6 +10120,8 @@ $as_echo "#define DYNAMIC 1" >>confdefs.h
fi
+ ;;
+esac
case `(uname) 2> /dev/null` in
*VMS*|*BeOS*|*OS/2*|*MS-DOS*)
diff --git a/configure.ac b/configure.ac
index 5b2507e5..b3087686 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,6 +118,13 @@ dnl need -D_SYSV3 for ISC
CFLAGS="$CFLAGS -D_SYSV3"
fi
+dnl check for systems where libc is borked for regex handling
+case `uname` in
+MirBSD | MirOS)
+ AC_DEFINE([LIBC_IS_BORKED], 1, [libc is broken for regex handling])
+ ;;
+esac
+
dnl Set the programming language for checks. Fortunately,
dnl this only needs to be set once, since everything is in C.
AC_LANG([C])
@@ -287,6 +294,11 @@ 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
@@ -306,6 +318,8 @@ AC_CHECK_HEADER(dlfcn.h,
fi
fi
])
+ ;;
+esac
dnl check for how to use getpgrp
dnl have to hardwire it for VMS POSIX. Sigh.
diff --git a/extension/ChangeLog b/extension/ChangeLog
index fcaff2b7..62638fcc 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -3,6 +3,13 @@
* filefuncs.c (fill_stat_array): Adjust computation for block
count for WIN32 systems after consultation with Eli Zaretskii.
+2013-02-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (check-recursive, all-recursive): Make dependant upon
+ check-for-shared-lib-support.
+ (check-for-shared-lib-support): New target. If gawk doesn't have the
+ API built-in, don't try to build.
+
2013-02-11 Arnold D. Robbins <arnold@skeeve.com>
* fnmatch.c: Pull in versions of C routine from missing_d
diff --git a/extension/Makefile.am b/extension/Makefile.am
index 48d315a9..61e26976 100644
--- a/extension/Makefile.am
+++ b/extension/Makefile.am
@@ -111,3 +111,15 @@ dist_man_MANS = \
# gettext requires this
SUBDIRS =
+
+# This is an ugly hack, initially for MirBSD but probably needed for other
+# systems. If gawk doesn't have the API built in, don't try to build the
+# extensions.
+check-recursive all-recursive: check-for-shared-lib-support
+
+check-for-shared-lib-support:
+ @if ../gawk$(EXEEXT) --version | sed 1q | grep API > /dev/null; \
+ then : do nothing ; \
+ else echo Building the extensions is not supported on this platform ; \
+ exit 1; \
+ fi
diff --git a/extension/Makefile.in b/extension/Makefile.in
index 20a52404..9aa75cee 100644
--- a/extension/Makefile.in
+++ b/extension/Makefile.in
@@ -1183,6 +1183,18 @@ uninstall-man: uninstall-man3
uninstall-pkgextensionLTLIBRARIES
+# This is an ugly hack, initially for MirBSD but probably needed for other
+# systems. If gawk doesn't have the API built in, don't try to build the
+# extensions.
+check-recursive all-recursive: check-for-shared-lib-support
+
+check-for-shared-lib-support:
+ @if ../gawk$(EXEEXT) --version | sed 1q | grep API > /dev/null; \
+ then : do nothing ; \
+ else echo Building the extensions is not supported on this platform ; \
+ exit 1; \
+ fi
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/regcomp.c b/regcomp.c
index 70a0d38a..fd490d02 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -856,6 +856,10 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
#ifndef _LIBC
char *codeset_name;
#endif
+#if defined(GAWK) && defined(LIBC_IS_BORKED)
+ /* Needed for brain damaged systems */
+ extern int gawk_mb_cur_max;
+#endif
memset (dfa, '\0', sizeof (re_dfa_t));
@@ -877,7 +881,11 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size);
dfa->state_hash_mask = table_size - 1;
+#if defined(GAWK) && defined(LIBC_IS_BORKED)
+ dfa->mb_cur_max = gawk_mb_cur_max;
+#else
dfa->mb_cur_max = MB_CUR_MAX;
+#endif
#ifdef _LIBC
if (dfa->mb_cur_max == 6
&& strcmp (_NL_CURRENT (LC_CTYPE, _NL_CTYPE_CODESET_NAME), "UTF-8") == 0)
@@ -912,6 +920,10 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
? codeset_name[4] == '8' && codeset_name[5] == '\0'
: codeset_name[3] == '8' && codeset_name[4] == '\0'))
dfa->is_utf8 = 1;
+#if defined(GAWK) && defined(LIBC_IS_BORKED)
+ if (gawk_mb_cur_max == 1)
+ dfa->is_utf8 = 0;
+#endif /* defined(GAWK) && defined(LIBC_IS_BORKED) */
#endif
/* We check exhaustively in the loop below if this charset is a