[project @ 2005-02-01 00:52:20 by ross]
authorross <unknown>
Tue, 1 Feb 2005 00:52:22 +0000 (00:52 +0000)
committerross <unknown>
Tue, 1 Feb 2005 00:52:22 +0000 (00:52 +0000)
more regex test down to libraries/base

Makefile
Text/Regex/Posix.hsc
cbits/Makefile
config.mk.in [new file with mode: 0644]
configure.ac
include/Makefile

index 08da6a7..2c8aead 100644 (file)
--- 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
 
index f2dda51..0f28295 100644 (file)
@@ -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
index 9001b89..b1bbba6 100644 (file)
@@ -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 (file)
index 0000000..1122fde
--- /dev/null
@@ -0,0 +1,4 @@
+# Regex library
+# (if present in libc use that one, otherwise use the one in the tree)
+#
+HavePosixRegex  = @HavePosixRegex@
index 570ad36..349f445 100644 (file)
@@ -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
index 4b70356..5fe9734 100644 (file)
@@ -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)