Skip to content

Commit 3daf6cd

Browse files
committed
Bundle PCRE2.
1 parent a306d7f commit 3daf6cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+63018
-18
lines changed

.github/workflows/cygwin.bat

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ python38,^
8787
python38-pip,^
8888
python38-devel,^
8989
libsqlite3-devel,^
90-
libuv-devel,^
91-
libpcre2-devel
90+
libuv-devel
9291

9392
ECHO.
9493
ECHO Cygwin Installed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,9 @@ a.out
132132
/foo*
133133
.test_*.toml
134134
build_*
135-
!build_pcre2
136-
!build_libuv
137135
*.gch
138136
/install
139137
!/mys/cli/templates/build
140-
/mys/lib/pcre2/
141138
mys/lib/3pp/bin/
142139
mys/lib/3pp/include/
143140
mys/lib/3pp/lib/

docs/user-guide/installation.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Installation
44
Linux
55
^^^^^
66

7-
#. Install recent versions of ``g++``, ``make``, ``ccache``,
8-
``libuv1-dev`` and ``libpcre2-dev``.
7+
#. Install recent versions of ``g++``, ``make``, ``ccache`` and
8+
``libuv1-dev``.
99

1010
#. Install Python 3.8 or later, and then install Mys using ``pip``.
1111

@@ -22,8 +22,8 @@ Linux
2222
macOS
2323
^^^^^
2424

25-
#. Install recent versions of ``ccache``, ``libuv``, ``pcre2`` and
26-
``pkg-config`` using ``brew``.
25+
#. Install recent versions of ``ccache``, ``libuv`` and ``pkg-config``
26+
using ``brew``.
2727

2828
#. Install Python 3.8 or later, and then install Mys using ``pip``.
2929

@@ -41,8 +41,8 @@ Windows
4141
^^^^^^^
4242

4343
#. Install `Cygwin`_. Required packages are ``gcc-g++``, ``make``,
44-
``python38``, ``python38-pip``, ``python38-devel``, ``ccache``,
45-
``libuv-devel``, and ``libpcre2-devel``.
44+
``python38``, ``python38-pip``, ``python38-devel``, ``ccache`` and
45+
``libuv-devel``.
4646

4747
#. Start Cygwin and install Mys.
4848

mys/cli/templates/build/Makefile

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
.PHONY: all test
1+
.PHONY: pcre2 all test
22

3-
LIB = {mys_dir}/lib
4-
#export CCACHE_BASEDIR = {mys_dir}
3+
MYS_DIR = {mys_dir}
4+
LIB = $(MYS_DIR)/lib
5+
#export CCACHE_BASEDIR = $(MYS_DIR)
56
export CCACHE_SLOPPINESS = pch_defines,time_macros,include_file_mtime,include_file_ctime
67

78
STATUS_PATH ?= {status_path}
89
BUILD := {build}
910
GCH := $(BUILD)/mys_pre_
1011
MYS_CXX ?= {ccache}$(CXX)
1112
MYS ?= {mys}
13+
CFLAGS += -I$(BUILD)/pcre2/src
1214
CFLAGS += $(CFLAGS_EXTRA)
1315
CFLAGS += -I$(LIB)
14-
CFLAGS += $(shell pkg-config libpcre2-32 libuv --cflags)
16+
CFLAGS += $(shell pkg-config libuv --cflags)
1517
CFLAGS += -I$(BUILD)/cpp/include
1618
CFLAGS += {cflags}
1719
# CFLAGS += -Wall
@@ -52,24 +54,31 @@ OBJ_SUFFIX = o
5254
EXE = $(BUILD)/app
5355
endif
5456
LDFLAGS += $(LDFLAGS_EXTRA)
57+
LDFLAGS += -L$(BUILD)/pcre2
5558
LDFLAGS += -std=c++17
5659
# LDFLAGS += -static
5760
# LDFLAGS += -Wl,--gc-sections
5861
LDFLAGS += -fdiagnostics-color=always
59-
LIBS += $(shell pkg-config libpcre2-32 libuv --libs)
62+
LIBS += $(shell pkg-config libuv --libs)
63+
LIBS += -lpcre2
6064
LIBS += -lpthread
6165
LIBS += {libs}
6266
{transpiled_cpp}
6367
{objs}
6468

65-
all:
69+
all: pcre2
70+
$(MAKE) -f $(BUILD)/Makefile $(BUILD)/transpile {hpps}
6671
$(MAKE) -f $(BUILD)/Makefile $(BUILD)/transpile {hpps}
6772
$(MAKE) -f $(BUILD)/Makefile {all_deps} {assets}
6873

69-
test:
74+
test: pcre2
7075
$(MAKE) -f $(BUILD)/Makefile $(BUILD)/transpile {hpps}
7176
$(MAKE) -f $(BUILD)/Makefile $(EXE) {assets}
7277

78+
pcre2:
79+
rsync -tr $(MYS_DIR)/pcre2 $(BUILD)
80+
env CC="{ccache}$(CC)" $(MAKE) -C $(BUILD)/pcre2
81+
7382
$(BUILD)/transpile: {transpile_srcs_paths}
7483
@echo "> Transpiling {number_of_modules} modules" >> $(STATUS_PATH)
7584
$(MYS) $(TRANSPILE_DEBUG) transpile $(TRANSPILE_COVERAGE) \

mys/pcre2/AUTHORS

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
THE MAIN PCRE2 LIBRARY CODE
2+
---------------------------
3+
4+
Written by: Philip Hazel
5+
Email local part: Philip.Hazel
6+
Email domain: gmail.com
7+
8+
Retired from University of Cambridge Computing Service,
9+
Cambridge, England.
10+
11+
Copyright (c) 1997-2021 University of Cambridge
12+
All rights reserved
13+
14+
15+
PCRE2 JUST-IN-TIME COMPILATION SUPPORT
16+
--------------------------------------
17+
18+
Written by: Zoltan Herczeg
19+
Email local part: hzmester
20+
Emain domain: freemail.hu
21+
22+
Copyright(c) 2010-2021 Zoltan Herczeg
23+
All rights reserved.
24+
25+
26+
STACK-LESS JUST-IN-TIME COMPILER
27+
--------------------------------
28+
29+
Written by: Zoltan Herczeg
30+
Email local part: hzmester
31+
Emain domain: freemail.hu
32+
33+
Copyright(c) 2009-2021 Zoltan Herczeg
34+
All rights reserved.
35+
36+
####

mys/pcre2/COPYING

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
PCRE2 LICENCE
2+
3+
Please see the file LICENCE in the PCRE2 distribution for licensing details.
4+
5+
End

0 commit comments

Comments
 (0)