Skip to content

Instantly share code, notes, and snippets.

@robe2
Created August 25, 2019 04:47
Show Gist options
  • Save robe2/8586531779f00f63e7eddc54513f122a to your computer and use it in GitHub Desktop.
Save robe2/8586531779f00f63e7eddc54513f122a to your computer and use it in GitHub Desktop.
PostGIS 3.0 windows 64-bit dependencies
#these are compiled using mingw64 gcc 8.1 chain
#http://www.bostongis.com/postgisstuff/ming64gcc81.7z
export OS_BUILD=64
export GCC_TYPE=gcc81
PROJECTS=/projects
SOURCES=/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
fi
#alias cmake="/c/ming${OS_BUILD}/cmake-2.8.10.2-win32-x86/bin/cmake"
#alias ctest="/c/ming${OS_BUILD}/cmake-2.8.10.2-win32-x86/bin/ctest"
CMAKE_PATH=/cmake
cd ${PROJECTS}
#export PATH="/mingw/bin:/mingw/include:/c/Windows/system32:.:/bin"
export PATHOLD="/c/Program Files/TortoiseSVN/bin:/mingw/bin:/mingw/include:/c/Windows/system32:/bin:/include" #export
export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin"
#export PATH="${PATH}:/c/ming${OS_BUILD}/svn:/c/ming${OS_BUILD}/cmake-2.8.11-win32-x86/bin"
cd ${PROJECTS}
#build openssl
if false; then
cd ${PROJECTS}
mkdir ssl
cd ssl
cd ${SOURCES}
export PATH="/mingw/bin:/bin"
export SSL_VER=1.1.1c
#export SSL_VER=1.0.2g
#wget https://www.openssl.org/source/openssl-${SSL_VER}.tar.gz
rm -rf openssl-${SSL_VER}
tar xvfz openssl-${SSL_VER}.tar.gz
cd openssl-${SSL_VER}
SSL_REL_PATH=${PROJECTS}/ssl/rel-openssl-${SSL_VER}w${OS_BUILD}${GCC_TYPE}
make clean
./configure mingw64 --prefix=${SSL_REL_PATH} shared
make
make install
fi
#build curl
if true; then
cd ${PROJECTS}
mkdir curl
cd curl
cd ${SOURCES}
export PATH="/mingw/bin:/bin"
export CURL_VER=7.65.3
export ZLIB_VER=1.2.11
#export SSL_VER=1.0.1p
#export SSL_VER=1.0.2g
export SSL_VER=1.1.1c
export PATH="${PATH}:${PROJECTS}/ssl/rel-openssl-${SSL_VER}w${OS_BUILD}${GCC_TYPE}/include:${PROJECTS}/ssl/rel-openssl-${SSL_VER}w${OS_BUILD}${GCC_TYPE}/lib"
wget --no-check-certificate http://curl.haxx.se/download/curl-${CURL_VER}.tar.gz
rm -rf curl-${CURL_VER}
tar xvfz curl-${CURL_VER}.tar.gz
cd curl-${CURL_VER}
CURL_REL_PATH=${PROJECTS}/curl/rel-curl-${CURL_VER}w${OS_BUILD}${GCC_TYPE}
#LIBXML_PATH=${PROJECTS}/libxml/rel-libxml2-2.7.8w${OS_BUILD}${GCC_TYPE}
make clean
./configure --enable-shared --disable-static --prefix=${CURL_REL_PATH} --with-ssl=${PROJECTS}/ssl/rel-openssl-${SSL_VER}w${OS_BUILD}${GCC_TYPE} --with-zlib=${PROJECTS}/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}
#export PATH="/cmake/bin:/mingw/bin:/mingw/include:/mingw/lib:/bin"
#/cmake/bin/cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:bool=on -DCMAKE_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR:PATH=${PROJECTS}/ssl/rel-openssl-${SSL_VER}w${OS_BUILD}${GCC_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=${CURL_REL_PATH} ../curl-${CURL_VER}
make
make install
cd ${CURL_REL_PATH}/bin
strip *.dll
fi
if false; then
cd ${PROJECTS}
#wget -O /sources/autoconf-2.69.tar.gz ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar -xvf /sources/autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --host=${MINGHOST} --target=${MINGHOST} --prefix=/mingw
make && make install
autoconf --version
rm -rf ${PROJECTS}/autoconf-2.69
fi
if false; then
cd ${PROJECTS}
#wget -O /sources/automake-1.14.tar.gz ftp://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
tar -xvf /sources/automake-1.14.tar.gz
cd automake-1.14
./configure --host=${MINGHOST} --target=${MINGHOST} --prefix=/mingw
make && make install
automake --version
rm -rf ${PROJECTS}/automake-1.14
fi
if false; then
cd ${PROJECTS}
#wget --no-parent -O /sources/libtool-2.4.2.tar.gz ftp://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz
tar -xvf /sources/libtool-2.4.2.tar.gz
cd libtool-2.4.2
./configure --host=${MINGHOST} --target=${MINGHOST} --prefix=/mingw
make && make install
libtool --version
rm -rf ${PROJECTS}/libtool-2.4.2
fi
#zlib (needed for sqlite, openjpeg, and gdal)
if false; then
#export PATH=/mingw
cd ${SOURCES}
export ZLIB_VER=1.2.11
#wget --no-check-certificate http://zlib.net/zlib-1.2.11.tar.gz
rm -rf zlib-${ZLIB_VER}
tar xvfz zlib-${ZLIB_VER}.tar.gz
cd zlib-${ZLIB_VER}
export REL_PATH=/projects/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}
make install -fwin32/Makefile.gcc SHARED_MODE=1 INCLUDE_PATH=${REL_PATH}/include LIBRARY_PATH=${REL_PATH}/lib BINARY_PATH=${REL_PATH}/bin
#make && make install
fi
#SQLite3 library
if false; then
export ZLIB_VER=1.2.11
export ZLIB_PATH=/projects/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}
echo $PATH
cd ${SOURCES}
#exit
export PATH="/bin:/mingw/bin:/mingw/include:${ZLIB_PATH}/bin:${ZLIB_PATH}/lib:${ZLIB_PATH}/include"
#xport SQLVER=3240000
export SQLVER=3280000
export SQLYR=2019
#export ZLIB_VER=1.2.11
#export PATH="/projects/zlib/rel-zlib${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}:${PATH}"
#export PKG_CONFIG_PATH=/projects/zlib/rel-zlib${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig
#export SQLVER=3160200
#export SQLYR=2017
#rm sqlite-autoconf-${SQLVER}.tar.gz
wget --no-check-certificate https://www.sqlite.org/${SQLYR}/sqlite-autoconf-${SQLVER}.tar.gz
rm -rf sqlite-autoconf-${SQLVER}
tar xvfz sqlite-autoconf-${SQLVER}.tar.gz
cd sqlite-autoconf-${SQLVER}
export "CFLAGS=-O3 -DSQLITE_ENABLE_STAT3=1 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_TREE_EXPLAIN=1 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 -DSQLITE_ENABLE_FTS5=1 -DSQLITE_ENABLE_COLUMN_METADATA=1"
sh configure
#./configure --help
#exit
#./configure --target=${MINGHOST} --enable-shared=yes --enable-static=no --prefix=${PROJECTS}/sqlite/rel-sqlite3w${OS_BUILD}${GCC_TYPE}
./configure --target=${MINGHOST} --prefix=${PROJECTS}/sqlite/rel-sqlite3w${OS_BUILD}${GCC_TYPE}
#gcc -shared -link sqlite3.c -o sqlite3.dll
make
make install-strip
make check
fi
if false; then
cd ${PROJECTS}
LIBICONV_VER=1.15
wget --no-parent -O /sources/libiconv-${LIBICONV_VER}.tar.gz http://ftp.gnu.org/gnu/libiconv/libiconv-${LIBICONV_VER}.tar.gz
rm -rf libiconv-${LIBICONV_VER}
tar xvfz /sources/libiconv-${LIBICONV_VER}.tar.gz
cd libiconv-${LIBICONV_VER}
export LFLAGS="-static-libgcc"
./configure --build=${MINGHOST} --target=${MINGHOST} --prefix=${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}
make && make install
make check
rm -rf ${PROJECTS}/libiconv-${LIBICONV_VER}
fi
if false; then
cd ${SOURCES}
rm -rf CUnit-2.1-2
rm -rf CUnit-2.1-3
#wget --no-parent -O ${SOURCES}/CUnit-2.1-2-src.tar.bz2 http://iweb.dl.sourceforge.net/project/cunit/CUnit/2.1-2/CUnit-2.1-2-src.tar.bz2
tar xvf CUnit-2.1-2-src.tar.bz2
cd CUnit-2.1-2
# libtoolize -f -c -i \
# && aclocal \
# && autoconf \
# && automake --gnu --add-missing \
./configure --target=${MINGHOST} --prefix=/mingw/${MINGHOST}
make clean
make && make install
make check
cd ..
rm -rf ${SOURCES}/CUnit-2.1-3
fi
if false; then
export LIBXML_VER=2.9.9
mkdir ${PROJECTS}/libxml
cd ${PROJECTS}/libxml
cd ${SOURCES}
export LIBICONV_VER=1.15
export PATH="/bin:/mingw/bin:/mingw/include:/bin"
export CURL_VER=7.61.1
export SSL_VER=1.0.2g
export CURL_REL_PATH=${PROJECTS}/curl/rel-curl-${CURL_VER}w${OS_BUILD}${GCC_TYPE}
#export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin:${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/lib:${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/bin:${CURL_REL_PATH}/include"
export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin:${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/lib:${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/bin"
#had to rename C:\ming64gcc81\mingw64\x86_64-w64-mingw32\lib\libz.a to libz.a.old so didn't get picked up
#wget -O libxml2-${LIBXML_VER}.tar.gz ftp://xmlsoft.org/libxml2/libxml2-${LIBXML_VER}.tar.gz
rm -rf libxml2-${LIBXML_VER}
tar xvfz libxml2-${LIBXML_VER}.tar.gz
cd libxml2-${LIBXML_VER}
./configure --prefix=${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE} --target=${MINGHOST} --with-threads=no --enable-shared CFLAGS=-O2
make clean
make
make install
make check
cd ..
rm -rf ${PROJECTS}/libxml/libxml2-${LIBXML_VER}
fi
if false; then
#This is needed for ST_GeomFromGeoJSON and family
mkdir ${PROJECTS}/json-c
cd ${PROJECTS}/json-c
export JSON_VER=0.12
#rm json-c-${JSON_VER}.zip
cd ${SOURCES}
#wget --no-check-certificate --output-document=${SOURCES}/json-c-${JSON_VER}.zip https://github.com/json-c/json-c/archive/json-c-${JSON_VER}.zip
rm -rf json-c-${JSON_VER}
unzip ${SOURCES}/json-c-${JSON_VER}.zip
mv json-c-json-c-${JSON_VER} json-c-${JSON_VER}
cd json-c-${JSON_VER}
## had to compile with -w (disable warnings otherwise it gave errors)
# note we use --enable-static -disable-shared so we don't have a small itsy bitsy json..dll we need to distribute
# this will force json support to be embedded directly in postgis-.dll
export VERBOSE=1
./configure --target=${MINGHOST} \
--prefix=${PROJECTS}/json-c/rel-${JSON_VER}w${OS_BUILD}${GCC_TYPE} --enable-static --disable-shared CFLAGS=-w
make
make install
make check #fails for some reason
#after install change lib/libjson-c.la file from library_names='' to library_names='libjson-c.a'
#for some reason install fails to copy this file
#cp json_object_iterator.h ${PROJECTS}/json-c/rel-${JSON_VER}w${OS_BUILD}${GCC_TYPE}/include/json/json_object_iterator.h
fi
if false; then
cd ${PROJECTS}/postgresql
cd ${SOURCES}
export PG_VER=9.3w${OS_BUILD}${GCC_TYPE}
export PG_VER_FULL=9.3.5
export PG_DIR=${SOURCES}/postgresql-${PG_VER_FULL}
rm postgresql-${PG_VER_FULL}.tar.bz2
rm -rf postgresql-${PG_VER_FULL}
wget http://ftp.postgresql.org/pub/source/v${PG_VER_FULL}/postgresql-${PG_VER_FULL}.tar.bz2
#wget http://ftp.postgresql.org/pub/snapshot/dev/postgresql-${PG_VER_FULL}.tar.bz2
tar xvjf postgresql-${PG_VER_FULL}.tar.bz2
cd postgresql-${PG_VER_FULL}
export PATH="${PROJECTS}/rel/pg${PG_VER}/bin:${PROJECTS}/rel/pg${PG_VER}/lib:$PATH"
#if you are building for 64-bit then use x86_64-w64-mingw32 for the build,host,target
#32 bit uses i686-w64-mingw32 for build, host, target
./configure --prefix=${PROJECTS}/postgresql/rel/pg${PG_VER}\
--build=${MINGHOST} \
--with-pgport=8443 --disable-float8-byval --enable-cassert --enable-debug \
--enable-integer-datetimes --without-zlib
make clean
make
#gmake world
make install
make check
#gmake install-world
cd ${PG_DIR}/contrib/postgres_fdw
make install
cd ${PG_DIR}/contrib/hstore
make
make install
cd ${PG_DIR}/contrib/fuzzystrmatch
make
make install
cd ${PG_DIR}/contrib/pg_trgm
make
make install
fi
#wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.65.tar.gz
#tar -xvf autoconf-2.65.tar.gz
# cd autoconf-2.65
# ./configure --host=x86_64-w64-mingw32 --prefix=/mingw
# make clean && make && make install
# autoconf --version
# exit;
if false; then
export PROJ_VER=4.9.3
cd ${SOURCES}
rm -rf proj-${PROJ_VER}
wget http://download.osgeo.org/proj/proj-${PROJ_VER}.tar.gz
wget http://download.osgeo.org/proj/proj-datumgrid-1.6.zip
tar xvfz proj-${PROJ_VER}.tar.gz
cd proj-${PROJ_VER}
cd nad
unzip ../../proj-datumgrid-1.6.zip
cd ..
./configure --prefix=${PROJECTS}/proj/rel-${PROJ_VER}w${OS_BUILD}${GCC_TYPE} --build=${MINGHOST}
make clean
make && make install
cd ${PROJECTS}/proj/rel-${PROJ_VER}w${OS_BUILD}${GCC_TYPE}
strip bin/*.dll
fi
if false; then
#export PROJ_VER=5.2.0
export PROJ_VER=6.1.1
#export DATUM_VER=1.8
#export DATUM_VER=world-1.0RC1
export DATUM_VER=world-1.0
export DATUM_VER_NA=north-america-1.2
export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin"
export ZLIB_VER=1.2.11
export ZLIB_PATH=/projects/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}
#wget --no-check-certificate http://zlib.net/zlib-1.2.11.tar.gz
export PATH="/bin:/mingw/bin:/mingw/include:${ZLIB_PATH}/bin:${ZLIB_PATH}/lib:${ZLIB_PATH}/include"
export PATH=${PROJECTS}/sqlite/rel-sqlite3w${OS_BUILD}${GCC_TYPE}/bin:${PATH}
export PKG_CONFIG_PATH=${PROJECTS}/sqlite/rel-sqlite3w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig:${ZLIB_PATH}/lib/pgconfig
cd ${SOURCES}
rm -rf proj-${PROJ_VER}
#wget http://download.osgeo.org/proj/proj-${PROJ_VER}.tar.gz
#wget http://download.osgeo.org/proj/proj-datumgrid-${DATUM_VER}.zip
#wget https://download.osgeo.org/proj/proj-datumgrid-n${DATUM_VER_NA}.zip
tar xvfz proj-${PROJ_VER}.tar.gz
tar xvfz ../proj-${PROJ_VER}.tar.gz -d proj-${PROJ_VER}/data/
cd proj-${PROJ_VER}
make clean
#cd nad
#unzip ../../proj-datumgrid-${DATUM_VER}.zip
#cd ..
LDFLAGS="-L${ZLIB_PATH}/lib" \
./configure --enable-shared --disable-static --prefix=${PROJECTS}/proj/rel-${PROJ_VER}w${OS_BUILD}${GCC_TYPE} --build=${MINGHOST}
#exit
#make clean
make && make install
cd ${PROJECTS}/proj/rel-${PROJ_VER}w${OS_BUILD}${GCC_TYPE}
strip bin/*.dll
exit
fi
#compile freexl
if false; then
export PATH="/mingw/usr/bin:/mingw/bin:/mingw/include:/mingw/lib:/bin:${PROJECTS}/rel-libiconv-1.15w${OS_BUILD}${GCC_TYPE}/bin"
cd ${PROJECTS}
mkdir freexl
export FREEXL_VER=1.0.5
cd ${SOURCES}
wget http://www.gaia-gis.it/gaia-sins/freexl-${FREEXL_VER}.tar.gz
rm -rf freexl-${FREEXL_VER}
tar xvfz freexl-${FREEXL_VER}.tar.gz
cd freexl-${FREEXL_VER}
export FREEXL_REL_PATH=${PROJECTS}/freexl/rel-freexl-${FREEXL_VER}w${OS_BUILD}${GCC_TYPE}
./configure --disable-static --enable-shared --prefix=${FREEXL_REL_PATH}
make && make install
make check
fi
#compile openjpeg
if false; then
cd ${PROJECTS}
mkdir openjpeg
export OPENJPEG_VER=2.3.1
cd ${SOURCES}
export ZLIB_VER=1.2.11
#export PATH="$PATH:${PROJECTS}/openjpeg/rel-openjpeg-${OPENJPEG_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig"
export ZLIB_PATH=/projects/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}
export PATH="/cmake/bin:/mingw/bin:/mingw/include:/mingw/lib:/bin"
#wget https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VER}.tar.gz -O openjpeg-${OPENJPEG_VER}.tar.gz
rm -rf openjpeg-${OPENJPEG_VER}
tar xvfz openjpeg-${OPENJPEG_VER}.tar.gz
rm -rf build
mkdir -p build
cd build
#export PATH="/cmake/bin:/mingw/bin:/mingw/include:/mingw/lib:/bin"
/cmake/bin/cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_PKGCONFIG_FILES=on -DBUILD_SHARED_LIBS:bool=on -DZLIB_LIBRARY:PATH=${ZLIB_PATH}/lib/libz.a -DZLIB_INCLUDE_DIR:PATH=${ZLIB_PATH}/include -DCMAKE_INSTALL_PREFIX:PATH=${PROJECTS}/openjpeg/rel-openjpeg-${OPENJPEG_VER}w${OS_BUILD}${GCC_TYPE} ../openjpeg-${OPENJPEG_VER}
#after install edit the lib/pkgconfig file to get rid of windows paths e.g C:/.. should be /projects/..
#cd openjpeg-${OPENJPEG_VER}
#autoconf
#./configure --prefix=${PROJECTS}/openjpeg/rel-openjpeg-${OPENJPEG_VER}w${OS_BUILD}${GCC_TYPE}
make && make install
#make check
fi
## build expat needed for XLSX support
if false; then
cd ${PROJECTS}
mkdir expat
EXPAT_VER=2.2.7
EXPAT_VERWU=R_2_2_7
cd ${SOURCES}
#rm -rf expat-${EXPAT_VER}.tar.gz
#need to download expat from here
#wget https://github.com/libexpat/libexpat/archive/${EXPAT_VERWU}.tar.gz -O expat-${EXPAT_VER}.tar.gz
#exit
rm -rf expat-${EXPAT_VER}
tar xvfz expat-${EXPAT_VER}.tar.gz
mv libexpat-${EXPAT_VERWU} expat-${EXPAT_VER}
cd expat-${EXPAT_VER}/expat
sh buildconf.sh
#had to put in --without-xmlwf wide-format otherwise looks for docbook and fails install
./configure --host=${MINGHOST} --target=${MINGHOST} --without-xmlwf --prefix=${PROJECTS}/expat/rel-expat-${EXPAT_VER}w${OS_BUILD}${GCC_TYPE}
make && make install
#doc build fails, that's okay
fi
if false; then
export PATH="/mingw/bin:/mingw/include:/bin"
cd ${PROJECTS}
mkdir protobuf
cd ${PROJECTS}/protobuf
cd ${SOURCES}
export PROTOBUF_VER=3.2.0
#rm protobuf-${PROTOBUF_VER}.tar.gz
wget https://github.com/google/protobuf/archive/v${PROTOBUF_VER}.tar.gz -O protobuf-${PROTOBUF_VER}.tar.gz
rm -rf protobuf-${PROTOBUF_VER}
tar xvfz protobuf-${PROTOBUF_VER}.tar.gz
cd protobuf-${PROTOBUF_VER}
sh autogen.sh
#CPPFLAGS="-I${PROJECTS}/rel-libiconv-1.13.1w${OS_BUILD}${GCC_TYPE}/include"
#LDFLAGS="-L${PROJECTS}/rel-libiconv-1.13.1w${OS_BUILD}${GCC_TYPE}/lib -L${CURL_REL_PATH}/lib -L/mingw/x86_64-w64-mingw32/lib"
#export LIBS="-lodbc32 -lodbcinst32"
./configure --build=${MINGHOST} --prefix=${PROJECTS}/protobuf/rel-${PROTOBUF_VER}w${OS_BUILD}${GCC_TYPE}
#exit
#./configure --build=${MINGHOST} --with-curl=no --with-threads=no --prefix=${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}
make && make install
cd ${PROJECTS}/protobuf/rel-${PROTOBUF_VER}w${OS_BUILD}${GCC_TYPE}
strip *.dll
fi
if false; then
export PATH="/mingw/bin:/mingw/include:/bin"
cd ${PROJECTS}
mkdir protobuf-c
cd ${PROJECTS}/protobuf-c
cd ${SOURCES}
export PROTOBUFC_VER=1.2.1
export PROTOBUF_VER=3.2.0
#export PATH="${PATH}:${PROJECTS}/protobuf/rel-${PROTOBUF_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/protobuf/rel-${PROTOBUF_VER}w${OS_BUILD}${GCC_TYPE}/include"
export PKG_CONFIG_PATH=${PROJECTS}/protobuf/rel-${PROTOBUF_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig;
rm protobuf-c-${PROTOBUFC_VER}.tar.gz
wget https://github.com/protobuf-c/protobuf-c/releases/download/v${PROTOBUFC_VER}/protobuf-c-${PROTOBUFC_VER}.tar.gz
rm -rf protobuf-c-${PROTOBUFC_VER}
tar xvfz protobuf-c-${PROTOBUFC_VER}.tar.gz
cd protobuf-c-${PROTOBUFC_VER}
make clean
#CPPFLAGS="-I${PROJECTS}/rel-libiconv-1.13.1w${OS_BUILD}${GCC_TYPE}/include"
#LDFLAGS="-L${PROJECTS}/rel-libiconv-1.13.1w${OS_BUILD}${GCC_TYPE}/lib -L${CURL_REL_PATH}/lib -L/mingw/x86_64-w64-mingw32/lib"
#export LIBS="-lodbc32 -lodbcinst32"
#./configure --build=${MINGHOST} --prefix=${PROJECTS}/protobuf-c/rel-${PROTOBUFC_VER}w${OS_BUILD}${GCC_TYPE}
./configure --build=${MINGHOST} --prefix=${PROJECTS}/protobuf/rel-${PROTOBUF_VER}w${OS_BUILD}${GCC_TYPE}
make && make install
cd ${PROJECTS}/protobuf-c/rel-${PROTOBUFC_VER}w${OS_BUILD}${GCC_TYPE}
strip *.dll
fi
if false; then
export PATH=$PATHOLD
export LIBICONV_VER=1.15
export CURL_VER=7.65.3
#export SSL_VER=1.0.2g
export SSL_VER=1.1.1c
#export PROJ_VER=5.2.0
export CURL_REL_PATH=${PROJECTS}/curl/rel-curl-${CURL_VER}w${OS_BUILD}${GCC_TYPE}
#export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin:${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/lib:${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/bin:${CURL_REL_PATH}/include"
export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin:${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/lib:${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/bin"
cd ${PROJECTS}
mkdir gdal
cd ${PROJECTS}/gdal
export GDAL_VER=2.4.2
export GDAL_VER_PRE=2.4.2
cd ${SOURCES}
#rm gdal-${GDAL_VER_PRE}.tar.gz
#wget https://github.com/OSGeo/gdal/releases/download/v${GDAL_VER}/gdal-${GDAL_VER}.tar.gz
#wget http://download.osgeo.org/gdal/${GDAL_VER}/gdal-${GDAL_VER_PRE}.tar.gz
rm -rf gdal-${GDAL_VER}
tar xvfz gdal-${GDAL_VER_PRE}.tar.gz
#exit
export EXPAT_VER=2.2.7
export FREEXL_VER=1.0.5
export ZLIB_VER=1.2.11
#export OPENJPEG_VER=2.12
export OPENJPEG_VER=2.3.1
#export PATH="$PATH:${PROJECTS}/openjpeg/rel-openjpeg-${OPENJPEG_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig"
export PKG_CONFIG_PATH="${PROJECTS}/openjpeg/rel-openjpeg-${OPENJPEG_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig"
export FREEXL_REL_PATH=${PROJECTS}/freexl/rel-freexl-${FREEXL_VER}w${OS_BUILD}${GCC_TYPE}
#cd gdal
#cd branches/${GDAL_VER}/gdal
#this you need to create and change m_nColCount = 500 to m_nColCount = 1024 (2 lines of that)
cp /projects/gdal/branches/${GDAL_VER}/port/cpl_odbc.cpp gdal-${GDAL_VER}/port
cd gdal-${GDAL_VER}
#make
#exit
#if you get a static exes (huge exes) and no dll it's usually libiconv or zlib that is the culprit.
# (I use --with-libz=internal because mingw sometimes comes with static libz that causes build to be static )
# Make sure after install you have a .dll in your install bin folder
#export CPPFLAGS="-I${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/include -I${CURL_REL_PATH}/include"
export CPPFLAGS="-I${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/include"
#export LDFLAGS="-L${PROJECTS}/ssl/rel-openssl-${SSL_VER}w${OS_BUILD}${GCC_TYPE}/lib -L${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/lib -L${CURL_REL_PATH}/lib -L/mingw/x86_64-w64-mingw32"
export LDFLAGS="-L${PROJECTS}/ssl/rel-openssl-${SSL_VER}w${OS_BUILD}${GCC_TYPE}/lib -L${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/lib -L/mingw/x86_64-w64-mingw32"
#export PKG_CONFIG_PATH=""
make clean
./configure --host=${MINGHOST} --enable-shared --disable-static --with-expat=${PROJECTS}/expat/rel-expat-${EXPAT_VER}w${OS_BUILD}${GCC_TYPE} --with-freexl=${FREEXL_REL_PATH} --with-odbc=/mingw/${MINGHOST} --with-sqlite3=${PROJECTS}/sqlite/rel-sqlite3w${OS_BUILD}${GCC_TYPE} --with-curl=${CURL_REL_PATH}/bin/curl-config \
--with-openjpeg=${PROJECTS}/openjpeg/rel-openjpeg-${OPENJPEG_VER}w${OS_BUILD}${GCC_TYPE} \
--with-libz=internal \
--prefix=${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}
#exit
make
make install
#if you get an error like gdalopeninfo.cpp:87:8: error: 'mutex' in namespace 'std' does not name a type
#then your mingw64 is missing std compatible thread support - download this https://github.com/meganz/mingw-std-threads
cd ${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}/bin
strip *.dll
strip *.exe
fi
if false; then
export PATH=$PATHOLD
export LIBICONV_VER=1.15
export CURL_VER=7.54.1
export SSL_VER=1.0.2g
export PROJ_VER=6.1.1
export CURL_REL_PATH=${PROJECTS}/curl/rel-curl-${CURL_VER}w${OS_BUILD}${GCC_TYPE}
#export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin:${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/lib:${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/bin:${CURL_REL_PATH}/include"
export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin:${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/lib:${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/bin"
cd ${PROJECTS}
mkdir gdal
cd ${PROJECTS}/gdal
export GDAL_VER=3.0.1
export GDAL_VER_PRE=3.0.1rc1
cd ${SOURCES}
#rm gdal-${GDAL_VER_PRE}.tar.gz
#wget https://github.com/OSGeo/gdal/releases/download/v${GDAL_VER}/gdal-${GDAL_VER}.tar.gz
wget http://download.osgeo.org/gdal/${GDAL_VER}/gdal-${GDAL_VER_PRE}.tar.gz
rm -rf gdal-${GDAL_VER}
tar xvfz gdal-${GDAL_VER_PRE}.tar.gz
#exit
export EXPAT_VER=2.2.7
export FREEXL_VER=1.0.5
export ZLIB_VER=1.2.11
#export OPENJPEG_VER=2.12
export OPENJPEG_VER=2.3.1
#export PATH="$PATH:${PROJECTS}/openjpeg/rel-openjpeg-${OPENJPEG_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig"
export ZLIB_PATH=/projects/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}
#wget --no-check-certificate http://zlib.net/zlib-1.2.11.tar.gz
export PATH="/bin:/mingw/bin:/mingw/include:${ZLIB_PATH}/bin:${ZLIB_PATH}/lib:${ZLIB_PATH}/include"
export PATH=${PROJECTS}/sqlite/rel-sqlite3w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/proj/rel-${PROJ_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PATH}
export FREEXL_REL_PATH=${PROJECTS}/freexl/rel-freexl-${FREEXL_VER}w${OS_BUILD}${GCC_TYPE}
export PKG_CONFIG_PATH="${PROJECTS}/openjpeg/rel-openjpeg-${OPENJPEG_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig:${PROJECTS}/sqlite/rel-sqlite3w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig:${PROJECTS}/proj/rel-${PROJ_VER}${OS_BUILD}${GCC_TYPE}/lib/pkgconfig"
#${ZLIB_PATH}/lib/pkgconfig:
#cd gdal
#cd branches/${GDAL_VER}/gdal
#this you need to create and change m_nColCount = 500 to m_nColCount = 1024 (2 lines of that)
cp /projects/gdal/branches/${GDAL_VER}/port/cpl_odbc.cpp gdal-${GDAL_VER}/port
echo ${PROJECTS}/proj/rel-proj-${PROJ_VER}w${OS_BUILD}${GCC_TYPE}
cd gdal-${GDAL_VER}
#make
#exit
#if you get a static exes (huge exes) and no dll it's usually libiconv or zlib that is the culprit.
# (I use --with-libz=internal because mingw sometimes comes with static libz that causes build to be static )
# Make sure after install you have a .dll in your install bin folder
#export CPPFLAGS="-I${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/include -I${CURL_REL_PATH}/include"
export CPPFLAGS="-I${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/include"
#export LDFLAGS="-L${PROJECTS}/ssl/rel-openssl-${SSL_VER}w${OS_BUILD}${GCC_TYPE}/lib -L${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/lib -L${CURL_REL_PATH}/lib -L/mingw/x86_64-w64-mingw32"
export LDFLAGS="-L${PROJECTS}/ssl/rel-openssl-${SSL_VER}w${OS_BUILD}${GCC_TYPE}/lib -L${PROJECTS}/rel-libiconv-${LIBICONV_VER}w${OS_BUILD}${GCC_TYPE}/lib -L/mingw/x86_64-w64-mingw32"
#export PKG_CONFIG_PATH=""
make clean
./configure --host=${MINGHOST} --enable-shared --disable-static --with-expat=${PROJECTS}/expat/rel-expat-${EXPAT_VER}w${OS_BUILD}${GCC_TYPE} --with-freexl=${FREEXL_REL_PATH} --with-odbc=/mingw/${MINGHOST} --with-sqlite3=${PROJECTS}/sqlite/rel-sqlite3w${OS_BUILD}${GCC_TYPE} --with-curl=${CURL_REL_PATH}/bin/curl-config \
--with-openjpeg=${PROJECTS}/openjpeg/rel-openjpeg-${OPENJPEG_VER}w${OS_BUILD}${GCC_TYPE} \
--with-proj=${PROJECTS}/proj/rel-${PROJ_VER}w${OS_BUILD}${GCC_TYPE} \
--with-libz=internal \
--prefix=${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}
make
make install
#if you get an error like gdalopeninfo.cpp:87:8: error: 'mutex' in namespace 'std' does not name a type
#then your mingw64 is missing std compatible thread support - download this https://github.com/meganz/mingw-std-threads
cd ${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}/bin
strip *.dll
strip *.exe
fi
if false; then
export PATH=$PATHOLD
export SPATIALITE_VER=4.2.0
cd ${SOURCES}
wget http://www.gaia-gis.it/gaia-sins/libspatialite-${SPATIALITE_VER}.tar.gz
tar xvfz libspatialite-${SPATIALITE_VER}.tar.gz
./configure --target=${MINGHOST} --prefix=${PROJECTS}/spatialite/rel-${SPATIALITE_VER}w${OS_BUILD}${GCC_TYPE}
fi
if false; then
export PATH=$PATHOLD
cd ${PROJECTS}
mkdir gdal
cd ${PROJECTS}/gdal
export GDAL_VER=2.0
cd ${SOURCES}
#rm gdal-${GDAL_VER}.tar.gz
#wget http://download.osgeo.org/gdal/${GDAL_VER}/gdal-${GDAL_VER}.tar.gz
#wget http://download.osgeo.org/gdal/2.0.0/gdal-${GDAL_VER}.tar.gz
#rm -rf gdal-${GDAL_VER}
#tar xvfz gdal-${GDAL_VER}.tar.gz
export EXPAT_VER=2.1.0
export CURL_VER=7.39.0
export CURL_REL_PATH=${PROJECTS}/curl/rel-curl-${CURL_VER}w${OS_BUILD}${GCC_TYPE}
export FREEXL_VER=1.0.1
export FREEXL_REL_PATH=${PROJECTS}/freexl/rel-freexl-${FREEXL_VER}w${OS_BUILD}${GCC_TYPE}
export XML_VER=2.7.8
#svn checkout http://svn.osgeo.org/gdal/tags/2.0.0/gdal gdal-${GDAL_VER}
#exit;
cd gdal-${GDAL_VER}
svn update
make clean
#CPPFLAGS="-I${PROJECTS}/rel-libiconv-1.13.1w${OS_BUILD}${GCC_TYPE}/include"
#LDFLAGS="-L${PROJECTS}/rel-libiconv-1.13.1w${OS_BUILD}${GCC_TYPE}/lib -L${CURL_REL_PATH}/lib -L/mingw/x86_64-w64-mingw32/lib"
#export LIBS="-lodbc32 -lodbcinst32"
#--with-curl=${CURL_REL_PATH}/bin/curl-config
#to build with native windows ODBC support
# edit the configure script in root of gdal source tree
# change all references to -lodbc to -lodbc32, and -lodbcinst to -lodbccp32 (yes this is both for 32-bit and 64-bit)
#sh autogen.sh
autoconf
# ./configure --help
# exit
./configure --host=${MINGHOST} --with-expat=${PROJECTS}/expat/rel-expat-${EXPAT_VER}w${OS_BUILD}${GCC_TYPE} --with-freexl=${FREEXL_REL_PATH} --with-threads=no --with-odbc=/mingw/${MINGHOST} --with-sqlite3=${PROJECTS}/sqlite/rel-sqlite3w${OS_BUILD}${GCC_TYPE} --prefix=${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}
#exit
#./configure --build=${MINGHOST} --with-curl=no --with-threads=no --prefix=${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}
make && make install
cd ${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}/bin
strip *.dll
#cd ${PROJECTS}/gdal/gdal-${GDAL_VER}
#make clean
fi
#-- SFCGAL and pgRouting dependencies start here --
cd ${PROJECTS}
mkdir CGAL
GMP_VER=5.1.2
MPFR_VER=4.0.1
CGAL_VER=4.11
BOOST_VER=1.59.0
#BOOST_VER=1.68.0
#BOOST_VER=1.53.0
BOOST_VER_WU=1_59_0
#BOOST_VER_WU=1_68_0
#BOOST_VER_WU=1_53_0
export ICU_VER=62.1
export ICU_VER_WU=62_1
#build ICU needed for boost regex which is needed for new address_standardizer
if false; then
cd ${PROJECTS}
mkdir icu
cd ${SOURCES}
#wget http://download.icu-project.org/files/icu4c/${ICU_VER}/icu4c-${ICU_VER_WU}-src.tgz
rm -rf icu
tar -xvf icu4c-${ICU_VER_WU}-src.tgz
cd icu/source
./runConfigureICU MinGW --disable-strict --disable-threads --enable-shared --prefix=${PROJECTS}/ICU/rel-icu-${ICU_VER}w${OS_BUILD}${GCC_TYPE}
# ./configure --enable-static --disable-shared --prefix=${PROJECTS}/ICU/rel-icu-${ICU_VER}w${OS_BUILD}${GCC_TYPE}
# make
make
make install
fi
export PATH="/mingw/bin:/mingw/include:/c/Windows/system32"
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:${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}/bin"
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"
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"
#PATH="${PATH}:${PROJECTS}/CGAL/gmp-${GMP_VER}"
PATH="${PATH}:.:/bin:/include"
if false; 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}
export BOOST_HAS_ICU=true
export ICU_PATH=${PROJECTS}/icu/rel-icu-${ICU_VER}w${OS_BUILD}${GCC_TYPE}
export PKG_CONFIG_PATH=${PATH}:${ICU_PATH}/lib/pkgconfig
export ICU_LINK="-L${ICU_PATH}/lib `pkg-config --libs --cflags icu-i18n icu-uc icu-io`"
export LIB="$LIB:${ICU_PATH}/lib"
export ICU_LINK="-L${ICU_PATH}/lib -licuuc -licuin -licudt"
echo $ICU_LINK
export LDFLAGS="$LDFLAGS -L${ICU_PATH}/lib `pkg-config --libs`"
cmd //c bootstrap.bat mingw
cd tools/build
#cp b2.exe ../..
cd ../..
#b2 --clean
b2 threading=multi address-model=${OS_BUILD} toolset=gcc define=BOOST_USE_WINDOWS_H variant=release link=static threading=multi --with-thread --with-system --with-date_time --with-serialization --with-regex --with-graph --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
export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin"
cd ${PROJECTS}/CGAL
cd ${SOURCES}
#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
export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin"
cd ${PROJECTS}/CGAL
cd ${SOURCES}
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.11
export CGAL_VER_FULL=4.11.3
cd ${SOURCES}
# # this site requires a login so you have to fetch the file interactively
# delete all dynamic boost files *.dll* from boost install otherwise compiles dynamicall and libCGAL has dependency on boost
#wget https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-${CGAL_VER_FULL}/CGAL-${CGAL_VER_FULL}.tar.xz
export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin:/cmake/bin"
rm -rf CGAL-${CGAL_VER}
cd ${SOURCES}
rm -rf CGAL-${CGAL_VER}
tar xf ${SOURCES}/CGAL-${CGAL_VER_FULL}.tar.xz
mv CGAL-${CGAL_VER_FULL} CGAL-${CGAL_VER}
export MPFR_DIR=${PROJECTS}/CGAL/rel-mpfr-${MPFR_VER}w${OS_BUILD}${GCC_TYPE}
export GMP_DIR=${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}
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"
rm -rf build
mkdir -p build
cd build
##for some reason if the boost .dlls are in boost bin folder, then static doesn't work.
## To force statis remove the .dlls from boost folder so you just have the .a in lib left
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}
make && make install
fi
#build sfcgal
if false; then
export SFCGAL_VER=1.3.4
echo "GMP VER is ${GMP_VER}"
#exit
#export PATH="/mingw/bin:/mingw/include:/c/Windows/system32"
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:${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}/bin"
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"
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"
#PATH="${PATH}:${PROJECTS}/CGAL/gmp-${GMP_VER}"
#PATH="${PATH}:.:/bin:/include"
export PATH="${PATH}:/cmake/bin"
#cd ${PROJECTS}/CGAL
cd ${SOURCES}
rm -rf SFCGAL-${SFCGAL_VER}
wget --no-check-certificate -O SFCGAL-${SFCGAL_VER}.tar.gz https://github.com/Oslandia/SFCGAL/archive/v${SFCGAL_VER}.tar.gz
tar xvfz SFCGAL-${SFCGAL_VER}.tar.gz
export PATH="/mingw/bin:/mingw/include:/c/Windows/system32"
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:${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}/bin"
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"
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"
#PATH="${PATH}:${PROJECTS}/CGAL/gmp-${GMP_VER}"
PATH="${PATH}:.:/bin:/include"
#export PATH="/mingw/bin:/mingw/include:/c/Windows/system32"
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:${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}/bin"
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"
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"
#PATH="${PATH}:${PROJECTS}/CGAL/gmp-${GMP_VER}"
#PATH="${PATH}:.:/bin:/include"
export PATH="${PATH}:/cmake/bin"
#cd ${PROJECTS}/CGAL
#wget --no-check-certificate -O SFCGAL-${SFCGAL_VER}.tar.gz https://github.com/Oslandia/SFCGAL/archive/v${SFCGAL_VER}.tar.gz
#tar -xvf SFCGAL-${SFCGAL_VER}.tar.gz
export MPFR_DIR=${PROJECTS}/CGAL/rel-mpfr-${MPFR_VER}w${OS_BUILD}${GCC_TYPE}
export GMP_DIR=${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}
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"
export CGAL_DIR=${PROJECTS}/CGAL/rel-cgal-${CGAL_VER}w${OS_BUILD}${GCC_TYPE}/lib
export GMP_INCLUDE_DIRS=${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}/include
export GMP_LIBRARIES=${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}/lib/libgmp.a
cd ${PROJECTS}/cgal/sfcgal
#make sure to change file src/CMakeList.txt move MPFR check before GMP
rm -rf build${OS_BUILD}${GCC_TYPE}
mkdir -p build${OS_BUILD}${GCC_TYPE}
cd build${OS_BUILD}${GCC_TYPE}
#if gmp include not find, hack teh cgal/lib/CGAL/CGALConfig.make replacing C:\ming..\Projects with /projects
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=${PROJECTS}/CGAL/rel-sfcgal-${SFCGAL_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} -DGMP_INCLUDE_DIR:PATH=${PROJECTS}/CGAL/rel-gmp-${GMP_VER}w${OS_BUILD}${GCC_TYPE}/include ${SOURCES}/SFCGAL-${SFCGAL_VER}
make
make install
cd ${PROJECTS}/CGAL/rel-sfcgal-${SFCGAL_VER}w${OS_BUILD}${GCC_TYPE}/bin
strip *.dll
#config file looks for dll in the lib folder instead of bin
cp ${PROJECTS}/CGAL/rel-sfcgal-${SFCGAL_VER}w${OS_BUILD}${GCC_TYPE}/bin/*.dll ${PROJECTS}/CGAL/rel-sfcgal-${SFCGAL_VER}w${OS_BUILD}${GCC_TYPE}/lib
#replace windows path format (drive latter) with unix path format
sed -i "/prefix=./c\prefix=${PROJECTS}/CGAL/rel-sfcgal-${SFCGAL_VER}w${OS_BUILD}${GCC_TYPE}" ${PROJECTS}/CGAL/rel-sfcgal-${SFCGAL_VER}w${OS_BUILD}${GCC_TYPE}/bin/sfcgal-config
fi
#--SFCGAL and pgRouting dependencies end here --
#from tar
if false; then
export LIBXML_VER=2.7.8
cd ${PROJECTS}/postgresql
export PG_VER=9.4w${OS_BUILD}${GCC_TYPE}
export PG_VER_FULL=9.4.12
export PG_DIR=${PROJECTS}/postgresql/postgresql-${PG_VER_FULL}
#cd ${PG_DIR}/contrib/hstore
#make clean
#make
#make install
#exit;
#rm postgresql-${PG_VER_FULL}.tar.bz2
rm -rf postgresql-${PG_VER_FULL}
wget http://ftp.postgresql.org/pub/source/v${PG_VER_FULL}/postgresql-${PG_VER_FULL}.tar.bz2
#wget http://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2
#tar -xvjf postgresql-snapshot.tar.bz2
tar -xvjf postgresql-${PG_VER_FULL}.tar.bz2
#gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -shared -o hstore.dll hstore_io.o hstore_op.o hstore_gist.o hstore_gin.o hstore_compat.o crc32.o -L../../src/port -L../../src/common -Wl,--allow-multiple-definition -Wl,--disable-auto-import -Wl,--as-needed -L../../src/backend -lpostgres -lpgcommon -lpgport -lm -lws2_32 -lshfolder -Wl,--export-all-symbols -Wl,--out-implib=libhstore.a
#9.3
#gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -I. -I. -I../../src/include -I./src/include/port/win32 -DEXEC_BACKEND "-I../../src/include/port/win32" -c -o hstore_io.o hstore_io.c
#dllwrap -o hstore.dll --dllname hstore.dll --def libhstoredll.def hstore_io.o hstore_op.o hstore_gist.o hstore_gin.o hstore_compat.o crc32.o -L../../src/port -L../../src/common -Wl,--allow-multiple-definition -Wl,--as-needed -L../../src/backend -lpostgres
cd postgresql-${PG_VER_FULL}
export PATH="${PROJECTS}/rel/pg${PG_VER}/bin:${PROJECTS}/rel/pg${PG_VER}/lib:$PATH"
export PATH="${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE}/bin:$PATH"
make distclean
#if you are building for 64-bit then use x86_64-w64-mingw32 for the build,host,target
#32 bit uses i686-w64-mingw32 for build, host, target
#9.4 LDFLAGS=-Wl,--allow-multiple-definition -Wl,--disable-auto-import -Wl,--as-needed
#9.3 LDFLAGS=-Wl,--allow-multiple-definition -Wl,--as-needed
export LDFLAGS=-Wl,--allow-multiple-definition -Wl,--enable-auto-import -Wl,--as-needed
./configure --prefix=${PROJECTS}/postgresql/rel/pg${PG_VER}\
--build=${MINGHOST} \
--with-pgport=8443 --disable-float8-byval --enable-cassert --enable-debug \
--without-zlib --with-libxml
make clean
make
#gmake world
rm -rf ${PROJECTS}/postgresql/rel/pg${PG_VER}
make install
make check
#gmake install-world
cd ${PG_DIR}/contrib/postgres_fdw
make install
cd ${PG_DIR}/contrib/hstore
make
make install
cd ${PG_DIR}/contrib/fuzzystrmatch
make
make install
cd ${PG_DIR}/contrib/pg_trgm
make
make install
exit;
fi
#from tar
if false; then
export LIBXML_VER=2.7.8
cd ${PROJECTS}/postgresql
export PG_VER=9.6w${OS_BUILD}${GCC_TYPE}
export PG_VER_FULL=9.6.2
export PG_DIR=${PROJECTS}/postgresql/postgresql-${PG_VER_FULL}
rm postgresql-${PG_VER_FULL}.tar.bz2
rm -rf postgresql-${PG_VER_FULL}
wget http://ftp.postgresql.org/pub/source/v${PG_VER_FULL}/postgresql-${PG_VER_FULL}.tar.bz2
#wget http://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2
#tar -xvjf postgresql-snapshot.tar.bz2
tar -xvjf postgresql-${PG_VER_FULL}.tar.bz2
cd postgresql-${PG_VER_FULL}
export PATH="${PROJECTS}/rel/pg${PG_VER}/bin:${PROJECTS}/rel/pg${PG_VER}/lib:$PATH"
export PATH="${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE}/bin:$PATH"
make distclean
#if you are building for 64-bit then use x86_64-w64-mingw32 for the build,host,target
#32 bit uses i686-w64-mingw32 for build, host, target
#9.4 LDFLAGS=-Wl,--allow-multiple-definition -Wl,--disable-auto-import -Wl,--as-needed
#9.3 LDFLAGS=-Wl,--allow-multiple-definition -Wl,--as-needed
#export LDFLAGS=-Wl,--allow-multiple-definition -Wl,--enable-auto-import -Wl,--as-needed
./configure --prefix=${PROJECTS}/postgresql/rel/pg${PG_VER}\
--build=${MINGHOST} \
--with-pgport=8443 --enable-cassert --enable-debug \
--without-zlib --with-libxml
make clean
make
rm -rf ${PROJECTS}/postgresql/rel/pg${PG_VER}
make install
make check
#gmake install-world
cd ${PG_DIR}/contrib/postgres_fdw
make install
cd ${PG_DIR}/contrib/hstore
make
make install
cd ${PG_DIR}/contrib/fuzzystrmatch
make
make install
cd ${PG_DIR}/contrib/pg_trgm
make
make install
fi
#from tar
if false; then
export LIBXML_VER=2.7.8
cd ${PROJECTS}/postgresql
export PG_VER=9.6w${OS_BUILD}${GCC_TYPE}
export PG_VER_FULL=9.6.0
export PG_DIR=${PROJECTS}/postgresql/postgresql-${PG_VER_FULL}
#cd ${PG_DIR}/contrib/hstore
#make clean
#make
#make install
#exit;
#rm postgresql-${PG_VER_FULL}.tar.bz2
#rm -rf postgresql-${PG_VER_FULL}
#wget http://ftp.postgresql.org/pub/source/v${PG_VER_FULL}/postgresql-${PG_VER_FULL}.tar.bz2
#wget http://ftp.postgresql.org/pub/snapshot/${PG_VER_FULL}/postgresql-${PG_VER_FULL}-snapshot.tar.bz2
#tar -xvjf postgresql-${PG_VER_FULL}-snapshot.tar.bz2
#tar -xvjf postgresql-${PG_VER_FULL}.tar.bz2
#gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -shared -o hstore.dll hstore_io.o hstore_op.o hstore_gist.o hstore_gin.o hstore_compat.o crc32.o -L../../src/port -L../../src/common -Wl,--allow-multiple-definition -Wl,--disable-auto-import -Wl,--as-needed -L../../src/backend -lpostgres -lpgcommon -lpgport -lm -lws2_32 -lshfolder -Wl,--export-all-symbols -Wl,--out-implib=libhstore.a
#9.3
#gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -I. -I. -I../../src/include -I./src/include/port/win32 -DEXEC_BACKEND "-I../../src/include/port/win32" -c -o hstore_io.o hstore_io.c
#dllwrap -o hstore.dll --dllname hstore.dll --def libhstoredll.def hstore_io.o hstore_op.o hstore_gist.o hstore_gin.o hstore_compat.o crc32.o -L../../src/port -L../../src/common -Wl,--allow-multiple-definition -Wl,--as-needed -L../../src/backend -lpostgres
cd postgresql-${PG_VER_FULL}
export PATH="${PROJECTS}/rel/pg${PG_VER}/bin:${PROJECTS}/rel/pg${PG_VER}/lib:$PATH"
export PATH="${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE}/bin:$PATH"
make distclean
#if you are building for 64-bit then use x86_64-w64-mingw32 for the build,host,target
#32 bit uses i686-w64-mingw32 for build, host, target
#9.4 LDFLAGS=-Wl,--allow-multiple-definition -Wl,--disable-auto-import -Wl,--as-needed
#9.3 LDFLAGS=-Wl,--allow-multiple-definition -Wl,--as-needed
#export LDFLAGS=-Wl,--allow-multiple-definition -Wl,--enable-auto-import -Wl,--as-needed
./configure --prefix=${PROJECTS}/postgresql/rel/pg${PG_VER}\
--build=${MINGHOST} \
--with-pgport=8443 --enable-cassert --enable-debug \
--without-zlib --with-libxml
#9.4 and below add
## --disable-float8-byval
make clean
make
#gmake world
rm -rf ${PROJECTS}/postgresql/rel/pg${PG_VER}
make install
make check
#gmake install-world
cd ${PG_DIR}/contrib/postgres_fdw
make install
cd ${PG_DIR}/contrib/hstore
make
make install
cd ${PG_DIR}/contrib/fuzzystrmatch
make
make install
cd ${PG_DIR}/contrib/pg_trgm
make
make install
cd ${PG_DIR}/contrib/bloom
make
make install
cd ${PG_DIR}/contrib/earthdistance
make
make install
exit;
fi
#from tar master branch
if false; then
export LIBXML_VER=2.7.8
cd ${PROJECTS}/postgresql
export PG_VER=10w${OS_BUILD}${GCC_TYPE}
export PG_VER_FULL=10.3
export PG_DIR=${PROJECTS}/postgresql/postgresql-${PG_VER_FULL}
export ZLIB_VER=1.2.11
rm postgresql-${PG_VER_FULL}.tar.bz2
# rm postgresql-snapshot.tar.bz2
# rm -rf postgresql-${PG_VER_FULL}
wget http://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2
tar -xvjf postgresql-snapshot.tar.bz2
cd postgresql-${PG_VER_FULL}
export PATH="${PROJECTS}/rel/pg${PG_VER}/bin:${PROJECTS}/rel/pg${PG_VER}/lib:$PATH"
export PATH="${PROJECTS}/zlib/rel-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}/lib:$PATH"
export PATH="${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE}/bin:$PATH"
export PATH="${PROJECTS}/zlib/rel-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}/bin:$PATH"
# make distclean
#./configure --prefix=${PROJECTS}/postgresql/rel/pg${PG_VER}\
# --build=${MINGHOST} \
# --with-pgport=8443 --enable-cassert --enable-debug \
# --with-zlib --with-libxml
## make clean
#make
## #gmake world
## rm -rf ${PROJECTS}/postgresql/rel/pg${PG_VER}
#make install
#make check
#gmake install-world
cd ${PG_DIR}/contrib/fuzzystrmatch
make
make install
cd ${PG_DIR}/contrib/adminpack
make && make install
cd ${PG_DIR}/contrib/auto_explain
make && make install
cd ${PG_DIR}/contrib/btree_gin
make install
cd ${PG_DIR}/contrib/btree_gist
make install
cd ${PG_DIR}/contrib/dblink
make install
exit
cd ${PG_DIR}/contrib/postgres_fdw
make install
cd ${PG_DIR}/contrib/hstore
make
make install
cd ${PG_DIR}/contrib/pg_trgm
make
make install
cd ${PG_DIR}/contrib/bloom
make
make install
cd ${PG_DIR}/contrib/earthdistance
make
make install
exit;
fi
if false; then #make PostgreSQL 9.4 from git
export LIBXML_VER=2.7.8
export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin"
cd ${PROJECTS}/postgresql
export PG_VER_FULL=9.4
export PG_VER=${PG_VER_FULL}w${OS_BUILD}${GCC_TYPE}
export PG_DIR=${PROJECTS}/postgresql/postgresql-git
export PGUSER=postgres
#rm -rf $PG_DIR
#wget https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2
#tar -xvjf postgresql-snapshot.tar.bz2
git config --global core.autocrlf false
#git clone https://git.postgresql.org/git/postgresql.git $PG_DIR
#git clone --depth=1 -b REL_10_STABLE http://git.postgresql.org/git/postgresql.git $PG_DIR
cd $PG_DIR
git pull
#git checkout REL_${PG_VER_FULL}_STABLE
git checkout REL9_4_STABLE
#exit
#dos2unix *
#dos2unix *.*
#dos2unix */*.*
#dos2unix */*/*.h
#find . -type f -exec dos2unix --safe {} \;
#exit
#find -type f -not \( -wholename '*git*' \) -exec dos2unix {} \;
#exit;
#export PATH="${PROJECTS}/rel/pg${PG_VER}/bin:${PROJECTS}/rel/pg${PG_VER}/lib:$PATH"
#make clean
#make distclean
# cd ${PG_DIR}/contrib/hstore
# make
# make install
# make installcheck
# make install
# make installcheck
# cd ${PG_DIR}/contrib/pg_trgm
# make
# make install
# make installcheck
# exit
#sh autogen.sh
#autoconf
#exit
#if you are building for 64-bit then use x86_64-w64-mingw32 for the build,host,target
#32 bit uses i686-w64-mingw32 for build, host, target
#9.4 LDFLAGS=-Wl,--allow-multiple-definition -Wl,--disable-auto-import -Wl,--as-needed
#9.3 LDFLAGS=-Wl,--allow-multiple-definition -Wl,--as-needed
#export LDFLAGS=-Wl,--allow-multiple-definition -Wl,--enable-auto-import -Wl,--as-needed
export LIBXML_VER=2.7.8
export ZLIB_VER=1.2.11
export PATH=${PATH}:${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}/bin
./configure --prefix=${PROJECTS}/postgresql/rel/pg${PG_VER}\
--build=${MINGHOST} \
--with-pgport=8443 --enable-cassert --enable-debug \
--with-zlib --with-libxml
#for 9.4 and below for EDB add to configure --with-float-by-val=false
make clean
make
#gmake world
rm -rf ${PROJECTS}/postgresql/rel/pg${PG_VER}
make install
make check
#gmake install-world
cd ${PG_DIR}/contrib/postgres_fdw
make && make install
cd ${PG_DIR}/contrib/hstore
make
make install
cd ${PG_DIR}/contrib/fuzzystrmatch
make
make install
cd ${PG_DIR}/contrib/pg_trgm
make
make install
exit;
fi
if false; then #make PostgreSQL from git 12
export LIBXML_VER=2.9.9
export ZLIB_VER=1.2.11
export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin"
cd ${PROJECTS}/postgresql
#export PG_VER_FULL=9.3
#export feature_type=slicing
export feature_type=
export PG_VER_FULL=12${feature_type}
export PG_VER=${PG_VER_FULL}w${OS_BUILD}${GCC_TYPE}
export PG_DIR=${PROJECTS}/postgresql/postgresql-git
export PGUSER=postgres
export ZLIB_PATH=${PROJECTS}/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}
export CPPFLAGS="-I${ZLIB_PATH}/include -I${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE}/include"
export LDFLAGS="-L${ZLIB_PATH}/lib -L${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE}/lib"
#rm -rf $PG_DIR
#wget https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2
#tar -xvjf postgresql-snapshot.tar.bz2
#git config --global core.autocrlf true
#git clone http://git.postgresql.org/git/postgresql.git $PG_DIR
#git clone --depth=1 -b master https://git.postgresql.org/git/postgresql.git $PG_DIR
cd $PG_DIR
#git checkout REL${PG_VER_FULL/./_}_STABLE
git checkout REL_${PG_VER_FULL/./_}_STABLE
#git checkout master
#git checkout feature-${feature_type}
git pull
#dos2unix *
#dos2unix *.*
#dos2unix */*.*
#dos2unix */*/*.h
#find . -type f -exec dos2unix --safe {} \;
#exit
#find -type f -not \( -wholename '*git*' \) -exec dos2unix {} \;
#exit;
#export PATH="${PROJECTS}/rel/pg${PG_VER}/bin:${PROJECTS}/rel/pg${PG_VER}/lib:$PATH"
#make clean
#make distclean
# cd ${PG_DIR}/contrib/hstore
# make
# make install
# make installcheck
# make install
# make installcheck
# cd ${PG_DIR}/contrib/pg_trgm
# make
# make install
# make installcheck
# exit
#sh autogen.sh
#autoconf
#exit
#if you are building for 64-bit then use x86_64-w64-mingw32 for the build,host,target
#32 bit uses i686-w64-mingw32 for build, host, target
#9.4 LDFLAGS=-Wl,--allow-multiple-definition -Wl,--disable-auto-import -Wl,--as-needed
#9.3 LDFLAGS=-Wl,--allow-multiple-definition -Wl,--as-needed
#export LDFLAGS=-Wl,--allow-multiple-definition -Wl,--enable-auto-import -Wl,--as-needed
export PATH=${PATH}:${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/libxml
export PATH=${PATH}:${ZLIB_PATH}/bin:${ZLIB_PATH}/lib:${ZLIB_PATH}/include
./configure --prefix=${PROJECTS}/postgresql/rel/pg${PG_VER}\
--build=${MINGHOST} \
--with-pgport=8447 --enable-cassert --enable-debug \
--with-zlib --with-libxml
#for 9.4 and below for EDB add to configure --with-float-by-val=false
make clean
make
#gmake world
rm -rf ${PROJECTS}/postgresql/rel/pg${PG_VER}
make install
make check
#gmake install-world
cd ${PG_DIR}/contrib/file_fdw
make && make install
exit
cd ${PG_DIR}/contrib/postgres_fdw
make && make install
cd ${PG_DIR}/contrib/hstore
make
make install
cd ${PG_DIR}/contrib/fuzzystrmatch
make && make install
cd ${PG_DIR}/contrib/pg_trgm
make && make install
cd ${PG_DIR}/contrib/pg_stat_statements
make && make install
fi
if false; then #make from tar
cd ${PROJECTS}/postgresql
export PG_VER_MINOR=10
export PG_VER=${PG_VER_MINOR}w${OS_BUILD}${GCC_TYPE}
export PG_VER_FULL=10rc1
export PG_DIR=${PROJECTS}/postgresql/postgresql-${PG_VER_FULL}
export PGUSER=postgres
export LIBXML_VER=2.7.8
export PATH="/mingw/bin:/mingw/include:/mingw/lib:/bin:${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE}/bin"
rm postgresql-${PG_VER_FULL}.tar.bz2
rm -rf postgresql-${PG_VER_FULL}
wget http://ftp.postgresql.org/pub/snapshot/${PG_VER_MINOR}/postgresql-${PG_VER_MINOR}-snapshot.tar.bz2 -O postgresql-${PG_VER_FULL}.tar.bz2
tar -xvjf postgresql-${PG_VER_FULL}.tar.bz2
cd $PG_DIR
#find -type f -not \( -wholename '*git*' \) -exec dos2unix {} \;
#exit;
#export PATH="${PROJECTS}/rel/pg${PG_VER}/bin:${PROJECTS}/rel/pg${PG_VER}/lib:$PATH"
#make clean
#make distclean
# cd ${PG_DIR}/contrib/hstore
# make
# make install
# make installcheck
# cd ${PG_DIR}/contrib/fuzzystrmatch
# make
# make install
# make installcheck
# cd ${PG_DIR}/contrib/pg_trgm
# make
# make install
# make installcheck
# exit
#sh autogen.sh
#if you are building for 64-bit then use x86_64-w64-mingw32 for the build,host,target
#32 bit uses i686-w64-mingw32 for build, host, target
#9.4 LDFLAGS=-Wl,--allow-multiple-definition -Wl,--disable-auto-import -Wl,--as-needed
#9.3 LDFLAGS=-Wl,--allow-multiple-definition -Wl,--as-needed
#export LDFLAGS=-Wl,--allow-multiple-definition -Wl,--enable-auto-import -Wl,--as-needed
./configure --prefix=${PROJECTS}/postgresql/rel/pg${PG_VER}\
--build=${MINGHOST} \
--with-pgport=8443 --enable-cassert --enable-debug \
--without-zlib --with-libxml
make clean
make
#gmake world
rm -rf ${PROJECTS}/postgresql/rel/pg${PG_VER}
make install
cp /mingw/bin/libgcc*.dll ${PROJECTS}/postgresql/rel/pg${PG_VER}/bin
cp /mingw/bin/libstdc++*.dll ${PROJECTS}/postgresql/rel/pg${PG_VER}/bin
make check
#gmake install-world
cd ${PG_DIR}/contrib/postgres_fdw
make install
exit;
cd ${PG_DIR}/contrib/hstore
make
make install
cd ${PG_DIR}/contrib/fuzzystrmatch
make
make install
cd ${PG_DIR}/contrib/pg_trgm
make
make install
fi
# cd ${PROJECTS}/json-c
# ##tar xvfz json-c-0.9.tar.gz
# cd json-c-0.9
# ## had to compile with -w (disable warnings otherwise it gave errors
# ./configure --build=x86_64-w64-mingw32 \
# --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 \
# --prefix=${PROJECTS}/json-c/rel-0.9w64 CFLAGS=-w
# make clean
# make
# make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment