Install PCRE on RHEL7.1
PCRE官方网站:http://www.pcre.org/
下载安装包:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
[root@adamhuanlinux ~]# cd /software [root@adamhuanlinux software]# ls yum_data [root@adamhuanlinux software]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.00.tar.gz --2015-04-10 16:02:30-- ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.00.tar.gz => “pcre2-10.00.tar.gz” 正在解析主机 ftp.csx.cam.ac.uk (ftp.csx.cam.ac.uk)... 131.111.8.115 正在连接 ftp.csx.cam.ac.uk (ftp.csx.cam.ac.uk)|131.111.8.115|:21... 已连接。 正在以 anonymous 登录 ... 登录成功! ==> SYST ... 完成。 ==> PWD ... 完成。 ==> TYPE I ... 完成。 ==> CWD (1) /pub/software/programming/pcre ... 完成。 ==> SIZE pcre2-10.00.tar.gz ... 1734669 ==> PASV ... 完成。 ==> RETR pcre2-10.00.tar.gz ... 完成。 长度:1734669 (1.7M) (非正式数据) 100%[==================================================================================================>] 1,734,669 13.2KB/s 用时 2m 11s 2015-04-10 16:04:46 (12.9 KB/s) - “pcre2-10.00.tar.gz” 已保存 [1734669] [root@adamhuanlinux software]# ll 总用量 1696 -rw-r--r-- 1 root root 1734669 4月 10 16:04 pcre2-10.00.tar.gz drwxrwxrwx 3 root root 19 4月 10 10:34 yum_data [root@adamhuanlinux software]# |
解压缩:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
[root@adamhuanlinux software]# ll 总用量 1696 -rw-r--r-- 1 root root 1734669 4月 10 16:04 pcre2-10.00.tar.gz drwxrwxrwx 3 root root 19 4月 10 10:34 yum_data [root@adamhuanlinux software]# [root@adamhuanlinux software]# tar -xzf pcre2-10.00.tar.gz [root@adamhuanlinux software]# ll 总用量 1700 drwxr-xr-x 7 1169 1169 4096 1月 5 23:59 pcre2-10.00 -rw-r--r-- 1 root root 1734669 4月 10 16:04 pcre2-10.00.tar.gz drwxrwxrwx 3 root root 19 4月 10 10:34 yum_data [root@adamhuanlinux software]# cd pcre2-10.00/ [root@adamhuanlinux pcre2-10.00]# ll 总用量 1612 -rwxr-xr-x 1 1169 1169 7016 10月 17 22:38 132html -rw-r--r-- 1 1169 1169 51933 1月 5 23:24 aclocal.m4 -rwxr-xr-x 1 1169 1169 5826 1月 5 23:24 ar-lib -rw-r--r-- 1 1169 1169 728 1月 5 23:24 AUTHORS -rw-r--r-- 1 1169 1169 3056 1月 5 23:26 ChangeLog -rwxr-xr-x 1 1169 1169 1494 9月 23 2014 CheckMan -rwxr-xr-x 1 1169 1169 2941 9月 23 2014 CleanTxt drwxr-xr-x 2 1169 1169 126 1月 5 23:59 cmake -rw-r--r-- 1 1169 1169 26894 11月 22 00:52 CMakeLists.txt -rwxr-xr-x 1 1169 1169 7333 1月 5 23:24 compile -rw-r--r-- 1 1169 1169 1263 9月 20 2014 config-cmake.h.in -rwxr-xr-x 1 1169 1169 45805 1月 5 23:24 config.guess -rwxr-xr-x 1 1169 1169 35594 1月 5 23:24 config.sub -rwxr-xr-x 1 1169 1169 534803 1月 5 23:24 configure -rw-r--r-- 1 1169 1169 32972 1月 5 23:24 configure.ac -rw-r--r-- 1 1169 1169 35147 2月 19 2014 COPYING -rwxr-xr-x 1 1169 1169 23566 1月 5 23:24 depcomp -rwxr-xr-x 1 1169 1169 643 9月 23 2014 Detrail drwxr-xr-x 3 1169 1169 4096 1月 5 23:59 doc -rw-r--r-- 1 1169 1169 24776 10月 17 22:57 HACKING -rw-r--r-- 1 1169 1169 15752 1月 5 23:24 INSTALL -rwxr-xr-x 1 1169 1169 13997 1月 5 23:24 install-sh -rw-r--r-- 1 1169 1169 347 10月 17 23:04 libpcre2-16.pc.in -rw-r--r-- 1 1169 1169 347 10月 17 23:04 libpcre2-32.pc.in -rw-r--r-- 1 1169 1169 344 10月 17 23:04 libpcre2-8.pc.in -rw-r--r-- 1 1169 1169 329 10月 17 23:04 libpcre2-posix.pc.in -rw-r--r-- 1 1169 1169 2922 1月 5 23:27 LICENCE -rw-r--r-- 1 1169 1169 322647 1月 5 23:24 ltmain.sh drwxr-xr-x 2 1169 1169 145 1月 5 23:59 m4 -rw-r--r-- 1 1169 1169 22152 11月 24 20:42 Makefile.am -rw-r--r-- 1 1169 1169 189588 1月 5 23:24 Makefile.in -rwxr-xr-x 1 1169 1169 6872 1月 5 23:24 missing -rw-r--r-- 1 1169 1169 458 1月 5 23:27 NEWS -rw-r--r-- 1 1169 1169 17710 1月 5 23:59 NON-AUTOTOOLS-BUILD -rw-r--r-- 1 1169 1169 2280 10月 17 23:07 pcre2-config.in -rwxr-xr-x 1 1169 1169 8213 11月 6 00:10 perltest.sh -rwxr-xr-x 1 1169 1169 6957 10月 25 18:57 PrepareRelease -rw-r--r-- 1 1169 1169 37879 1月 5 23:58 README -rwxr-xr-x 1 1169 1169 28855 11月 4 01:15 RunGrepTest -rwxr-xr-x 1 1169 1169 20873 11月 22 00:52 RunTest drwxr-xr-x 3 1169 1169 4096 1月 5 23:59 src drwxr-xr-x 2 1169 1169 4096 1月 5 23:59 testdata -rwxr-xr-x 1 1169 1169 4287 1月 5 23:24 test-driver [root@adamhuanlinux pcre2-10.00]# |
创建安装路径:/usr/local/pcre
1 2 3 4 5 6 |
[root@adamhuanlinux pcre2-10.00]# ls /usr/local/ bin etc games golang include lib lib64 libexec liteide nginx pycharm-4.0.6 python2 python3 sbin share src [root@adamhuanlinux pcre2-10.00]# mkdir /usr/local/pcre [root@adamhuanlinux pcre2-10.00]# ls /usr/local/ bin etc games golang include lib lib64 libexec liteide nginx pcre pycharm-4.0.6 python2 python3 sbin share src [root@adamhuanlinux pcre2-10.00]# |
二进制安装:
一、configure,配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
[root@adamhuanlinux pcre2-10.00]# ls 132html CleanTxt config.sub doc libpcre2-8.pc.in Makefile.in PrepareRelease test-driver aclocal.m4 cmake configure HACKING libpcre2-posix.pc.in missing README ar-lib CMakeLists.txt configure.ac INSTALL LICENCE NEWS RunGrepTest AUTHORS compile COPYING install-sh ltmain.sh NON-AUTOTOOLS-BUILD RunTest ChangeLog config-cmake.h.in depcomp libpcre2-16.pc.in m4 pcre2-config.in src CheckMan config.guess Detrail libpcre2-32.pc.in Makefile.am perltest.sh testdata [root@adamhuanlinux pcre2-10.00]# [root@adamhuanlinux pcre2-10.00]# ./configure --prefix=/usr/local/pcre (... ...output) configure: creating ./config.status config.status: creating Makefile config.status: creating libpcre2-8.pc config.status: creating libpcre2-16.pc config.status: creating libpcre2-32.pc config.status: creating libpcre2-posix.pc config.status: creating pcre2-config config.status: creating src/pcre2.h config.status: creating src/config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing script-chmod commands config.status: executing delete-old-chartables commands pcre2-10.00 configuration summary: Install prefix .................. : /usr/local/pcre C preprocessor .................. : gcc -E C compiler ...................... : gcc Linker .......................... : /usr/bin/ld -m elf_x86_64 C preprocessor flags ............ : C compiler flags ................ : -g -O2 -fvisibility=hidden Linker flags .................... : Extra libraries ................. : Build 8-bit pcre2 library ....... : yes Build 16-bit pcre2 library ...... : no Build 32-bit pcre2 library ...... : no Enable JIT compiling support .... : no Enable Unicode support .......... : yes Newline char/sequence ........... : lf \R matches only ANYCRLF ......... : no EBCDIC coding ................... : no EBCDIC code for NL .............. : n/a Rebuild char tables ............. : no Use stack recursion ............. : yes Internal link size .............. : 2 Nested parentheses limit ........ : 250 Match limit ..................... : 10000000 Match limit recursion ........... : MATCH_LIMIT Build shared libs ............... : yes Build static libs ............... : yes Use JIT in pcre2grep ............ : no Buffer size for pcre2grep ....... : 20480 Link pcre2grep with libz ........ : no Link pcre2grep with libbz2 ...... : no Link pcre2test with libedit ..... : no Link pcre2test with libreadline . : no Valgrind support ................ : no Code coverage ................... : no [root@adamhuanlinux pcre2-10.00]# |
二、make,编译
1 2 |
[root@adamhuanlinux pcre2-10.00]# make (... ...output) |
三、make check,校验(Option.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
[root@adamhuanlinux pcre2-10.00]# make check make check-am make[1]: 进入目录“/software/pcre2-10.00” make make[2]: 进入目录“/software/pcre2-10.00” make all-am make[3]: 进入目录“/software/pcre2-10.00” make[3]: 离开目录“/software/pcre2-10.00” make[2]: 离开目录“/software/pcre2-10.00” make check-TESTS make[2]: 进入目录“/software/pcre2-10.00” make[3]: 进入目录“/software/pcre2-10.00” PASS: RunTest PASS: RunGrepTest make[4]: 进入目录“/software/pcre2-10.00” make all-am make[5]: 进入目录“/software/pcre2-10.00” make[5]: 离开目录“/software/pcre2-10.00” make[4]: 离开目录“/software/pcre2-10.00” ============================================================================ Testsuite summary for PCRE2 10.00 ============================================================================ # TOTAL: 2 # PASS: 2 # SKIP: 0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================ make[3]: 离开目录“/software/pcre2-10.00” make[2]: 离开目录“/software/pcre2-10.00” make[1]: 离开目录“/software/pcre2-10.00” [root@adamhuanlinux pcre2-10.00]# |
四、make install,安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
[root@adamhuanlinux pcre2-10.00]# ls /usr/local/pcre/ [root@adamhuanlinux pcre2-10.00]# make install (... ...output) ynumber.3 doc/pcre2_substring_list_free.3 doc/pcre2_substring_list_get.3 doc/pcre2_substring_nametable_scan.3 doc/pcre2_substring_number_from_name.3 doc/pcre2api.3 doc/pcre2build.3 doc/pcre2callout.3 doc/pcre2compat.3 doc/pcre2demo.3 doc/pcre2jit.3 doc/pcre2limits.3 doc/pcre2matching.3 doc/pcre2partial.3 doc/pcre2pattern.3 doc/pcre2perform.3 doc/pcre2posix.3 doc/pcre2sample.3 doc/pcre2stack.3 doc/pcre2syntax.3 doc/pcre2unicode.3 '/usr/local/pcre/share/man/man3' /usr/bin/mkdir -p '/usr/local/pcre/include' /usr/bin/install -c -m 644 src/pcre2.h '/usr/local/pcre/include' /usr/bin/mkdir -p '/usr/local/pcre/lib/pkgconfig' /usr/bin/install -c -m 644 libpcre2-8.pc libpcre2-posix.pc '/usr/local/pcre/lib/pkgconfig' make[2]: 离开目录“/software/pcre2-10.00” make[1]: 离开目录“/software/pcre2-10.00” [root@adamhuanlinux pcre2-10.00]# [root@adamhuanlinux pcre2-10.00]# ls /usr/local/pcre/ bin include lib share [root@adamhuanlinux pcre2-10.00]# tree /usr/local/pcre/ /usr/local/pcre/ ├── bin │ ├── pcre2-config │ ├── pcre2grep │ └── pcre2test ├── include │ ├── pcre2.h │ └── pcre2posix.h ├── lib │ ├── libpcre2-8.a │ ├── libpcre2-8.la │ ├── libpcre2-8.so -> libpcre2-8.so.0.0.0 │ ├── libpcre2-8.so.0 -> libpcre2-8.so.0.0.0 │ ├── libpcre2-8.so.0.0.0 │ ├── libpcre2-posix.a │ ├── libpcre2-posix.la │ ├── libpcre2-posix.so -> libpcre2-posix.so.0.0.0 │ ├── libpcre2-posix.so.0 -> libpcre2-posix.so.0.0.0 │ ├── libpcre2-posix.so.0.0.0 │ └── pkgconfig │ ├── libpcre2-8.pc │ └── libpcre2-posix.pc └── share ├── doc │ └── pcre2 │ ├── AUTHORS │ ├── ChangeLog │ ├── COPYING │ ├── html │ │ ├── index.html │ │ ├── NON-AUTOTOOLS-BUILD.txt │ │ ├── pcre2api.html │ │ ├── pcre2build.html │ │ ├── pcre2callout.html │ │ ├── pcre2_code_free.html │ │ ├── pcre2compat.html │ │ ├── pcre2_compile_context_copy.html │ │ ├── pcre2_compile_context_create.html │ │ ├── pcre2_compile_context_free.html │ │ ├── pcre2_compile.html │ │ ├── pcre2_config.html │ │ ├── pcre2-config.html │ │ ├── pcre2demo.html │ │ ├── pcre2_dfa_match.html │ │ ├── pcre2_general_context_copy.html │ │ ├── pcre2_general_context_create.html │ │ ├── pcre2_general_context_free.html │ │ ├── pcre2_get_error_message.html │ │ ├── pcre2_get_mark.html │ │ ├── pcre2_get_ovector_count.html │ │ ├── pcre2_get_ovector_pointer.html │ │ ├── pcre2_get_startchar.html │ │ ├── pcre2grep.html │ │ ├── pcre2.html │ │ ├── pcre2_jit_compile.html │ │ ├── pcre2_jit_free_unused_memory.html │ │ ├── pcre2jit.html │ │ ├── pcre2_jit_match.html │ │ ├── pcre2_jit_stack_assign.html │ │ ├── pcre2_jit_stack_create.html │ │ ├── pcre2_jit_stack_free.html │ │ ├── pcre2limits.html │ │ ├── pcre2_maketables.html │ │ ├── pcre2_match_context_copy.html │ │ ├── pcre2_match_context_create.html │ │ ├── pcre2_match_context_free.html │ │ ├── pcre2_match_data_create_from_pattern.html │ │ ├── pcre2_match_data_create.html │ │ ├── pcre2_match_data_free.html │ │ ├── pcre2_match.html │ │ ├── pcre2matching.html │ │ ├── pcre2partial.html │ │ ├── pcre2pattern.html │ │ ├── pcre2_pattern_info.html │ │ ├── pcre2perform.html │ │ ├── pcre2posix.html │ │ ├── pcre2sample.html │ │ ├── pcre2_set_bsr.html │ │ ├── pcre2_set_callout.html │ │ ├── pcre2_set_character_tables.html │ │ ├── pcre2_set_compile_recursion_guard.html │ │ ├── pcre2_set_match_limit.html │ │ ├── pcre2_set_newline.html │ │ ├── pcre2_set_parens_nest_limit.html │ │ ├── pcre2_set_recursion_limit.html │ │ ├── pcre2_set_recursion_memory_management.html │ │ ├── pcre2stack.html │ │ ├── pcre2_substitute.html │ │ ├── pcre2_substring_copy_byname.html │ │ ├── pcre2_substring_copy_bynumber.html │ │ ├── pcre2_substring_free.html │ │ ├── pcre2_substring_get_byname.html │ │ ├── pcre2_substring_get_bynumber.html │ │ ├── pcre2_substring_length_byname.html │ │ ├── pcre2_substring_length_bynumber.html │ │ ├── pcre2_substring_list_free.html │ │ ├── pcre2_substring_list_get.html │ │ ├── pcre2_substring_nametable_scan.html │ │ ├── pcre2_substring_number_from_name.html │ │ ├── pcre2syntax.html │ │ ├── pcre2test.html │ │ ├── pcre2unicode.html │ │ └── README.txt │ ├── LICENCE │ ├── NEWS │ ├── pcre2-config.txt │ ├── pcre2grep.txt │ ├── pcre2test.txt │ ├── pcre2.txt │ └── README └── man ├── man1 │ ├── pcre2-config.1 │ ├── pcre2grep.1 │ └── pcre2test.1 └── man3 ├── pcre2.3 ├── pcre2api.3 ├── pcre2build.3 ├── pcre2callout.3 ├── pcre2_code_free.3 ├── pcre2compat.3 ├── pcre2_compile.3 ├── pcre2_compile_context_copy.3 ├── pcre2_compile_context_create.3 ├── pcre2_compile_context_free.3 ├── pcre2_config.3 ├── pcre2demo.3 ├── pcre2_dfa_match.3 ├── pcre2_general_context_copy.3 ├── pcre2_general_context_create.3 ├── pcre2_general_context_free.3 ├── pcre2_get_error_message.3 ├── pcre2_get_mark.3 ├── pcre2_get_ovector_count.3 ├── pcre2_get_ovector_pointer.3 ├── pcre2_get_startchar.3 ├── pcre2jit.3 ├── pcre2_jit_compile.3 ├── pcre2_jit_free_unused_memory.3 ├── pcre2_jit_match.3 ├── pcre2_jit_stack_assign.3 ├── pcre2_jit_stack_create.3 ├── pcre2_jit_stack_free.3 ├── pcre2limits.3 ├── pcre2_maketables.3 ├── pcre2_match.3 ├── pcre2_match_context_copy.3 ├── pcre2_match_context_create.3 ├── pcre2_match_context_free.3 ├── pcre2_match_data_create.3 ├── pcre2_match_data_create_from_pattern.3 ├── pcre2_match_data_free.3 ├── pcre2matching.3 ├── pcre2partial.3 ├── pcre2pattern.3 ├── pcre2_pattern_info.3 ├── pcre2perform.3 ├── pcre2posix.3 ├── pcre2sample.3 ├── pcre2_set_bsr.3 ├── pcre2_set_callout.3 ├── pcre2_set_character_tables.3 ├── pcre2_set_compile_recursion_guard.3 ├── pcre2_set_match_limit.3 ├── pcre2_set_newline.3 ├── pcre2_set_parens_nest_limit.3 ├── pcre2_set_recursion_limit.3 ├── pcre2_set_recursion_memory_management.3 ├── pcre2stack.3 ├── pcre2_substitute.3 ├── pcre2_substring_copy_byname.3 ├── pcre2_substring_copy_bynumber.3 ├── pcre2_substring_free.3 ├── pcre2_substring_get_byname.3 ├── pcre2_substring_get_bynumber.3 ├── pcre2_substring_length_byname.3 ├── pcre2_substring_length_bynumber.3 ├── pcre2_substring_list_free.3 ├── pcre2_substring_list_get.3 ├── pcre2_substring_nametable_scan.3 ├── pcre2_substring_number_from_name.3 ├── pcre2syntax.3 └── pcre2unicode.3 11 directories, 172 files [root@adamhuanlinux pcre2-10.00]# |
————————————————————————
Done。