]> granicus.if.org Git - postgis/commitdiff
#2877 Revise configure to build make scripts and address_standardizer extension
authorRegina Obe <lr@pcorp.us>
Wed, 8 Oct 2014 01:50:39 +0000 (01:50 +0000)
committerRegina Obe <lr@pcorp.us>
Wed, 8 Oct 2014 01:50:39 +0000 (01:50 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13043 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac
extensions/Makefile.in

index 520492ffad0b5633ae75b6ffc5cda2f613dc94bd..508328a3d3c571e02218ced4689a9aeb9e949f7c 100644 (file)
@@ -685,6 +685,8 @@ AC_SUBST([SFCGAL_OBJS])
 AC_SUBST([SFCGAL])
 AC_SUBST([HAVE_SFCGAL])
 
+
+
 dnl ===========================================================================
 dnl Detect gettext
 dnl ===========================================================================
@@ -836,6 +838,8 @@ AC_SUBST([HAVE_JSON])
 
 fi dnl }
 
+
+
 dnl ===========================================================================
 dnl Detect GTK+2.0 for GUI
 dnl ===========================================================================
@@ -925,10 +929,10 @@ dnl Always enable use of ANALYZE statistics by default
 AC_DEFINE_UNQUOTED([POSTGIS_USE_STATS], [1], [Enable use of ANALYZE statistics])
 
 
-CPPFLAGS="$PGSQL_CPPFLAGS $GEOS_CPPFLAGS $PROJ_CPPFLAGS $XML2_CPPFLAGS $SFCGAL_CPPFLAGS $JSON_CPPFLAGS $CPPFLAGS"
+CPPFLAGS="$PGSQL_CPPFLAGS $GEOS_CPPFLAGS $PROJ_CPPFLAGS $XML2_CPPFLAGS $SFCGAL_CPPFLAGS $JSON_CPPFLAGS $PCRE_CPPFLAGS $CPPFLAGS"
 dnl AC_MSG_RESULT([CPPFLAGS: $CPPFLAGS])
 
-SHLIB_LINK="$PGSQL_LDFLAGS $GEOS_LDFLAGS $PROJ_LDFLAGS -lgeos_c -lproj $JSON_LDFLAGS $XML2_LDFLAGS $SFCGAL_LDFLAGS"
+SHLIB_LINK="$PGSQL_LDFLAGS $GEOS_LDFLAGS $PROJ_LDFLAGS -lgeos_c -lproj $JSON_LDFLAGS $XML2_LDFLAGS $SFCGAL_LDFLAGS $PCRE_LDFLAGS"
 AC_SUBST([SHLIB_LINK])
 dnl AC_MSG_RESULT([SHLIB_LINK: $SHLIB_LINK])
 
@@ -1163,6 +1167,72 @@ else
        RT_MAKEFILE_LIST="raster/Makefile"
 fi
 
