Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pgRouting dependencies mingw64 chain (OS_BUILD toggle between 64 (gcc 4.8.3) and 32 (gcc 4.8.1))
#!/bin/sh
#use 7zip to extract the dev env
# 64-bit builds my chain is http://www.bostongis.com/postgisstuff/ming64gcc48.7z (gcc 4.8.3)
export GCC_TYPE=gcc48
export OS_BUILD=64
export SOURCES=/projects/sources
if [[ "${OS_BUILD}" == "" && "$1" == "" ]] ; then
echo "Usage: makedependencies OS_BUILD"
echo " OS_BUILD = 32|64"
echo " or export OS_BUILD=xx"
exit 1
fi
if [[ "${OS_BUILD}" == "64" ]] ; then
export MINGHOST=x86_64-w64-mingw32
export PG_BITS=
else
export MINGHOST=i686-w64-mingw32
export PG_BITS=w32
# alias cmake="/c/ming32/projects/cmake-2.8.10.2-win32-x86/bin/cmake"
fi
export PROJECTS=/projects
export PG_VER=9.4
export PGPATH=/projects/postgresql/rel/pg${PG_VER}w${OS_BUILD}${GCC_TYPE}
export PATH="${PROJECTS}/rel-libiconv-1.13.1w${OS_BUILD}${GCC_TYPE}/include:/mingw/bin:/mingw/include:/c/Windows/system32:/c/Windows:${PGPATH}/bin:${PGPATH}/lib:.:/bin:/include"
GMP_VER=5.1.2
MPFR_VER=3.1.2
CGAL_VER=4.6.1
BOOST_VER=1.59.0
BOOST_VER_WU=1_59_0
#gmp
PATH="${PATH}:${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}/include:${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}/lib"
#mpfr
PATH="${PATH}:${PROJECTS}/CGAL/rel-mpfr-${MPFR_VER}w${OS_BUILD}${GCC_TYPE}/include:${PROJECTS}/CGAL/rel-mpfr-${MPFR_VER}w${OS_BUILD}${GCC_TYPE}/lib:${PROJECTS}/CGAL/rel-mpfr-${MPFR_VER}w${OS_BUILD}${GCC_TYPE}/bin"
#boost
PATH="${PATH}:${PROJECTS}/boost/rel-${BOOST_VER_WU}w${OS_BUILD}${GCC_TYPE}/lib"
#cgal
PATH="${PATH}:${PROJECTS}/CGAL/rel-cgal-${CGAL_VER}w${OS_BUILD}${GCC_TYPE}/include:${PROJECTS}/CGAL/rel-cgal-${CGAL_VER}w${OS_BUILD}${GCC_TYPE}/lib"
#add cmake
export PATH="${PATH}:/cmake/bin"
if true; then
cd ${PROJECTS}
mkdir boost
cd ${PROJECTS}/boost
cd ${SOURCES}
wget http://sourceforge.net/projects/boost/files/boost/${BOOST_VER}/boost_${BOOST_VER_WU}.tar.bz2
rm -rf boost_${BOOST_VER_WU}
tar -xvjf boost_${BOOST_VER_WU}.tar.bz2
cd boost_${BOOST_VER_WU}
cmd //c bootstrap.bat gcc
cd tools/build
cp b2.exe ../..
cd ../..
b2 --clean
b2 toolset=gcc address-model=${OS_BUILD} define=BOOST_USE_WINDOWS_H threading=multi variant=release link=static --with-thread --with-system --with-date_time --with-serialization --with-program_options --prefix=${PROJECTS}/boost/rel-${BOOST_VER_WU}w${OS_BUILD}${GCC_TYPE} install
#cd ..
#rm -rf boost_${BOOST_VER_WU}
fi
if false; then
cd ${PROJECTS}/CGAL
wget ftp://ftp.gmplib.org/pub/gmp/gmp-${GMP_VER}.tar.bz2
rm -rf gmp-${GMP_VER}
tar xvjf gmp-${GMP_VER}.tar.bz2
cd gmp-${GMP_VER}
#make clean
./configure --build=${MINGHOST} --enable-static --disable-shared --prefix=${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}
make && make install
make check
fi
if false; then
cd ${PROJECTS}/CGAL
wget http://www.mpfr.org/mpfr-current/mpfr-${MPFR_VER}.tar.bz2
rm -rf mpfr-${MPFR_VER}
tar xvjf mpfr-${MPFR_VER}.tar.bz2
cd mpfr-${MPFR_VER}
#make clean
export CPPFLAGS="-I${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}/include"
export LDFLAGS="-L${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}/lib"
./configure --build=${MINGHOST} --enable-static --disable-shared --prefix=${PROJECTS}/CGAL/rel-mpfr-${MPFR_VER}w${OS_BUILD}${GCC_TYPE}
make && make install
make check
fi
if false; then
cd ${PROJECTS}/CGAL
export CGAL_VER=4.6.1
# download tar.bz2 file from https://gforge.inria.fr/frs/?group_id=52
#rm -rf CGAL-${CGAL_VER}
#tar xvjf CGAL-${CGAL_VER}.tar.bz2
rm -rf build
mkdir -p build
cd build
cmake -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=${PROJECTS}/CGAL/rel-cgal-${CGAL_VER}w${OS_BUILD}${GCC_TYPE} -DBoost_USE_STATIC_LIBS=ON -DCMAKE_CXX_FLAGS:STRING="-DBOOST_THREAD_USE_LIB -DBoost_USE_STATIC_LIBS -DBOOST_USE_WINDOWS_H" -DBOOST_ROOT:PATH=${PROJECTS}/boost/rel-${BOOST_VER_WU}w${OS_BUILD}${GCC_TYPE} ../CGAL-${CGAL_VER}
## Fixup generated files - this doesn't seem to be needed for CGAL 4.2
if false; then
mv src/CGAL/all_files.cpp aatmp
echo "#include <windows.h>" > src/CGAL/all_files.cpp
cat aatmp >> src/CGAL/all_files.cpp
rm aatmp
mv src/ImageIO/all_files.cpp aatmp
echo "#include <windows.h>" > src/ImageIO/all_files.cpp
cat aatmp >> src/ImageIO/all_files.cpp
rm aatmp
fi
make && make install
fi
if false ; then
cd ${PROJECTS}
export PGPATH=${PROJECTS}/postgresql/rel/pg92w${OS_BUILD}${GCC_TYPE}
wget -N http://ftp.postgresql.org/pub/source/v9.2.3/postgresql-9.2.3.tar.bz2
tar xjf postgresql-9.2.3.tar.bz2
cd postgresql-9.2.2
./configure --prefix=${PGPATH} --build=${MINGHOST} --target=${MINGHOST} --with-pgport=5442 --enable-cassert --enable-debug --enable-integer-datetimes --disable-float8-byval --without-zlib build_alias=${MINGHOST} host_alias=${MINGHOST} target_alias=${MINGHOST}
make && make install
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.