Difference between revisions of "Pcre"

From CBLFS
Jump to navigationJump to search
(I added the "Contents" section from BLFS.)
(Added --enable-pcre32 --enable-pcre16 to ./configure to fix Apache build error)
 
(13 intermediate revisions by 6 users not shown)
Line 2: Line 2:
 
|-valign="top"
 
|-valign="top"
 
!Download Source:
 
!Download Source:
| ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-6.7.tar.bz2
+
| ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-{{Pcre-Version}}.tar.bz2
 
|}
 
|}
  
 
----
 
----
  
== Introduction to PCRE ==
+
{{Package-Introduction|PCRE is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.|http://www.pcre.org}}
 
 
The PCRE package contains Perl Compatible Regular Expression libraries. These are useful for implementing regular expression pattern matching using the same syntax and semantics as Perl 5.
 
  
 
== Dependencies ==
 
== Dependencies ==
Line 17: Line 15:
 
Configure and compile the package:
 
Configure and compile the package:
  
  ./configure --prefix=/usr --enable-utf8 &&
+
  ./configure --prefix=/usr \
 +
    --enable-utf8 --enable-unicode-properties \
 +
    --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
 +
    --enable-pcretest-libreadline --enable-pcre32 --enable-pcre16 &&
 
  make
 
  make
 +
  
 
Install the package:
 
Install the package:
  
  make install &&
+
  make install
install -v -m755 -d /usr/share/doc/pcre-6.7/html &&
 
install -v -m644 doc/html/* /usr/share/doc/pcre-6.7/html &&
 
install -v -m644 doc/{Tech.Notes,*.txt} /usr/share/doc/pcre-6.7
 
  
 
If you reinstall Grep after installing PCRE, Grep will get linked against PCRE and may cause problems if /usr is a separate mount point. To avoid this, either pass the option --disable-perl-regexp when executing ./configure for Grep or move libpcre to /lib as follows.
 
If you reinstall Grep after installing PCRE, Grep will get linked against PCRE and may cause problems if /usr is a separate mount point. To avoid this, either pass the option --disable-perl-regexp when executing ./configure for Grep or move libpcre to /lib as follows.
  
 
  mv -v /usr/lib/libpcre.so.* /lib/ &&
 
  mv -v /usr/lib/libpcre.so.* /lib/ &&
  ln -v -sf ../../lib/libpcre.so.0 /usr/lib/libpcre.so
+
  ln -svf ../../lib/libpcre.so.0 /usr/lib/libpcre.so
  
 
=== Command Explanations ===
 
=== Command Explanations ===
Line 42: Line 41:
 
Configure and compile the package:
 
Configure and compile the package:
  
  CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" ./configure --prefix=/usr --enable-utf8 &&
+
  CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" \
 +
./configure --prefix=/usr --enable-utf8 --enable-unicode-properties \
 +
    --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
 +
    --enable-pcretest-libreadline --enable-pcre32 --enable-pcre16 &&
 
  make
 
  make
  
Line 53: Line 55:
  
 
  mv -v /usr/lib/libpcre.so.* /lib/ &&
 
  mv -v /usr/lib/libpcre.so.* /lib/ &&
  ln -v -sf ../../lib/libpcre.so.0 /usr/lib/libpcre.so
+
  ln -svf ../../lib/libpcre.so.0 /usr/lib/libpcre.so
  
 
=== N32 ===
 
=== N32 ===
Line 59: Line 61:
 
Configure and compile the package:
 
Configure and compile the package:
  
  CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" ./configure --prefix=/usr --enable-utf8 --libdir=/usr/lib32 &&
+
  CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" \
 +
./configure --prefix=/usr --libdir=/usr/lib32 \
 +
    --enable-utf8 --enable-unicode-properties \
 +
    --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
 +
    --enable-pcretest-libreadline --enable-pcre32 --enable-pcre16 &&
 
  make
 
  make
  
Line 70: Line 76:
  
 
  mv -v /usr/lib32/libpcre.so.* /lib32/ &&
 
  mv -v /usr/lib32/libpcre.so.* /lib32/ &&
  ln -v -sf ../../lib32/libpcre.so.0 /usr/lib32/libpcre.so
+
  ln -svf ../../lib32/libpcre.so.0 /usr/lib32/libpcre.so
  
 
=== 64Bit ===
 
=== 64Bit ===
Line 76: Line 82:
 
Configure and compile the package:
 
Configure and compile the package:
  
  CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure --prefix=/usr --enable-utf8 --libdir=/usr/lib64 &&
+
  CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure \
 +
--prefix=/usr --libdir=/usr/lib64 \
 +
    --enable-utf8 --enable-unicode-properties \
 +
    --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
 +
    --enable-pcretest-libreadline --enable-pcre32 --enable-pcre16 &&
 
  make
 
  make
  
Line 83: Line 93:
 
  make install &&
 
  make install &&
 
  mv -v /usr/bin/pcre-config{,-64} &&
 
  mv -v /usr/bin/pcre-config{,-64} &&
  ln -s multiarch_wrapper /usr/bin/pcre-config &&
+
  ln -s multiarch_wrapper /usr/bin/pcre-config
install -v -m755 -d /usr/share/doc/pcre-6.7/html &&
 
install -v -m644 doc/html/* /usr/share/doc/pcre-6.7/html &&
 
install -v -m644 doc/{Tech.Notes,*.txt} /usr/share/doc/pcre-6.7
 
  
If you reinstall Grep after installing PCRE, Grep will get linked against PCRE and may cause problems if /usr is a separate mount point. To avoid this, either pass the option --disable-perl-regexp when executing ./configure for Grep or move libpcre to /lib as follows.
+
If you reinstall Grep after installing PCRE, Grep will get linked against PCRE and may cause problems if /usr is a separate mount point. To avoid this, either pass the option --disable-perl-regexp when executing ./configure for Grep or move libpcre to /lib64 as follows.
  
 
  mv -v /usr/lib64/libpcre.so.* /lib64/ &&
 
  mv -v /usr/lib64/libpcre.so.* /lib64/ &&
  ln -v -sf ../../lib64/libpcre.so.0 /usr/lib64/libpcre.so
+
  ln -svf ../../lib64/libpcre.so.0 /usr/lib64/libpcre.so
  
 
= Contents =
 
= Contents =
Line 104: Line 111:
 
|-valign="top"
 
|-valign="top"
 
! Installed Directories:
 
! Installed Directories:
| /usr/share/doc/pcre-6.7
+
| /usr/share/doc/pcre
 
|}
 
|}
  
Line 120: Line 127:
 
| is used during the compile process of programs linking to the PCRE libraries.  
 
| is used during the compile process of programs linking to the PCRE libraries.  
 
|}
 
|}
 +
 +
[[Category:General Libs]]

Latest revision as of 21:51, 22 March 2014

Download Source: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.34.tar.bz2

Introduction to Pcre

PCRE is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.

Project Homepage: http://www.pcre.org

Dependencies

Non-Multilib

Configure and compile the package:

./configure --prefix=/usr \
    --enable-utf8 --enable-unicode-properties \
    --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
    --enable-pcretest-libreadline --enable-pcre32 --enable-pcre16 &&
make


Install the package:

make install

If you reinstall Grep after installing PCRE, Grep will get linked against PCRE and may cause problems if /usr is a separate mount point. To avoid this, either pass the option --disable-perl-regexp when executing ./configure for Grep or move libpcre to /lib as follows.

mv -v /usr/lib/libpcre.so.* /lib/ &&
ln -svf ../../lib/libpcre.so.0 /usr/lib/libpcre.so

Command Explanations

--enable-utf8: This switch includes the code for handling UTF-8 character strings in the library.

Multilib

32Bit

Configure and compile the package:

CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" \
./configure --prefix=/usr --enable-utf8 --enable-unicode-properties \
    --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
    --enable-pcretest-libreadline --enable-pcre32 --enable-pcre16 &&
make

Install the package:

make install &&
mv -v /usr/bin/pcre-config{,-32}

If you reinstall Grep after installing PCRE, Grep will get linked against PCRE and may cause problems if /usr is a separate mount point. To avoid this, either pass the option --disable-perl-regexp when executing ./configure for Grep or move libpcre to /lib as follows.

mv -v /usr/lib/libpcre.so.* /lib/ &&
ln -svf ../../lib/libpcre.so.0 /usr/lib/libpcre.so

N32

Configure and compile the package:

CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" \
./configure --prefix=/usr --libdir=/usr/lib32 \
    --enable-utf8 --enable-unicode-properties \
    --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
    --enable-pcretest-libreadline --enable-pcre32 --enable-pcre16 &&
make

Install the package:

make install &&
mv -v /usr/bin/pcre-config{,-n32}

If you reinstall Grep after installing PCRE, Grep will get linked against PCRE and may cause problems if /usr is a separate mount point. To avoid this, either pass the option --disable-perl-regexp when executing ./configure for Grep or move libpcre to /lib as follows.

mv -v /usr/lib32/libpcre.so.* /lib32/ &&
ln -svf ../../lib32/libpcre.so.0 /usr/lib32/libpcre.so

64Bit

Configure and compile the package:

CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure \
--prefix=/usr --libdir=/usr/lib64 \
    --enable-utf8 --enable-unicode-properties \
    --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
    --enable-pcretest-libreadline --enable-pcre32 --enable-pcre16 &&
make

Install the package:

make install &&
mv -v /usr/bin/pcre-config{,-64} &&
ln -s multiarch_wrapper /usr/bin/pcre-config

If you reinstall Grep after installing PCRE, Grep will get linked against PCRE and may cause problems if /usr is a separate mount point. To avoid this, either pass the option --disable-perl-regexp when executing ./configure for Grep or move libpcre to /lib64 as follows.

mv -v /usr/lib64/libpcre.so.* /lib64/ &&
ln -svf ../../lib64/libpcre.so.0 /usr/lib64/libpcre.so

Contents

Installed Programs: pcregrep, pcretest, and pcre-config
Installed Libraries: libpcre.{so,a}, libpcrecpp.{so,a} and libpcreposix.{so,a}
Installed Directories: /usr/share/doc/pcre

Short Descriptions

pcregrep is a grep that understands Perl compatible regular expressions.
pcretest can test a Perl compatible regular expression.
pcre-config is used during the compile process of programs linking to the PCRE libraries.