summaryrefslogtreecommitdiff
path: root/src/third_party/scripts
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2016-07-20 16:15:53 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2016-07-20 16:35:25 -0400
commited0af84b314a4f89ff9f46064feca34e8bb79c31 (patch)
tree1436def375c13b113242cc32e51d21f4400b4420 /src/third_party/scripts
parent60379c1daaaf50d90d240a0ae5b4c6fdad7b4c36 (diff)
downloadmongo-ed0af84b314a4f89ff9f46064feca34e8bb79c31.tar.gz
SERVER-24662 PCRE 8.39 Import Script Update
Diffstat (limited to 'src/third_party/scripts')
-rw-r--r--src/third_party/scripts/pcre_get_sources.sh60
1 files changed, 44 insertions, 16 deletions
diff --git a/src/third_party/scripts/pcre_get_sources.sh b/src/third_party/scripts/pcre_get_sources.sh
index e4be2525378..da73652ef66 100644
--- a/src/third_party/scripts/pcre_get_sources.sh
+++ b/src/third_party/scripts/pcre_get_sources.sh
@@ -8,13 +8,22 @@
# 2. Run on Solaris
# 3. Run on Windows
#
-VERSION=8.38
+set -euo pipefail
+IFS=$'\n\t'
+
+if [ "$#" -ne 0 ]; then
+ echo "This script does not take any arguments"
+ exit 1
+fi
+
+VERSION=8.39
NAME=pcre
TARBALL=$NAME-$VERSION.tar.gz
TARBALL_DIR=$NAME-$VERSION
-TEMP_DIR=/tmp/temp-$NAME-$VERSION
-DEST_DIR=`git rev-parse --show-toplevel`/src/third_party/$NAME-$VERSION
-UNAME=`uname | tr A-Z a-z`
+TEMP_DIR=$(mktemp -d /tmp/pcre.XXXXXX)
+trap "rm -rf $TEMP_DIR" EXIT
+DEST_DIR=$(git rev-parse --show-toplevel)/src/third_party/$NAME-$VERSION
+UNAME=$(uname | tr A-Z a-z)
if [ $UNAME == "sunos" ]; then
TARGET_UNAME=solaris
@@ -27,8 +36,7 @@ fi
echo TARGET_UNAME: $TARGET_UNAME
if [ ! -f $TARBALL ]; then
- echo "Get tarball"
- wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/$TARBALL
+ curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/$TARBALL
fi
tar -zxvf $TARBALL
@@ -41,13 +49,28 @@ cd $TEMP_DIR
if [ $TARGET_UNAME != "windows" ]; then
# Do a shallow copy, it is all we need
- cp $TEMP_DIR/* $DEST_DIR
+ for file_copy in $(find $TEMP_DIR -maxdepth 1 -type f); do
+ echo copying $file_copy $DEST_DIR
+ cp $file_copy $DEST_DIR
+ done
+
rm -f $DEST_DIR/Makefile* $DEST_DIR/config* $DEST_DIR/*sh
rm -f $DEST_DIR/compile* $DEST_DIR/depcomp $DEST_DIR/libtool
rm -f $DEST_DIR/test-driver $DEST_DIR/*.m4 $DEST_DIR/missing
echo "Generating Config.h and other files"
- ./configure --disable-jit --with-posix-malloc-threshold=10 --with-match-limit-recursion=4000 --disable-stack-for-recursion --with-link-size=2 -enable-newline-is-lf --with-match-limit=200000 --with-parens-nest-limit=250 --enable-utf --enable-unicode-properties --enable-shared=no
+ ./configure \
+ --disable-jit \
+ --with-posix-malloc-threshold=10 \
+ --with-match-limit-recursion=4000 \
+ --disable-stack-for-recursion \
+ --with-link-size=2 \
+ -enable-newline-is-lf \
+ --with-match-limit=200000 \
+ --with-parens-nest-limit=250 \
+ --enable-utf \
+ --enable-unicode-properties \
+ --enable-shared=no
# We need to make it to get pcre_chartables.c
make
@@ -57,16 +80,21 @@ if [ $TARGET_UNAME != "windows" ]; then
cp $TEMP_DIR/pcre_chartables.c $DEST_DIR
cp $TEMP_DIR/pcre_stringpiece.h $DEST_DIR
cp $TEMP_DIR/pcrecpparg.h $DEST_DIR
-
- # Copy over config.h
- mkdir $DEST_DIR/build_$TARGET_UNAME
- cp $TEMP_DIR/config.h $DEST_DIR/build_$TARGET_UNAME
else
- /cygdrive/c/Program\ Files\ \(x86\)/CMake/bin/cmake.exe -DPCRE_SUPPORT_PCREGREP_JIT:BOOL="0" -DPCRE_BUILD_TESTS:BOOL="0" -DPCRE_POSIX_MALLOC_THRESHOLD:STRING="10" -DPCRE_MATCH_LIMIT_RECURSION:STRING="4000" -DPCRE_NO_RECURSE:BOOL="1" -DPCRE_LINK_SIZE:STRING="2" -DPCRE_NEWLINE:STRING="LF" -DPCRE_MATCH_LIMIT:STRING="200000" -DPCRE_PARENS_NEST_LIMIT:STRING="250" -DPCRE_SUPPORT_UTF:BOOL="1" -DPCRE_SUPPORT_UNICODE_PROPERTIES:BOOL="1"
+ /cygdrive/c/cmake/bin/cmake.exe \
+ -DPCRE_SUPPORT_PCREGREP_JIT:BOOL="0" \
+ -DPCRE_BUILD_TESTS:BOOL="0" \
+ -DPCRE_POSIX_MALLOC_THRESHOLD:STRING="10" \
+ -DPCRE_MATCH_LIMIT_RECURSION:STRING="4000" \
+ -DPCRE_NO_RECURSE:BOOL="1" \
+ -DPCRE_LINK_SIZE:STRING="2" \
+ -DPCRE_NEWLINE:STRING="LF" \
+ -DPCRE_MATCH_LIMIT:STRING="200000" \
+ -DPCRE_PARENS_NEST_LIMIT:STRING="250" \
+ -DPCRE_SUPPORT_UTF:BOOL="1" \
+ -DPCRE_SUPPORT_UNICODE_PROPERTIES:BOOL="1"
fi
# Copy over config.h
-mkdir $DEST_DIR/build_$TARGET_UNAME
+mkdir $DEST_DIR/build_$TARGET_UNAME || true
cp $TEMP_DIR/config.h $DEST_DIR/build_$TARGET_UNAME
-
-echo "Done"