annotate lib/swig/swigwin-2.0.11/Tools/pcre-build.sh @ 2069:259df09dfb50

32bits almost there
author Nomad
date Tue, 03 Dec 2013 20:18:17 +0200
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 #!/bin/sh
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 pcre_subdir=pcre/pcre-swig-install
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 pcre_install_dir=`pwd`/$pcre_subdir
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 usage() {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 echo "Helper script to build PCRE as a static library from a tarball just for use during the"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 echo "SWIG build. It does not install PCRE for global use on your system."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 echo "Usage: pcre-build.sh [--help] [args]"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 echo " args - optional additional arguments passed on to the PCRE configure script (leave out"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11 echo " unless you are an expert at configure)"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 echo " --help - Display this help information."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 echo "Instructions:"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 echo " - Download the latest PCRE source tarball from http://www.pcre.org and place in the"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 echo " directory that you will configure and build SWIG."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 echo " - Run this script in the same directory that you intend to configure and build SWIG in."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 echo " This will configure and build PCRE as a static library."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 echo " - Afterwards run the SWIG configure script which will then find and use the PCRE static"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 echo " libraries in the $pcre_subdir subdirectory."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 exit 0
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 bail() {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 echo $1 >&2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 exit 1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 if test "$1" = "-h" -o "$1" = "-help" -o "$1" = "--help" ; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 usage
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 if test -f "pcre-build.sh" ; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 echo "Error: this script should not be run in the Tools directory" >&2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 echo ""
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 usage
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 echo "Looking for PCRE tarball..."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 rm -rf pcre
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 pcre_tarball=`ls pcre-*.tar*`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 test -n "$pcre_tarball" || bail "Could not find tarball matching pattern: pcre-*.tar*"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42 test -f "$pcre_tarball" || bail "Could not find a single PCRE tarball. Found: $pcre_tarball"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 echo "Extracting tarball: $pcre_tarball"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 tar -xf $pcre_tarball || bail "Could not untar $pcre_tarball"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 pcre_dir=`echo $pcre_tarball | sed -e "s/\.tar.*//"`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 echo "Configuring PCRE in directory: pcre"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48 mv $pcre_dir pcre || bail "Could not create pcre directory"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 cd pcre && ./configure --prefix=$pcre_install_dir --disable-shared $* || bail "PCRE configure failed"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 echo "Building PCRE..."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 ${MAKE:-make} -s || bail "Could not build PCRE"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 echo "Installing PCRE locally to $pcre_install_dir..."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53 ${MAKE:-make} -s install || bail "Could not install PCRE"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 echo ""
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55 echo "The SWIG configure script can now be run, whereupon PCRE will automatically be detected and used from $pcre_install_dir/bin/pcre-config."