Changeset 634


Ignore:
Timestamp:
Apr 24, 2015, 4:57:59 PM (10 years ago)
Author:
djay
Message:

Integrate a basic SAGA-GIS support into the ZOO-Kernel.

Location:
trunk
Files:
6 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/kernel/index.txt

    r569 r634  
    1313   mapserver
    1414   orfeotoolbox
     15   sagagis
    1516
  • trunk/docs/services/howtos.txt

    r613 r634  
    1919----------------------
    2020
    21 The function of the process for each programming language take three arguments: the main
    22 configuration, inputs and outputs.
     21A ZOO-Service is a couple composed of a ZCFG file and a
     22ServiceProvider. This last depend of the programming language but
     23should expose at least one function corresponding to the Service. This
     24function take three arguments: the main configuration, inputs and
     25outputs and return an integer:
     26* 3 if the process run sucessfully
     27* 4 in case any error occur. In such a case, programmer may add
     28detailler message map
     29
     30Data structures for those arguments depend on the programming
     31-UMRlanguage and is detailled below.
    2332
    2433.. Note:: The service has to **return 3 if the process run successfully instead it
  • trunk/zoo-project/HISTORY.txt

    r621 r634  
    1414  * Run validateRequest (download, default settings and decoding)
    1515  after fork if any
     16  * Add SAGA-GIS support for modules as a service
     17  * Add saga2zcfg utility to generate zcfg for SAGA-GIS modules
     18  * Add SAGA-GIS Observer to have ongoing status updates
    1619
    1720Version 1.4.0
  • trunk/zoo-project/zoo-kernel/Makefile.in

    r621 r634  
    4848        g++ ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c service_internal_python.c
    4949
    50 service_internal_otb.o: service_internal_otb.c service.h
     50service_internal_otb.o: service_internal_otb.c service_internal_otb.h service.h
    5151        g++ ${XML2CFLAGS} ${OTBCFLAGS} ${CFLAGS} -c service_internal_otb.c
     52
     53service_internal_saga.o: service_internal_saga.c service_internal_saga.h service.h
     54        g++ ${XML2CFLAGS} ${SAGA_CFLAGS} ${CFLAGS} -c service_internal_saga.c
    5255
    5356otbZooWatcher.o: otbZooWatcher.cxx otbZooWatcher.h  service.h
     
    7376
    7477zoo_service_loader.o: zoo_service_loader.c service.h
    75         g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${OTBCFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${OTB_ENABLED} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} -c zoo_service_loader.c  -fno-common -DPIC -o zoo_service_loader.o
     78        g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${SAGA_ENABLED} ${OTB_ENABLED} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} -c zoo_service_loader.c  -fno-common -DPIC -o zoo_service_loader.o
    7679
    77 zoo_loader.cgi: version.h zoo_loader.c zoo_service_loader.o  ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o service_internal.o request_parser.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE}
     80zoo_loader.cgi: version.h zoo_loader.c zoo_service_loader.o  ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o service_internal.o request_parser.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE}
    7881        g++ -g -O2 ${JSCFLAGS} ${PHPCFLAGS}  ${PERLCFLAGS} ${RUBYCFLAGS}  ${JAVACFLAGS} ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c  -fno-common -DPIC -o zoo_loader.o
    79         g++  ${JSCFLAGS} ${OTBCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o service_internal.o ${MS_FILE} ${PYTHON_FILE}  ${PERL_FILE} ${PHP_FILE}  ${JS_FILE} ${JAVA_FILE} ${YAML_FILE} ${OTB_FILE} request_parser.o ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi ${LDFLAGS}
     82        g++  ${JSCFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o service_internal.o ${MS_FILE} ${PYTHON_FILE}  ${PERL_FILE} ${PHP_FILE}  ${JS_FILE} ${JAVA_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} request_parser.o ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi ${LDFLAGS}
    8083
    8184zcfg2yaml: zcfg2yaml.c  ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o service_internal.o ${MS_FILE} ${JS_FILE} ${RUBY_FILE}  ${YAML_FILE}
  • trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in

    r550 r634  
    7474OTB_FILE=@OTB_FILE@
    7575
     76SAGA_CFLAGS=@SAGA_CPPFLAGS@
     77SAGA_LDFLAGS=@SAGA_LDFLAGS@
     78SAGA_ENABLED=@SAGA_ENABLED@
     79SAGA_FILE=@SAGA_FILE@
     80
    7681CFLAGS=@DEB_DEF@ -fpic ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
    77 LDFLAGS=-lcurl -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS}
     82LDFLAGS=-lcurl -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS}
    7883
  • trunk/zoo-project/zoo-kernel/configure.ac

    r611 r634  
    4646AC_SUBST([DEB_DEF])
    4747
    48 
    49 
    50 
    5148AC_ARG_WITH([cgi-dir],
    5249    [AS_HELP_STRING([--with-cgi-dir=PATH], [specify an alternative cgi directory path ( default: /usr/lib/cgi-bin) ])],
    5350    [CGI_DIR="$withval"], [CGI_DIR="/usr/lib/cgi-bin"])
    5451AC_SUBST([CGI_DIR])
    55 
    56 #============================================================================
    57 # Detect if gdal is installed
    58 #============================================================================
    59 
    60 AC_ARG_WITH([gdal-config],
    61         [AS_HELP_STRING([--with-gdal-config=FILE], [specify an alternative gdal-config file])],
    62         [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""])
    63 if test -z $GDAL_CONFIG;
    64 then
    65         AC_PATH_PROG([GDAL_CONFIG], [gdal-config])
    66         if test -z $GDAL_CONFIG;
    67         then
    68                 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.])
    69         fi
    70        
    71 else
    72         if test -f $GDAL_CONFIG; then
    73                 AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG])
    74         else
    75                 AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist])
    76         fi
    77 fi
    78 
    79 GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
    80 GDAL_LIBS="`$GDAL_CONFIG --libs`"
    81 
    82 AC_SUBST([GDAL_CFLAGS])
    83 AC_SUBST([GDAL_LIBS])
    84 
    85 # ===========================================================================
    86 # Detect if otb is available
    87 # ===========================================================================
    88 
    89 AC_ARG_WITH([itk],
    90         [AS_HELP_STRING([--with-itk=PATH], [specify an alternative location for the itk library])],
    91         [ITKPATH="$withval"], [ITKPATH=""])
    92 
    93 AC_ARG_WITH([itk-version],
    94         [AS_HELP_STRING([--with-itk-version=VERSION], [specify an alternative version for the itk library])],
    95         [ITKVERS="$withval"], [ITKVERS=""])
    96 
    97 AC_ARG_WITH([otb],
    98         [AS_HELP_STRING([--with-otb=PATH], [specify an alternative location for the otb library])],
    99         [OTBPATH="$withval"], [OTBPATH=""])
    100 
    101 if test -z "$OTBPATH"
    102 then
    103         OTB_LDFLAGS=""
    104         OTB_CPPFLAGS=""
    105         OTB_FILE=""
    106         OTB_ENABLED=""
    107 else
    108     if test -z "$ITKVERS"
    109     then
    110         ITKVERS="4.5"
    111     fi
    112         OTB_ENABLED="-DUSE_OTB"
    113         OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib -lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkdouble-conversion-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS -litkzlib-$ITKVERS"
    114         OTB_CPPFLAGS="-I$OTBPATH/include/otb/ApplicationEngine -I$OTBPATH/include/otb/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTBPATH/include/otb/Utilities/ITK -I$OTBPATH/include/otb/ -I$OTBPATH/include/otb/IO -I$OTBPATH/include/otb/UtilitiesAdapters/OssimAdapters -I$OTBPATH/include/otb/UtilitiesAdapters/CurlAdapters -I$OTBPATH/include/otb/Utilities/BGL -I$OTBPATH/include/otb/UtilitiesAdapters/ITKPendingPatches -I$OTBPATH/include/otb/Utilities/otbconfigfile $GDAL_CFLAGS"
    115         OTB_FILE="otbZooWatcher.o service_internal_otb.o"
    116        
    117         AC_LANG_PUSH([C++])
    118         # Check headers file
    119         CPPFLAGS_SAVE="$CPPFLAGS"
    120         CPPFLAGS="$OTB_CPPFLAGS"
    121         LDFLAGS_SAVE="$LDFLAGS"
    122         LDFLAGS="$OTB_LDFLAGS"
    123         AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h],
    124                         [], [AC_MSG_ERROR([could not find header file $i related to OTB])])
    125         AC_LANG_POP([C++])
    126 fi
    127 AC_SUBST([OTB_CPPFLAGS])
    128 AC_SUBST([OTB_LDFLAGS])
    129 AC_SUBST([OTB_FILE])
    130 AC_SUBST([OTB_ENABLED])
    131 
    132 # ===========================================================================
    133 # Detect if libyaml is available
    134 # ===========================================================================
    135 
    136 AC_ARG_WITH([yaml],
    137         [AS_HELP_STRING([--with-yaml=PATH], [specify an alternative location for the yaml library])],
    138         [YAMLPATH="$withval"], [YAMLPATH=""])
    139 
    140 if test -z "$YAMLPATH"
    141 then
    142         YAML_LDFLAGS=""
    143         YAML_CPPFLAGS=""
    144         YAML_FILE=""
    145         YAML_FILE1=""
    146 else
    147 
    148         # Extract the linker and include flags
    149         YAML_LDFLAGS="-L$YAMLPATH/lib -lyaml"
    150         YAML_CPPFLAGS="-I$YAMLPATH/include -DYAML"
    151         YAML_FILE="service_yaml.o"
    152         YAML_FILE1="zcfg2yaml"
    153        
    154         # Check headers file
    155         CPPFLAGS_SAVE="$CPPFLAGS"
    156         CPPFLAGS="$YAML_CPPFLAGS"
    157         LDFLAGS_SAVE="$LDFLAGS"
    158         LDFLAGS="YAML_LDFLAGS"
    159         AC_CHECK_LIB([yaml], [yaml_parser_initialize,yaml_parser_set_input_file,yaml_parser_scan])
    160         AC_CHECK_HEADERS([yaml.h],
    161                  [], [AC_MSG_ERROR([could not find headers include related to YAML])])
    162 
    163 fi
    164 AC_SUBST([YAML_CPPFLAGS])
    165 AC_SUBST([YAML_LDFLAGS])
    166 AC_SUBST([YAML_FILE])
    167 AC_SUBST([YAML_FILE1])
    168 
    169 # ===========================================================================
    170 # Detect if fastcgi is available
    171 # ===========================================================================
    172 
    173 AC_ARG_WITH([fastcgi],
    174         [AS_HELP_STRING([--with-fastcgi=PATH], [specify an alternative location for the fastcgi library])],
    175         [FCGIPATH="$withval"], [FCGIPATH="/usr"])
    176 
    177 # Extract the linker and include flags
    178 FCGI_LDFLAGS="-L$FCGIPATH/lib"
    179 FCGI_CPPFLAGS="-I$FCGIPATH/include"
    180 
    181 # Check headers file
    182 CPPFLAGS_SAVE="$CPPFLAGS"
    183 CPPFLAGS="$FCGI_CPPFLAGS"
    184 LDFLAGS_SAVE="LDFLAGS"
    185 LDFLAGS="$FCGI_LDFLAGS"
    186 AC_CHECK_LIB([fcgi], [main])
    187 AC_CHECK_HEADERS([fcgi_stdio.h],
    188                  [], [AC_MSG_ERROR([could not find headers include related to fastcgi])])
    189 
    190 AC_SUBST([FCGI_CPPFLAGS])
    191 AC_SUBST([FCGI_LDFLAGS])
    192 
    193 # ===========================================================================
    194 # Detect if proj is installed
    195 # ===========================================================================
    196 
    197 AC_ARG_WITH([proj],
    198         [AS_HELP_STRING([--with-proj=PATH], [specify an alternative location for PROJ4 setup])],
    199         [PROJPATH="$withval"], [PROJPATH=""])
    200 
    201 # Extract the linker and include flags
    202 PROJ_LDFLAGS="-L$PROJPATH/lib"
    203 PROJ_CPPFLAGS="-I$PROJPATH/include"
    204 
    205 # Check headers file
    206 CPPFLAGS_SAVE="$CPPFLAGS"
    207 CPPFLAGS="$PROJ_CPPFLAGS"
    208 AC_CHECK_HEADERS([proj_api.h],
    209                  [], [AC_MSG_ERROR([could not find headers include related to PROJ4])])
    210 
    211 AC_SUBST([PROJ_CPPFLAGS])
    212 AC_SUBST([PROJ_LDFLAGS])
    213 
    214 # ===========================================================================
    215 # Detect if libxml2 is installed
    216 # ===========================================================================
    217 
    218 AC_ARG_WITH([xml2config],
    219         [AS_HELP_STRING([--with-xml2config=FILE], [specify an alternative xml2-config file])],
    220         [XML2CONFIG="$withval"], [XML2CONFIG=""])
    221 
    222 if test "x$XML2CONFIG" = "x"; then
    223         # XML2CONFIG was not specified, so search within the current path
    224         AC_PATH_PROG([XML2CONFIG], [xml2-config])
    225 
    226         # If we couldn't find xml2-config, display a warning
    227         if test "x$XML2CONFIG" = "x"; then
    228                 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.])
    229         fi
    230 else
    231         # XML2CONFIG was specified; display a message to the user
    232         if test "x$XML2CONFIG" = "xyes"; then
    233                 AC_MSG_ERROR([you must specify a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config])
    234         else
    235                 if test -f $XML2CONFIG; then
    236                         AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG])
    237                 else
    238                         AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist])
    239                 fi     
    240         fi
    241 fi
    242 
    243 # Extract the linker and include flags
    244 XML2_LDFLAGS=`$XML2CONFIG --libs`
    245 XML2_CPPFLAGS=`$XML2CONFIG --cflags`
    246 
    247 # Check headers file
    248 CPPFLAGS_SAVE="$CPPFLAGS"
    249 CPPFLAGS="$XML2_CPPFLAGS"
    250 AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h],
    251                  [], [AC_MSG_ERROR([could not find headers include related to libxml2])])
    252 
    253 # Ensure we can link against libxml2
    254 LIBS_SAVE="$LIBS"
    255 LIBS="$XML2_LDFLAGS"
    256 AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
    257 
    258 AC_SUBST([XML2_CPPFLAGS])
    259 AC_SUBST([XML2_LDFLAGS])
    260 
    261 
    262 
    263 # ===========================================================================
    264 # Detect if libxslt is installed
    265 # ===========================================================================
    266 
    267 AC_ARG_WITH([xsltconfig],
    268         [AS_HELP_STRING([--with-xsltconfig=FILE], [specify an alternative xslt-config file])],
    269         [XSLTCONFIG="$withval"], [XSLTCONFIG=""])
    270 
    271 if test "x$XSLTCONFIG" = "x"; then
    272         # XSLTCONFIG was not specified, so search within the current path
    273         AC_PATH_PROG([XSLTCONFIG], [xslt-config])
    274 
    275         # If we couldn't find xslt-config, display a warning
    276         if test "x$XSLTCONFIG" = "x"; then
    277                 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.])
    278         fi
    279 else
    280         # XSLTCONFIG was specified; display a message to the user
    281         if test "x$XSLTCONFIG" = "xyes"; then
    282                 AC_MSG_ERROR([you must specify a parameter to --with-xsltconfig, e.g. --with-xsltconfig=/path/to/xslt-config])
    283         else
    284                 if test -f $XSLTCONFIG; then
    285                         AC_MSG_RESULT([Using user-specified xslt-config file: $XSLTCONFIG])
    286                 else
    287                         AC_MSG_ERROR([the user-specified xslt-config file $XSLTCONFIG does not exist])
    288                 fi     
    289         fi
    290 fi
    291 
    292 # Extract the linker and include flags
    293 XSLT_LDFLAGS=`$XSLTCONFIG --libs`
    294 XSLT_CPPFLAGS=`$XSLTCONFIG --cflags`
    295 
    296 # Check headers file
    297 CPPFLAGS_SAVE="$CPPFLAGS"
    298 CPPFLAGS="$XSLT_CPPFLAGS"
    299 AC_CHECK_HEADERS([libxslt/xslt.h libxslt/xsltInternals.h libxslt/transform.h libxslt/xsltutils.h],
    300                  [], [AC_MSG_ERROR([could not find headers include related to libxlst])])
    301 
    302 AC_SUBST([XSLT_CPPFLAGS])
    303 AC_SUBST([XSLT_LDFLAGS])
    304 
    305 
    306 
    307 # ===========================================================================
    308 # Detect if libgeos is installed
    309 # ===========================================================================
    310 
    311 AC_ARG_WITH([geosconfig],
    312         [AS_HELP_STRING([--with-geosconfig=FILE], [specify an alternative geos-config file])],
    313         [GEOSCONFIG="$withval"], [GEOSCONFIG=""])
    314 
    315 if test "x$GEOSCONFIG" = "x"; then
    316         # GEOSCONFIG was not specified, so search within the current path
    317         AC_PATH_PROG([GEOSCONFIG], [geos-config])
    318 
    319         # If we couldn't find geos-config, display a warning
    320         if test "x$GEOSCONFIG" = "x"; then
    321                 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.])
    322         fi
    323 else
    324         # GEOSCONFIG was specified; display a message to the user
    325         if test "x$GEOSCONFIG" = "xyes"; then
    326                 AC_MSG_WARN([you must specify a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config])
    327         else
    328                 if test -f $GEOSCONFIG; then
    329                         AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG])
    330                 else
    331                         AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist])
    332                 fi     
    333         fi
    334 fi
    335 
    336 GEOS_LDFLAGS=`$GEOSCONFIG --libs`
    337 GEOS_CPPFLAGS=`$GEOSCONFIG --cflags`
    338 
    339 # Check headers file
    340 CPPFLAGS_SAVE="$CPPFLAGS"
    341 CPPFLAGS="$GEOS_CPPFLAGS"
    342 AC_CHECK_HEADERS([geos_c.h],
    343                  [], [AC_MSG_WARN([could not find headers include related to libgeos])])
    344 
    345 AC_SUBST([GEOS_CPPFLAGS])
    346 AC_SUBST([GEOS_LDFLAGS])
    347 
    348 
    349 # ===========================================================================
    350 # Detect if cgal is installed
    351 # ===========================================================================
    352 
    353 AC_ARG_WITH([cgal],
    354         [AS_HELP_STRING([--with-cgal=PATH], [specify an alternative location for CGAL setup])],
    355         [CGALPATH="$withval"], [CGALPATH="/usr"])
    356 
    357 
    358 # Check headers file
    359 CPPFLAGS_SAVE="$CPPFLAGS"
    360 CPPFLAGS="$CGAL_CPPFLAGS"
    361 AC_CHECK_HEADERS([CGAL/Delaunay_triangulation_2.h],
    362          [], [AC_MSG_WARN([could not find headers include related to libgeos])])
    363 
    364 # Extract the linker and include flags
    365 CGAL_LDFLAGS="-L$CGALPATH/lib"
    366 CGAL_CPPFLAGS="-I$CGALPATH/include"
    367 
    368 
    369 AC_SUBST([CGAL_CPPFLAGS])
    370 AC_SUBST([CGAL_LDFLAGS])
    371 #============================================================================
    372 # Detect if mapserver is installed
    373 #============================================================================
    374 
    375 AC_ARG_WITH([mapserver],
    376        [AS_HELP_STRING([--with-mapserver=PATH], [specify the path for MapServer compiled source tree])],
    377        [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""])
    378 
    379 if test -z $MS_SRC_PATH;
    380 then
    381         MS_CPPFLAGS=""
    382         MS_LDFLAGS=""
    383 else
    384        if test "x$MS_SRC_PATH" = "xmacos";
    385        then
    386                MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl"
    387                MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver "
    388                AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree])
    389                AC_MSG_RESULT([Using MacOS X Framework for MapServer])
    390        else
    391                if test -d $MS_SRC_PATH; then
    392                        MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`"
    393                        MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH "
    394                
    395                        AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
    396                else
    397                        AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist])
    398                fi
    399        fi
    400        MS_FILE="service_internal_ms.o"
    401 fi
    402 
    403 MS_CFLAGS="$MS_CPPFLAGS"
    404 MS_LIBS="$MS_LDFLAGS"
    405 
    406 AC_SUBST([MS_CFLAGS])
    407 AC_SUBST([MS_LIBS])
    408 AC_SUBST([MS_FILE])
    409 
    410 # ===========================================================================
    411 # Detect if ruby is installed
    412 # ===========================================================================
    413 AC_ARG_WITH([ruby],
    414         [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation,  disabled by default])],
    415         [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""])
    416 
    417 AC_ARG_WITH([rvers],
    418         [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])],
    419         [RUBY_VERS="$withval"], [RUBY_VERS=""])
    420 
    421 
    422 if test -z "$RUBY_ENABLED"
    423 then
    424         RUBY_FILE=""
    425 else
    426         RUBY_FILE="service_internal_ruby.o"
    427 
    428         # Extract the linker and include flags
    429         RUBY_LDFLAGS="-lruby"
    430         RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS"
    431 
    432         # Check headers file
    433         CPPFLAGS_SAVE="$CPPFLAGS"
    434         CPPFLAGS="$RUBY_CPPFLAGS"
    435         AC_CHECK_HEADERS([ruby.h],
    436                  [], [AC_MSG_ERROR([could not find headers include related to libruby])])
    437 
    438         # Ensure we can link against libphp
    439         LIBS_SAVE="$LIBS"
    440         LIBS="$RUBY_LDFLAGS"
    441         # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
    442         AC_SUBST([RUBY_CPPFLAGS])
    443         AC_SUBST([RUBY_LDFLAGS])
    444 fi
    445 
    446 AC_SUBST([RUBY_ENABLED])
    447 AC_SUBST([RUBY_FILE])
    44852
    44953# ===========================================================================
     
    500104AC_SUBST([PYTHON_ENABLED])
    501105AC_SUBST([PYTHON_FILE])
    502 
    503 # ===========================================================================
    504 # Detect if php is installed
    505 # ===========================================================================
    506 
    507 AC_ARG_WITH([php],
    508         [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation,  disabled by default])],
    509         [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""])
    510 
    511 
    512 if test -z "$PHP_ENABLED"
    513 then
    514         PHP_FILE=""
    515 else
    516         PHPCONFIG="$PHP_PATH/bin/php-config"
    517         PHP_FILE="service_internal_php.o"
    518         if test  "$PHP_PATH" = "yes"
    519         then
    520                 # PHP was not specified, so search within the current path
    521                 AC_PATH_PROG([PHPCONFIG], [php-config])
    522         else
    523                 PHPCONFIG="$PHP_PATH/bin/php-config"
    524         fi
    525 
    526         # Extract the linker and include flags
    527         PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
    528         PHP_CPPFLAGS=`$PHPCONFIG --includes`
    529 
    530         # Check headers file
    531         CPPFLAGS_SAVE="$CPPFLAGS"
    532         CPPFLAGS="$PHP_CPPFLAGS"
    533         AC_CHECK_HEADERS([sapi/embed/php_embed.h],
    534                  [], [AC_MSG_ERROR([could not find headers include related to libphp])])
    535 
    536         # Ensure we can link against libphp
    537         LIBS_SAVE="$LIBS"
    538         LIBS="$PHP_LDFLAGS"
    539         # Shouldn't we get php here rather than php5 :) ??
    540         AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
    541         AC_SUBST([PHP_CPPFLAGS])
    542         AC_SUBST([PHP_LDFLAGS])
    543 fi
    544 
    545 AC_SUBST([PHP_ENABLED])
    546 AC_SUBST([PHP_FILE])
    547 
    548 # ===========================================================================
    549 # Detect if perl is installed
    550 # ===========================================================================
    551 
    552 AC_ARG_WITH([perl],
    553         [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation,  disabled by default])],
    554         [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""])
    555 
    556 
    557 if test -z "$PERL_ENABLED"
    558 then
    559         PERL_FILE=""
    560 else
    561         PERL_FILE="service_internal_perl.o"
    562         if test  "$PERL_PATH" = "yes"
    563         then
    564                 # Perl was not specified, so search within the current path
    565                 AC_PATH_PROG([PERLCONFIG], [perl])
    566         else
    567                 PERLCONFIG="$PERL_PATH/bin/perl"
    568         fi
    569 
    570         # Extract the linker and include flags
    571         PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts`
    572         PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts`
    573 
    574         # Check headers file
    575         CPPFLAGS_SAVE="$CPPFLAGS"
    576         CPPFLAGS="$PERL_CPPFLAGS"
    577         AC_CHECK_HEADERS([EXTERN.h],
    578                  [], [AC_MSG_ERROR([could not find headers include related to libperl])])
    579 
    580         AC_SUBST([PERL_CPPFLAGS])
    581         AC_SUBST([PERL_LDFLAGS])
    582 fi
    583 
    584 AC_SUBST([PERL_ENABLED])
    585 AC_SUBST([PERL_FILE])
    586 
    587 # ===========================================================================
    588 # Detect if java is installed
    589 # ===========================================================================
    590 
    591 AC_ARG_WITH([java],
    592         [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME,  disabled by default])],
    593         [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""])
    594 
    595 if test -z "$JAVA_ENABLED"
    596 then
    597         JAVA_FILE=""
    598 else
    599         JAVA_FILE="service_internal_java.o"
    600         if test "x$JDKHOME" = "x";
    601         then
    602                 AC_MSG_ERROR([could not find java installation path within the current path. You may need to try re-running configure with a --with-java parameter.])
    603         fi      # JAVA was specified; display a message to the user
    604         if test "x$JDKHOME" = "xyes";
    605         then
    606                 AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java])
    607         fi
    608 
    609         # Extract the linker and include flags
    610         if test "x$JDKHOME" = "xmacos";
    611         then
    612                 JAVA_LDFLAGS="-framework JavaVM"
    613                 JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
    614         else
    615                 if test -d "$JDKHOME/jre/lib/i386";
    616                 then
    617                         JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/server/ -ljvm -lpthread"
    618                         JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
    619                 else
    620                         JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/server/ -ljvm -lpthread"
    621                         JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
    622                 fi
    623         fi
    624 
    625         # Check headers file (second time we check that in fact)
    626         CPPFLAGS_SAVE="$CPPFLAGS"
    627         CPPFLAGS="$JAVA_CPPFLAGS"
    628         AC_CHECK_HEADERS([jni.h],
    629                          [], [AC_MSG_ERROR([could not find jni.h file])])
    630 
    631         # Ensure we can link against libjava
    632         LIBS_SAVE="$LIBS"
    633         LIBS="$JAVA_LDFLAGS"
    634         if test "x$JDKHOME" != "xmacos";
    635         then
    636                 AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjvm])], [])
    637         fi
    638 
    639         AC_SUBST([JAVA_CPPFLAGS])
    640         AC_SUBST([JAVA_LDFLAGS])
    641 fi
    642 
    643 AC_SUBST([JAVA_ENABLED])
    644 AC_SUBST([JAVA_FILE])
    645106
    646107# ===========================================================================
     
    707168AC_SUBST([JS_FILE])
    708169
     170# ===========================================================================
     171# Detect if php is installed
     172# ===========================================================================
     173
     174AC_ARG_WITH([php],
     175        [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation,  disabled by default])],
     176        [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""])
     177
     178
     179if test -z "$PHP_ENABLED"
     180then
     181        PHP_FILE=""
     182else
     183        PHPCONFIG="$PHP_PATH/bin/php-config"
     184        PHP_FILE="service_internal_php.o"
     185        if test  "$PHP_PATH" = "yes"
     186        then
     187                # PHP was not specified, so search within the current path
     188                AC_PATH_PROG([PHPCONFIG], [php-config])
     189        else
     190                PHPCONFIG="$PHP_PATH/bin/php-config"
     191        fi
     192
     193        # Extract the linker and include flags
     194        PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
     195        PHP_CPPFLAGS=`$PHPCONFIG --includes`
     196
     197        # Check headers file
     198        CPPFLAGS_SAVE="$CPPFLAGS"
     199        CPPFLAGS="$PHP_CPPFLAGS"
     200        AC_CHECK_HEADERS([sapi/embed/php_embed.h],
     201                 [], [AC_MSG_ERROR([could not find headers include related to libphp])])
     202
     203        # Ensure we can link against libphp
     204        LIBS_SAVE="$LIBS"
     205        LIBS="$PHP_LDFLAGS"
     206        # Shouldn't we get php here rather than php5 :) ??
     207        AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
     208        AC_SUBST([PHP_CPPFLAGS])
     209        AC_SUBST([PHP_LDFLAGS])
     210fi
     211
     212AC_SUBST([PHP_ENABLED])
     213AC_SUBST([PHP_FILE])
     214
     215# ===========================================================================
     216# Detect if java is installed
     217# ===========================================================================
     218
     219AC_ARG_WITH([java],
     220        [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME,  disabled by default])],
     221        [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""])
     222
     223if test -z "$JAVA_ENABLED"
     224then
     225        JAVA_FILE=""
     226else
     227        JAVA_FILE="service_internal_java.o"
     228        if test "x$JDKHOME" = "x";
     229        then
     230                AC_MSG_ERROR([could not find java installation path within the current path. You may need to try re-running configure with a --with-java parameter.])
     231        fi      # JAVA was specified; display a message to the user
     232        if test "x$JDKHOME" = "xyes";
     233        then
     234                AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java])
     235        fi
     236
     237        # Extract the linker and include flags
     238        if test "x$JDKHOME" = "xmacos";
     239        then
     240                JAVA_LDFLAGS="-framework JavaVM"
     241                JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
     242        else
     243                if test -d "$JDKHOME/jre/lib/i386";
     244                then
     245                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/server/ -ljvm -lpthread"
     246                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
     247                else
     248                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/server/ -ljvm -lpthread"
     249                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
     250                fi
     251        fi
     252
     253        # Check headers file (second time we check that in fact)
     254        CPPFLAGS_SAVE="$CPPFLAGS"
     255        CPPFLAGS="$JAVA_CPPFLAGS"
     256        AC_CHECK_HEADERS([jni.h],
     257                         [], [AC_MSG_ERROR([could not find jni.h file])])
     258
     259        # Ensure we can link against libjava
     260        LIBS_SAVE="$LIBS"
     261        LIBS="$JAVA_LDFLAGS"
     262        if test "x$JDKHOME" != "xmacos";
     263        then
     264                AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjvm])], [])
     265        fi
     266
     267        AC_SUBST([JAVA_CPPFLAGS])
     268        AC_SUBST([JAVA_LDFLAGS])
     269fi
     270
     271AC_SUBST([JAVA_ENABLED])
     272AC_SUBST([JAVA_FILE])
     273
     274# ===========================================================================
     275# Detect if ruby is installed
     276# ===========================================================================
     277AC_ARG_WITH([ruby],
     278        [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation,  disabled by default])],
     279        [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""])
     280
     281AC_ARG_WITH([rvers],
     282        [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])],
     283        [RUBY_VERS="$withval"], [RUBY_VERS=""])
     284
     285
     286if test -z "$RUBY_ENABLED"
     287then
     288        RUBY_FILE=""
     289else
     290        RUBY_FILE="service_internal_ruby.o"
     291
     292        # Extract the linker and include flags
     293        RUBY_LDFLAGS="-lruby"
     294        RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS"
     295
     296        # Check headers file
     297        CPPFLAGS_SAVE="$CPPFLAGS"
     298        CPPFLAGS="$RUBY_CPPFLAGS"
     299        AC_CHECK_HEADERS([ruby.h],
     300                 [], [AC_MSG_ERROR([could not find headers include related to libruby])])
     301
     302        # Ensure we can link against libphp
     303        LIBS_SAVE="$LIBS"
     304        LIBS="$RUBY_LDFLAGS"
     305        # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
     306        AC_SUBST([RUBY_CPPFLAGS])
     307        AC_SUBST([RUBY_LDFLAGS])
     308fi
     309
     310AC_SUBST([RUBY_ENABLED])
     311AC_SUBST([RUBY_FILE])
     312
     313# ===========================================================================
     314# Detect if perl is installed
     315# ===========================================================================
     316
     317AC_ARG_WITH([perl],
     318        [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation,  disabled by default])],
     319        [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""])
     320
     321
     322if test -z "$PERL_ENABLED"
     323then
     324        PERL_FILE=""
     325else
     326        PERL_FILE="service_internal_perl.o"
     327        if test  "$PERL_PATH" = "yes"
     328        then
     329                # Perl was not specified, so search within the current path
     330                AC_PATH_PROG([PERLCONFIG], [perl])
     331        else
     332                PERLCONFIG="$PERL_PATH/bin/perl"
     333        fi
     334
     335        # Extract the linker and include flags
     336        PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts`
     337        PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts`
     338
     339        # Check headers file
     340        CPPFLAGS_SAVE="$CPPFLAGS"
     341        CPPFLAGS="$PERL_CPPFLAGS"
     342        AC_CHECK_HEADERS([EXTERN.h],
     343                 [], [AC_MSG_ERROR([could not find headers include related to libperl])])
     344
     345        AC_SUBST([PERL_CPPFLAGS])
     346        AC_SUBST([PERL_LDFLAGS])
     347fi
     348
     349AC_SUBST([PERL_ENABLED])
     350AC_SUBST([PERL_FILE])
     351
     352# ===========================================================================
     353# Detect if otb is available
     354# ===========================================================================
     355
     356AC_ARG_WITH([itk],
     357        [AS_HELP_STRING([--with-itk=PATH], [specify an alternative location for the itk library])],
     358        [ITKPATH="$withval"], [ITKPATH=""])
     359
     360AC_ARG_WITH([itk-version],
     361        [AS_HELP_STRING([--with-itk-version=VERSION], [specify an alternative version for the itk library])],
     362        [ITKVERS="$withval"], [ITKVERS=""])
     363
     364AC_ARG_WITH([otb],
     365        [AS_HELP_STRING([--with-otb=PATH], [specify an alternative location for the otb library])],
     366        [OTBPATH="$withval"], [OTBPATH=""])
     367
     368if test -z "$OTBPATH"
     369then
     370        OTB_LDFLAGS=""
     371        OTB_CPPFLAGS=""
     372        OTB_FILE=""
     373        OTB_ENABLED=""
     374else
     375    if test -z "$ITKVERS"
     376    then
     377        ITKVERS="4.5"
     378    fi
     379        OTB_ENABLED="-DUSE_OTB"
     380        OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib -lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkdouble-conversion-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS -litkzlib-$ITKVERS"
     381        OTB_CPPFLAGS="-I$OTBPATH/include/otb/ApplicationEngine -I$OTBPATH/include/otb/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTBPATH/include/otb/Utilities/ITK -I$OTBPATH/include/otb/ -I$OTBPATH/include/otb/IO -I$OTBPATH/include/otb/UtilitiesAdapters/OssimAdapters -I$OTBPATH/include/otb/UtilitiesAdapters/CurlAdapters -I$OTBPATH/include/otb/Utilities/BGL -I$OTBPATH/include/otb/UtilitiesAdapters/ITKPendingPatches -I$OTBPATH/include/otb/Utilities/otbconfigfile $GDAL_CFLAGS"
     382        OTB_FILE="otbZooWatcher.o service_internal_otb.o"
     383       
     384        AC_LANG_PUSH([C++])
     385        # Check headers file
     386        CPPFLAGS_SAVE="$CPPFLAGS"
     387        CPPFLAGS="$OTB_CPPFLAGS"
     388        LDFLAGS_SAVE="$LDFLAGS"
     389        LDFLAGS="$OTB_LDFLAGS"
     390        AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h],
     391                        [], [AC_MSG_ERROR([could not find header file $i related to OTB])])
     392        AC_LANG_POP([C++])
     393fi
     394AC_SUBST([OTB_CPPFLAGS])
     395AC_SUBST([OTB_LDFLAGS])
     396AC_SUBST([OTB_FILE])
     397AC_SUBST([OTB_ENABLED])
     398
     399# ===========================================================================
     400# Detect if saga-gis is available
     401# ===========================================================================
     402
     403AC_ARG_WITH([wx-config],
     404        [AS_HELP_STRING([--with-wx-config=PATH], [specify an alternative path for the wx-config tool])],
     405        [WXCFG="$withval"], [WXCFG=""])
     406
     407AC_ARG_WITH([saga],
     408        [AS_HELP_STRING([--with-saga=PATH], [specify an alternative location for the SAGA-GIS library])],
     409        [SAGAPATH="$withval"], [SAGAPATH=""])
     410
     411if test -z "$SAGAPATH"
     412then
     413        SAGA_LDFLAGS=""
     414        SAGA_CPPFLAGS=""
     415        SAGA_FILE=""
     416        SAGA_ENABLED=""
     417else
     418        if test -z "$WXCFG" ; then
     419           WXCFG="$(which wx-config)"
     420        fi
     421        if test "`$WXCFG --list | grep unicode`" == "" ; then
     422           AC_MSG_ERROR(SAGA requires a unicode build of wxGTK)
     423        fi
     424        WX_ISSUE="-D_WX_WXCRTVARARG_H_"
     425        SAGA_DEFS="-D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DMODULE_LIBRARY_PATH=\\\"$SAGAPATH/lib/saga\\\""
     426        SAGA_CPPFLAGS=" -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE"
     427        SAGA_LDFLAGS="-fPIC `$WXCFG --unicode=yes --static=no --libs` -lsaga_api"
     428        SAGA_ENABLED="-DUSE_SAGA"
     429        SAGA_FILE="service_internal_saga.o"
     430       
     431        AC_LANG_PUSH([C++])
     432        # Check headers file
     433        CPPFLAGS_SAVE="$CPPFLAGS"
     434        CPPFLAGS="$SAGA_CPPFLAGS"
     435        LIBS_SAVE="$LIBS"
     436        LIBS="$SAGA_LDFLAGS"
     437        AC_MSG_RESULT(CPPFLAGS are $CPPFLAGS)
     438        AC_CHECK_HEADERS([module_library.h],
     439                        [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])])
     440        LIBS_SAVE="$LIBS"
     441        AC_LANG_POP([C++])
     442        AC_CHECK_LIB([saga_api], [SG_Set_UI_Callback,SG_Get_Module_Library_Manager])
     443fi
     444AC_SUBST([SAGA_CPPFLAGS])
     445AC_SUBST([SAGA_LDFLAGS])
     446AC_SUBST([SAGA_FILE])
     447AC_SUBST([SAGA_ENABLED])
     448
     449# ===========================================================================
     450# Detect if libyaml is available
     451# ===========================================================================
     452
     453AC_ARG_WITH([yaml],
     454        [AS_HELP_STRING([--with-yaml=PATH], [specify an alternative location for the yaml library])],
     455        [YAMLPATH="$withval"], [YAMLPATH=""])
     456
     457if test -z "$YAMLPATH"
     458then
     459        YAML_LDFLAGS=""
     460        YAML_CPPFLAGS=""
     461        YAML_FILE=""
     462        YAML_FILE1=""
     463else
     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"
     480fi
     481AC_SUBST([YAML_CPPFLAGS])
     482AC_SUBST([YAML_LDFLAGS])
     483AC_SUBST([YAML_FILE])
     484AC_SUBST([YAML_FILE1])
     485
     486# ===========================================================================
     487# Detect if fastcgi is available
     488# ===========================================================================
     489
     490AC_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
     495FCGI_LDFLAGS="-L$FCGIPATH/lib"
     496FCGI_CPPFLAGS="-I$FCGIPATH/include"
     497
     498# Check headers file
     499CPPFLAGS_SAVE="$CPPFLAGS"
     500CPPFLAGS="$FCGI_CPPFLAGS"
     501LIBS_SAVE="$LIBS"
     502LIBS="$FCGI_LDFLAGS"
     503AC_CHECK_LIB([fcgi], [main])
     504AC_CHECK_HEADERS([fcgi_stdio.h],
     505                 [], [AC_MSG_ERROR([could not find headers include related to fastcgi])])
     506LIBS="$LIBS_SAVE"
     507AC_SUBST([FCGI_CPPFLAGS])
     508AC_SUBST([FCGI_LDFLAGS])
     509
     510
     511# ===========================================================================
     512# Detect if libxml2 is installed
     513# ===========================================================================
     514
     515AC_ARG_WITH([xml2config],
     516        [AS_HELP_STRING([--with-xml2config=FILE], [specify an alternative xml2-config file])],
     517        [XML2CONFIG="$withval"], [XML2CONFIG=""])
     518
     519if 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
     527else
     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
     538fi
     539
     540# Extract the linker and include flags
     541XML2_LDFLAGS=`$XML2CONFIG --libs`
     542XML2_CPPFLAGS=`$XML2CONFIG --cflags`
     543
     544# Check headers file
     545CPPFLAGS_SAVE="$CPPFLAGS"
     546CPPFLAGS="$XML2_CPPFLAGS"
     547AC_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
     551LIBS_SAVE="$LIBS"
     552LIBS="$XML2_LDFLAGS"
     553AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
     554
     555AC_SUBST([XML2_CPPFLAGS])
     556AC_SUBST([XML2_LDFLAGS])
     557
     558# ===========================================================================
     559# Detect if libxslt is installed
     560# ===========================================================================
     561
     562AC_ARG_WITH([xsltconfig],
     563        [AS_HELP_STRING([--with-xsltconfig=FILE], [specify an alternative xslt-config file])],
     564        [XSLTCONFIG="$withval"], [XSLTCONFIG=""])
     565
     566if 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
     574else
     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
     585fi
     586
     587# Extract the linker and include flags
     588XSLT_LDFLAGS=`$XSLTCONFIG --libs`
     589XSLT_CPPFLAGS=`$XSLTCONFIG --cflags`
     590
     591# Check headers file
     592CPPFLAGS_SAVE="$CPPFLAGS"
     593CPPFLAGS="$XSLT_CPPFLAGS"
     594AC_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
     597AC_SUBST([XSLT_CPPFLAGS])
     598AC_SUBST([XSLT_LDFLAGS])
     599
     600#============================================================================
     601# Detect if gdal is installed
     602#============================================================================
     603
     604AC_ARG_WITH([gdal-config],
     605        [AS_HELP_STRING([--with-gdal-config=FILE], [specify an alternative gdal-config file])],
     606        [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""])
     607if test -z $GDAL_CONFIG;
     608then
     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       
     615else
     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
     621fi
     622
     623GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
     624GDAL_LIBS="`$GDAL_CONFIG --libs`"
     625
     626AC_SUBST([GDAL_CFLAGS])
     627AC_SUBST([GDAL_LIBS])
     628
     629# ===========================================================================
     630# Detect if proj is installed
     631# ===========================================================================
     632
     633AC_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
     638PROJ_LDFLAGS="-L$PROJPATH/lib"
     639PROJ_CPPFLAGS="-I$PROJPATH/include"
     640
     641# Check headers file
     642CPPFLAGS_SAVE="$CPPFLAGS"
     643CPPFLAGS="$PROJ_CPPFLAGS"
     644AC_CHECK_HEADERS([proj_api.h],
     645                 [], [AC_MSG_ERROR([could not find headers include related to PROJ4])])
     646
     647AC_SUBST([PROJ_CPPFLAGS])
     648AC_SUBST([PROJ_LDFLAGS])
     649
     650# ===========================================================================
     651# Detect if libgeos is installed
     652# ===========================================================================
     653
     654AC_ARG_WITH([geosconfig],
     655        [AS_HELP_STRING([--with-geosconfig=FILE], [specify an alternative geos-config file])],
     656        [GEOSCONFIG="$withval"], [GEOSCONFIG=""])
     657
     658if 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
     666else
     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
     677fi
     678
     679GEOS_LDFLAGS=`$GEOSCONFIG --libs`
     680GEOS_CPPFLAGS=`$GEOSCONFIG --cflags`
     681
     682# Check headers file
     683CPPFLAGS_SAVE="$CPPFLAGS"
     684CPPFLAGS="$GEOS_CPPFLAGS"
     685AC_CHECK_HEADERS([geos_c.h],
     686                 [], [AC_MSG_WARN([could not find headers include related to libgeos])])
     687
     688AC_SUBST([GEOS_CPPFLAGS])
     689AC_SUBST([GEOS_LDFLAGS])
     690
     691
     692# ===========================================================================
     693# Detect if cgal is installed
     694# ===========================================================================
     695
     696AC_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
     702CPPFLAGS_SAVE="$CPPFLAGS"
     703CPPFLAGS="$CGAL_CPPFLAGS"
     704AC_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
     708CGAL_LDFLAGS="-L$CGALPATH/lib"
     709CGAL_CPPFLAGS="-I$CGALPATH/include"
     710
     711
     712AC_SUBST([CGAL_CPPFLAGS])
     713AC_SUBST([CGAL_LDFLAGS])
     714#============================================================================
     715# Detect if mapserver is installed
     716#============================================================================
     717
     718AC_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
     722if test -z $MS_SRC_PATH;
     723then
     724        MS_CPPFLAGS=""
     725        MS_LDFLAGS=""
     726else
     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"
     744fi
     745
     746MS_CFLAGS="$MS_CPPFLAGS"
     747MS_LIBS="$MS_LDFLAGS"
     748
     749AC_SUBST([MS_CFLAGS])
     750AC_SUBST([MS_LIBS])
     751AC_SUBST([MS_FILE])
     752
    709753AC_CONFIG_FILES([Makefile])
    710754AC_CONFIG_FILES([ZOOMakefile.opts])
  • trunk/zoo-project/zoo-kernel/service_conf.l

    r621 r634  
    3535%}
    3636
    37 
    3837S               [ \t\r\n]+
    3938
     
    4746
    4847attname [a-zA-Z0-9._\-]+
    49 attvalue1       [#°²θé\^\*\+,;?!~`ú@a-zA-Z0-9%_\-:\:.:" "\"\'/\\\(\)\t\|\$\&>\[\]]+
     48attvalue1       [\x80-\xbf\xc2-\xdf\xe0-\xef\xf0-\xf4#°²θé\^\*\+\,\;?!~`ú@a-zA-Z0-9%_\-:\:.:" "\"\'/\\\(\)\t\|\$\&>\[\]]+
    5049
    5150attvalue                \"[^"]*\"|\'[^']*\'\(\)
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r633 r634  
    22492249    if(e!=NULL){
    22502250      if(strncasecmp(e->format,"LiteralOutput",strlen(e->format))==0)
    2251          nc3=xmlNewNode(ns_wps, BAD_CAST "LiteralData");
     2251        nc3=xmlNewNode(ns_wps, BAD_CAST "LiteralData");
    22522252      else
    22532253        if(strncasecmp(e->format,"ComplexOutput",strlen(e->format))==0)
    2254                    nc3=xmlNewNode(ns_wps, BAD_CAST "ComplexData");
    2255           else if(strncasecmp(e->format,"BoundingBoxOutput",strlen(e->format))==0)
    2256             nc3=xmlNewNode(ns_wps, BAD_CAST "BoundingBoxData");
    2257           else
    2258             nc3=xmlNewNode(ns_wps, BAD_CAST e->format);
     2254          nc3=xmlNewNode(ns_wps, BAD_CAST "ComplexData");
     2255        else if(strncasecmp(e->format,"BoundingBoxOutput",strlen(e->format))==0)
     2256          nc3=xmlNewNode(ns_wps, BAD_CAST "BoundingBoxData");
     2257        else
     2258          nc3=xmlNewNode(ns_wps, BAD_CAST e->format);
    22592259    }
    22602260    else {
    22612261      map* tmpV=getMapFromMaps(m,"format","value");
    22622262      if(tmpV!=NULL)
    2263             nc3=xmlNewNode(ns_wps, BAD_CAST tmpV->value);
     2263        nc3=xmlNewNode(ns_wps, BAD_CAST tmpV->value);
    22642264      else
    2265             nc3=xmlNewNode(ns_wps, BAD_CAST "LiteralData");
     2265        nc3=xmlNewNode(ns_wps, BAD_CAST "LiteralData");
    22662266    }
    22672267    tmp=m->content;
     
    22692269    while(tmp!=NULL){
    22702270      if(strcasecmp(tmp->name,"mimeType")==0 ||
    2271              strcasecmp(tmp->name,"encoding")==0 ||
    2272              strcasecmp(tmp->name,"schema")==0 ||
    2273              strcasecmp(tmp->name,"datatype")==0 ||
    2274              strcasecmp(tmp->name,"uom")==0) {
    2275 
    2276             xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value);
     2271         strcasecmp(tmp->name,"encoding")==0 ||
     2272         strcasecmp(tmp->name,"schema")==0 ||
     2273         strcasecmp(tmp->name,"datatype")==0 ||
     2274         strcasecmp(tmp->name,"uom")==0) {
     2275
     2276        xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value);
    22772277      }
    22782278      tmp=tmp->next;
     
    22822282      map* bb=getMap(m->content,"value");
    22832283      if(bb!=NULL) {
    2284             map* tmpRes=parseBoundingBox(bb->value);
    2285             printBoundingBox(ns_ows,nc3,tmpRes);
    2286             freeMap(&tmpRes);
    2287             free(tmpRes);
    2288       }
    2289     }
    2290         else {
     2284        map* tmpRes=parseBoundingBox(bb->value);
     2285        printBoundingBox(ns_ows,nc3,tmpRes);
     2286        freeMap(&tmpRes);
     2287        free(tmpRes);
     2288      }
     2289    }
     2290    else {
    22912291      if(e!=NULL)
    2292             tmp=getMap(e->defaults->content,"mimeType");
     2292        tmp=getMap(e->defaults->content,"mimeType");
    22932293      else
    2294             tmp=NULL;
     2294        tmp=NULL;
    22952295       
    2296         map* tmp1=getMap(m->content,"encoding");
    2297         map* tmp2=getMap(m->content,"mimeType");
    2298         map* tmp3=getMap(m->content,"value");
    2299         int hasValue=1;
    2300         if(tmp3==NULL){
    2301               tmp3=createMap("value","");
    2302               hasValue=-1;
    2303         }
    2304 
    2305        if( ( tmp1 != NULL && strncmp(tmp1->value,"base64",6) == 0 )  // if encoding is base64
    2306                 ||                                                           // or if
    2307                 ( tmp2 != NULL && ( strstr(tmp2->value,"text") == NULL //  mime type is not text
    2308                                     &&                                   //  nor
    2309                                                             strstr(tmp2->value,"xml") == NULL  //  xml
    2310                                                                 &&                                          // nor
    2311                                                                 strstr(tmp2->value,"javascript") == NULL  // javascript
    2312                                                                 &&
    2313                                                                 strstr(tmp2->value,"json") == NULL
    2314                                                                 &&
    2315                                                                 strstr(tmp2->value,"ecmascript") == NULL
    2316                                                                 &&
    2317                                                                 // include for backwards compatibility,
    2318                                                                 // although correct mime type is ...kml+xml:
    2319                                                                 strstr(tmp2->value,"google-earth.kml") == NULL                                                         
    2320                                                           )
    2321                 )
    2322                   ) {                                                      // then     
    2323               map* rs=getMap(m->content,"size");                       // obtain size
    2324               bool isSized=true;
    2325               if(rs==NULL){
    2326                 char tmp1[1024];
    2327                 sprintf(tmp1,"%ld",strlen(tmp3->value));
    2328                 rs=createMap("size",tmp1);
    2329                 isSized=false;
    2330               }
    2331 
    2332             xmlAddChild(nc3,xmlNewText(BAD_CAST base64(tmp3->value, atoi(rs->value))));  // base 64 encode in XML
     2296      map* tmp1=getMap(m->content,"encoding");
     2297      map* tmp2=getMap(m->content,"mimeType");
     2298      map* tmp3=getMap(m->content,"value");
     2299      int hasValue=1;
     2300      if(tmp3==NULL){
     2301        tmp3=createMap("value","");
     2302        hasValue=-1;
     2303      }
     2304
     2305      if( ( tmp1 != NULL && strncmp(tmp1->value,"base64",6) == 0 )     // if encoding is base64
     2306          ||                                                           // or if
     2307          ( tmp2 != NULL && ( strstr(tmp2->value,"text") == NULL       //  mime type is not text
     2308                              &&                                       //  nor
     2309                              strstr(tmp2->value,"xml") == NULL        //  xml
     2310                              &&                                       // nor
     2311                              strstr(tmp2->value,"javascript") == NULL // javascript
     2312                              &&
     2313                              strstr(tmp2->value,"json") == NULL
     2314                              &&
     2315                              strstr(tmp2->value,"ecmascript") == NULL
     2316                              &&
     2317                              // include for backwards compatibility,
     2318                              // although correct mime type is ...kml+xml:
     2319                              strstr(tmp2->value,"google-earth.kml") == NULL                                                    )
     2320            )
     2321          ) {                                                    // then       
     2322        map* rs=getMap(m->content,"size");                       // obtain size
     2323        bool isSized=true;
     2324        if(rs==NULL){
     2325          char tmp1[1024];
     2326          sprintf(tmp1,"%ld",strlen(tmp3->value));
     2327          rs=createMap("size",tmp1);
     2328          isSized=false;
     2329        }
     2330         
     2331        xmlAddChild(nc3,xmlNewText(BAD_CAST base64(tmp3->value, atoi(rs->value))));  // base 64 encode in XML
    23332332               
    2334             if(tmp1==NULL || (tmp1!=NULL && strncmp(tmp1->value,"base64",6)!=0)) {
    2335                xmlAttrPtr ap = xmlHasProp(nc3, BAD_CAST "encoding");
    2336                if (ap != NULL) {
    2337                   xmlRemoveProp(ap);
    2338                }                       
    2339                xmlNewProp(nc3,BAD_CAST "encoding",BAD_CAST "base64");
    2340                 }
     2333        if(tmp1==NULL || (tmp1!=NULL && strncmp(tmp1->value,"base64",6)!=0)) {
     2334          xmlAttrPtr ap = xmlHasProp(nc3, BAD_CAST "encoding");
     2335          if (ap != NULL) {
     2336            xmlRemoveProp(ap);
     2337          }                     
     2338          xmlNewProp(nc3,BAD_CAST "encoding",BAD_CAST "base64");
     2339        }
    23412340               
    2342             if(!isSized){
    2343               freeMap(&rs);
    2344               free(rs);
    2345             }
     2341        if(!isSized){
     2342          freeMap(&rs);
     2343          free(rs);
     2344        }
    23462345      }
    23472346      else if (tmp2!=NULL) {                                 // else (text-based format)
    2348             if(strstr(tmp2->value, "javascript") != NULL ||      //    if javascript put code in CDATA block
    2349                strstr(tmp2->value, "json") != NULL ||            //    (will not be parsed by XML reader)
    2350                strstr(tmp2->value, "ecmascript") != NULL
    2351                   ) {
    2352                xmlAddChild(nc3,xmlNewCDataBlock(doc,BAD_CAST tmp3->value,strlen(tmp3->value)));
    2353                 }   
    2354             else {                                                     // else
    2355                if (strstr(tmp2->value, "xml") != NULL ||                 // if XML-based format
    2356                            // include for backwards compatibility,
    2357                            // although correct mime type is ...kml+xml:           
    2358                    strstr(tmp2->value, "google-earth.kml") != NULL
    2359                           ) {
     2347        if(strstr(tmp2->value, "javascript") != NULL ||      //    if javascript put code in CDATA block
     2348           strstr(tmp2->value, "json") != NULL ||            //    (will not be parsed by XML reader)
     2349           strstr(tmp2->value, "ecmascript") != NULL
     2350           ) {
     2351          xmlAddChild(nc3,xmlNewCDataBlock(doc,BAD_CAST tmp3->value,strlen(tmp3->value)));
     2352        }   
     2353        else {                                                     // else
     2354          if (strstr(tmp2->value, "xml") != NULL ||                 // if XML-based format
     2355              // include for backwards compatibility,
     2356              // although correct mime type is ...kml+xml:                 
     2357              strstr(tmp2->value, "google-earth.kml") != NULL
     2358              ) {
    23602359                         
    2361                   int li=zooXmlAddDoc(tmp3->value);
    2362                   xmlDocPtr doc = iDocs[li];
    2363                   xmlNodePtr ir = xmlDocGetRootElement(doc);
    2364                   xmlAddChild(nc3,ir);
    2365                }
    2366                else                                                     // else
    2367                   xmlAddChild(nc3,xmlNewText(BAD_CAST tmp3->value));    //   add text node
    2368             }
    2369             xmlAddChild(nc2,nc3);
     2360            int li=zooXmlAddDoc(tmp3->value);
     2361            xmlDocPtr doc = iDocs[li];
     2362            xmlNodePtr ir = xmlDocGetRootElement(doc);
     2363            xmlAddChild(nc3,ir);
     2364          }
     2365          else                                                     // else     
     2366            xmlAddChild(nc3,xmlNewText(BAD_CAST tmp3->value));    //   add text node
     2367        }
     2368        xmlAddChild(nc2,nc3);
    23702369      }
    23712370      else {
    2372             xmlAddChild(nc3,xmlNewText(BAD_CAST tmp3->value));
     2371        xmlAddChild(nc3,xmlNewText(BAD_CAST tmp3->value));
    23732372      }
    23742373         
    23752374      if(hasValue<0) {
    2376             freeMap(&tmp3);
    2377             free(tmp3);
     2375        freeMap(&tmp3);
     2376        free(tmp3);
    23782377      }
    23792378    }
     
    23872386      xmlNewNsProp(nc3,ns_xlink,BAD_CAST "href",BAD_CAST tmpMap->value);
    23882387   
    2389         tmp=m->content;
     2388    tmp=m->content;
    23902389    while(tmp!=NULL) {
    23912390      if(strcasecmp(tmp->name,"mimeType")==0 ||
    2392              strcasecmp(tmp->name,"encoding")==0 ||
    2393              strcasecmp(tmp->name,"schema")==0 ||
    2394              strcasecmp(tmp->name,"datatype")==0 ||
    2395              strcasecmp(tmp->name,"uom")==0){
    2396 
    2397             if(strcasecmp(tmp->name,"datatype")==0)
    2398               xmlNewProp(nc3,BAD_CAST "mimeType",BAD_CAST "text/plain");
    2399             else
    2400               xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value);
     2391         strcasecmp(tmp->name,"encoding")==0 ||
     2392         strcasecmp(tmp->name,"schema")==0 ||
     2393         strcasecmp(tmp->name,"datatype")==0 ||
     2394         strcasecmp(tmp->name,"uom")==0){
     2395
     2396        if(strcasecmp(tmp->name,"datatype")==0)
     2397          xmlNewProp(nc3,BAD_CAST "mimeType",BAD_CAST "text/plain");
     2398        else
     2399          xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value);
    24012400      }
    24022401      tmp=tmp->next;
     
    26602659  free(tmpMap1->value);
    26612660  tmpMap1->value=(char*) malloc((count+1)*sizeof(char)); 
    2662   fread(tmpMap1->value,count,sizeof(char),file);
     2661  fread(tmpMap1->value,1,count,file);
     2662  tmpMap1->value[count]=0;
    26632663  fclose(file);
    2664   char rsize[100];
     2664  char rsize[1000];
    26652665  sprintf(rsize,"%ld",count);
    26662666  addToMap(content,"size",rsize);
     
    28332833              map* size=getMap(tmpI->content,"size");
    28342834              if(size!=NULL && toto!=NULL)
    2835                 fwrite(toto->value,1,atoi(size->value)*sizeof(char),ofile);
     2835                fwrite(toto->value,1,(atoi(size->value))*sizeof(char),ofile);
    28362836              else
    28372837                if(toto!=NULL && toto->value!=NULL)
     
    30443044  bmem = BIO_new(BIO_s_mem());
    30453045  b64 = BIO_push(b64, bmem);
    3046   BIO_write(b64, input, length+1);
     3046  BIO_write(b64, input, length);
    30473047  BIO_flush(b64);
    30483048  BIO_get_mem_ptr(b64, &bptr);
     
    30503050  char *buff = (char *)malloc((bptr->length+1)*sizeof(char));
    30513051  memcpy(buff, bptr->data, bptr->length);
    3052   buff[bptr->length-1] = 0;
     3052  buff[bptr->length] = 0;
    30533053
    30543054  BIO_free_all(b64);
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r631 r634  
    5858#ifdef USE_PYTHON
    5959#include "service_internal_python.h"
     60#endif
     61
     62#ifdef USE_SAGA
     63#include "service_internal_saga.h"
    6064#endif
    6165
     
    695699    }
    696700  else
     701
     702#ifdef USE_SAGA
     703  if (strncasecmp (r_inputs->value, "SAGA", 6) == 0)
     704    {
     705      *eres =
     706        zoo_saga_support (&m, request_inputs, s1,
     707                            &request_input_real_format,
     708                            &request_output_real_format);
     709    }
     710  else
     711#endif
    697712
    698713#ifdef USE_OTB
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