Skip to content

Commit e526692

Browse files
committed
Merge branch 'jk/use-our-regexp'
* jk/use-our-regexp: Makefile: Solaris needs HAVE_ALLOCA_H for alloca() Makefile: use compat regex on Solaris Makefile: refactor regex compat support
2 parents 5cacf3d + 1d7b1af commit e526692

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ all::
194194
#
195195
# Define USE_NED_ALLOCATOR if you want to replace the platforms default
196196
# memory allocators with the nedmalloc allocator written by Niall Douglas.
197+
#
198+
# Define NO_REGEX if you have no or inferior regex support in your C library.
197199

198200
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
199201
@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -723,6 +725,7 @@ ifeq ($(uname_S),SunOS)
723725
NO_MEMMEM = YesPlease
724726
NO_MKDTEMP = YesPlease
725727
NO_MKSTEMPS = YesPlease
728+
NO_REGEX = YesPlease
726729
ifeq ($(uname_R),5.7)
727730
NEEDS_RESOLV = YesPlease
728731
NO_IPV6 = YesPlease
@@ -750,7 +753,7 @@ ifeq ($(uname_S),SunOS)
750753
endif
751754
INSTALL = /usr/ucb/install
752755
TAR = gtar
753-
BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__
756+
BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H
754757
endif
755758
ifeq ($(uname_O),Cygwin)
756759
NO_D_TYPE_IN_DIRENT = YesPlease
@@ -884,9 +887,10 @@ ifneq (,$(findstring MINGW,$(uname_S)))
884887
USE_NED_ALLOCATOR = YesPlease
885888
UNRELIABLE_FSTAT = UnfortunatelyYes
886889
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
887-
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/regex -Icompat/fnmatch
890+
NO_REGEX = YesPlease
891+
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch
888892
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
889-
COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/regex/regex.o compat/winansi.o
893+
COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o
890894
EXTLIBS += -lws2_32
891895
X = .exe
892896
ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
@@ -1200,6 +1204,10 @@ endif
12001204
ifdef UNRELIABLE_FSTAT
12011205
BASIC_CFLAGS += -DUNRELIABLE_FSTAT
12021206
endif
1207+
ifdef NO_REGEX
1208+
COMPAT_CFLAGS += -Icompat/regex
1209+
COMPAT_OBJS += compat/regex/regex.o
1210+
endif
12031211

12041212
ifdef USE_NED_ALLOCATOR
12051213
COMPAT_CFLAGS += -DUSE_NED_ALLOCATOR -DOVERRIDE_STRDUP -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR -Icompat/nedmalloc

0 commit comments

Comments
 (0)