+dnl ====================================
+dnl address standardizer stuff
+dnl ====================================
+AC_ARG_WITH([address_standardizer],
+    [AS_HELP_STRING([--without-address_standardizer],
+                    [Disable the address_standardizer extension])],
+    [], [])
+
+if test "x$address_standardizer" != "xno"; then
+    dnl ===========================================================================
+    dnl Detect the version of PCRE installed
+    dnl ===========================================================================
+    LDFLAGS="$LDFLAGS_SAVE"
+    CFLAGS="$CFLAGS_SAVE"
+    
+    CHECK_PCRE=yes
+    HAVE_PCRE=no
+    ADDRESS_STANDARDIZER="address_standardizer"
+    AC_ARG_WITH([pcredir], 
+        [AS_HELP_STRING([--with-pcredir=PATH], [specify the PCRE installation directory])], 
+        [PCREDIR="$withval"], [PCREDIR=""])
+    
+    if test ! "x$PCREDIR" = "x"; then
+        dnl Make sure that the directory exists 
+        if test "x$PCREDIR" = "xyes"; then
+            AC_MSG_ERROR([you must specify a parameter to --with-pcredir, e.g. --with-pcredir=/path/to])
+        else
+            if test -d "$PCREDIR"; then
+                AC_MSG_RESULT([Using user-specified PCRE directory: $PCREDIR])
+    
+                dnl Add the include directory to PCRE_CPPFLAGS 
+                PCRE_CPPFLAGS="-I$PCREDIR/include"     
+                PCRE_LDFLAGS="-L$PCREDIR/lib"
+            else
+                AC_MSG_ERROR([the --with-pcredir directory "$PCREDIR" cannot be found]) 
+            fi
+        fi
+    fi
+    
+    
+    dnl Check that we can find the pcre.h header file
+    CPPFLAGS_SAVE="$CPPFLAGS"
+    CPPFLAGS="$PCRE_CPPFLAGS"
+    
+    AC_CHECK_HEADER([pcre.h], [HAVE_PCRE=yes], [ADDRESS_STANDARDIZER=""])      
+    AC_SUBST([PCRE])
+    AC_SUBST([HAVE_PCRE])
+    AC_SUBST([ADDRESS_STANDARDIZER])
+    
+    dnl Return the PCRE version number
+    AC_DEFINE_UNQUOTED([PCRE_VERSION], [$PCRE_VERSION], [PCRE library version])
+    AC_SUBST([PCRE_VERSION])
+    CPPFLAGS="$CPPFLAGS_SAVE"
+    
+    AC_SUBST([PCRE_CPPFLAGS])
+    AC_SUBST([PCRE_LDFLAGS])
+    
+    
+
+else
+    ADDRESS_STANDARDIZER=""
+    AC_SUBST([ADDRESS_STANDARDIZER])
+    AC_MSG_RESULT([ADDRESS_STANDARDIZER support: disabled])
+fi
+
+
 
 dnl ===========================================================================
 dnl See if we have the requirements for building the extensions, namely
@@ -1250,6 +1320,7 @@ AC_MSG_RESULT([  PROJ4 version:        ${POSTGIS_PROJ_VERSION}])
 AC_MSG_RESULT([  Libxml2 config:       ${XML2CONFIG}])
 AC_MSG_RESULT([  Libxml2 version:      ${POSTGIS_LIBXML2_VERSION}])
 AC_MSG_RESULT([  JSON-C support:       ${HAVE_JSON}])
+AC_MSG_RESULT([  PCRE support:       ${HAVE_PCRE}])
 AC_MSG_RESULT([  PostGIS debug level:  ${POSTGIS_DEBUG_LEVEL}])
 AC_MSG_RESULT([  Perl:                 ${PERL}])
 AC_MSG_RESULT()
@@ -1270,6 +1341,12 @@ if test "x$SFCGAL" = "xsfcgal"; then
 else
     AC_MSG_RESULT([  SFCGAL support:       disabled])
 fi
+
+if test "x$ADDRESS_STANDARDIZER" = "xaddress_standardizer"; then
+    AC_MSG_RESULT([  Address Standardizer support:       enabled])
+else
+    AC_MSG_RESULT([  Address Standardizer support:       disabled])
+fi
 AC_MSG_RESULT()
 AC_MSG_RESULT([ -------- Documentation Generation -------- ])
 AC_MSG_RESULT([  xsltproc:             ${XSLTPROC}])
index 56c3a2259cc5469c04a2d2fafe4f24d9d2f51b95..2b00e2b9bcbd18b862485f75b12f4680170c1557 100644 (file)
@@ -18,6 +18,10 @@ ifeq (@SFCGAL@,sfcgal)
        SUBDIRS += postgis_sfcgal
 endif
 
+ifeq (@ADDRESS_STANDARDIZER@,address_standardizer)
+       SUBDIRS += address_standardizer
+endif
+
 all clean distclean install uninstall:
        for DIR in $(SUBDIRS); do \
                echo "---- Making $@ in $${DIR}"; \