Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Build PostGIS 3.0 for windows under mingw64 gcc 8.1 PostgreSQL 12
#these are compiled using mingw64 gcc 8.1 chain
#http://www.bostongis.com/postgisstuff/ming64gcc81.7z
#!/bin/bash
set -e
export GEOS_VER=3.8
#export GDAL_VER=2.3.1
#export PROJ_VER=6.0.0
export GDAL_VER=3.0.1
export PROJ_VER=6.1.1
export SFCGAL_VER=1.3.2
export PCRE_VER=8.33
export PROTOBUF_VER=3.2.0
export PROTOBUFC_VER=1.2.1
export CGAL_VER=4.11
export ICON_VER=1.15
export PG_VER=12
export TESTVER=
export OS_BUILD=64
export GCC_TYPE=gcc81
export JSON_VER=0.12
export XSLTPROCFLAGS="--nonet"
export PCRE_VER=8.33
export PROJSO=libproj-15.dll
export ZLIB_VER=1.2.11
export PROJECTS=/projects
export MINGPROJECTS=/projects
export PATHOLD=$PATH
export POSTGIS_MAJOR_VERSION=3
export POSTGIS_MINOR_VERSION=0
export POSTGIS_MICRO_VERSION=0alpha5dev
export PGHOST=localhost
export PGPORT=5449
if [ "$OS_BUILD" == "64" ] ; then
export MINGHOST=x86_64-w64-mingw32
else
export MINGHOST=i686-w64-mingw32
fi;
export PATHOLD="/mingw/bin:/mingw/include:/mingw/lib:/c/Windows/system32:/c/Windows:.:/bin:/include:/usr/local/bin:/c/ming${OS_BUILD}/svn"
#export PG_VER=9.2beta2
export PGWINVER=${PG_VER}w${OS_BUILD}${GCC_TYPE}edb
export WORKSPACE=`pwd`
echo PATH BEFORE: $PATH
#export PGHOST=localhost
#export PGPORT=8442
export PGUSER=postgres
#export GEOS_VER=3.4.0dev
#export GDAL_VER=1.9.1
export PGPATH=${PROJECTS}/postgresql/rel/pg${PG_VER}${TESTVER}w${OS_BUILD}${GCC_TYPE}
export PGPATHEDB=${PROJECTS}/postgresql/rel/pg${PG_VER}w${OS_BUILD}${GCC_TYPE}edb
export POSTGIS_VER=${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}
export POSTGIS_MICRO_VER=${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}
cd /projects/postgis/branches
if false; then
#using tagged download release
#rm postgis-${POSTGIS_MICRO_VER}.tar.gz
rm -rf postgis-${POSTGIS_MICRO_VER}
export POSTGIS_SRC=${PROJECTS}/postgis/tags/postgis-${POSTGIS_MICRO_VER}
cd /projects/postgis/tags
#wget http://download.osgeo.org/postgis/source/postgis-${POSTGIS_MICRO_VER}.tar.gz
rm -rf postgis-${POSTGIS_MICRO_VER}
tar -xvf postgis-${POSTGIS_MICRO_VER}.tar.gz
#exit
else
if [ -n "$SOURCE_FOLDER" ]; then
export POSTGIS_SRC=${PROJECTS}/postgis/$SOURCE_FOLDER
else
if [[ "$POSTGIS_MICRO_VERSION" == *SVN* || "$POSTGIS_MICRO_VERSION" == *dev* ]] ; then
export POSTGIS_SRC=${PROJECTS}/postgis/branches/${POSTGIS_VER}
else
#tagged version -- official release
export POSTGIS_SRC=${PROJECTS}/postgis/tags/${POSTGIS_VER}.${POSTGIS_MICRO_VERSION}
fi;
fi;
fi
export LIBXML_VER=2.9.9
#export POSTGIS_SRC=${PROJECTS}/postgis/trunk
export GDAL_DATA="${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}/share/gdal"
export RELVERDIR=postgis-pg${REL_PGVER}-binaries-${POSTGIS_MICRO_VER}w${OS_BUILD}
export PATH="${PATHOLD}:${PGPATH}/bin:${PGPATH}/lib"
#PATH="${MINGPROJECTS}/gettext/rel-gettext-0.18.1/bin:${MINGPROJECTS}/xsltproc:${MINGPROJECTS}/gtk/bin:${PROJECTS}/geos/rel-${GEOS_VER}w${OS_BUILD}/bin:${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}/bin:${MINGPROJECTS}/rel-libiconv-1.13.1w${OS_BUILD}/include:${MINGPROJECTS}/rel-libiconv-1.13.1w${OS_BUILD}/bin:${MINGPROJECTS}/proj/rel-${PROJ_VER}w${OS_BUILD}/bin:${MINGPROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}/bin:${PATH}"
export PATH="${PROJECTS}/xsltproc:${MINGPROJECTS}/gtkw${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/geos/rel-${GEOS_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/rel-libiconv-${ICON_VER}w${OS_BUILD}${GCC_TYPE}/lib:${PROJECTS}/rel-libiconv-${ICON_VER}w${OS_BUILD}${GCC_TYPE}/include:${PROJECTS}/rel-libiconv-${ICON_VER}w${OS_BUILD}${GCC_TYPE}/bin:${MINGPROJECTS}/proj/rel-${PROJ_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}/lib:${PATH}"
#add protobuf
export PATH="${PROJECTS}/protobuf/rel-${PROTOBUF_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/protobuf/rel-${PROTOBUF_VER}w${OS_BUILD}${GCC_TYPE}/lib:${PATH}"
export PATH="${PROJECTS}/CGAL/rel-cgal-${CGAL_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/CGAL/rel-sfcgal-${SFCGAL_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/boost/rel-${BOOST_VER_WU}w${OS_BUILD}${GCC_TYPE}/lib:${PATH}"
echo PATH AFTER: $PATH
echo WORKSPACE IS $WORKSPACE
#mkdir ${PROJECTS}/postgis/tmp
export PGIS_REG_TMPDIR=${PROJECTS}/postgis/tmp/${POSTGIS_MICRO_VER}_pg${PG_VER}_geos${GEOS_VER}_gdal${GDAL_VER}w${OS_BUILD}
rm -rf ${PGIS_REG_TMPDIR}
mkdir ${PGIS_REG_TMPDIR}
export TMPDIR=${PGIS_REG_TMPDIR}
#make
#make install
#make check
#exit
#rm -rf ${PGIS_REG_TMPDIR}
#TMPDIR=${PROJECTS}/postgis/tmp/${POSTGIS_VER}_${PG_VER}_${GEOS_VERSION}_${PROJ_VER}
echo PORT IS $PGPORT
echo PGIS_REG_TMPDIR IS $PGIS_REG_TMPDIR
export XSLTPROCFLAGS=
cd ${POSTGIS_SRC}
export PKG_CONFIG_PATH="${PROJECTS}/sqlite/rel-sqlite3w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig:${PROJECTS}/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}/lib:${PROJECTS}/protobuf/rel-${PROTOBUF_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig:${PROJECTS}/json-c/rel-${JSON_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig:${PROJECTS}/proj/rel-${PROJ_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig:${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig:${PROJECTS}/pcre/rel-${PCRE_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig:${PROJECTS}/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}/lib/pkgconfig"
export PATH="${PROJECTS}/CGAL/rel-cgal-${CGAL_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/CGAL/rel-sfcgal-${SFCGAL_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/boost/rel-${BOOST_VER_WU}w${OS_BUILD}${GCC_TYPE}/lib:${PATH}"
export SHLIB_LINK="-static-libstdc++ -lstdc++ -Wl,-Bdynamic -lm"
CPPFLAGS="-I${PGPATH}/include -I${PROJECTS}/rel-libiconv-${ICON_VER}w${OS_BUILD}${GCC_TYPE}/include"
#cd postgis
#CC=g++ make
#CC=g++ -Wl,--enable-auto-import
#gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -shared -static-libgcc -o postgis-3.dll postgis_module.o lwgeom_accum.o lwgeom_spheroid.o lwgeom_ogc.o lwgeom_functions_analytic.o lwgeom_inout.o lwgeom_functions_basic.o lwgeom_btree.o lwgeom_box.o lwgeom_box3d.o lwgeom_geos.o lwgeom_sfcgal.o lwgeom_geos_prepared.o lwgeom_geos_clean.o lwgeom_geos_relatematch.o lwgeom_export.o lwgeom_in_gml.o lwgeom_in_kml.o lwgeom_in_geohash.o lwgeom_in_geojson.o lwgeom_in_encoded_polyline.o lwgeom_triggers.o lwgeom_dump.o lwgeom_dumppoints.o lwgeom_functions_lrs.o lwgeom_functions_temporal.o lwgeom_rectree.o long_xact.o lwgeom_sqlmm.o lwgeom_rtree.o lwgeom_transform.o lwgeom_window.o gserialized_typmod.o gserialized_gist_2d.o gserialized_gist_nd.o gserialized_supportfn.o gserialized_spgist_2d.o gserialized_spgist_3d.o gserialized_spgist_nd.o brin_2d.o brin_nd.o brin_common.o gserialized_estimate.o geography_inout.o geography_btree.o geography_centroid.o geography_measurement.o geography_measurement_trees.o geometry_inout.o postgis_libprotobuf.o vector_tile.pb-c.o geobuf.pb-c.o mvt.o lwgeom_out_mvt.o geobuf.o lwgeom_out_geobuf.o lwgeom_out_geojson.o postgis_legacy.o -LC:/MING64~1/projects/POSTGR~1/rel/PG12W6~2/lib -L/projects/zlib/rel-zlib-1.2.11w64gcc81/lib -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -Wl,--allow-multiple-definition -Wl,--disable-auto-import -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -Wl,--as-needed ../deps/wagyu/libwagyu.la -lstdc++ ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a -LC:/ming64gcc81/projects/geos/rel-3.8w64gcc81/lib -lgeos_c -LC:/ming64gcc81/projects/proj/rel-6.0.0w64gcc81/lib -lproj -LC:/ming64gcc81/projects/json-c/rel-0.12w64gcc81/lib -ljson-c -LC:/ming64gcc81/projects/protobuf/rel-3.2.0w64gcc81/lib -lprotobuf-c -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -lxml2 -lws2_32 -L/projects/CGAL/rel-sfcgal-1.3.2w64gcc81/lib -lSFCGAL -Wl,--exclude-libs,ALL -L/projects/CGAL/rel-sfcgal-1.3.2w64gcc81/lib -lSFCGAL -lc++ ../deps/wagyu/libwagyu.la -LC:/MING64~1/projects/POSTGR~1/rel/PG12W6~2/lib -lpostgres -lpgcommon -lpgport -lxml2 -lws2_32 -lm -lz -lws2_32 -Wl,--export-all-symbols -Wl,--out-implib=libpostgis-3.a
#exit
#gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -shared -static-libgcc -static-libstdc++ -o postgis-3.dll postgis_module.o lwgeom_accum.o lwgeom_spheroid.o lwgeom_ogc.o lwgeom_functions_analytic.o lwgeom_inout.o lwgeom_functions_basic.o lwgeom_btree.o lwgeom_box.o lwgeom_box3d.o lwgeom_geos.o lwgeom_sfcgal.o lwgeom_geos_prepared.o lwgeom_geos_clean.o lwgeom_geos_relatematch.o lwgeom_export.o lwgeom_in_gml.o lwgeom_in_kml.o lwgeom_in_geohash.o lwgeom_in_geojson.o lwgeom_in_encoded_polyline.o lwgeom_triggers.o lwgeom_dump.o lwgeom_dumppoints.o lwgeom_functions_lrs.o lwgeom_functions_temporal.o lwgeom_rectree.o long_xact.o lwgeom_sqlmm.o lwgeom_rtree.o lwgeom_transform.o lwgeom_window.o gserialized_typmod.o gserialized_gist_2d.o gserialized_gist_nd.o gserialized_supportfn.o gserialized_spgist_2d.o gserialized_spgist_3d.o gserialized_spgist_nd.o brin_2d.o brin_nd.o brin_common.o gserialized_estimate.o geography_inout.o geography_btree.o geography_centroid.o geography_measurement.o geography_measurement_trees.o geometry_inout.o postgis_libprotobuf.o vector_tile.pb-c.o geobuf.pb-c.o mvt.o lwgeom_out_mvt.o geobuf.o lwgeom_out_geobuf.o lwgeom_out_geojson.o postgis_legacy.o -LC:/MING64~1/projects/POSTGR~1/rel/PG12W6~2/lib -L/projects/zlib/rel-zlib-1.2.11w64gcc81/lib -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -Wl,--allow-multiple-definition -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -Wl,--as-needed ../deps/wagyu/libwagyu.la -lstdc++ ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a -LC:/ming64gcc81/projects/geos/rel-3.8w64gcc81/lib -lgeos_c -LC:/ming64gcc81/projects/proj/rel-6.0.0w64gcc81/lib -lproj -LC:/ming64gcc81/projects/json-c/rel-0.12w64gcc81/lib -ljson-c -LC:/ming64gcc81/projects/protobuf/rel-3.2.0w64gcc81/lib -lprotobuf-c -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -lxml2 -lws2_32 -L/projects/CGAL/rel-sfcgal-1.3.2w64gcc81/lib -lSFCGAL -Wl,--exclude-libs,ALL -L/projects/CGAL/rel-sfcgal-1.3.2w64gcc81/lib -lSFCGAL ../deps/wagyu/libwagyu.la -std=c++11 -lstdc++ -LC:/MING64~1/projects/POSTGR~1/rel/PG12W6~2/lib -lpostgres -lpgcommon -lpgport -lxml2 -lws2_32 -lm -lws2_32 -Wl,--export-all-symbols -Wl,--out-implib=libpostgis-3.a
#exit
#gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -shared -static-libgcc -o postgis-3.dll postgis_module.o lwgeom_accum.o lwgeom_spheroid.o lwgeom_ogc.o lwgeom_functions_analytic.o lwgeom_inout.o lwgeom_functions_basic.o lwgeom_btree.o lwgeom_box.o lwgeom_box3d.o lwgeom_geos.o lwgeom_sfcgal.o lwgeom_geos_prepared.o lwgeom_geos_clean.o lwgeom_geos_relatematch.o lwgeom_export.o lwgeom_in_gml.o lwgeom_in_kml.o lwgeom_in_geohash.o lwgeom_in_geojson.o lwgeom_in_encoded_polyline.o lwgeom_triggers.o lwgeom_dump.o lwgeom_dumppoints.o lwgeom_functions_lrs.o lwgeom_functions_temporal.o lwgeom_rectree.o long_xact.o lwgeom_sqlmm.o lwgeom_rtree.o lwgeom_transform.o lwgeom_window.o gserialized_typmod.o gserialized_gist_2d.o gserialized_gist_nd.o gserialized_supportfn.o gserialized_spgist_2d.o gserialized_spgist_3d.o gserialized_spgist_nd.o brin_2d.o brin_nd.o brin_common.o gserialized_estimate.o geography_inout.o geography_btree.o geography_centroid.o geography_measurement.o geography_measurement_trees.o geometry_inout.o postgis_libprotobuf.o vector_tile.pb-c.o geobuf.pb-c.o mvt.o lwgeom_out_mvt.o geobuf.o lwgeom_out_geobuf.o lwgeom_out_geojson.o postgis_legacy.o -LC:/MING64~1/projects/POSTGR~1/rel/PG12W6~2/lib -L/projects/zlib/rel-zlib-1.2.11w64gcc81/lib -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -Wl,--allow-multiple-definition -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -Wl,--as-needed ../deps/wagyu/libwagyu.la -lstdc++ ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a -LC:/ming64gcc81/projects/geos/rel-3.8w64gcc81/lib -lgeos_c -LC:/ming64gcc81/projects/proj/rel-6.0.0w64gcc81/lib -lproj -LC:/ming64gcc81/projects/json-c/rel-0.12w64gcc81/lib -ljson-c -LC:/ming64gcc81/projects/protobuf/rel-3.2.0w64gcc81/lib -lprotobuf-c -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -lxml2 -lws2_32 -L/projects/CGAL/rel-sfcgal-1.3.2w64gcc81/lib -lSFCGAL -Wl,--exclude-libs,ALL -L/projects/CGAL/rel-sfcgal-1.3.2w64gcc81/lib -lSFCGAL ../deps/wagyu/libwagyu.la -std=c++11 -lstdc++ -LC:/MING64~1/projects/POSTGR~1/rel/PG12W6~2/lib -lpostgres -lpgcommon -lpgport -lxml2 -lz -lws2_32 -lm -lws2_32 -Wl,--export-all-symbols -Wl,--out-implib=libpostgis-3.a
#cd ../regress
#cd regress
#make check
#gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -shared -static-libgcc -o postgis-3.dll postgis_module.o lwgeom_accum.o lwgeom_spheroid.o lwgeom_ogc.o lwgeom_functions_analytic.o lwgeom_inout.o lwgeom_functions_basic.o lwgeom_btree.o lwgeom_box.o lwgeom_box3d.o lwgeom_geos.o lwgeom_sfcgal.o lwgeom_geos_prepared.o lwgeom_geos_clean.o lwgeom_geos_relatematch.o lwgeom_export.o lwgeom_in_gml.o lwgeom_in_kml.o lwgeom_in_geohash.o lwgeom_in_geojson.o lwgeom_in_encoded_polyline.o lwgeom_triggers.o lwgeom_dump.o lwgeom_dumppoints.o lwgeom_functions_lrs.o lwgeom_functions_temporal.o lwgeom_rectree.o long_xact.o lwgeom_sqlmm.o lwgeom_rtree.o lwgeom_transform.o lwgeom_window.o gserialized_typmod.o gserialized_gist_2d.o gserialized_gist_nd.o gserialized_supportfn.o gserialized_spgist_2d.o gserialized_spgist_3d.o gserialized_spgist_nd.o brin_2d.o brin_nd.o brin_common.o gserialized_estimate.o geography_inout.o geography_btree.o geography_centroid.o geography_measurement.o geography_measurement_trees.o geometry_inout.o postgis_libprotobuf.o vector_tile.pb-c.o geobuf.pb-c.o mvt.o lwgeom_out_mvt.o geobuf.o lwgeom_out_geobuf.o lwgeom_out_geojson.o postgis_legacy.o -LC:/MING64~1/projects/POSTGR~1/rel/PG12W6~2/lib -L/projects/zlib/rel-zlib-1.2.11w64gcc81/lib -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -Wl,--allow-multiple-definition -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -Wl,--as-needed -lstdc++ ../deps/wagyu/libwagyu.la ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a -LC:/ming64gcc81/projects/geos/rel-3.8w64gcc81/lib -lgeos_c -LC:/ming64gcc81/projects/proj/rel-6.0.0w64gcc81/lib -lproj -LC:/ming64gcc81/projects/json-c/rel-0.12w64gcc81/lib -ljson-c -LC:/ming64gcc81/projects/protobuf/rel-3.2.0w64gcc81/lib -lprotobuf-c -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -lxml2 -lws2_32 -L/projects/CGAL/rel-sfcgal-1.3.2w64gcc81/lib -lSFCGAL -Wl,--exclude-libs,ALL -L/projects/CGAL/rel-sfcgal-1.3.2w64gcc81/lib -lSFCGAL -LC:/MING64~1/projects/POSTGR~1/rel/PG12W6~2/lib -lpostgres -lpgcommon -lpgport -lxml2 -lz -lws2_32 -lm -lws2_32 -Wl,--export-all-symbols -Wl,--out-implib=libpostgis-3.a
#cd /projects/postgis/branches/3.0/liblwgeom
#make
#exit
#cd /projects/postgis/branches/3.0/postgis
#gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -shared -static-libgcc -o postgis-3.dll postgis_module.o lwgeom_accum.o lwgeom_spheroid.o lwgeom_ogc.o lwgeom_functions_analytic.o lwgeom_inout.o lwgeom_functions_basic.o lwgeom_btree.o lwgeom_box.o lwgeom_box3d.o lwgeom_geos.o lwgeom_sfcgal.o lwgeom_geos_prepared.o lwgeom_geos_clean.o lwgeom_geos_relatematch.o lwgeom_export.o lwgeom_in_gml.o lwgeom_in_kml.o lwgeom_in_geohash.o lwgeom_in_geojson.o lwgeom_in_encoded_polyline.o lwgeom_triggers.o lwgeom_dump.o lwgeom_dumppoints.o lwgeom_functions_lrs.o lwgeom_functions_temporal.o lwgeom_rectree.o long_xact.o lwgeom_sqlmm.o lwgeom_rtree.o lwgeom_transform.o lwgeom_window.o gserialized_typmod.o gserialized_gist_2d.o gserialized_gist_nd.o gserialized_supportfn.o gserialized_spgist_2d.o gserialized_spgist_3d.o gserialized_spgist_nd.o brin_2d.o brin_nd.o brin_common.o gserialized_estimate.o geography_inout.o geography_btree.o geography_centroid.o geography_measurement.o geography_measurement_trees.o geometry_inout.o postgis_libprotobuf.o vector_tile.pb-c.o geobuf.pb-c.o mvt.o lwgeom_out_mvt.o geobuf.o lwgeom_out_geobuf.o lwgeom_out_geojson.o postgis_legacy.o -LC:/MING64~1/projects/POSTGR~1/rel/PG12W6~2/lib -L/projects/zlib/rel-zlib-1.2.11w64gcc81/lib -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -Wl,--allow-multiple-definition -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -Wl,--as-needed ../deps/wagyu/libwagyu.la -lstdc++ ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a -LC:/ming64gcc81/projects/geos/rel-3.8w64gcc81/lib -lgeos_c -LC:/ming64gcc81/projects/proj/rel-6.0.0w64gcc81/lib -lproj -LC:/ming64gcc81/projects/json-c/rel-0.12w64gcc81/lib -ljson-c -LC:/ming64gcc81/projects/protobuf/rel-3.2.0w64gcc81/lib -lprotobuf-c -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -lxml2 -lws2_32 -L/projects/CGAL/rel-sfcgal-1.3.2w64gcc81/lib -lSFCGAL -Wl,--exclude-libs,ALL -L/projects/CGAL/rel-sfcgal-1.3.2w64gcc81/lib -lSFCGAL -LC:/MING64~1/projects/POSTGR~1/rel/PG12W6~2/lib -lpostgres -lpgcommon -lpgport -lxml2 -lz -lws2_32 -lm -lws2_32 -Wl,--export-all-symbols -Wl,--out-implib=libpostgis-3.a
#exit
#g++ -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -shared -static-libgcc -o postgis-3.dll postgis_module.o lwgeom_accum.o lwgeom_spheroid.o lwgeom_ogc.o lwgeom_functions_analytic.o lwgeom_inout.o lwgeom_functions_basic.o lwgeom_btree.o lwgeom_box.o lwgeom_box3d.o lwgeom_geos.o lwgeom_sfcgal.o lwgeom_geos_prepared.o lwgeom_geos_clean.o lwgeom_geos_relatematch.o lwgeom_export.o lwgeom_in_gml.o lwgeom_in_kml.o lwgeom_in_geohash.o lwgeom_in_geojson.o lwgeom_in_encoded_polyline.o lwgeom_triggers.o lwgeom_dump.o lwgeom_dumppoints.o lwgeom_functions_lrs.o lwgeom_functions_temporal.o lwgeom_rectree.o long_xact.o lwgeom_sqlmm.o lwgeom_rtree.o lwgeom_transform.o lwgeom_window.o gserialized_typmod.o gserialized_gist_2d.o gserialized_gist_nd.o gserialized_supportfn.o gserialized_spgist_2d.o gserialized_spgist_3d.o gserialized_spgist_nd.o brin_2d.o brin_nd.o brin_common.o gserialized_estimate.o geography_inout.o geography_btree.o geography_centroid.o geography_measurement.o geography_measurement_trees.o geometry_inout.o postgis_libprotobuf.o vector_tile.pb-c.o geobuf.pb-c.o mvt.o lwgeom_out_mvt.o geobuf.o lwgeom_out_geobuf.o lwgeom_out_geojson.o postgis_legacy.o -LC:/MING64~1/projects/POSTGR~1/rel/PG12W6~2/lib -L/projects/zlib/rel-zlib-1.2.11w64gcc81/lib -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -Wl,--allow-multiple-definition -Wl,--disable-auto-import -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -Wl,--as-needed ../deps/wagyu/libwagyu.la -lstdc++ ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a -LC:/ming64gcc81/projects/geos/rel-3.8w64gcc81/lib -lgeos_c -L/projects/proj/rel-6.0.0w64gcc81/lib -lproj -L/projects/protobuf/rel-3.2.0w64gcc81/lib -lprotobuf-c -L/projects/libxml/rel-libxml2-2.7.8w64gcc81/lib -lxml2 -lws2_32 -L/projects/CGAL/rel-sfcgal-1.3.2w64gcc81/lib -lSFCGAL -Wl,--exclude-libs,ALL -L/projects/CGAL/rel-sfcgal-1.3.2w64gcc81/lib -lSFCGAL -LC:/MING64~1/projects/POSTGR~1/rel/PG12W6~2/lib -lpostgres -lpgcommon -lpgport -lxml2 -lz -lws2_32 -lm -lws2_32 -Wl,--export-all-symbols -Wl,--out-implib=libpostgis-3.a
#exit
cd ${POSTGIS_SRC}
# rm ChangeLog
#PATH=${PATH}:/projects/svn2cl
#make ChangeLog
#exit;
#sh autogen.sh
# if [ -e ./GNUMakefile ]; then
# make distclean
# fi
if [ -n "$PCRE_VER" ]; then
export PATH="${PROJECTS}/pcre/rel-${PCRE_VER}w${OS_BUILD}${GCC_TYPE}/include:${PROJECTS}/pcre/rel-${PCRE_VER}w${OS_BUILD}${GCC_TYPE}/lib:${PATH}"
fi
if [ -n "$SFCGAL_VER" ]; then
##hard code versions of cgal etc. for now
export CGAL_VER=4.11
BOOST_VER=1.53.0
#BOOST_VER_WU=1_49_0
export BOOST_VER_WU=1_53_0
export PATH="${PROJECTS}/CGAL/rel-cgal-${CGAL_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/CGAL/rel-sfcgal-${SFCGAL_VER}w${OS_BUILD}${GCC_TYPE}/bin:${PROJECTS}/boost/rel-${BOOST_VER_WU}w${OS_BUILD}${GCC_TYPE}/lib:${PATH}"
#CPPFLAGS="-I${PGPATH}/include -I${PROJECTS}/rel-libiconv-${ICON_VER}w${OS_BUILD}${GCC_TYPE}/include" \
#CFLAGS="-Wall -fno-omit-frame-pointer"
#LDFLAGS="-Wl,--enable-auto-import -L${PGPATH}/lib -L${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}/lib -L${PROJECTS}/rel-libiconv-${ICON_VER}w${OS_BUILD}${GCC_TYPE}/lib" \
LDFLAGS="-Wl,--enable-auto-import -L${PGPATH}/lib -L${PROJECTS}/rel-libiconv-${ICON_VER}w${OS_BUILD}${GCC_TYPE}/lib -L${PROJECTS}/zlib/rel-zlib-${ZLIB_VER}w${OS_BUILD}${GCC_TYPE}/lib" \
./configure \
--host=${MINGHOST} --with-xml2config=${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE}/bin/xml2-config \
--with-pgconfig=${PGPATH}/bin/pg_config \
--with-geosconfig=${PROJECTS}/geos/rel-${GEOS_VER}w${OS_BUILD}${GCC_TYPE}/bin/geos-config \
--with-libiconv=${PROJECTS}/rel-libiconv-${ICON_VER}w${OS_BUILD}${GCC_TYPE} \
--with-xsldir=${PROJECTS}/docbook/docbook-xsl-1.76.1 \
--with-gui --with-gettext=no \
--with-sfcgal=${PROJECTS}/CGAL/rel-sfcgal-${SFCGAL_VER}w${OS_BUILD}${GCC_TYPE}/bin/sfcgal-config \
--without-interrupt-tests \
--prefix=${PROJECTS}/postgis/liblwgeom-${POSTGIS_VER}w${OS_BUILD}${GCC_TYPE}
#exit
else
CPPFLAGS="-I${PGPATH}/include -I${PROJECTS}/rel-libiconv-${ICON_VER}w${OS_BUILD}${GCC_TYPE}/include" \
CFLAGS="-Wall -fno-omit-frame-pointer" \
LDFLAGS="-L${PGPATH}/lib -L${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}${GCC_TYPE}/lib -L${PROJECTS}/rel-libiconv-${ICON_VER}w${OS_BUILD}${GCC_TYPE}/lib" ./configure \
--host=${MINGHOST} --with-xml2config=${PROJECTS}/libxml/rel-libxml2-${LIBXML_VER}w${OS_BUILD}${GCC_TYPE}/bin/xml2-config \
--with-pgconfig=${PGPATH}/bin/pg_config \
--with-geosconfig=${PROJECTS}/geos/rel-${GEOS_VER}w${OS_BUILD}${GCC_TYPE}/bin/geos-config \
--with-gui --with-gettext=no \
--with-libiconv=${PROJECTS}/rel-libiconv-${ICON_VER}w${OS_BUILD}${GCC_TYPE} \
--with-xsldir=${PROJECTS}/docbook/docbook-xsl-1.76.1 \
--without-interrupt-tests \
--prefix=${PROJECTS}/postgis/liblwgeom-${POSTGIS_VER}w${OS_BUILD}${GCC_TYPE}
fi;
#make clean
#patch liblwgeom generated make to get rid of dynamic linking
sed -i 's/LDFLAGS += -no-undefined//g' liblwgeom/Makefile
make
make install
make check RUNTESTFLAGS="--extension -v"
#make check
exit
make check RUNTESTFLAGS=-v
if [ "$MAKE_EXTENSION" == "1" ]; then
export PGUSER=postgres
#need to copy install files to EDB install (since not done by make install
cd ${POSTGIS_SRC}
echo "Postgis src dir is ${POSTGIS_SRC}"
strip postgis/postgis-*.dll
strip raster/rt_pg/rtpostgis-*.dll
cp topology/*.dll ${PGPATHEDB}/lib
cp postgis/postgis*.dll ${PGPATHEDB}/lib
cp raster/rt_pg/rtpostgis-*.dll ${PGPATHEDB}/lib
cp -r ${PGPATH}/share/extension/postgis*${POSTGIS_MICRO_VER}.sql ${PGPATHEDB}/share/extension
cp -r ${PGPATH}/share/extension/postgis*${POSTGIS_MICRO_VER}next.sql ${PGPATHEDB}/share/extension
cp -r ${PGPATH}/share/extension/address_standardizer*${POSTGIS_MICRO_VER}.sql ${PGPATHEDB}/share/extension
cp -r extensions/*/*.control ${PGPATHEDB}/share/extension
cp -r extensions/*/*.dll ${PGPATHEDB}/lib
make check RUNTESTFLAGS="--extension -v"
##test address standardizer
cd ${POSTGIS_SRC}
cd extensions/address_standardizer
make installcheck
##test tiger geocoder
cd ${POSTGIS_SRC}
cd extensions/postgis_tiger_geocoder
make installcheck
if [ "$?" != "0" ]; then
exit $?
fi
fi
if [ "$DUMP_RESTORE" = "1" ]; then
echo "Dum restore test"
make install
make check RUNTESTFLAGS="-v --dumprestore"
if [ "$?" != "0" ]; then
exit $?
fi
fi
if [ "$MAKE_GARDEN" == "1" ]; then
export PGUSER=postgres
make garden
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment