Ignore:
Timestamp:
May 28, 2015, 4:25:06 PM (9 years ago)
Author:
djay
Message:

First version including zoo_service shared library

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/configure.ac

    r637 r640  
    5151AC_SUBST([CGI_DIR])
    5252
     53
     54# ===========================================================================
     55# Detect if libyaml is available
     56# ===========================================================================
     57
     58AC_ARG_WITH([yaml],
     59        [AS_HELP_STRING([--with-yaml=PATH], [specify an alternative location for the yaml library])],
     60        [YAMLPATH="$withval"], [YAMLPATH=""])
     61
     62if test -z "$YAMLPATH"
     63then
     64        YAML_LDFLAGS=""
     65        YAML_CPPFLAGS=""
     66        YAML_FILE=""
     67        YAML_FILE1=""
     68else
     69
     70        # Extract the linker and include flags
     71        YAML_LDFLAGS="-L$YAMLPATH/lib -lyaml"
     72        YAML_CPPFLAGS="-I$YAMLPATH/include -DYAML"
     73        YAML_FILE="service_yaml.o"
     74        YAML_FILE1="zcfg2yaml"
     75       
     76        # Check headers file
     77        CPPFLAGS_SAVE="$CPPFLAGS"
     78        CPPFLAGS="$YAML_CPPFLAGS"
     79        LIBS_SAVE="$LIBS"
     80        LIBS="$YAML_LDFLAGS"
     81        AC_CHECK_LIB([yaml], [yaml_parser_initialize,yaml_parser_set_input_file,yaml_parser_scan])
     82        AC_CHECK_HEADERS([yaml.h],
     83                 [], [AC_MSG_ERROR([could not find headers include related to YAML])])
     84        LIBS="$LIBS_SAVE"
     85fi
     86AC_SUBST([YAML_CPPFLAGS])
     87AC_SUBST([YAML_LDFLAGS])
     88AC_SUBST([YAML_FILE])
     89AC_SUBST([YAML_FILE1])
     90
     91# ===========================================================================
     92# Detect if fastcgi is available
     93# ===========================================================================
     94
     95AC_ARG_WITH([fastcgi],
     96        [AS_HELP_STRING([--with-fastcgi=PATH], [specify an alternative location for the fastcgi library])],
     97        [FCGIPATH="$withval"], [FCGIPATH="/usr"])
     98
     99# Extract the linker and include flags
     100FCGI_LDFLAGS="-L$FCGIPATH/lib"
     101FCGI_CPPFLAGS="-I$FCGIPATH/include"
     102
     103# Check headers file
     104CPPFLAGS_SAVE="$CPPFLAGS"
     105CPPFLAGS="$FCGI_CPPFLAGS"
     106LIBS_SAVE="$LIBS"
     107LIBS="$FCGI_LDFLAGS"
     108AC_CHECK_LIB([fcgi], [main])
     109AC_CHECK_HEADERS([fcgi_stdio.h],
     110                 [], [AC_MSG_ERROR([could not find headers include related to fastcgi])])
     111LIBS="$LIBS_SAVE"
     112AC_SUBST([FCGI_CPPFLAGS])
     113AC_SUBST([FCGI_LDFLAGS])
     114
     115# ===========================================================================
     116# Detect if libxml2 is installed
     117# ===========================================================================
     118
     119AC_ARG_WITH([xml2config],
     120        [AS_HELP_STRING([--with-xml2config=FILE], [specify an alternative xml2-config file])],
     121        [XML2CONFIG="$withval"], [XML2CONFIG=""])
     122
     123if test "x$XML2CONFIG" = "x"; then
     124        # XML2CONFIG was not specified, so search within the current path
     125        AC_PATH_PROG([XML2CONFIG], [xml2-config])
     126
     127        # If we couldn't find xml2-config, display a warning
     128        if test "x$XML2CONFIG" = "x"; then
     129                AC_MSG_ERROR([could not find xml2-config from libxml2 within the current path. You may need to try re-running configure with a --with-xml2config parameter.])
     130        fi
     131else
     132        # XML2CONFIG was specified; display a message to the user
     133        if test "x$XML2CONFIG" = "xyes"; then
     134                AC_MSG_ERROR([you must specify a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config])
     135        else
     136                if test -f $XML2CONFIG; then
     137                        AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG])
     138                else
     139                        AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist])
     140                fi     
     141        fi
     142fi
     143
     144# Extract the linker and include flags
     145XML2_LDFLAGS=`$XML2CONFIG --libs`
     146XML2_CPPFLAGS=`$XML2CONFIG --cflags`
     147
     148# Check headers file
     149CPPFLAGS_SAVE="$CPPFLAGS"
     150CPPFLAGS="$XML2_CPPFLAGS"
     151AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h],
     152                 [], [AC_MSG_ERROR([could not find headers include related to libxml2])])
     153
     154# Ensure we can link against libxml2
     155LIBS_SAVE="$LIBS"
     156LIBS="$XML2_LDFLAGS"
     157AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
     158
     159AC_SUBST([XML2_CPPFLAGS])
     160AC_SUBST([XML2_LDFLAGS])
     161LIBS="$LIBS_SAVE"
     162
     163
     164# ===========================================================================
     165# Detect if libxslt is installed
     166# ===========================================================================
     167
     168AC_ARG_WITH([xsltconfig],
     169        [AS_HELP_STRING([--with-xsltconfig=FILE], [specify an alternative xslt-config file])],
     170        [XSLTCONFIG="$withval"], [XSLTCONFIG=""])
     171
     172if test "x$XSLTCONFIG" = "x"; then
     173        # XSLTCONFIG was not specified, so search within the current path
     174        AC_PATH_PROG([XSLTCONFIG], [xslt-config])
     175
     176        # If we couldn't find xslt-config, display a warning
     177        if test "x$XSLTCONFIG" = "x"; then
     178                AC_MSG_ERROR([could not find xslt-config from libxslt within the current path. You may need to try re-running configure with a --with-xtltconfig parameter.])
     179        fi
     180else
     181        # XSLTCONFIG was specified; display a message to the user
     182        if test "x$XSLTCONFIG" = "xyes"; then
     183                AC_MSG_ERROR([you must specify a parameter to --with-xsltconfig, e.g. --with-xsltconfig=/path/to/xslt-config])
     184        else
     185                if test -f $XSLTCONFIG; then
     186                        AC_MSG_RESULT([Using user-specified xslt-config file: $XSLTCONFIG])
     187                else
     188                        AC_MSG_ERROR([the user-specified xslt-config file $XSLTCONFIG does not exist])
     189                fi     
     190        fi
     191fi
     192
     193# Extract the linker and include flags
     194XSLT_LDFLAGS=`$XSLTCONFIG --libs`
     195XSLT_CPPFLAGS=`$XSLTCONFIG --cflags`
     196
     197# Check headers file
     198CPPFLAGS_SAVE="$CPPFLAGS"
     199CPPFLAGS="$XSLT_CPPFLAGS"
     200AC_CHECK_HEADERS([libxslt/xslt.h libxslt/xsltInternals.h libxslt/transform.h libxslt/xsltutils.h],
     201                 [], [AC_MSG_ERROR([could not find headers include related to libxlst])])
     202
     203AC_SUBST([XSLT_CPPFLAGS])
     204AC_SUBST([XSLT_LDFLAGS])
     205
     206#============================================================================
     207# Detect if gdal is installed
     208#============================================================================
     209
     210AC_ARG_WITH([gdal-config],
     211        [AS_HELP_STRING([--with-gdal-config=FILE], [specify an alternative gdal-config file])],
     212        [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""])
     213if test -z $GDAL_CONFIG;
     214then
     215        AC_PATH_PROG([GDAL_CONFIG], [gdal-config])
     216        if test -z $GDAL_CONFIG;
     217        then
     218                AC_MSG_ERROR([could not find gdal-config from libgdal within the current path. You may need to try re-running configure with a --with-gdal-config parameter.])
     219        fi
     220       
     221else
     222        if test -f $GDAL_CONFIG; then
     223                AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG])
     224        else
     225                AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist])
     226        fi
     227fi
     228
     229GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
     230GDAL_LIBS="`$GDAL_CONFIG --libs`"
     231
     232AC_SUBST([GDAL_CFLAGS])
     233AC_SUBST([GDAL_LIBS])
     234
     235# ===========================================================================
     236# Detect if proj is installed
     237# ===========================================================================
     238
     239AC_ARG_WITH([proj],
     240        [AS_HELP_STRING([--with-proj=PATH], [specify an alternative location for PROJ4 setup])],
     241        [PROJPATH="$withval"], [PROJPATH=""])
     242
     243# Extract the linker and include flags
     244PROJ_LDFLAGS="-L$PROJPATH/lib"
     245PROJ_CPPFLAGS="-I$PROJPATH/include"
     246
     247# Check headers file
     248CPPFLAGS_SAVE="$CPPFLAGS"
     249CPPFLAGS="$PROJ_CPPFLAGS"
     250AC_CHECK_HEADERS([proj_api.h],
     251                 [], [AC_MSG_ERROR([could not find headers include related to PROJ4])])
     252
     253AC_SUBST([PROJ_CPPFLAGS])
     254AC_SUBST([PROJ_LDFLAGS])
     255
     256# ===========================================================================
     257# Detect if libgeos is installed
     258# ===========================================================================
     259
     260AC_ARG_WITH([geosconfig],
     261        [AS_HELP_STRING([--with-geosconfig=FILE], [specify an alternative geos-config file])],
     262        [GEOSCONFIG="$withval"], [GEOSCONFIG=""])
     263
     264if test "x$GEOSCONFIG" = "x"; then
     265        # GEOSCONFIG was not specified, so search within the current path
     266        AC_PATH_PROG([GEOSCONFIG], [geos-config])
     267
     268        # If we couldn't find geos-config, display a warning
     269        if test "x$GEOSCONFIG" = "x"; then
     270                AC_MSG_WARN([could not find geos-config from libgeos within the current path. You may need to try re-running configure with a --with-geosconfig parameter.])
     271        fi
     272else
     273        # GEOSCONFIG was specified; display a message to the user
     274        if test "x$GEOSCONFIG" = "xyes"; then
     275                AC_MSG_WARN([you must specify a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config])
     276        else
     277                if test -f $GEOSCONFIG; then
     278                        AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG])
     279                else
     280                        AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist])
     281                fi     
     282        fi
     283fi
     284
     285GEOS_LDFLAGS=`$GEOSCONFIG --libs`
     286GEOS_CPPFLAGS=`$GEOSCONFIG --cflags`
     287
     288# Check headers file
     289CPPFLAGS_SAVE="$CPPFLAGS"
     290CPPFLAGS="$GEOS_CPPFLAGS"
     291AC_CHECK_HEADERS([geos_c.h],
     292                 [], [AC_MSG_WARN([could not find headers include related to libgeos])])
     293
     294AC_SUBST([GEOS_CPPFLAGS])
     295AC_SUBST([GEOS_LDFLAGS])
     296
     297
     298# ===========================================================================
     299# Detect if cgal is installed
     300# ===========================================================================
     301
     302AC_ARG_WITH([cgal],
     303        [AS_HELP_STRING([--with-cgal=PATH], [specify an alternative location for CGAL setup])],
     304        [CGALPATH="$withval"], [CGALPATH="/usr"])
     305
     306
     307# Check headers file
     308CPPFLAGS_SAVE="$CPPFLAGS"
     309CPPFLAGS="$CGAL_CPPFLAGS"
     310AC_CHECK_HEADERS([CGAL/Delaunay_triangulation_2.h],
     311         [], [AC_MSG_WARN([could not find headers include related to libCGAL])])
     312
     313# Extract the linker and include flags
     314CGAL_LDFLAGS="-L$CGALPATH/lib"
     315CGAL_CPPFLAGS="-I$CGALPATH/include"
     316
     317
     318AC_SUBST([CGAL_CPPFLAGS])
     319AC_SUBST([CGAL_LDFLAGS])
     320#============================================================================
     321# Detect if mapserver is installed
     322#============================================================================
     323
     324AC_ARG_WITH([mapserver],
     325       [AS_HELP_STRING([--with-mapserver=PATH], [specify the path for MapServer compiled source tree])],
     326       [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""])
     327
     328if test -z $MS_SRC_PATH;
     329then
     330        MS_CPPFLAGS=""
     331        MS_LDFLAGS=""
     332else
     333       if test "x$MS_SRC_PATH" = "xmacos";
     334       then
     335               MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl"
     336               MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver "
     337               AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree])
     338               AC_MSG_RESULT([Using MacOS X Framework for MapServer])
     339       else
     340               if test -d $MS_SRC_PATH; then
     341                       MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`"
     342                       MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH "
     343               
     344                       AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
     345               else
     346                       AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist])
     347               fi
     348       fi
     349       MS_FILE="service_internal_ms.o"
     350fi
     351
     352MS_CFLAGS="$MS_CPPFLAGS"
     353MS_LIBS="$MS_LDFLAGS"
     354
     355AC_SUBST([MS_CFLAGS])
     356AC_SUBST([MS_LIBS])
     357AC_SUBST([MS_FILE])
     358
    53359# ===========================================================================
    54360# Detect if python is installed
     
    100406        AC_SUBST([PYTHON_CPPFLAGS])
    101407        AC_SUBST([PYTHON_LDFLAGS])
     408        LIBS="$LIBS_SAVE"
    102409fi
    103410
     
    151458        CPPFLAGS_SAVE="$CPPFLAGS"
    152459        CPPFLAGS="$JS_CPPFLAGS"
    153 
    154         #AC_CHECK_HEADERS([jsapi.h],
    155         #                [], [AC_MSG_ERROR([could not find headers include related to libjs])])
    156 
    157        
     460        AC_LANG_PUSH([C++])
     461        AC_CHECK_HEADERS([jsapi.h],
     462                        [], [AC_MSG_ERROR([could not find headers include related to libjs])])
     463
     464        AC_LANG_POP([C++])
    158465        LIBS_SAVE="$LIBS"
    159466        LIBS="$JS_LDFLAGS"
    160467
    161468        AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
    162                        
     469        LIBS="$LIBS_SAVE"
     470       
    163471        AC_SUBST([JS_CPPFLAGS])
    164472        AC_SUBST([JS_LDFLAGS])
     
    206514        # Shouldn't we get php here rather than php5 :) ??
    207515        AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
     516        LIBS="$LIBS_SAVE"
    208517        AC_SUBST([PHP_CPPFLAGS])
    209518        AC_SUBST([PHP_LDFLAGS])
     
    264573                AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjvm])], [])
    265574        fi
     575        LIBS="$LIBS_SAVE"
    266576
    267577        AC_SUBST([JAVA_CPPFLAGS])
     
    304614        LIBS="$RUBY_LDFLAGS"
    305615        # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
     616        LIBS="$LIBS_SAVE"
    306617        AC_SUBST([RUBY_CPPFLAGS])
    307618        AC_SUBST([RUBY_LDFLAGS])
     
    387698        CPPFLAGS="$OTB_CPPFLAGS"
    388699        LDFLAGS_SAVE="$LDFLAGS"
    389         LDFLAGS="$OTB_LDFLAGS"
     700        LIBS="$LIBS_SAVE $OTB_LDFLAGS"
    390701        AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h],
    391702                        [], [AC_MSG_ERROR([could not find header file $i related to OTB])])
    392703        AC_LANG_POP([C++])
     704        AC_LANG(C++)
     705        LDFLAGS_SAVE="$LDFLAGS"
     706        LDFLAGS="$OTB_LDFLAGS"
     707        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplication.h"],[std::vector<std::string> list = otb::Wrapwper::ApplicationRegistry::GetAvailableApplication();]])],
     708                [AC_MSG_RESULT([checking for GetAvailableApplication... yes])],[AC_MSG_ERROR([checking for GetAvailableApplication... failed])])
     709        LDFLAGS="$LDFLAGS_SAVE"
     710                       
    393711fi
    394712AC_SUBST([OTB_CPPFLAGS])
     
    435753        LIBS_SAVE="$LIBS"
    436754        LIBS="$SAGA_LDFLAGS"
    437         AC_MSG_RESULT(CPPFLAGS are $CPPFLAGS)
    438755        AC_CHECK_HEADERS([module_library.h],
    439756                        [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])])
    440         LIBS_SAVE="$LIBS"
    441         AC_CHECK_LIB([saga_api], [SG_Set_UI_Callback,SG_Get_Module_Library_Manager])
     757        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "module_library.h"],[SG_Get_Module_Library_Manager();]])],
     758                [AC_MSG_RESULT([checking for SG_Get_Module_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Module_Library_Manager... failed])])
     759        LIBS="$LIBS_SAVE"
    442760        AC_LANG_POP([C++])
    443761fi
     
    447765AC_SUBST([SAGA_ENABLED])
    448766
    449 # ===========================================================================
    450 # Detect if libyaml is available
    451 # ===========================================================================
    452 
    453 AC_ARG_WITH([yaml],
    454         [AS_HELP_STRING([--with-yaml=PATH], [specify an alternative location for the yaml library])],
    455         [YAMLPATH="$withval"], [YAMLPATH=""])
    456 
    457 if test -z "$YAMLPATH"
    458 then
    459         YAML_LDFLAGS=""
    460         YAML_CPPFLAGS=""
    461         YAML_FILE=""
    462         YAML_FILE1=""
    463 else
    464 
    465         # Extract the linker and include flags
    466         YAML_LDFLAGS="-L$YAMLPATH/lib -lyaml"
    467         YAML_CPPFLAGS="-I$YAMLPATH/include -DYAML"
    468         YAML_FILE="service_yaml.o"
    469         YAML_FILE1="zcfg2yaml"
    470        
    471         # Check headers file
    472         CPPFLAGS_SAVE="$CPPFLAGS"
    473         CPPFLAGS="$YAML_CPPFLAGS"
    474         LIBS_SAVE="$LIBS"
    475         LIBS="$YAML_LDFLAGS"
    476         AC_CHECK_LIB([yaml], [yaml_parser_initialize,yaml_parser_set_input_file,yaml_parser_scan])
    477         AC_CHECK_HEADERS([yaml.h],
    478                  [], [AC_MSG_ERROR([could not find headers include related to YAML])])
    479         LIBS="$LIBS_SAVE"
    480 fi
    481 AC_SUBST([YAML_CPPFLAGS])
    482 AC_SUBST([YAML_LDFLAGS])
    483 AC_SUBST([YAML_FILE])
    484 AC_SUBST([YAML_FILE1])
    485 
    486 # ===========================================================================
    487 # Detect if fastcgi is available
    488 # ===========================================================================
    489 
    490 AC_ARG_WITH([fastcgi],
    491         [AS_HELP_STRING([--with-fastcgi=PATH], [specify an alternative location for the fastcgi library])],
    492         [FCGIPATH="$withval"], [FCGIPATH="/usr"])
    493 
    494 # Extract the linker and include flags
    495 FCGI_LDFLAGS="-L$FCGIPATH/lib"
    496 FCGI_CPPFLAGS="-I$FCGIPATH/include"
    497 
    498 # Check headers file
    499 CPPFLAGS_SAVE="$CPPFLAGS"
    500 CPPFLAGS="$FCGI_CPPFLAGS"
    501 LIBS_SAVE="$LIBS"
    502 LIBS="$FCGI_LDFLAGS"
    503 AC_CHECK_LIB([fcgi], [main])
    504 AC_CHECK_HEADERS([fcgi_stdio.h],
    505                  [], [AC_MSG_ERROR([could not find headers include related to fastcgi])])
    506 LIBS="$LIBS_SAVE"
    507 AC_SUBST([FCGI_CPPFLAGS])
    508 AC_SUBST([FCGI_LDFLAGS])
    509 
    510 
    511 # ===========================================================================
    512 # Detect if libxml2 is installed
    513 # ===========================================================================
    514 
    515 AC_ARG_WITH([xml2config],
    516         [AS_HELP_STRING([--with-xml2config=FILE], [specify an alternative xml2-config file])],
    517         [XML2CONFIG="$withval"], [XML2CONFIG=""])
    518 
    519 if test "x$XML2CONFIG" = "x"; then
    520         # XML2CONFIG was not specified, so search within the current path
    521         AC_PATH_PROG([XML2CONFIG], [xml2-config])
    522 
    523         # If we couldn't find xml2-config, display a warning
    524         if test "x$XML2CONFIG" = "x"; then
    525                 AC_MSG_ERROR([could not find xml2-config from libxml2 within the current path. You may need to try re-running configure with a --with-xml2config parameter.])
    526         fi
    527 else
    528         # XML2CONFIG was specified; display a message to the user
    529         if test "x$XML2CONFIG" = "xyes"; then
    530                 AC_MSG_ERROR([you must specify a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config])
    531         else
    532                 if test -f $XML2CONFIG; then
    533                         AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG])
    534                 else
    535                         AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist])
    536                 fi     
    537         fi
    538 fi
    539 
    540 # Extract the linker and include flags
    541 XML2_LDFLAGS=`$XML2CONFIG --libs`
    542 XML2_CPPFLAGS=`$XML2CONFIG --cflags`
    543 
    544 # Check headers file
    545 CPPFLAGS_SAVE="$CPPFLAGS"
    546 CPPFLAGS="$XML2_CPPFLAGS"
    547 AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h],
    548                  [], [AC_MSG_ERROR([could not find headers include related to libxml2])])
    549 
    550 # Ensure we can link against libxml2
    551 LIBS_SAVE="$LIBS"
    552 LIBS="$XML2_LDFLAGS"
    553 AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
    554 
    555 AC_SUBST([XML2_CPPFLAGS])
    556 AC_SUBST([XML2_LDFLAGS])
    557 
    558 # ===========================================================================
    559 # Detect if libxslt is installed
    560 # ===========================================================================
    561 
    562 AC_ARG_WITH([xsltconfig],
    563         [AS_HELP_STRING([--with-xsltconfig=FILE], [specify an alternative xslt-config file])],
    564         [XSLTCONFIG="$withval"], [XSLTCONFIG=""])
    565 
    566 if test "x$XSLTCONFIG" = "x"; then
    567         # XSLTCONFIG was not specified, so search within the current path
    568         AC_PATH_PROG([XSLTCONFIG], [xslt-config])
    569 
    570         # If we couldn't find xslt-config, display a warning
    571         if test "x$XSLTCONFIG" = "x"; then
    572                 AC_MSG_ERROR([could not find xslt-config from libxslt within the current path. You may need to try re-running configure with a --with-xtltconfig parameter.])
    573         fi
    574 else
    575         # XSLTCONFIG was specified; display a message to the user
    576         if test "x$XSLTCONFIG" = "xyes"; then
    577                 AC_MSG_ERROR([you must specify a parameter to --with-xsltconfig, e.g. --with-xsltconfig=/path/to/xslt-config])
    578         else
    579                 if test -f $XSLTCONFIG; then
    580                         AC_MSG_RESULT([Using user-specified xslt-config file: $XSLTCONFIG])
    581                 else
    582                         AC_MSG_ERROR([the user-specified xslt-config file $XSLTCONFIG does not exist])
    583                 fi     
    584         fi
    585 fi
    586 
    587 # Extract the linker and include flags
    588 XSLT_LDFLAGS=`$XSLTCONFIG --libs`
    589 XSLT_CPPFLAGS=`$XSLTCONFIG --cflags`
    590 
    591 # Check headers file
    592 CPPFLAGS_SAVE="$CPPFLAGS"
    593 CPPFLAGS="$XSLT_CPPFLAGS"
    594 AC_CHECK_HEADERS([libxslt/xslt.h libxslt/xsltInternals.h libxslt/transform.h libxslt/xsltutils.h],
    595                  [], [AC_MSG_ERROR([could not find headers include related to libxlst])])
    596 
    597 AC_SUBST([XSLT_CPPFLAGS])
    598 AC_SUBST([XSLT_LDFLAGS])
    599 
    600 #============================================================================
    601 # Detect if gdal is installed
    602 #============================================================================
    603 
    604 AC_ARG_WITH([gdal-config],
    605         [AS_HELP_STRING([--with-gdal-config=FILE], [specify an alternative gdal-config file])],
    606         [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""])
    607 if test -z $GDAL_CONFIG;
    608 then
    609         AC_PATH_PROG([GDAL_CONFIG], [gdal-config])
    610         if test -z $GDAL_CONFIG;
    611         then
    612                 AC_MSG_ERROR([could not find gdal-config from libgdal within the current path. You may need to try re-running configure with a --with-gdal-config parameter.])
    613         fi
    614        
    615 else
    616         if test -f $GDAL_CONFIG; then
    617                 AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG])
    618         else
    619                 AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist])
    620         fi
    621 fi
    622 
    623 GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
    624 GDAL_LIBS="`$GDAL_CONFIG --libs`"
    625 
    626 AC_SUBST([GDAL_CFLAGS])
    627 AC_SUBST([GDAL_LIBS])
    628 
    629 # ===========================================================================
    630 # Detect if proj is installed
    631 # ===========================================================================
    632 
    633 AC_ARG_WITH([proj],
    634         [AS_HELP_STRING([--with-proj=PATH], [specify an alternative location for PROJ4 setup])],
    635         [PROJPATH="$withval"], [PROJPATH=""])
    636 
    637 # Extract the linker and include flags
    638 PROJ_LDFLAGS="-L$PROJPATH/lib"
    639 PROJ_CPPFLAGS="-I$PROJPATH/include"
    640 
    641 # Check headers file
    642 CPPFLAGS_SAVE="$CPPFLAGS"
    643 CPPFLAGS="$PROJ_CPPFLAGS"
    644 AC_CHECK_HEADERS([proj_api.h],
    645                  [], [AC_MSG_ERROR([could not find headers include related to PROJ4])])
    646 
    647 AC_SUBST([PROJ_CPPFLAGS])
    648 AC_SUBST([PROJ_LDFLAGS])
    649 
    650 # ===========================================================================
    651 # Detect if libgeos is installed
    652 # ===========================================================================
    653 
    654 AC_ARG_WITH([geosconfig],
    655         [AS_HELP_STRING([--with-geosconfig=FILE], [specify an alternative geos-config file])],
    656         [GEOSCONFIG="$withval"], [GEOSCONFIG=""])
    657 
    658 if test "x$GEOSCONFIG" = "x"; then
    659         # GEOSCONFIG was not specified, so search within the current path
    660         AC_PATH_PROG([GEOSCONFIG], [geos-config])
    661 
    662         # If we couldn't find geos-config, display a warning
    663         if test "x$GEOSCONFIG" = "x"; then
    664                 AC_MSG_WARN([could not find geos-config from libgeos within the current path. You may need to try re-running configure with a --with-geosconfig parameter.])
    665         fi
    666 else
    667         # GEOSCONFIG was specified; display a message to the user
    668         if test "x$GEOSCONFIG" = "xyes"; then
    669                 AC_MSG_WARN([you must specify a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config])
    670         else
    671                 if test -f $GEOSCONFIG; then
    672                         AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG])
    673                 else
    674                         AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist])
    675                 fi     
    676         fi
    677 fi
    678 
    679 GEOS_LDFLAGS=`$GEOSCONFIG --libs`
    680 GEOS_CPPFLAGS=`$GEOSCONFIG --cflags`
    681 
    682 # Check headers file
    683 CPPFLAGS_SAVE="$CPPFLAGS"
    684 CPPFLAGS="$GEOS_CPPFLAGS"
    685 AC_CHECK_HEADERS([geos_c.h],
    686                  [], [AC_MSG_WARN([could not find headers include related to libgeos])])
    687 
    688 AC_SUBST([GEOS_CPPFLAGS])
    689 AC_SUBST([GEOS_LDFLAGS])
    690 
    691 
    692 # ===========================================================================
    693 # Detect if cgal is installed
    694 # ===========================================================================
    695 
    696 AC_ARG_WITH([cgal],
    697         [AS_HELP_STRING([--with-cgal=PATH], [specify an alternative location for CGAL setup])],
    698         [CGALPATH="$withval"], [CGALPATH="/usr"])
    699 
    700 
    701 # Check headers file
    702 CPPFLAGS_SAVE="$CPPFLAGS"
    703 CPPFLAGS="$CGAL_CPPFLAGS"
    704 AC_CHECK_HEADERS([CGAL/Delaunay_triangulation_2.h],
    705          [], [AC_MSG_WARN([could not find headers include related to libCGAL])])
    706 
    707 # Extract the linker and include flags
    708 CGAL_LDFLAGS="-L$CGALPATH/lib"
    709 CGAL_CPPFLAGS="-I$CGALPATH/include"
    710 
    711 
    712 AC_SUBST([CGAL_CPPFLAGS])
    713 AC_SUBST([CGAL_LDFLAGS])
    714 #============================================================================
    715 # Detect if mapserver is installed
    716 #============================================================================
    717 
    718 AC_ARG_WITH([mapserver],
    719        [AS_HELP_STRING([--with-mapserver=PATH], [specify the path for MapServer compiled source tree])],
    720        [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""])
    721 
    722 if test -z $MS_SRC_PATH;
    723 then
    724         MS_CPPFLAGS=""
    725         MS_LDFLAGS=""
    726 else
    727        if test "x$MS_SRC_PATH" = "xmacos";
    728        then
    729                MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl"
    730                MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver "
    731                AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree])
    732                AC_MSG_RESULT([Using MacOS X Framework for MapServer])
    733        else
    734                if test -d $MS_SRC_PATH; then
    735                        MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`"
    736                        MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH "
    737                
    738                        AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
    739                else
    740                        AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist])
    741                fi
    742        fi
    743        MS_FILE="service_internal_ms.o"
    744 fi
    745 
    746 MS_CFLAGS="$MS_CPPFLAGS"
    747 MS_LIBS="$MS_LDFLAGS"
    748 
    749 AC_SUBST([MS_CFLAGS])
    750 AC_SUBST([MS_LIBS])
    751 AC_SUBST([MS_FILE])
    752 
    753767AC_CONFIG_FILES([Makefile])
    754768AC_CONFIG_FILES([ZOOMakefile.opts])
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png