Get jenkins_build.sh to use make -j instead of make -j4

v0.27.3
Robin Mills 10 years ago
parent ad8d5f711f
commit 29f75b529b

@ -2,9 +2,9 @@
## ##
# jenkins_build.sh # jenkins_build.sh
# called by jenkins to build/test exiv2 # called by jenkins to build/test exiv2
# - jenkins sets environment variables # - jenkins sets environment variables
# called from terminal # called from terminal
# - script has build-in defaults for some environment variable # - script has build-in defaults for some environment variable
# #
# arguments: # arguments:
@ -31,7 +31,7 @@ run_tests() {
fi fi
} }
thepath () { thepath () {
if [ -d $1 ]; then if [ -d $1 ]; then
( cd $1; ( cd $1;
pwd ); pwd );
@ -84,7 +84,7 @@ fi
echo "1 target = $target platform = $PLATFORM WORKSPACE = $WORKSPACE" echo "1 target = $target platform = $PLATFORM WORKSPACE = $WORKSPACE"
if [ $PLATFORM == "macosx" -a -z "$macosx" ]; then export macosx=true ; export target=macosx ; fi if [ $PLATFORM == "macosx" -a -z "$macosx" ]; then export macosx=true ; export target=macosx ; fi
if [ $PLATFORM == "linux" -a -z "$linux" ]; then export linux=true ; export target=linux ; fi if [ $PLATFORM == "linux" -a -z "$linux" ]; then export linux=true ; export target=linux ; fi
if [ -z "$cygwin" -a ! -z "$CYGWIN" ]; then export cygwin=$CYGWIN ; fi if [ -z "$cygwin" -a ! -z "$CYGWIN" ]; then export cygwin=$CYGWIN ; fi
if [ -z "$tests" ]; then export tests=true ; fi if [ -z "$tests" ]; then export tests=true ; fi
if [ -z "$WORKSPACE" ]; then export WORKSPACE="$0/$PLATFORM" ; fi if [ -z "$WORKSPACE" ]; then export WORKSPACE="$0/$PLATFORM" ; fi
@ -143,12 +143,12 @@ echo ---- end of path and perl ----
case "$build" in case "$build" in
UNIX) UNIX)
echo ./configure --prefix=$PWD/usr $withcurl $withssh echo ./configure --prefix=$PWD/usr $withcurl $withssh
./configure "--prefix=$PWD/usr" $withcurl $withssh ./configure "--prefix=$PWD/usr" $withcurl $withssh
make -j4 "LDFLAGS=-L${PWD}/usr/lib -L${PWD}/xmpsdk/src/.libs" make -j "LDFLAGS=-L${PWD}/usr/lib -L${PWD}/xmpsdk/src/.libs"
make install make install
make -j4 samples "CXXFLAGS=-I${PWD}/usr/include -I${PWD}/src" "LDFLAGS=-L${PWD}/usr/lib -L${PWD}/xmpsdk/src/.libs -lexiv2" make -j samples "CXXFLAGS=-I${PWD}/usr/include -I${PWD}/src" "LDFLAGS=-L${PWD}/usr/lib -L${PWD}/xmpsdk/src/.libs -lexiv2"
result=$? result=$?
run_tests run_tests
"$PWD/usr/bin/exiv2" -v -V "$PWD/usr/bin/exiv2" -v -V
@ -162,24 +162,24 @@ case "$build" in
# 2 trying to get Cygwin to install into a local directory # 2 trying to get Cygwin to install into a local directory
# deal with 32bit and 64bit build requests # deal with 32bit and 64bit build requests
# Jenkins invokes the 32 bit cygwin, so recursively build 64 bits. # Jenkins invokes the 32 bit cygwin, so recursively build 64 bits.
make clean make clean
rm -rf config.log config.status rm -rf config.log config.status
echo ./configure ${withcurl} ${withssh} --disable-nls echo ./configure ${withcurl} ${withssh} --disable-nls
./configure ${withcurl} ${withssh} --disable-nls ./configure ${withcurl} ${withssh} --disable-nls
make -j4 make -j
make install make install
make -j4 samples make -j samples
run_tests run_tests
/usr/local/bin/exiv2 -v -V /usr/local/bin/exiv2 -v -V
result=$? result=$?
else else
if [ "$x64" == true ]; then if [ "$x64" == true ]; then
export RECURSIVE=1 export RECURSIVE=1
/cygdrive/c/cygwin64/bin/bash.exe -c "cd $PWD ; ./$0" /cygdrive/c/cygwin64/bin/bash.exe -c "cd $PWD ; ./$0"
result=$? result=$?
fi fi
if [ "$Win32" == true ]; then if [ "$Win32" == true ]; then
export RECURSIVE=1 export RECURSIVE=1
/cygdrive/c/cygwin/bin/bash.exe -c "cd $PWD ; ./$0" /cygdrive/c/cygwin/bin/bash.exe -c "cd $PWD ; ./$0"
result=$? result=$?
@ -187,7 +187,7 @@ case "$build" in
fi fi
;; ;;
MING) MING)
if [ ! -z "$RECURSIVE" ]; then if [ ! -z "$RECURSIVE" ]; then
export CC=$(which gcc) export CC=$(which gcc)
export CXX=$(which g++) export CXX=$(which g++)
@ -215,7 +215,7 @@ case "$build" in
fi fi
./configure $withcurl $withssh ./configure $withcurl $withssh
make # DO NOT USE -j4. It seems to hang the build! make # DO NOT USE -j. It seems to hang the build!
make install make install
make samples make samples
run_tests run_tests
@ -227,11 +227,11 @@ case "$build" in
export TEMP=$TMP export TEMP=$TMP
export RECURSIVE=1 export RECURSIVE=1
# recursively invoke MinGW/bash with appropriate tool chain # recursively invoke MinGW/bash with appropriate tool chain
if [ "$x64" == true ]; then if [ "$x64" == true ]; then
/cygdrive/c/MinGW64/msys/1.0/bin/bash.exe -c "export PATH=/c/TDM-GCC-64/bin:/c/MinGW64/bin:/c/MinGW64/msys/1.0/bin:/c/MinGW64/msys/1.0/local/bin; $0" /cygdrive/c/MinGW64/msys/1.0/bin/bash.exe -c "export PATH=/c/TDM-GCC-64/bin:/c/MinGW64/bin:/c/MinGW64/msys/1.0/bin:/c/MinGW64/msys/1.0/local/bin; $0"
result=$? result=$?
fi fi
if [ "$Win32" == true ]; then if [ "$Win32" == true ]; then
/cygdrive/c/MinGW/msys/1.0/bin/bash.exe -c "export PATH=/c/MinGW/bin:/c/MinGW/msys/1.0/bin:/c/MinGW/msys/1.0/local/bin; $0" /cygdrive/c/MinGW/msys/1.0/bin/bash.exe -c "export PATH=/c/MinGW/bin:/c/MinGW/msys/1.0/bin:/c/MinGW/msys/1.0/local/bin; $0"
result=$? result=$?
fi fi
@ -239,7 +239,7 @@ case "$build" in
######################################### #########################################
## #!/bin/bash ## #!/bin/bash
## # mingw32.sh ## # mingw32.sh
## # invoke 32bit MinGW bash ## # invoke 32bit MinGW bash
## # ## #
## export "PATH=c:\\MinGW\\bin;c:\\MinGW\\msys\\1.0\\bin;C:\\MinGW\\msys\\1.0\\local\\bin;" ## export "PATH=c:\\MinGW\\bin;c:\\MinGW\\msys\\1.0\\bin;C:\\MinGW\\msys\\1.0\\local\\bin;"
## /cygdrive/c/MinGW/msys/1.0/bin/bash.exe $* ## /cygdrive/c/MinGW/msys/1.0/bin/bash.exe $*
@ -264,7 +264,7 @@ case "$build" in
## see http://clanmills.com/exiv2/mingw.shtml about 64bit build ## see http://clanmills.com/exiv2/mingw.shtml about 64bit build
## Install a fresh (32 bit) mingw/msys into c:\MinGW64 ## Install a fresh (32 bit) mingw/msys into c:\MinGW64
## install the 64 bit compiler from: http://tdm-gcc.tdragon.net ## install the 64 bit compiler from: http://tdm-gcc.tdragon.net
## I used the "on-demand" installer and "Create" put the tools in c:\TDM-GCC-64. The main change is to add the 64 bit compilers to the path BEFORE the 32 bit compilers. ## I used the "on-demand" installer and "Create" put the tools in c:\TDM-GCC-64. The main change is to add the 64 bit compilers to the path BEFORE the 32 bit compilers.
## set PATH=c:\TDM-GCC-64\bin;c:\MinGW\bin;c:\MinGW\msys\1.0\bin;C:\MinGW\msys\1.0\local\bin; ## set PATH=c:\TDM-GCC-64\bin;c:\MinGW\bin;c:\MinGW\msys\1.0\bin;C:\MinGW\msys\1.0\local\bin;
## ##
## keep MinGW64 for 64 bit builds and /usr/lib has 64bit libraries ## keep MinGW64 for 64 bit builds and /usr/lib has 64bit libraries
@ -297,7 +297,7 @@ case "$build" in
fi fi
;; ;;
MSVC) MSVC)
rm -rf $PWD/bin rm -rf $PWD/bin
mkdir $PWD/bin mkdir $PWD/bin
@ -306,12 +306,12 @@ case "$build" in
result=$? result=$?
;; ;;
NONE) NONE)
echo "**************************************" echo "**************************************"
echo "*** no build requested for $target ***" echo "*** no build requested for $target ***"
if [ "$target" == "cygwin" ]; then echo try export CYGWIN=true and run $(basename $0) again ; fi if [ "$target" == "cygwin" ]; then echo try export CYGWIN=true and run $(basename $0) again ; fi
echo "**************************************" echo "**************************************"
;; ;;
esac esac
echo target "$target" start: "$start" finish: $(date) diff: $(( $(date +%s) - starts )) seconds echo target "$target" start: "$start" finish: $(date) diff: $(( $(date +%s) - starts )) seconds

Loading…
Cancel
Save