From d5fdccbecd2acde9a6e067b54fcd69b02f31a820 Mon Sep 17 00:00:00 2001 From: Robert Spalek Date: Thu, 27 Nov 2008 08:24:52 -0800 Subject: [PATCH] make regex and asciidoc work on Darwin without hacking - use $(PREFIX) when accessing files in /etc/asciidoc/... on Darwin, we use /sw - remove obsolete reference to internal regex library - configure script makes sure the BSD library isn't used on Darwin due to incompatibility - document dependency on asciidoc --- build/Makebottom | 2 +- build/Maketop | 2 ++ ucw/perl/UCW/Configure/C.pm | 4 ++++ ucw/regex.c | 4 ---- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/build/Makebottom b/build/Makebottom index 12b2d555..6b9e2e42 100644 --- a/build/Makebottom +++ b/build/Makebottom @@ -198,7 +198,7 @@ $(DATAFILES): $(o)/%: $(s)/% $(o)/%.html: $(o)/%.txt $(BUILDSYS)/asciidoc.conf $(BUILDSYS)/asciidoc-xhtml.conf run/$(DOCDIR)/$(DOC_MODULE)/.dir-stamp $(M)"DOC-HTML $<" - $(Q)asciidoc -e -f $(BUILDSYS)/asciidoc.conf -f $(BUILDSYS)/asciidoc-xhtml.conf -f /etc/asciidoc/asciidoc.conf -f /etc/asciidoc/xhtml11.conf $< + $(Q)asciidoc -e -f $(BUILDSYS)/asciidoc.conf -f $(BUILDSYS)/asciidoc-xhtml.conf -f $(PREFIX)/etc/asciidoc/asciidoc.conf -f $(PREFIX)/etc/asciidoc/xhtml11.conf $< $(Q)$(call symlink,$@,run/$(DOCDIR)/$(DOC_MODULE)) # In reality, we do not depend on the .txt files, but on the corresponding .deflist's. diff --git a/build/Maketop b/build/Maketop index 5027cfce..f82f48c6 100644 --- a/build/Maketop +++ b/build/Maketop @@ -36,8 +36,10 @@ endif ifdef CONFIG_DARWIN SOEXT=bundle +PREFIX=/sw else SOEXT=so +PREFIX= endif SO_RUNDIR=lib diff --git a/ucw/perl/UCW/Configure/C.pm b/ucw/perl/UCW/Configure/C.pm index 026aef6f..b5e8c0c0 100644 --- a/ucw/perl/UCW/Configure/C.pm +++ b/ucw/perl/UCW/Configure/C.pm @@ -257,6 +257,10 @@ if (IsSet("CONFIG_DARWIN")) { # Fill in some constants not found in the system header files Set("SOL_TCP" => 6); # missing in /usr/include/netinet/tcp.h Set("O_DIRECT" => 0); # Darwin doesn't support direct IO, so make Sherlock at least compilable + if (!IsSet("CONFIG_POSIX_REGEX") && !IsSet("CONFIG_PCRE")) { + Set("CONFIG_POSIX_REGEX" => 1); + Warn "BSD regexp library on Darwin isn't compatible, using POSIX regexp.\n"; + } } ### Writing C headers with configuration ### diff --git a/ucw/regex.c b/ucw/regex.c index aa87d2c1..6ead4648 100644 --- a/ucw/regex.c +++ b/ucw/regex.c @@ -208,11 +208,7 @@ rx_subst(regex *r, const char *by, const char *src, char *dest, uns destlen) /* BSD regular expression library */ -#ifdef CONFIG_OWN_BSD_REGEX -#include "ucw/regex/regex-sh.h" -#else #include -#endif #define INITIAL_MEM 1024 /* Initial space allocated for each pattern */ #define CHAR_SET_SIZE 256 /* How many characters in the character set. */ -- 2.39.5