From: ross Date: Tue, 1 Feb 2005 00:52:22 +0000 (+0000) Subject: [project @ 2005-02-01 00:52:20 by ross] X-Git-Tag: nhc98-1-18-release~47 X-Git-Url: http://git.megacz.com/?p=ghc-base.git;a=commitdiff_plain;h=e9e2a5412bb7cda8d13a063ac403d9f18ac97380 [project @ 2005-02-01 00:52:20 by ross] more regex test down to libraries/base --- diff --git a/Makefile b/Makefile index 08da6a7..2c8aead 100644 --- a/Makefile +++ b/Makefile @@ -42,13 +42,6 @@ VERSION = 1.0 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude -"\#include" HsBase.h SRC_HSC2HS_OPTS += -Iinclude -I$(FPTOOLS_TOP)/ghc/includes -# If there is no system-supplied POSIX regex library, use our own -ifneq "$(HavePosixRegex)" "YES" -# Make sure we can get hold of regex.h -SRC_HC_OPTS += -Icbits/regex -SRC_HSC2HS_OPTS += -Icbits/regex -endif - # ----------------------------------------------------------------------------- # Per-module flags diff --git a/Text/Regex/Posix.hsc b/Text/Regex/Posix.hsc index f2dda51..0f28295 100644 --- a/Text/Regex/Posix.hsc +++ b/Text/Regex/Posix.hsc @@ -14,7 +14,7 @@ -- ToDo: should have an interface using PackedStrings. #ifndef __NHC__ -#include "ghcconfig.h" +#include "HsBaseConfig.h" #else #define HAVE_REGEX_H 1 #define HAVE_REGCOMP 1 diff --git a/cbits/Makefile b/cbits/Makefile index 9001b89..b1bbba6 100644 --- a/cbits/Makefile +++ b/cbits/Makefile @@ -1,7 +1,8 @@ -# $Id: Makefile,v 1.13 2004/11/10 11:27:54 simonmar Exp $ +# $Id: Makefile,v 1.14 2005/02/01 00:52:22 ross Exp $ TOP = ../.. include $(TOP)/mk/boilerplate.mk +-include ../config.mk HC = $(GHC_INPLACE) diff --git a/config.mk.in b/config.mk.in new file mode 100644 index 0000000..1122fde --- /dev/null +++ b/config.mk.in @@ -0,0 +1,4 @@ +# Regex library +# (if present in libc use that one, otherwise use the one in the tree) +# +HavePosixRegex = @HavePosixRegex@ diff --git a/configure.ac b/configure.ac index 570ad36..349f445 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,11 @@ AC_CHECK_HEADERS([ctype.h fcntl.h signal.h sys/resource.h termios.h time.h]) # rlim_t, because it will affect the result of that test. AC_SYS_LARGEFILE +dnl ** check for POSIX regex +HavePosixRegex=NO +AC_CHECK_HEADERS([regex.h], [AC_CHECK_FUNCS(regcomp, [HavePosixRegex=YES])]) +AC_SUBST(HavePosixRegex) + dnl ** check for wide-char classifications dnl FreeBSD has an emtpy wctype.h, so test one of the affected dnl functions if it's really there. @@ -85,6 +90,6 @@ case "$target" in esac AC_SUBST([EXTRA_LIBS]) -AC_CONFIG_FILES([base.buildinfo]) +AC_CONFIG_FILES([config.mk base.buildinfo]) AC_OUTPUT diff --git a/include/Makefile b/include/Makefile index 4b70356..5fe9734 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,8 +1,9 @@ # ----------------------------------------------------------------------------- -# $Id: Makefile,v 1.4 2004/10/05 07:43:07 mthomas Exp $ +# $Id: Makefile,v 1.5 2005/02/01 00:52:22 ross Exp $ TOP=../.. include $(TOP)/mk/boilerplate.mk +-include ../config.mk H_FILES = $(wildcard *.h)