Difference between revisions of "Pcre"

From CBLFS
Jump to navigationJump to search
m
m
Line 15: 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-pcregrep-libz  --enable-pcregrep-libbz2 \
 
     --enable-pcretest-libreadline &&
 
     --enable-pcretest-libreadline &&
Line 42: Line 43:
  
 
  CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" \
 
  CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" \
  ./configure --prefix=/usr --enable-utf8 \
+
  ./configure --prefix=/usr --enable-utf8 --enable-unicode-properties \
 
     --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
 
     --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
 
     --enable-pcretest-libreadline &&
 
     --enable-pcretest-libreadline &&
Line 63: Line 64:
  
 
  CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" \
 
  CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" \
  ./configure --prefix=/usr --enable-utf8 --libdir=/usr/lib32 \
+
  ./configure --prefix=/usr --libdir=/usr/lib32 \
 +
    --enable-utf8 --enable-unicode-properties \
 
     --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
 
     --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
 
     --enable-pcretest-libreadline &&
 
     --enable-pcretest-libreadline &&
Line 84: Line 86:
  
 
  CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure \
 
  CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure \
  --prefix=/usr --enable-utf8 --libdir=/usr/lib64 \
+
  --prefix=/usr --libdir=/usr/lib64 \
 +
    --enable-utf8 --enable-unicode-properties \
 
     --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
 
     --enable-pcregrep-libz  --enable-pcregrep-libbz2 \
 
     --enable-pcretest-libreadline &&
 
     --enable-pcretest-libreadline &&

Revision as of 00:05, 19 May 2008

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

Introduction to Pcre

...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 &&
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/ &&
LIBNAME=$(cat libpcre.la | grep dlname | cut -f2 -d"'" | cut -f1 -d" ") &&
ln -svf ../../lib/$LIBNAME /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 &&
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/ &&
LIBNAME=$(cat libpcre.la | grep dlname | cut -f2 -d"'" | cut -f1 -d" ") &&
ln -svf ../../lib/$LIBNAME /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 &&
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/ &&
LIBNAME=$(cat libpcre.la | grep dlname | cut -f2 -d"'" | cut -f1 -d" ") &&
ln -svf ../../lib32/$LIBNAME /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 &&
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/ &&
LIBNAME=$(cat libpcre.la | grep dlname | cut -f2 -d"'" | cut -f1 -d" ") &&
ln -svf ../../lib64/$LIBNAME /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.