Skip to content

Instantly share code, notes, and snippets.

@robe2
Created July 12, 2013 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robe2/5981115 to your computer and use it in GitHub Desktop.
Save robe2/5981115 to your computer and use it in GitHub Desktop.
Building pagc address standardizer extension under mingw (to be used with postgis_tiger_geocoder extension for pagc_normalize_address function.
export OS_BUILD=32
export PROJECTS=/projects
export PATHOLD=$PATH
export GCC_TYPE=
export SOURCES=/sources
#echo $PATHOLD
echo $PATHOLD >c:/path.txt
#export PATHOLD=".:/bin:/mingw/bin:/mingw/include:/c/Windows/system32:/c/Windows:/usr/local/bin"
#export PATHOLD=".:/bin:/include:/mingw/bin:/mingw/include:/c/Windows/system32:/c/Windows:/c/Windows/SysWow64"
export PG_VER=9.2
export PGWINVER=${PG_VER}edb
if [ "$OS_BUILD" == "64" ] ; then
export MINGHOST=x86_64-w64-mingw32
else
export MINGHOST=i686-w64-mingw32
fi;
echo $PATH
export PGHOST=localhost
export PGPORT=5442
export PCRE_VER=8.33
export PGUSER=postgres
export PGPATH=${PROJECTS}/postgresql/rel/pg${PG_VER}w${OS_BUILD}${GCC_TYPE}
export PATHOLD=".:/bin:/include:/mingw/bin:/mingw/include:/c/Windows/system32:/c/Windows"
export PATH="${PATHOLD}:${PGPATH}/bin:${PGPATH}/lib"
export PATH="${PGPATH}/lib:${PGPATH}/bin:${PROJECTS}/pcre/rel-${PCRE_VER}/bin:${PROJECTS}/pcre/rel-${PCRE_VER}/lib:${PATH}"
if true; then
cd ${PROJECTS}
mkdir pcre
cd pcre
rm -rf pcre-${PCRE_VER}
unzip /sources/pcre-${PCRE_VER}.zip
cd pcre-${PCRE_VER}
./configure --build=${MINGHOST} --prefix=${PROJECTS}/pcre/rel-${PCRE_VER}w${OS_BUILD}${GCC_TYPE}
make && make install
strip ${PROJECTS}/pcre/rel-${PCRE_VER}w${OS_BUILD}${GCC_TYPE}/bin/*.dll
rm -rf pcre-${PCRE_VER}
fi
if true; then
cd ${PROJECTS}/pagc
wget -O pagc-postgresql.tgz 'http://pagc.svn.sourceforge.net/viewvc/pagc/branches/sew-refactor/postgresql/?view=tar'
rm -rf postgresql
tar xzf pagc-postgresql.tgz
cd postgresql
# createdb test1
# psql -c 'create extension address_standardizer;' test1
# psql -f test.sql test1
# psql -f test2.sql test1
export PCRE_PATH=${PROJECTS}/pcre/rel-${PCRE_VER}w${OS_BUILD}${GCC_TYPE}
make SHLIB_LINK="-L${PCRE_PATH}/lib -lpostgres -lpgport -lpcre" CPPFLAGS="-I. -I${PCRE_PATH}/include" && make install
strip *.dll
fi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment