On Mon, 6 Nov 2006, Humberto Ortiz-Zuazaga wrote: | Gabriel Dos Reis wrote: | | > While composing this message, I fired the upgrade to the most recent | > GCL-2.6.8pre. Do you see any other patches that I may have forgotten | > that should go into build-improvements? | | I still can't pull the svn source on the Mac, so I pulled on a linux box | and copied them over to the Mac this morning. | | I have built axiom again. I needed to patch 2 files: | | 1) src/hyper/hthits.pamphlet, using Waldek's patch: | | http://lists.nongnu.org/archive/html/axiom-developer/2006-11/msg00195.html | | and | | 2) $ svn diff src/graph/viewman/viewman.c.pamphlet | Index: src/graph/viewman/viewman.c.pamphlet | =================================================================== | --- src/graph/viewman/viewman.c.pamphlet (revision 252) | +++ src/graph/viewman/viewman.c.pamphlet (working copy) | @@ -116,7 +116,7 @@ | int keepLooking,code; | | bsdSignal(SIGPIPE,brokenPipe,DontRestartSystemCalls); | -#if defined(BSDplatform) | +#if defined(BSDplatform) || defined (MACOSXplatform) | bsdSignal(SIGCHLD,endChild,RestartSystemCalls); | #else | bsdSignal(SIGCLD,endChild,RestartSystemCalls);
Humberto -- Thanks for your patience. I'm testing the patch below. I'll commit it once build and test completed. -- Gaby 2006-11-09 Gabriel Dos Reis <[EMAIL PROTECTED]> * configure.ac.pamphlet (\subsection{C headers}): New. Check for <regex.h>. Document that the macros XXXplatform should be removed. * configure.ac: Regenerate. * configure: Likewise. src/hyper/ 2006-11-09 Waldek Hebisch <[EMAIL PROTECTED]> Gabriel Dos Reis <[EMAIL PROTECTED]> * hthits.pamphlet: Remove use of <regexp.h>, and required C preprocessor macro interface. Explain why. (searchPage): Update. src/graph/viewman/ 2006-11-09 Humberto Ortiz-Zuazaga <[EMAIL PROTECTED]> * viewman.c.pamphlet (main): Use SIGHLD on MAC OS X too. *** configure.ac.pamphlet (revision 16865) --- configure.ac.pamphlet (local) *************** AC_SUBST(LISP) *** 521,526 **** --- 521,532 ---- AC_SUBST(GCLOPTS) @ + The C preprocessor symbols [[BSDplatform]], [[LINUXplatform]], etc. are being + used as ``catch all'' for unstructured codes. They should be + removed from the source base. Any source file using those should be + properly documented as its needs are, and a narrowed, specific configure + test should be added. + \subsubsection{The [[SRC_SUBDIRS]] variable} The [[SRC_SUBDIRS]] variable is used in the [[src/Makefile.pamphlet]] *************** AC_SUBST(X_PRE_LIBS) *** 619,624 **** --- 625,642 ---- @ + \subsection{C headers} + + \subsubsection{Regex} + + We need string pattern matching. We require [[<regex.h>]] from POSIX + definition, as we assume that the host is sufficiently POSIX conformant + enough for our needs. + <<headers>>= + AC_CHECK_HEADER([regex.h], [], [AC_MSG_ERROR([Axiom needs <regex.h>])]) + @ + + \section{A note about comments} \label{sec:comment} *************** poor masochist who will be debugging the *** 658,663 **** --- 676,683 ---- <<build utils>> + <<headers>> + <<locate X11>> <<define AXIOM>> *** src/graph/viewman/viewman.c.pamphlet (revision 16865) --- src/graph/viewman/viewman.c.pamphlet (local) *************** main (void) *** 116,122 **** int keepLooking,code; bsdSignal(SIGPIPE,brokenPipe,DontRestartSystemCalls); ! #if defined(BSDplatform) bsdSignal(SIGCHLD,endChild,RestartSystemCalls); #else bsdSignal(SIGCLD,endChild,RestartSystemCalls); --- 116,122 ---- int keepLooking,code; bsdSignal(SIGPIPE,brokenPipe,DontRestartSystemCalls); ! #if defined(BSDplatform) || defined (MACOSXplatform) bsdSignal(SIGCHLD,endChild,RestartSystemCalls); #else bsdSignal(SIGCLD,endChild,RestartSystemCalls); *** src/hyper/hthits.pamphlet (revision 16865) --- src/hyper/hthits.pamphlet (local) *************** *** 1,15 **** \documentclass{article} \usepackage{axiom} ! \begin{document} \title{\$SPAD/src/hthits} \author{The Axiom Team} \maketitle \begin{abstract} \end{abstract} \eject \tableofcontents \eject \section{hthits.c} <<hthits.c>>= /* * hthits pattern htdb-file --- 1,33 ---- \documentclass{article} \usepackage{axiom} ! \title{\$SPAD/src/hthits} \author{The Axiom Team} + + \begin{document} \maketitle + \begin{abstract} \end{abstract} \eject + \tableofcontents \eject + \section{hthits.c} + + This source file implements HyperDoc's ability to scan files for a + given pattern. For that purpose it needs a ``regex'' for string + pattern matching. + + This source file used to rely on [[<regexp.h>]], + which was originally part of the X/Open System Interface and Headers + Issue 2. However, since then, it has been withdrawn and no longer + always available on newer platfroms. Consequently, + we need to use a different, portable regex library. The POSIX + definition provides one, namely through [[<regex.h>]]. That is what we + use now. Its availability is tested at configure time. + <<hthits.c>>= /* * hthits pattern htdb-file *************** typedef struct pgInfo { *** 53,77 **** #include "hthits.H1" ! ! ! /* ! * Things for the regular expression scanning. ! */ ! char expbuf[MAX_COMP_REGEX]; ! ! #define INIT register char *sp = instring; ! #define GETC() (*sp++) ! #define PEEKC() (*sp) ! #define UNGETC(c) (--sp) ! #define RETURN(c) return(c); ! #define ERROR(c) regerr(c); ! ! #if defined(RIOSplatform) && !defined(_AIX41) && defined(_XOPEN_SOURCE) ! /* AIX3 regexp.h includes NLregexp which we don't want */ ! #undef _XOPEN_SOURCE ! #endif ! # include <regexp.h> /* * Global variables set according to the command line. --- 71,78 ---- #include "hthits.H1" ! #include <sys/types.h> ! #include <regex.h> /* * Global variables set according to the command line. *************** char *progName; *** 81,86 **** --- 82,88 ---- char *pattern; char *htdbFName; int gverifydates=0; + regex_t reg_pattern; int #ifdef _NO_PROTO *************** main(int argc,char ** argv) *** 93,99 **** { cmdline(argc, argv); ! compile(pattern, expbuf, expbuf + MAX_COMP_REGEX, '\0'); handleHtdb(); return(0); --- 95,101 ---- { cmdline(argc, argv); ! regcomp(®_pattern, pattern, REG_NEWLINE); handleHtdb(); return(0); *************** searchPage(char *pgname,char * pgtitle,c *** 335,347 **** #endif { char *bodyrest; int nhits = 0; ! if (step(pgtitle, expbuf)) nhits++; ! for (bodyrest = pgbody; step(bodyrest, expbuf); bodyrest = loc2) nhits++; if (nhits) { printf("\\newsearchresultentry{%d}{%s}",nhits, pgtitle); squirt(pgname, strlen(pgname)); --- 337,353 ---- #endif { char *bodyrest; + regmatch_t match_pos; int nhits = 0; ! if (!regexec(®_pattern, pgtitle, 1, &match_pos, 0)) nhits++; ! bodyrest = pgbody; ! while (!regexec(®_pattern, bodyrest, 1, &match_pos, 0)) { nhits++; + bodyrest += match_pos.rm_eo; + } if (nhits) { printf("\\newsearchresultentry{%d}{%s}",nhits, pgtitle); squirt(pgname, strlen(pgname)); _______________________________________________ Axiom-developer mailing list Axiom-developer@nongnu.org http://lists.nongnu.org/mailman/listinfo/axiom-developer