compile/libpcre2FromSource
About
- New Perl Compatible Regular Expression Library
Used by
compile/nginxFromSource: --with-pcre
Prepare
Configure
Show configuration help
Alternatively
A wrapper-script
build.sh
1 #!/bin/bash -vx
2
3 PREFIX="$HOME/.local"
4 ### C PREPROCESSOR FLAGS
5 CPPFLAGS_ARRAY=(
6 "-Wdate-time" # Warn when bit-wise-identical reproducible compilations may be disturbed
7 "-D_FORTIFY_SOURCE=2" #Add support for detecting buffer overflows in various functions
8 )
9 ### C COMPILER FLAGS
10 CFLAGS_ARRAY=(
11 "-g" # Produce debugging information
12 "-O2" # Optimize level 1+2
13 "-Werror=implicit-function-declaration" # Make all warnings into errors
14 "-fstack-protector-strong" # Emit extra code to check for buffer overflows
15 "-fstack-clash-protection" # Generate code to prevent stack clash style attacks.
16 "-Wformat" # Check calls have types appropriate to the format string specified
17 "-Werror=format-security" # Make all warnings into errors
18 "-fcf-protection" # Enable code instrumentation of control-flow transfers
19 "-Dregcomp=PCRE2regcomp" # Predefine name as a macro, with definition
20 "-Dregexec=PCRE2regexec" # Predefine name as a macro, with definition
21 "-Dregerror=PCRE2regerror" # Predefine name as a macro, with definition
22 "-Dregfree=PCRE2regfree" # Predefine name as a macro, with definition
23 "-fvisibility=hidden" # Set the default ELF image symbol visibility (not public)
24 )
25 ### C++ COMPILER FLAGS
26 CXXFLAGS_ARRAY=(
27 )
28 ### LINKER FLAGS
29 LDFLAGS_ARRAY=(
30 "-Wl,-z,relro" # Pass option as an option to the linker
31 )
32
33 ### EXPORTS TO SUB-SHELLS
34 export CPPFLAGS="${CPPFLAGS_ARRAY[*]}"
35 export CFLAGS="${CFLAGS_ARRAY[*]}"
36 export CXXFLAGS="${CXXFLAGS_ARRAY[*]}"
37 export LDFLAGS="${LDFLAGS_ARRAY[*]}"
38
39 CONFIGURE_OPTS=(
40 #"--build=x86_64-linux-gnu"
41 "--prefix=$PREFIX"
42 "--includedir=\${prefix}/include"
43 "--mandir=\${prefix}/share/man"
44 "--infodir=\${prefix}/share/info"
45 "--sysconfdir=\${prefix}/etc"
46 "--localstatedir=\${prefix}/var"
47 "--disable-option-checking"
48 "--disable-silent-rules"
49 #"--libdir=\${prefix}/lib/x86_64-linux-gnu"
50 "--libdir=\${prefix}/lib"
51 "--runstatedir=/run"
52 "--disable-maintainer-mode"
53 "--disable-dependency-tracking"
54 "--enable-pcre2-16"
55 "--enable-pcre2-32"
56 "--disable-pcre2grep-callout"
57 "--enable-jit"
58 )
59
60 #echo -e '\nStarting autogen.sh'
61 #./autogen.sh "${CONFIGURE_OPTS[@]}"
62 #
63 echo -e '\nStarting configure'
64 ./configure "${CONFIGURE_OPTS[@]}"
65
66 echo -e '\nStarting build'
67 make -j "$(nproc)"
68
69 echo -e '\nStarting tests'
70 make -j "$(nproc)" check
71
72 echo -e '\nStarting install'
73 make -j "$(nproc)" install
74
75 #echo -e '\nStarting uninstall'
76 #make -j "$(nproc)" uninstall
77
Make
1 make -j $(nproc)
Make install
1 make install