bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiling gawk on Tandem NSK/OSS


From: Matthew Woehlke
Subject: Re: Compiling gawk on Tandem NSK/OSS
Date: Thu, 08 Feb 2007 15:54:03 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20061206 Thunderbird/1.5.0.9 Mnenhy/0.7.4.0

(Sorry for the delay, I finally got around to trying this...)

Aharon Robbins wrote:
Greetings. Now that autoconf 2.61 will define _TANDEM_SOURCE for us,
I have incorporated a modified version of this patch that should let
gawk build out of the box on a Tandem system. The patches will show
up in the gawk CVS archive shortly.

Well. That was fun. CVS is not buildable. NSK (at least my revision) does not have snprintf, and CVS builtin.c blithely assumes it. I *think* I would get a successful link if that was fixed, although I also had to apply the attached patch.

I didn't do anything about the library; if you can add a shell snippet
to configure.ac to do the trick and send me a patch relative to the current
CVS, that will help.

I didn't check this part with CVS strictly OOTB, this trivial little change checks libzrldsrl for dlopen if it isn't in libdl. With this, configure sets LIBS correctly. A cursory check (try the link by hand - which fails, see above - without -lzrldsrl) complains about dlopen, dlerr, and dlsym as well as snprintf, so it seems it is still needed.

==== BEGIN patch
Index: configure.ac
===================================================================
RCS file: /sources/gawk/gawk-stable/configure.ac,v
retrieving revision 1.6
diff -u -r1.6 configure.ac
--- configure.ac        2 Feb 2007 08:47:18 -0000       1.6
+++ configure.ac        8 Feb 2007 20:35:41 -0000
@@ -282,7 +282,8 @@

        # Check this separately. Some systems have dlopen
        # in libc. Notably freebsd and cygwin.
-       AC_CHECK_LIB(dl, dlopen)
+       # HP-NSK has it in zrldsrl
+       AC_SEARCH_LIBS(dlopen, dl zrldsrl)
 ])

 dnl check for how to use getpgrp
==== END patch

--
Matthew
"Two IIRC's must make a right" -- Larry Hall (paraphrased)
Index: regex_internal.h
===================================================================
RCS file: /sources/gawk/gawk-stable/regex_internal.h,v
retrieving revision 1.3
diff -u -r1.3 regex_internal.h
--- regex_internal.h    14 Jan 2007 20:41:02 -0000      1.3
+++ regex_internal.h    8 Feb 2007 21:53:00 -0000
@@ -437,10 +437,9 @@
 #define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
 #define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))

-#include <alloca.h>
-
 #ifndef _LIBC
 # if HAVE_ALLOCA
+#  include <alloca.h>
 /* The OS usually guarantees only one guard page at the bottom of the stack,
    and a page size can be as small as 4096 bytes.  So we cannot safely
    allocate anything larger than 4096 bytes.  Also care for the possibility
Index: regexec.c
===================================================================
RCS file: /sources/gawk/gawk-stable/regexec.c,v
retrieving revision 1.5
diff -u -r1.5 regexec.c
--- regexec.c   2 Feb 2007 08:47:18 -0000       1.5
+++ regexec.c   8 Feb 2007 21:53:02 -0000
@@ -1411,9 +1411,11 @@
   cur_node = dfa->init_node;
   re_node_set_init_empty (&eps_via_nodes);

+#ifdef HAVE_ALLOCA
   if (__libc_use_alloca (nmatch * sizeof (regmatch_t)))
     prev_idx_match = (regmatch_t *) alloca (nmatch * sizeof (regmatch_t));
   else
+#endif
     {
       prev_idx_match = re_malloc (regmatch_t, nmatch);
       if (prev_idx_match == NULL)
@@ -2892,7 +2894,7 @@
              sizeof (re_dfastate_t *) * (path->alloc - old_alloc));
     }

-  str_idx = path->next_idx ?: top_str;
+  str_idx = path->next_idx ? path->next_idx : top_str;

   /* Temporary modify MCTX.  */
   backup_state_log = mctx->state_log;
@@ -3313,9 +3315,11 @@
      from `state'.  `dests_node[i]' represents the nodes which i-th
      destination state contains, and `dests_ch[i]' represents the
      characters which i-th destination state accepts.  */
+#ifdef HAVE_ALLOCA
   if (__libc_use_alloca (sizeof (struct dests_alloc)))
     dests_alloc = (struct dests_alloc *) alloca (sizeof (struct dests_alloc));
   else
+#endif
     {
       dests_alloc = re_malloc (struct dests_alloc, 1);
       if (BE (dests_alloc == NULL, 0))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]