Skip to content
Commits on Source (3)
zoo-project (1.6.0+ds-1) UNRELEASED; urgency=medium
zoo-project (1.7.0+ds-1) UNRELEASED; urgency=medium
* Initial release (closes: #nnnnnn)
* New upstream release.
-- Angelos Tzotsos <gcpp.kalxas@gmail.com> Sun, 12 Jun 2016 00:20:00 +0200
-- Angelos Tzotsos <gcpp.kalxas@gmail.com> Fri, 19 Jul 2019 23:34:14 +0300
zoo-project (1.5.0+svn780-0~xenial0) xenial; urgency=low
......
......@@ -2,11 +2,11 @@ OS:=$(shell uname -s)
CPU:=$(shell uname -m)
ifeq ($(OS),Darwin)
MACOS_CFLAGS=-arch x86_64
LIBS= -L./ -lcgic /usr/lib/libfcgi.dylib
LIBS= -L./ -lcgic /usr/local/lib/libfcgi.dylib
else
LIBS= -L./ -lcgic /usr/lib/libfcgi.a
endif
CFLAGS=-g -Wall ${MACOS_CFLAGS}
CFLAGS=-I/usr/local/include -g -Wall ${MACOS_CFLAGS}
CC=gcc
AR=ar
RANLIB=ranlib
......
......@@ -96,25 +96,60 @@ void printVector(){
std::cout << " encoding = utf-8" << std::endl;
std::cout << " </Supported>" << std::endl;
std::cout << " <Supported>" << std::endl;
std::cout << " mimeType = application/json" << std::endl;
std::cout << " encoding = utf-8" << std::endl;
std::cout << " </Supported>" << std::endl;
std::cout << " <Supported>" << std::endl;
std::cout << " mimeType = application/zip" << std::endl;
std::cout << " </Supported>" << std::endl;
}
void printOutputImage(){
void printOutputImage(ImagePixelType pt){
std::cout << " <LiteralData>" << std::endl;
std::cout << " dataType = string" << std::endl;
std::cout << " <Default>" << std::endl;
// Check for the default pixel type
switch(pt){
case ImagePixelType_uint8:
std::cout << " value = uint8" << std::endl;
break;
case ImagePixelType_int16:
std::cout << " value = int16" << std::endl;
break;
case ImagePixelType_uint16:
std::cout << " value = uint16" << std::endl;
break;
case ImagePixelType_int32:
std::cout << " value = int32" << std::endl;
break;
case ImagePixelType_uint32:
std::cout << " value = uint8" << std::endl;
break;
case ImagePixelType_double:
std::cout << " value = uint8" << std::endl;
break;
default:
std::cout << " value = float" << std::endl;
std::cout << " AllowedValues = uint8,uint16,int16n,int32,int32,float,double" << std::endl;
break;
}
std::cout << " AllowedValues = uint8,uint16,int16,int32,int32,float,double" << std::endl;
std::cout << " </Default>" << std::endl;
std::cout << " </LiteralData>" << std::endl;
}
void printOutputComplexImage(){
void printOutputComplexImage(ComplexImagePixelType pt){
std::cout << " <LiteralData>" << std::endl;
std::cout << " dataType = string" << std::endl;
std::cout << " <Default>" << std::endl;
// Check for the default pixel type
switch(pt){
case ComplexImagePixelType_double:
std::cout << " value = cdouble" << std::endl;
break;
default:
std::cout << " value = cfloat" << std::endl;
break;
}
std::cout << " AllowedValues = cfloat,cdouble" << std::endl;
std::cout << " </Default>" << std::endl;
std::cout << " </LiteralData>" << std::endl;
......@@ -241,11 +276,12 @@ int main(int itkNotUsed(argc), char * itkNotUsed(argv)[])
std::cout << " </LiteralData>" << std::endl;
}
else{
if(type == ParameterType_OutputImage)
printOutputImage();
if(type == ParameterType_OutputImage){
printOutputImage(m_Application->GetParameterOutputImagePixelType(paramKey));
}
else{
if(type == ParameterType_ComplexOutputImage){
printOutputComplexImage();
printOutputComplexImage(m_Application->GetParameterComplexOutputImagePixelType(paramKey));
}else{
std::cout << " <ComplexData>" << std::endl;
if(type == ParameterType_InputImage || type == ParameterType_InputImageList || type == ParameterType_ComplexInputImage){
......@@ -311,6 +347,7 @@ int main(int itkNotUsed(argc), char * itkNotUsed(argv)[])
std::cout << " [" << paramKey << "]" << std::endl;
std::string s=m_Application->GetParameterDescription(paramKey);
if(s.length()>0){
s=ReplaceAll(ReplaceAll(s,std::string("\n"),std::string("")),std::string("\t"),std::string(""));
std::cout << " Title = " << s << std::endl;
std::cout << " Abstract = " << s << std::endl;
}else{
......
......@@ -4,7 +4,7 @@
#include <wx/utils.h>
#include <api_core.h>
#include <module_library.h>
#include <saga_api.h>
int Callback(TSG_UI_Callback_ID ID, CSG_UI_Parameter &Param_1, CSG_UI_Parameter &Param_2){
return( 1 );
......@@ -143,20 +143,39 @@ int main(int argc, char *argv[]) {
setlocale(LC_NUMERIC, "C");
static bool g_bShow_Messages = false;
SG_Set_UI_Callback(Get_Callback());
#if SAGA_MAJOR_VERSION == 2
int n = SG_Get_Module_Library_Manager().Add_Directory(wxT(MODULE_LIBRARY_PATH),false);
if( SG_Get_Module_Library_Manager().Get_Count() <= 0 ){
if( SG_Get_Module_Library_Manager().Get_Count() <= 0 )
#else
int n = SG_Get_Tool_Library_Manager().Add_Directory(wxT(MODULE_LIBRARY_PATH),false);
if( SG_Get_Tool_Library_Manager().Get_Count() <= 0 )
#endif
{
fprintf(stderr,"could not load any tool library");
return -2;
}
for(int i=0;i<SG_Get_Module_Library_Manager().Get_Count();i++){
#if SAGA_MAJOR_VERSION == 2
for(int i=0;i<SG_Get_Module_Library_Manager().Get_Count();i++)
#else
for(int i=0;i<SG_Get_Tool_Library_Manager().Get_Count();i++)
#endif
{
#if SAGA_MAJOR_VERSION == 2
CSG_Module_Library * library=SG_Get_Module_Library_Manager().Get_Library(i);
#else
CSG_Tool_Library * library=SG_Get_Tool_Library_Manager().Get_Library(i);
#endif
int lc=library->Get_Count();
if(!library->Get_Library_Name().Contains("io_")) {
for(int j=0;j<lc;j++){
#if SAGA_MAJOR_VERSION == 2
CSG_Module * module=library->Get_Module(j);
#else
CSG_Tool * module=library->Get_Tool(j);
#endif
if(module!=NULL && !module->needs_GUI() /*&& !module->is_Interactive()*/ ){
mkdir(library->Get_Library_Name().b_str(),0755);
......@@ -201,6 +220,14 @@ int main(int argc, char *argv[]) {
// Node should be used for defining Complex ComplexData
if(CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("color"))){
}
else if(CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("date"),true)){
printBasicMetadata(stdout1,param,false,true,true);
fprintf(stdout1," <LiteralData>\n");
fprintf(stdout1," dataType = date\n");
fprintf(stdout1," <Default/>\n");
fprintf(stdout1," </LiteralData>\n");
}
else if(CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("range"),true)){
......@@ -211,7 +238,11 @@ int main(int argc, char *argv[]) {
fprintf(stdout1," dataType = float\n");
CSG_Parameter_Range *range=param->asRange();
fprintf(stdout1," <Default>\n");
#if SAGA_MAJOR_VERSION == 2
fprintf(stdout1," value = %f\n",((CSG_Parameter_Range*)param->Get_Data())->Get_LoVal());
#else
//fprintf(stdout1," value = %f\n",((CSG_Parameter_Range*)param->asDataObject())->Get_Min());
#endif
fprintf(stdout1," </Default>\n");
fprintf(stdout1," </LiteralData>\n");
......@@ -219,7 +250,11 @@ int main(int argc, char *argv[]) {
fprintf(stdout1," <LiteralData>\n");
fprintf(stdout1," dataType = float\n");
fprintf(stdout1," <Default>\n");
#if SAGA_MAJOR_VERSION == 2
fprintf(stdout1," value = %f\n",((CSG_Parameter_Range*)param->Get_Data())->Get_HiVal());
#else
//fprintf(stdout1," value = %f\n",((CSG_Parameter_Range*)param->asDataObject())->Get_Max());
#endif
fprintf(stdout1," </Default>\n");
fprintf(stdout1," </LiteralData>\n");
......@@ -279,9 +314,15 @@ int main(int argc, char *argv[]) {
fprintf(stdout1," <LiteralData>\n");
fprintf(stdout1," dataType = string\n");
fprintf(stdout1," <Default>\n");
#if SAGA_MAJOR_VERSION == 2
if( !param->Get_Data()->Get_Default().is_Empty() ){
fprintf(stdout1," value = %s\n",param->Get_Data()->Get_Default().b_str());
}
#else
if( !param->Get_Default().is_Empty() ){
fprintf(stdout1," value = %s\n",param->Get_Default().b_str());
}
#endif
fprintf(stdout1," </Default>\n");
fprintf(stdout1," </LiteralData>\n");
}
......@@ -298,9 +339,15 @@ int main(int argc, char *argv[]) {
fprintf(stdout1," dataType = integer\n");
fprintf(stdout1," <Default>\n");
#if SAGA_MAJOR_VERSION == 2
if( !param->Get_Data()->Get_Default().is_Empty() ){
fprintf(stdout1," value = %s\n",param->Get_Data()->Get_Default().b_str());
}
#else
if( !param->Get_Default().is_Empty() ){
fprintf(stdout1," value = %s\n",param->Get_Default().b_str());
}
#endif
if(param->asValue()->has_Minimum() && param->asValue()->has_Maximum()){
fprintf(stdout1," rangeMin = %f\n",param->asValue()->Get_Minimum());
fprintf(stdout1," rangeMax = %f\n",param->asValue()->Get_Maximum());
......@@ -313,9 +360,15 @@ int main(int argc, char *argv[]) {
fprintf(stdout1," <LiteralData>\n");
fprintf(stdout1," dataType = bool\n");
fprintf(stdout1," <Default>\n");
#if SAGA_MAJOR_VERSION == 2
if( !param->Get_Data()->Get_Default().is_Empty() ){
fprintf(stdout1," value = %s\n",(param->Get_Data()->Get_Default().Contains("0")?"false":"true"));
}
#else
if( !param->Get_Default().is_Empty() ){
fprintf(stdout1," value = %s\n",(param->Get_Default().Contains("0")?"false":"true"));
}
#endif
fprintf(stdout1," </Default>\n");
fprintf(stdout1," </LiteralData>\n");
}
......@@ -336,9 +389,15 @@ int main(int argc, char *argv[]) {
fprintf(stdout1,"\n");
}
fprintf(stdout1," <Default>\n");
#if SAGA_MAJOR_VERSION == 2
if( !param->Get_Data()->Get_Default().is_Empty() ){
fprintf(stdout1," value = %s\n",CSG_String(choice->Get_Item(atoi(param->Get_Data()->Get_Default()))).b_str());
}
#else
if( !param->Get_Default().is_Empty() ){
fprintf(stdout1," value = %s\n",CSG_String(choice->Get_Item(atoi(param->Get_Default()))).b_str());
}
#endif
fprintf(stdout1," </Default>\n");
fprintf(stdout1," </LiteralData>\n");
}
......
ZRPATH=../../zoo-project
include ${ZRPATH}/zoo-kernel/ZOOMakefile.opts
LCFLAGS=${CFLAGS} ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} -DLINUX_FREE_ISSUE #-DDEBUG
CC=gcc
ifeq (${CALLBACK_FILE},service_callback.o)
CALLBACK_FILES=${ZRPATH}/zoo-kernel/${CALLBACK_FILE} ${ZRPATH}/zoo-kernel/ulinet.o ${ZRPATH}/zoo-kernel/caching.o
else
CALLBACK_FILES=
endif
zcfg2sql: zcfg2sql.c
g++ -g -O2 ${JSCFLAGS} ${RUBYCFLAGS} ${XML2CFLAGS} ${LCFLAGS} -c zcfg2sql.c -fno-common -DPIC -o zcfg2sql.o
g++ ${XML2CFLAGS} ${LCFLAGS} zcfg2sql.o ${CALLBACK_FILES} ${ZRPATH}/zoo-kernel/server_internal.o ${ZRPATH}/zoo-kernel/service_internal.o ${ZRPATH}/zoo-kernel/${MS_FILE} ${ZRPATH}/zoo-kernel/response_print.o ${ZRPATH}/zoo-kernel/lex.cr.o ${ZRPATH}/zoo-kernel/lex.sr.o ${ZRPATH}/zoo-kernel/service_conf.tab.o ${ZRPATH}/zoo-kernel/main_conf_read.tab.o ${ZRPATH}/zoo-kernel/${YAML_FILE} -o zcfg2sql -L${ZRPATH}/zoo-kernel/ ${LDFLAGS}
clean:
rm -f zcfg2sql
/*
* Author : Gérald FENOY
*
* Copyright (c) 2017-2019 GeoLabs SARL. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "service.h"
extern int getServiceFromFile (maps *, const char *, service **);
/**
* Dump an elements on stderr using the SQL syntaxe
*
* @param e the elements to dump
*/
void dumpElementsAsSQL(const char* type,elements* e,int index,int level,FILE* f){
elements* tmp=e;
int i;
while(tmp!=NULL){
fprintf(f,"--\n-- %s %s \n--\n",type,tmp->name);
map* mcurs=tmp->content;
iotype* tmpio=tmp->defaults;
int ioc=0;
if(tmp->format!=NULL){
//fprintf(stderr,"%s:\n",tmp->format);
if(strncmp(tmp->format,"Complex",7)==0){
while(tmpio!=NULL){
map* values[3]={
getMap(tmpio->content,"mimeType"),
getMap(tmpio->content,"encoding"),
getMap(tmpio->content,"schema")
};
char cond[3][256]={
"mime_type is NULL",
"encoding is NULL",
"schema is NULL"
};
char *condNames[3]={
"mime_type",
"encoding",
"schema"
};
for(i=0;i<3;i++)
if(values[i]!=NULL){
sprintf(cond[i],"%s='%s'",condNames[i],values[i]->value);
}
fprintf(f,"INSERT INTO CollectionDB.ows_Format"
" (def,primitive_format_id) VALUES \n(true,");
fprintf(f,"(SELECT id from CollectionDB.PrimitiveFormats"
" WHERE %s AND %s AND %s));\n",cond[0],cond[1],cond[2]);
fprintf(f,"INSERT INTO CollectionDB.ows_DataDescription (format_id)"
" VALUES ((SELECT last_value FROM CollectionDB.ows_Format_id_seq));\n");
tmpio=tmpio->next;
ioc++;
}
}else{
if(strncmp(tmp->format,"Literal",7)==0){
while(tmpio!=NULL){
map* values[4]={
getMap(tmpio->content,"dataType"),
getMap(tmpio->content,"value"),
getMap(tmpio->content,"uom"),
getMap(tmpio->content,"AllowedValues")
};
char *fields[20]={
"default_value",
"def"
};
fprintf(f,"INSERT INTO CollectionDB.LiteralDataDomain"
" (def,data_type_id) VALUES \n(true,");
fprintf(f,"(SELECT id from CollectionDB.PrimitiveDatatypes"
" where name = '%s'));\n",values[0]->value);
if(values[1]!=NULL)
fprintf(f,"UPDATE CollectionDB.LiteralDataDomain \n"
"set %s = $q$%s$q$ \n WHERE id = \n"
" ((SELECT last_value FROM CollectionDB.ows_DataDescription_id_seq));\n ",
fields[0],values[1]->value);
if(values[2]!=NULL)
fprintf(f,"UPDATE CollectionDB.LiteralDataDomain \n"
"set uom = (SELECT id from CollectionDB.PrimitiveUOM WHERE uom=$q$%s$q$) \n WHERE id = \n"
" (SELECT last_value FROM CollectionDB.ows_DataDescription_id_seq);\n ",
values[2]->value);
if(values[3]!=NULL){
char *tmp=strtok(values[3]->value,",");
while(tmp!=NULL){
fprintf(f,"INSERT INTO CollectionDB.AllowedValues (allowed_value) VALUES ('%s');\n",tmp);
fprintf(f,"INSERT INTO CollectionDB.AllowedValuesAssignment"
" (allowed_value_id,literal_data_domain_id) VALUES "
"((SELECT last_value FROM CollectionDB.AllowedValues_id_seq),"
"(SELECT last_value FROM CollectionDB.ows_DataDescription_id_seq));\n",tmp);
tmp=strtok(NULL,",");
}
}
tmpio=tmpio->next;
ioc++;
}
}
}
}
map* values[4]={
getMap(tmp->content,"Title"),
getMap(tmp->content,"Abstract"),
getMap(tmp->content,"minOccurs"),
getMap(tmp->content,"maxOccurs")
};
char *toto=",min_occurs,max_occurs";
if(strcmp(type,"Input")==0){
fprintf(f,"INSERT INTO CollectionDB.ows_Input "
"(identifier,title,abstract,min_occurs,max_occurs)"
" VALUES "
"($q$%s$q$,\n$q$%s$q$,\n$q$%s$q$,\n%s,\n%s);\n",
tmp->name,
values[0]->value,
values[1]->value,
values[2]->value,
values[3]->value
);
if(tmp->format!=NULL)
fprintf(f,"INSERT INTO CollectionDB.InputDataDescriptionAssignment"
" (input_id,data_description_id) VALUES "
"((select last_value as id "
"from CollectionDB.Descriptions_id_seq),"
"(select last_value "
"from CollectionDB.ows_DataDescription_id_seq));\n");
if(level==0)
fprintf(f,"INSERT INTO CollectionDB.ProcessInputAssignment"
"(process_id,input_id)"
" VALUES"
"((select id from pid),"
"(select last_value as id from CollectionDB.Descriptions_id_seq));\n");
else
fprintf(f,"INSERT INTO CollectionDB.InputInputAssignment"
"(parent_input,child_input)"
" VALUES"
"((select id from cid_%d),"
"(select last_value as id from CollectionDB.Descriptions_id_seq));\n",level-1);
}
else{
fprintf(f,"INSERT INTO CollectionDB.ows_Output\n"
"\t(identifier,title,abstract)\n"
"\t VALUES \n"
"($q$%s$q$,$q$%s$q$,$q$%s$q$);\n",
tmp->name,
values[0]->value,
values[1]->value
);
if(tmp->format!=NULL)
fprintf(f,"INSERT INTO CollectionDB.OutputDataDescriptionAssignment"
" (output_id,data_description_id) VALUES "
"((select last_value as id "
"from CollectionDB.Descriptions_id_seq),"
"(select last_value "
"from CollectionDB.ows_DataDescription_id_seq));\n");
if(level==0)
fprintf(f,"INSERT INTO CollectionDB.ProcessOutputAssignment"
"(process_id,output_id)"
" VALUES"
"((select id from pid),"
"(select last_value as id from CollectionDB.Descriptions_id_seq));\n");
else
fprintf(f,"INSERT INTO CollectionDB.OutputOutputAssignment"
"(parent_output,child_output)"
" VALUES"
"((select id from cid_%d),"
"(select last_value as id from CollectionDB.Descriptions_id_seq));\n",level-1);
}
map* mcurs1=tmp->metadata;
if(mcurs1!=NULL){
while(mcurs1!=NULL){
if(strncasecmp(mcurs1->name,"title",5)==0){
fprintf(stdout,"INSERT INTO CollectionDB.ows_Metadata (title) "
"VALUES ($q$%s$q$);\n",mcurs->value);
tryagain0:
if(mcurs1->next!=NULL){
if(strncasecmp(mcurs->next->name,"role",4)==0){
fprintf(stdout,"UPDATE CollectionDB.ows_Metadata set role = \n"
"$q$%s$q$ where id=(SELECT last_value FROM CollectionDB.ows_Metadata_id_seq);\n",mcurs1->next->value);
mcurs1=mcurs1->next;
goto tryagain0;
}
else{
if(strncasecmp(mcurs1->next->name,"href",4)==0){
fprintf(stdout,"UPDATE CollectionDB.ows_Metadata set href = \n"
"$q$%s$q$ where id=(SELECT last_value FROM CollectionDB.ows_Metadata_id_seq);\n",mcurs1->next->value);
mcurs1=mcurs1->next;
goto tryagain0;
}
}
}
fprintf(stdout,"INSERT INTO CollectionDB.DescriptionsMetadataAssignment (descriptions_id,metadata_id) "
"VALUES ((select last_value as id from CollectionDB.Descriptions_id_seq),"
"(SELECT last_value FROM CollectionDB.ows_Metadata_id_seq));\n");
}
mcurs1=mcurs1->next;
}
}
mcurs=tmp->additional_parameters;
if(mcurs!=NULL){
while(mcurs!=NULL){
if(strncasecmp(mcurs->name,"title",5)==0){
fprintf(stdout,"INSERT INTO CollectionDB.ows_AdditionalParameters (title) "
"VALUES ($q$%s$q$);\n",mcurs->value);
tryagain:
if(mcurs->next!=NULL){
if(strncasecmp(mcurs->next->name,"role",4)==0){
fprintf(stdout,"UPDATE CollectionDB.ows_AdditionalParameters set role = \n"
"$q$%s$q$ where id=(SELECT last_value FROM CollectionDB.ows_AdditionalParameters_id_seq);\n",mcurs->next->value);
mcurs=mcurs->next;
goto tryagain;
}
else{
if(strncasecmp(mcurs->next->name,"href",4)==0){
fprintf(stdout,"UPDATE CollectionDB.ows_AdditionalParameters set href = \n"
"$q$%s$q$ where id=(SELECT last_value FROM CollectionDB.ows_AdditionalParameters_id_seq);\n",mcurs->next->value);
mcurs=mcurs->next;
goto tryagain;
}
}
}
fprintf(stdout,"INSERT INTO CollectionDB.DescriptionsAdditionalParametersAssignment (descriptions_id,additional_parameters_id) "
"VALUES ((select last_value as id from CollectionDB.Descriptions_id_seq),"
"(SELECT last_value FROM CollectionDB.ows_AdditionalParameters_id_seq));\n");
}else{
fprintf(stdout,"INSERT INTO CollectionDB.ows_AdditionalParameter (key,value,additional_parameters_id) "
"VALUES ($q$%s$q$,$q$%s$q$,"
"(SELECT last_value FROM CollectionDB.ows_AdditionalParameters_id_seq));\n",mcurs->name,mcurs->value);
}
mcurs=mcurs->next;
}
}
if(tmp->format!=NULL){
tmpio=tmp->supported;
if(strncmp(tmp->format,"Complex",7)==0){
while(tmpio!=NULL){
map* values[3]={
getMap(tmpio->content,"mimeType"),
getMap(tmpio->content,"encoding"),
getMap(tmpio->content,"schema")
};
char cond[3][256]={
"mime_type is NULL",
"encoding is NULL",
"schema is NULL",
};
char *condNames[3]={
"mime_type",
"encoding",
"schema"
};
for(i=0;i<3;i++)
if(values[i]!=NULL){
sprintf(cond[i],"%s='%s'",condNames[i],values[i]->value);
}
fprintf(f,"INSERT INTO CollectionDB.ows_Format"
" (def,primitive_format_id) VALUES \n(false,");
fprintf(f,"(SELECT id from CollectionDB.PrimitiveFormats"
" WHERE %s AND %s AND %s));\n",cond[0],cond[1],cond[2]);
fprintf(f,"INSERT INTO CollectionDB.ows_DataDescription (format_id)"
" VALUES ((SELECT last_value FROM CollectionDB.ows_Format_id_seq));\n");
fprintf(f,"INSERT INTO CollectionDB.%sDataDescriptionAssignment"
" (%s_id,data_description_id) VALUES "
"((select last_value as id "
"from CollectionDB.Descriptions_id_seq),"
"(select last_value "
"from CollectionDB.ows_DataDescription_id_seq));\n",
type,type);
tmpio=tmpio->next;
ioc++;
}
}else{
if(strncmp(tmp->format,"Literal",7)==0){
while(tmpio!=NULL){
map* values[4]={
getMap(tmpio->content,"dataType"),
getMap(tmpio->content,"value"),
getMap(tmpio->content,"uom"),
getMap(tmpio->content,"AllowedValues")
};
map* values0[4]={
getMap(tmp->defaults->content,"dataType"),
getMap(tmp->defaults->content,"value"),
getMap(tmp->defaults->content,"uom"),
getMap(tmp->defaults->content,"AllowedValues")
};
char *fields[20]={
"default_value",
"def"
};
fprintf(f,"INSERT INTO CollectionDB.LiteralDataDomain"
" (def,data_type_id) VALUES \n(false,");
if(values[0]!=NULL)
fprintf(f,"(SELECT id from CollectionDB.PrimitiveDatatypes"
" where name = '%s'));\n",values[0]->value);
else
fprintf(f,"(SELECT id from CollectionDB.PrimitiveDatatypes"
" where name = '%s'));\n",values0[0]->value);
if(values[1]!=NULL)
fprintf(f,"UPDATE CollectionDB.LiteralDataDomain \n"
"set %s = $q$%s$q$ \n WHERE id = \n"
" ((SELECT last_value FROM CollectionDB.ows_DataDescription_id_seq));\n ",
fields[0],values[1]->value);
if(values[2]!=NULL)
fprintf(f,"UPDATE CollectionDB.LiteralDataDomain \n"
"set uom = (SELECT id from CollectionDB.PrimitiveUOM WHERE uom=$q$%s$q$) \n WHERE id = \n"
" (SELECT last_value FROM CollectionDB.ows_DataDescription_id_seq);\n ",
values[2]->value);
if(type!=NULL)
fprintf(f,"INSERT INTO CollectionDB.%sDataDescriptionAssignment"
" (%s_id,data_description_id) VALUES "
"((select last_value "
"from CollectionDB.Descriptions_id_seq),"
"(select last_value "
"from CollectionDB.ows_DataDescription_id_seq));\n",
type,type);
tmpio=tmpio->next;
ioc++;
}
}
}
}
if(tmp->format==NULL){
fprintf(f,"--\n-- Child %d \n--\n",level);
fprintf(f,"CREATE TEMPORARY TABLE cid_%d AS (select last_value as id from CollectionDB.Descriptions_id_seq) ;\n",level);
if(tmp->child!=NULL)
dumpElementsAsSQL(type,tmp->child,0,level+1,f);
fprintf(f,"DROP TABLE cid_%d;\n",level);
fprintf(f,"--\n-- End Child %d \n--\n",level);
}
tmp=tmp->next;
}
}
int main(int argc, char *argv[]) {
service* s=NULL;
maps *m=NULL;
char conf_file[1024];
snprintf(conf_file,1024,"%s",argv[1]);
s=(service*)malloc(SERVICE_SIZE);
if(s == NULL){
fprintf(stderr,"Unable to allocate memory");
return -1;
}
int t=getServiceFromFile(m,conf_file,&s);
fprintf(stdout,"--\n-- Load from %s %d \n--",__FILE__,__LINE__);
int i;
fprintf(stdout,"--\n-- Service %s\n--\n",s->name);
if(s->content!=NULL){
map* values[4]={
getMap(s->content,"Title"),
getMap(s->content,"Abstract"),
getMap(s->content,"serviceProvider"),
getMap(s->content,"serviceType")
};
fprintf(stdout,"INSERT INTO CollectionDB.zoo_DeploymentMetadata\n"
"(executable_name,service_type_id)\n"
"\nVALUES\n"
"($q$%s$q$,\n(SELECT id from CollectionDB.zoo_ServiceTypes WHERE service_type=$q$%s$q$));\n\n",
values[2]->value,
values[3]->value);
fprintf(stdout,"INSERT INTO CollectionDB.zoo_PrivateMetadata"
"(id) VALUES (default);\n");
fprintf(stdout,"INSERT INTO CollectionDB.PrivateMetadataDeploymentMetadataAssignment"
"(private_metadata_id,deployment_metadata_id) VALUES \n"
"((SELECT last_value FROM CollectionDB.zoo_PrivateMetadata_id_seq),\n"
"(SELECT last_value FROM CollectionDB.zoo_DeploymentMetadata_id_seq));\n");
fprintf(stdout,"INSERT INTO CollectionDB.ows_Process\n"
"(identifier,title,abstract,private_metadata_id,"
"availability)\n"
"\nVALUES\n"
"($q$%s$q$,\n$q$%s$q$,\n$q$%s$q$,(SELECT last_value FROM CollectionDB.PrivateMetadataDeploymentMetadataAssignment_id_seq),\ntrue);\n\n",
s->name,
values[0]->value,
values[1]->value);
fprintf(stdout,"CREATE TEMPORARY TABLE pid AS "
"(select last_value as id from CollectionDB.Descriptions_id_seq);\n");
map* mcurs=s->content;
//dumpMap(mcurs);
mcurs=s->metadata;
if(mcurs!=NULL){
while(mcurs!=NULL){
if(strncasecmp(mcurs->name,"title",5)==0){
fprintf(stdout,"INSERT INTO CollectionDB.ows_Metadata (title) "
"VALUES ($q$%s$q$);\n",mcurs->value);
tryagain0:
if(mcurs->next!=NULL){
if(strncasecmp(mcurs->next->name,"role",4)==0){
fprintf(stdout,"UPDATE CollectionDB.ows_Metadata set role = \n"
"$q$%s$q$ where id=(SELECT last_value FROM CollectionDB.ows_Metadata_id_seq);\n",mcurs->next->value);
mcurs=mcurs->next;
goto tryagain0;
}
else{
if(strncasecmp(mcurs->next->name,"href",4)==0){
fprintf(stdout,"UPDATE CollectionDB.ows_Metadata set href = \n"
"$q$%s$q$ where id=(SELECT last_value FROM CollectionDB.ows_Metadata_id_seq);\n",mcurs->next->value);
mcurs=mcurs->next;
goto tryagain0;
}
}
}
fprintf(stdout,"INSERT INTO CollectionDB.DescriptionsMetadataAssignment (descriptions_id,metadata_id) "
"VALUES ((select last_value as id from CollectionDB.Descriptions_id_seq),"
"(SELECT last_value FROM CollectionDB.ows_Metadata_id_seq));\n");
}
mcurs=mcurs->next;
}
}
mcurs=s->additional_parameters;
if(mcurs!=NULL){
while(mcurs!=NULL){
if(strncasecmp(mcurs->name,"title",5)==0){
fprintf(stdout,"INSERT INTO CollectionDB.ows_AdditionalParameters (title) "
"VALUES ($q$%s$q$);\n",mcurs->value);
tryagain:
if(mcurs->next!=NULL){
if(strncasecmp(mcurs->next->name,"role",4)==0){
fprintf(stdout,"UPDATE CollectionDB.ows_AdditionalParameters set role = \n"
"$q$%s$q$ where id=(SELECT last_value FROM CollectionDB.ows_AdditionalParameters_id_seq);\n",mcurs->next->value);
mcurs=mcurs->next;
goto tryagain;
}
else{
if(strncasecmp(mcurs->next->name,"href",4)==0){
fprintf(stdout,"UPDATE CollectionDB.ows_AdditionalParameters set href = \n"
"$q$%s$q$ where id=(SELECT last_value FROM CollectionDB.ows_AdditionalParameters_id_seq);\n",mcurs->next->value);
mcurs=mcurs->next;
goto tryagain;
}
}
}
fprintf(stdout,"INSERT INTO CollectionDB.DescriptionsAdditionalParametersAssignment (descriptions_id,additional_parameters_id) "
"VALUES ((select last_value as id from CollectionDB.Descriptions_id_seq),"
"(SELECT last_value FROM CollectionDB.ows_AdditionalParameters_id_seq));\n");
}else{
fprintf(stdout,"INSERT INTO CollectionDB.ows_AdditionalParameter (key,value,additional_parameters_id) "
"VALUES ($q$%s$q$,$q$%s$q$,"
"(SELECT last_value FROM CollectionDB.ows_AdditionalParameters_id_seq));\n",mcurs->name,mcurs->value);
}
mcurs=mcurs->next;
}
}
}
if(s->inputs!=NULL){
//fprintf(stderr,"\ninputs:\n");
dumpElementsAsSQL("Input",s->inputs,0,0,stdout);
}
if(s->outputs!=NULL){
//fprintf(stderr,"\noutputs:\n");
dumpElementsAsSQL("Output",s->outputs,0,0,stdout);
}
fprintf(stdout,"--\n-- Load from %s %d \n--",__FILE__,__LINE__);
/*fprintf(stderr,"--\n-- Load from %s %d \n--",__FILE__,__LINE__);
fflush(stderr);
printf("--\n-- Load from %s %d \n--",__FILE__,__LINE__);
if(t>=0){
fprintf(stderr,"--\n-- Service %s\n--",s->name);
fflush(stderr);
dumpServiceAsSQL(s);
fprintf(stderr,"--\n-- Service %s\n--",s->name);
fflush(stderr);
}
*/
fflush(stderr);
return 0;
}
......@@ -28,3 +28,6 @@ reluc René-Luc D'HONT
rldhont at gmail.com
tclarke Trevor CLARKE
tclarke at ball.com
cresson Remi CRESSON
remi.cresson at irstea.fr
Version 1.6.0-dev
Version 1.7.0-dev
* Fix issue with UOM definitions in zcfg2sql
* Make callback and HPC support independent from each other
* Update SAGA-GIS support to version 7.2.0
* Add support for custom MapServer style definition for raster output
* Fix returned bbox definition #170
* Store semaphore status in lenv section for future deletion
* Update Windows support to newer compiler
* Fix issue with UpdateStatus function from the Mono ZOO-API
* Add logging functionality and other utility functions to the C-API
* Return an exception for every output for which nb_pixel or
nb_features is 0
* Add a shared key to the security section to differentiate the
referenced data
* Add MapServer output style definition depending on the geometry
type
* Add ogr.tindex service
* Add support for literaldata input arrays and to call services
asyncrhonously from the JavaScript ZOO-API
* Expose a sleep function to the JavaScript ZOO-API
* Provide FinalizeHPC and FinalizeHPC1 services using scontrol and
sacct respectively
* Store md5sum of the cached file (so, local to the WPS server) to
compare before uploading (if different md5sum) on the HPC server
* Add support for R language
* Add support for using "file://" for referenced data input
* Add an optional ecookie key for returning third-party cookies
* Fix issue when parsing BoundingBox input #163
* Add memory key to the main section to force the ZOO-Kernel to load
data into memory or use local file
* Add the dialect input to the ogr2ogr service
* Store the list of generated mapfiles in a file (cf DeleteData service)
* Define the correct MS_IMAGEMODE in the generated mapfile
* Option to use MapServer support to publish heatmap
* Add status_code key to the lenv for setting Status HTTP response header
* Add the Creation Option inputs to the Gdal_Dem service
* Add prohibited key in the callback section to define a list of
services not requiring any invocation
* Produce zcfg for OTB applications using the correct default pixel type
* Add asynchronous callback invocation to send information about
the ongoing services to a third-party software
* Add mapsToJson, mapsToJson, and elementsToJson to the API
* Provide a zcfg2sql tool to convert a zcfg metadata file to SQL script
* Add support to store service metadata information into a database
* Add HPC Support for remote execution of SBATCH scripts through Slurm
* Add cookie reference to _HINTERNET
* Support headers for GET requests from the js ZOO-API
* Pass all headers listed in the attributes parameter from the
[security] section to the hosts listed in the hosts parameter of the
same section (ticket #139)
Version 1.6.0
* Add the C# as a supported programming language for Services
* Add nested inputs and outputs support (WPS 2.0.0)
* Add servicePath special key to specify the service location
......
......@@ -435,11 +435,12 @@ ZOO.Request = {
* Parameters:
* url - {String} The URL to request.
* params - {Object} Params to add to the url
* headers - {Object/Array} A key-value object of headers
*
* Returns:
* {String} Request result.
*/
Get: function(url,params) {
Get: function(url,params,headers) {
var paramsArray = [];
for (var key in params) {
var value = params[key];
......@@ -465,7 +466,14 @@ ZOO.Request = {
var separator = (url.indexOf('?') > -1) ? '&' : '?';
url += separator + paramString;
}
return ZOORequest('GET',url);
if(!(headers instanceof Array)) {
var headersArray = [];
for (var name in headers) {
headersArray.push(name+': '+headers[name]);
}
headers = headersArray;
}
return ZOORequest('GET',url,headers);
},
/**
* Function: POST
......@@ -3677,14 +3685,34 @@ ZOO.Format.WPS = ZOO.Class(ZOO.Format, {
data = outputs[i].*::Reference;
}
var builder = this.parseData[data.localName().toLowerCase()];
if (builder)
if (builder){
res.push(builder.apply(this,[data]));
}
else
res.push(null);
data=null;
}
return res.length>1?res:res[0];
}
else{
var hasPercentCompleted=true;
var status = node.*::Status.*::ProcessStarted;
var msg = node.*::Status.*::ProcessStarted.*::*[0];
if(!status || !msg){
status = node.*::Status.*::ProcessAccepted;
msg = node.*::Status.*::ProcessAccepted.*::*[0];
msg=msg.toString();
hasPercentCompleted=false;
}else
msg=msg.toString();
if(status!=null && node.@statusLocation){
var res={"status": node.@statusLocation.toXMLString(), "message": msg};
if(hasPercentCompleted)
res["percentCompleted"]=status.@percentCompleted.toXMLString();
return res;
}else
return null;
}
},
/**
* Property: parseData
......@@ -3739,8 +3767,10 @@ ZOO.Format.WPS = ZOO.Class(ZOO.Format, {
* Returns:
* {Object} A WPS reference response.
*/
'reference': function(node) {
var result = {type:'reference',value:node.@href};
'reference': function(lnode) {
var lhref=lnode.@href;
var lmimeType=lnode.@mimeType;
var result = {type:'reference',value:lhref.toXMLString(),mimeType:lmimeType.toXMLString()};
return result;
}
},
......@@ -6137,6 +6167,11 @@ ZOO.Process = ZOO.Class({
* {String} Process identifier in the OGC's Web Processing Service.
*/
identifier: null,
/**
* Property: async
* {Bool} Define if the process should run asyncrhonously (true) or not (false, default).
*/
async: null,
/**
* Constructor: ZOO.Process
* Create a new Process
......@@ -6149,6 +6184,7 @@ ZOO.Process = ZOO.Class({
initialize: function(url,identifier) {
this.url = url;
this.identifier = identifier;
this.async = (arguments.length>2?arguments[2]:false);
},
/**
* Method: Execute
......@@ -6186,16 +6222,12 @@ ZOO.Process = ZOO.Class({
* {E4XElement} A WPS Input node.
*/
'ResponseDocument': function(identifier,obj) {
var output = new XML('<wps:ResponseForm xmlns:wps="'+this.namespaces['wps']+'"><wps:ResponseDocument><wps:Output'+(obj["mimeType"]?' mimeType="'+obj["mimeType"]+'" ':'')+(obj["encoding"]?' encoding="'+obj["encoding"]+'" ':'')+(obj["asReference"]?' asReference="'+obj["asReference"]+'" ':'')+'><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier></wps:Output></wps:ResponseDocument></wps:ResponseForm>');
if (obj.encoding)
output.*::Data.*::ComplexData.@encoding = obj.encoding;
if (obj.schema)
output.*::Data.*::ComplexData.@schema = obj.schema;
var output = new XML('<wps:Output xmlns:wps="'+this.namespaces['wps']+'" '+(obj["mimeType"]?' mimeType="'+obj["mimeType"]+'" ':'')+(obj["encoding"]?' encoding="'+obj["encoding"]+'" ':'')+(obj["asReference"]?' asReference="'+obj["asReference"]+'" ':'')+'><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier></wps:Output>');
output = output.toXMLString();
return output;
},
'RawDataOutput': function(identifier,obj) {
var output = new XML('<wps:ResponseForm xmlns:wps="'+this.namespaces['wps']+'"><wps:RawDataOutput '+(obj["mimeType"]?' mimeType="'+obj["mimeType"]+'" ':'')+(obj["encoding"]?' encoding="'+obj["encoding"]+'" ':'')+'><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier></wps:RawDataOutput></wps:ResponseForm>');
var output = new XML('<wps:RawDataOutput xmlns:wps="'+this.namespaces['wps']+'" '+(obj["mimeType"]?' mimeType="'+obj["mimeType"]+'" ':'')+(obj["encoding"]?' encoding="'+obj["encoding"]+'" ':'')+'><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier></wps:RawDataOutput>');
if (obj.encoding)
output.*::Data.*::ComplexData.@encoding = obj.encoding;
if (obj.schema)
......@@ -6222,7 +6254,7 @@ ZOO.Process = ZOO.Class({
* {E4XElement} A WPS Input node.
*/
'complex': function(identifier,data) {
var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier>'+(data.value?'<wps:Data><wps:ComplexData><![CDATA['+data.value+']]></wps:ComplexData></wps:Data>':(data.xlink?'<wps:Reference xmlns:xlink="'+this.namespaces['xlink']+'" xlink:href="'+data.xlink+'" mimeType="'+data.mimeType+'" />':''))+'</wps:Input>');
var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier>'+(data.value?'<wps:Data><wps:ComplexData '+(data.mimeType?'mimeType="'+data.mimeType+'"':"")+'><![CDATA['+data.value+']]></wps:ComplexData></wps:Data>':(data.xlink?'<wps:Reference xmlns:xlink="'+this.namespaces['xlink']+'" xlink:href="'+data.xlink+'" mimeType="'+data.mimeType+'" />':''))+'</wps:Input>');
if(data.xlink)
input.*::Reference.@mimeType = data.mimetype ? data.mimetype : 'application/json';
else
......@@ -6232,6 +6264,9 @@ ZOO.Process = ZOO.Class({
if (data.schema)
input.*::Data.*::ComplexData.@schema = data.schema;
input = input.toXMLString();
if(data.value)
return (('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier>'+(data.value?'<wps:Data><wps:ComplexData '+(data.mimeType?'mimeType="'+data.mimeType+'"':"")+'><![CDATA['+data.value+']]></wps:ComplexData></wps:Data>':(data.xlink?'<wps:Reference xmlns:xlink="'+this.namespaces['xlink']+'" xlink:href="'+data.xlink+'" mimeType="'+data.mimeType+'" />':''))+'</wps:Input>'));
else
return input;
},
/**
......@@ -6280,7 +6315,6 @@ ZOO.Process = ZOO.Class({
}
return inputf;
}
}
},
/**
......@@ -6309,13 +6343,30 @@ ZOO.Process = ZOO.Class({
},
buildDataOutputsNode:function(outputs){
var data, builder, outputsArray=[];
var data, builder, outputsArray=[[],[]];
for (var attr in outputs) {
data = outputs[attr];
builder = this.buildOutput[data.type];
outputsArray.push(builder.apply(this,[attr,data]));
}
return outputsArray.join('\n');
if(data.type=="ResponseDocument")
outputsArray[0].push(builder.apply(this,[attr,data]));
else
outputsArray[1].push(builder.apply(this,[attr,data]));
}
var responseDocuments=(outputsArray[0].length>0?
new XML('<wps:ResponseDocument '+(this.async?'storeExecuteResponse="true" status="true"':'')+' xmlns:wps="'+this.namespaces['wps']+'">'+
outputsArray[0].join('\n')+
'</wps:ResponseDocument>')
:
null);
var rawDataOutputs=(outputsArray[1].length>0?
outputsArray[1].join('\n')
:
null);
var res=new XML('<wps:ResponseForm xmlns:wps="'+this.namespaces['wps']+'">'+
(responseDocuments!=null?responseDocuments.toXMLString():"")+
(rawDataOutputs!=null?rawDataOutputs:"")+
'</wps:ResponseForm>');
return res.toXMLString();
},
CLASS_NAME: "ZOO.Process"
......
!INCLUDE ../../zoo-kernel/nmake.opt
all: ZMaps.dll
ZMaps.dll: ZMaps.cs
$(MONO_DIR)\bin\mcs /target:library ZMaps.cs
clean:
erase ZMaps.dll
ZOOTranslate <- function(a) {
return (.Call("ZOOTranslate",a))
}
ZOOUpdateStatus <- function(a,b) {
.Call("ZOOUpdateStatus",a,as.numeric(b))
}
......@@ -678,7 +678,7 @@ define([
}
$.ajax({
url: closure.statusLocation[sid]
url: closure.statusLocation[sid]+"&timestamp="++(new Date()).getTime()
})
.fail(
function(jqXHR, textStatus, errorThrown) {
......
......@@ -3,12 +3,12 @@ include ZOOMakefile.opts
all: version.h zoo_loader.cgi ${YAML_FILE1}
version.h: Makefile
echo "#define ZOO_VERSION \"1.6.0 `svnversion`\"" > version.h
echo "#define ZOO_VERSION \"1.7.0 `svnversion`\"" > version.h
echo "@ETC_DEF@" >> version.h
echo "#define LOCALEDIR \"@localedir@\"" >> version.h
service.o: service.c service.h
gcc ${YAML_CFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service.c
g++ ${YAML_CFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service.c
main_conf_read.tab.c: main_conf_read.y service.h
bison -p cr -d main_conf_read.y
......@@ -37,37 +37,55 @@ lex.sr.o: lex.sr.c service.h
ulinet.o: ulinet.c
gcc -fPIC ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c ulinet.c
sshapi.o: sshapi.c
g++ -fPIC ${CFLAGS} -c sshapi.c
service_json.o: service_json.c
g++ -fPIC ${JSON_CFLAGS} ${CFLAGS} -c service_json.c
service_callback.o: service_callback.c
g++ -fPIC ${XML2CFLAGS} ${GDAL_CFLAGS} ${JSON_CFLAGS} ${CFLAGS} -c service_callback.c
request_parser.o: request_parser.c request_parser.h
g++ -fPIC ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c request_parser.c
sqlapi.o: sqlapi.c sqlapi.h
g++ -fPIC ${GDAL_CFLAGS} ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c sqlapi.c
g++ -fPIC ${METADB_ENABLED} ${GDAL_CFLAGS} ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c sqlapi.c
caching.o: caching.c
g++ -fPIC ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c caching.c
response_print.o: response_print.c response_print.h
g++ -fPIC ${GDAL_CFLAGS} ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c response_print.c
g++ -fPIC ${GDAL_CFLAGS} ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} ${HPC_ENABLED} -c response_print.c
server_internal.o: server_internal.c server_internal.h service.h mimetypes.h
g++ ${GDAL_CFLAGS} ${JS_ENABLED} ${JSCFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c server_internal.c
g++ ${JSON_CFLAGS} ${GDAL_CFLAGS} ${JS_ENABLED} ${JSCFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c server_internal.c
service_internal.o: service_internal.c service_internal.h service.h
gcc ${GDAL_CFLAGS} ${JS_ENABLED} ${JSCFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service_internal.c
gcc ${JSON_CFLAGS} ${GDAL_CFLAGS} ${JS_ENABLED} ${JSCFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service_internal.c
service_yaml.o: service_yaml.c service.h
gcc ${YAML_CFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service_yaml.c
meta_sql.o: meta_sql.c meta_sql.h service.h
g++ ${METADB_ENABLED} ${GDAL_CFLAGS} ${XML2CFLAGS} ${CFLAGS} -c meta_sql.c
service_internal_ms.o: service_internal_ms.c
gcc ${JS_ENABLED} ${GDAL_CFLAGS} ${JSCFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service_internal_ms.c
echo "SYMBOLSET\nEND" > sybols.sym
echo "SYMBOLSET\nEND" > symbols.sym
service_internal_python.o: service_internal_python.c service.h
g++ ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c service_internal_python.c
service_internal_r.o: service_internal_r.c service.h
g++ ${XML2CFLAGS} ${RCFLAGS} ${CFLAGS} -c service_internal_r.c
service_internal_otb.o: service_internal_otb.c service_internal_otb.h service.h
g++ ${XML2CFLAGS} ${OTBCFLAGS} ${CFLAGS} -c service_internal_otb.c
service_internal_hpc.o: service_internal_hpc.c service_internal_hpc.h service.h
g++ ${JSON_CFLAGS} ${XML2CFLAGS} ${HPCCFLAGS} ${CFLAGS} -c service_internal_hpc.c
service_internal_saga.o: service_internal_saga.c service_internal_saga.h service.h
g++ ${XML2CFLAGS} ${SAGA_CFLAGS} ${CFLAGS} -c service_internal_saga.c
......@@ -98,19 +116,19 @@ service_internal_ruby.o: service_internal_ruby.c service_internal_ruby.h
service_loader.o: service_loader.c service.h
g++ -c ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} service_loader.c
zoo_service_loader.o: zoo_service_loader.c service.h version.h ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${MONO_FILE}
g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${MONO_CFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${SAGA_ENABLED} ${OTB_ENABLED} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} ${MONO_ENABLED} -c zoo_service_loader.c -fno-common -DPIC -o zoo_service_loader.o
zoo_service_loader.o: zoo_service_loader.c service.h version.h ${MS_FILE} ${R_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${MONO_FILE} ${HPC_FILES} ${METADB_FILE}
g++ -g -O2 ${JSON_CFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${CFLAGS} ${MONO_CFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${RCFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${SAGA_ENABLED} ${OTB_ENABLED} ${HPC_ENABLED} ${PYTHON_ENABLED} ${R_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} ${MONO_ENABLED} ${METADB_ENABLED} -c zoo_service_loader.c -fno-common -DPIC -o zoo_service_loader.o
libzoo_service.${EXT}: version.h service_internal.o service.o sqlapi.o
gcc -shared ${GDAL_CFLAGS} ${DEFAULT_OPTS} -fpic -o libzoo_service.${EXT} ${CFLAGS} service_internal.o service.o sqlapi.o ${FCGI_LDFLAGS} ${GDAL_LIBS}
g++ -shared ${GDAL_CFLAGS} ${DEFAULT_OPTS} -fpic -o libzoo_service.${EXT} ${CFLAGS} service_internal.o service.o sqlapi.o ${FCGI_LDFLAGS} ${GDAL_LIBS} ${ZOO_LDFLAGS} ${MACOS_LD_FLAGS}
zoo_loader.cgi: version.h libzoo_service.${EXT} 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 request_parser.o response_print.o server_internal.o caching.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE}
g++ -g -O2 ${JSCFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${RUBYCFLAGS} ${JAVACFLAGS} ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c -fno-common -DPIC -o zoo_loader.o
g++ ${JSCFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o ${MS_FILE} ${PYTHON_FILE} ${PERL_FILE} ${PHP_FILE} ${JS_FILE} ${JAVA_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${MONO_FILE} response_print.o server_internal.o caching.o request_parser.o ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi -L. ${LDFLAGS}
zoo_loader.cgi: version.h libzoo_service.${EXT} 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 request_parser.o response_print.o server_internal.o caching.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${R_FILE} ${SAGA_FILE} ${HPC_FILES} ${METADB_FILE} ${JSON_FILE} ${CALLBACK_FILE}
g++ -g -O2 ${JSON_CFLAGS} ${JSCFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${RUBYCFLAGS} ${JAVACFLAGS} ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c -fno-common -DPIC -o zoo_loader.o
g++ ${JSON_CFLAGS} ${JSCFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o ${MS_FILE} ${PYTHON_FILE} ${PERL_FILE} ${PHP_FILE} ${JS_FILE} ${JAVA_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} ${MONO_FILE} ${HPC_FILES} ${METADB_FILE} ${JSON_FILE} ${R_FILE} ${CALLBACK_FILE} response_print.o server_internal.o caching.o request_parser.o ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi -L. ${LDFLAGS}
zcfg2yaml: zcfg2yaml.c service.h lex.sr.o service_conf.tab.o service_conf.y main_conf_read.tab.o lex.cr.o response_print.o server_internal.o service_internal.o ${MS_FILE} ${YAML_FILE}
zcfg2yaml: zcfg2yaml.c service.h lex.sr.o service_conf.tab.o service_conf.y main_conf_read.tab.o lex.cr.o response_print.o server_internal.o service_internal.o ${MS_FILE} ${YAML_FILE} ${CALLBACK_FILE}
g++ -g -O2 ${JSCFLAGS} ${RUBYCFLAGS} ${XML2CFLAGS} ${CFLAGS} -c zcfg2yaml.c -fno-common -DPIC -o zcfg2yaml.o
g++ ${XML2CFLAGS} ${CFLAGS} zcfg2yaml.o server_internal.o service_internal.o ${MS_FILE} response_print.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o ${YAML_FILE} -o zcfg2yaml -L. ${LDFLAGS}
g++ ${XML2CFLAGS} ${CFLAGS} zcfg2yaml.o caching.o ulinet.o ${CALLBACK_FILE} server_internal.o service_internal.o ${MS_FILE} response_print.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o ${YAML_FILE} -o zcfg2yaml -L. ${LDFLAGS}
install: zoo_loader.cgi
install -d ${DESTDIR}${CGI_DIR}
......@@ -119,7 +137,7 @@ install: zoo_loader.cgi
(cd ${DESTDIR}${INST_LIB} ; \
if [ -e "libzoo_service.${EXT}" ]; then rm libzoo_service.${EXT}; fi ; \
ln -s ${LIBZOO_SERVICE} libzoo_service.${EXT})
if [ -z "${MS_FILE}" ] ; then echo "No symbols.sym" ; else install -d ${SHAREDSTATEDIR}; install symbols.sym ${SHAREDSTATEDIR}; fi
if [ -z "${MS_FILE}" ] ; then echo "No symbols.sym" ; else install -d ${DESTDIR}${SHAREDSTATEDIR}; install -m644 symbols.sym ${DESTDIR}${SHAREDSTATEDIR}; fi
install -d ${DESTDIR}${INST_INCLUDE}/zoo
install sqlapi.h service.h service_internal.h ${DESTDIR}${INST_INCLUDE}/zoo
......
......@@ -29,6 +29,14 @@ YAML_LDFLAGS=@YAML_LDFLAGS@
YAML_FILE=@YAML_FILE@
YAML_FILE1=@YAML_FILE1@
JSON_CFLAGS=@JSON_CPPFLAGS@
JSON_LDFLAGS=@JSON_LDFLAGS@
JSON_FILE=@JSON_FILE@
METADB_ENABLED=@METADB@
METADB_FILE=@METADB_FILE@
GDAL_CFLAGS=@GDAL_CFLAGS@
GDAL_LIBS=@GDAL_LIBS@
......@@ -49,6 +57,11 @@ PYTHONLDFLAGS=@PYTHON_LDFLAGS@
PYTHON_ENABLED=@PYTHON_ENABLED@
PYTHON_FILE=@PYTHON_FILE@
RCFLAGS=@R_CPPFLAGS@
RLDFLAGS=@R_LDFLAGS@
R_ENABLED=@R_ENABLED@
R_FILE=@R_FILE@
RUBYCFLAGS=@RUBY_CPPFLAGS@
RUBYLDFLAGS=@RUBY_LDFLAGS@
RUBY_ENABLED=@RUBY_ENABLED@
......@@ -67,7 +80,7 @@ MS_LDFLAGS=@MS_LIBS@
MS_FILE=@MS_FILE@
ZOO_CFLAGS=-I${ZRPATH}/../thirds/cgic206/ -I${ZRPATH}/zoo-kernel/
ZOO_LDFLAGS=@OPENSSL_LDFLAGS@ -luuid
ZOO_LDFLAGS=@OPENSSL_LDFLAGS@ @UUID_LDFLAGS@
JAVACFLAGS=@JAVA_CPPFLAGS@
JAVALDFLAGS=@JAVA_LDFLAGS@
......@@ -79,12 +92,19 @@ PHPLDFLAGS=@PHP_LDFLAGS@
PHP_ENABLED=@PHP_ENABLED@
PHP_FILE=@PHP_FILE@
PERLCFLAGS=@PERL_CPPFLAGS@
PERLLDFLAGS=@PERL_LDFLAGS@
PERL_ENABLED=@PERL_ENABLED@
PERL_FILE=@PERL_FILE@
HPCCFLAGS=@SSH2_CPPFLAGS@ @HPC_CPPFLAGS@
HPCLDFLAGS=@SSH2_LDFLAGS@ @HPC_LDFLAGS@
HPC_ENABLED=@HPC_ENABLED@
HPC_FILES=@HPC_FILES@
CALLBACK_FILE=@CALLBACK_FILE@
CALLBACK_USE=@CALLBACK_USE@
OTBCFLAGS=@OTB_CPPFLAGS@
OTBLDFLAGS=@OTB_LDFLAGS@
OTB_ENABLED=@OTB_ENABLED@
......@@ -100,8 +120,8 @@ MONO_LDFLAGS=@MONO_LDFLAGS@
MONO_ENABLED=@MONO_ENABLED@
MONO_FILE=@MONO_FILE@
CFLAGS=@RELY_ON_DB@ @DEB_DEF@ -fpic @OPENSSL_CFLAGS@ ${FCGI_CFLAGS} ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
LDFLAGS=-lzoo_service @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ -luuid ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} ${MONO_LDFLAGS}
CFLAGS=@CALLBACK_USE@ @SSH2_CPPFLAGS@ @PROJ_CPPFLAGS@ @RELY_ON_DB@ @DEB_DEF@ -fpic @OPENSSL_CFLAGS@ @UUID_CFLAGS@ ${FCGI_CFLAGS} ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
LDFLAGS=-lzoo_service @SSH2_LDFLAGS@ @PROJ_LDFLAGS@ @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ @UUID_LDFLAGS@ ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} ${MONO_LDFLAGS} ${RLDFLAGS} @JSON_LDFLAGS@ @XSLT_LDFLAGS@
DATAROOTDIR=@datarootdir@/zoo-project
SHAREDSTATEDIR=@sharedstatedir@/zoo-project
This diff is collapsed.
......@@ -34,6 +34,8 @@ extern "C" {
int runHttpRequests(maps**,maps**,HINTERNET*,map**);
void addRequestToQueue(maps**,HINTERNET*,const char*,bool);
int loadRemoteFile(maps**,map**,HINTERNET*,char*);
char* getMd5f(char*);
int storeMd5(char*);
#ifdef __cplusplus
}
......
This diff is collapsed.
AC_INIT([ZOO Kernel], [1.6.0], [bugs@zoo-project.org])
AC_INIT([ZOO Kernel], [1.7.0], [bugs@zoo-project.org])
AC_CONFIG_MACRO_DIR([macros])
# Checks for programs.
AC_PROG_YACC
......@@ -11,7 +13,6 @@ AC_PROG_SED
AC_CHECK_LIB([curl], [curl_easy_init,curl_easy_setopt,curl_easy_cleanup,curl_easy_perform])
AC_CHECK_LIB([dl], [dlopen,dlsym,dlerror,dlclose])
AC_CHECK_LIB([crypto], [EVP_DigestInit,EVP_md5,EVP_DigestUpdate,BIO_f_base64,BIO_new])
AC_CHECK_LIB([uuid], [uuid_generate_time])
DEFAULT_LIBS="$LIBS"
AC_SUBST([DEFAULT_LIBS])
......@@ -19,7 +20,7 @@ AC_SUBST([DEFAULT_LIBS])
# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h malloc.h stddef.h stdlib.h string.h unistd.h])
AC_CHECK_HEADERS([fcntl.h inttypes.h malloc.h stddef.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
......@@ -38,6 +39,63 @@ AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([dup2 getcwd memset setenv strdup strstr])
#============================================================================
# Detect if uuid is available
#============================================================================
AC_ARG_WITH([uuid],
[AS_HELP_STRING([--with-uuid=PATH], [Specifies an alternative location for the ossp-uuid library])],
[UUID_DIR="$withval"], [UUID_DIR="/usr/"])
UUID_CFLAGS="-I$UUID_DIR/include"
UUID_LDFLAGS="-L$UUID_DIR/lib -luuid"
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$UUID_CFLAGS"
LIBS_SAVE="$LIBS"
LIBS="$UUID_LDFLAGS"
AC_CHECK_HEADERS([uuid/uuid.h],
[], [AC_MSG_ERROR([could not find header file uuid.h])])
AC_CHECK_LIB([uuid], [uuid_generate_time],
[], [AC_MSG_ERROR([could not find function in uuid library])])
CPPFLAGS="$CPPFLAGS_SAVE"
AC_SUBST([UUID_CFLAGS])
AC_SUBST([UUID_LDFLAGS])
#============================================================================
# Detect if json-c is available
#============================================================================
AC_ARG_WITH([callback],
[AS_HELP_STRING([--with-callback=yes], [Activate callback invocation during HPC execution])],
[CALLBACK_ACTIVATED="$withval"], [CALLBACK_ACTIVATED="no"])
AC_ARG_WITH([json],
[AS_HELP_STRING([--with-json=PATH], [Specifies an alternative location for the json-c library])],
[JSON_DIR="$withval"], [JSON_DIR="/usr/"])
if test "x$JSON_DIR" != "x" && test "x$CALLBACK_ACTIVATED" == "xyes"
then
JSON_CPPFLAGS="-I$JSON_DIR/include/json-c/"
JSON_LDFLAGS="-L$JSON_DIR/lib -ljson-c"
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$JSON_CPPFLAGS"
LIBS_SAVE="$LIBS"
LIBS="$JSON_LDFLAGS"
AC_CHECK_HEADERS([json_object.h],
[], [AC_MSG_ERROR([could not find header file json_object.h])])
AC_CHECK_LIB([json-c], [json_object_new_object],
[], [AC_MSG_ERROR([could not find function in json-c library])])
CPPFLAGS="$CPPFLAGS_SAVE"
JSON_FILE="service_json.o"
JSON_ENABLED="-DJSON"
CALLBACK_FILE="service_callback.o"
CALLBACK_USE="-DUSE_CALLBACK"
fi
AC_SUBST([JSON_CPPFLAGS])
AC_SUBST([JSON_LDFLAGS])
AC_SUBST([JSON_FILE])
AC_SUBST([JSON_ENABLED])
AC_SUBST([CALLBACK_FILE])
AC_SUBST([CALLBACK_USE])
#============================================================================
# Detect if openssl is available
#============================================================================
......@@ -55,9 +113,30 @@ AC_CHECK_HEADERS([openssl/md5.h openssl/hmac.h openssl/evp.h openssl/bio.h opens
[], [AC_MSG_ERROR([could not find header file $i related to openssl])])
AC_CHECK_LIB(crypto, BIO_f_base64,
[], [AC_MSG_ERROR([could not find $i function in openssl library])])
CPPFLAGS="$CPPFLAGS_SAVE"
AC_SUBST([OPENSSL_CFLAGS])
AC_SUBST([OPENSSL_LDFLAGS])
#============================================================================
# Detect if gettext is available
#============================================================================
#AC_ARG_WITH([gettext],
# [AS_HELP_STRING([--with-gettext=PATH], [Specifies an alternative location for the openssl library])],
# [GETTEXT_DIR="$withval"], [GETTEXT_DIR="/usr/"])
#GETTEXT_CFLAGS="-I$GETTEXT_DIR/include"
#GETTEXT_LDFLAGS="-L$GETTEXT_DIR/lib -lintl"
#CFLAGS_SAVE="$CFLAGS"
#CFLAGS="$GETTEXT_CFLAGS"
#LIBS_SAVE="$LIBS"
#LIBS="$GETTEXT_LDFLAGS"
#AM_GNU_GETTEXT([external], [], [])
#AC_CHECK_LIB(intl,
# [dgettext], [] , [AC_MSG_ERROR([could not find $i function in gettext library])])
#AC_SUBST([GETTEXT_CFLAGS])
#AC_SUBST([GETTEXT_LDFLAGS])
#============================================================================
# Detect if run on debian / ubuntu
#============================================================================
......@@ -144,6 +223,59 @@ LIBS="$LIBS_SAVE"
AC_SUBST([FCGI_CPPFLAGS])
AC_SUBST([FCGI_LDFLAGS])
AC_ARG_WITH([metadb],
[AS_HELP_STRING([--with-metadb=yes], [Activates the metadata database support])],
[WITHMETADB="$withval"], [WITHMETADB=""])
if test "x$WITHMETADB" = "xyes"; then
METADB="-DMETA_DB"
METADB_FILE="meta_sql.o sqlapi.o"
else
METADB=""
METADB_FILE=""
fi
AC_SUBST([METADB])
AC_SUBST([METADB_FILE])
AC_ARG_WITH([hpc],
[AS_HELP_STRING([--with-hpc=yes], [Specifies if you need to activate HPC support])],
[HPCWITH="$withval"], [HPCWITH="no"])
AC_ARG_WITH([ssh2],
[AS_HELP_STRING([--with-ssh2=PATH], [Specifies an alternative location for the ssh2 library])],
[SSH2PATH="$withval"], [SSH2PATH="/usr"])
if test "x$HPCWITH" = "xyes"; then
HPC_FILES="service_internal_hpc.o sshapi.o"
HPC_ENABLED="-DUSE_HPC"
HPC_CPPFLAGS=""
HPC_LDFLAGS=""
# Extract the linker and include flags
SSH2_LDFLAGS="-L$SSH2PATH/lib -lssh2"
SSH2_CPPFLAGS="-I$SSH2PATH/include"
# Check headers file
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$SSH2_CPPFLAGS"
LIBS_SAVE="$LIBS"
LIBS="$SSH2_LDFLAGS"
AC_CHECK_HEADERS([libssh2.h],
[], [AC_MSG_ERROR([could not find headers related to libssh2])])
AC_CHECK_LIB([ssh2], [libssh2_session_init])
LIBS="$LIBS_SAVE"
fi
AC_SUBST([HPC_CPPFLAGS])
AC_SUBST([HPC_LDFLAGS])
AC_SUBST([HPC_ENABLED])
AC_SUBST([HPC_FILES])
AC_SUBST([SSH2_CPPFLAGS])
AC_SUBST([SSH2_LDFLAGS])
# ===========================================================================
# Detect if libxml2 is installed
# ===========================================================================
......@@ -399,6 +531,43 @@ MS_LIBS="$MS_LDFLAGS"
AC_SUBST([MS_CFLAGS])
AC_SUBST([MS_LIBS])
AC_SUBST([MS_FILE])
AC_SUBST([MS_VERSION])
# ===========================================================================
# Detect if R is installed
# ===========================================================================
AC_ARG_WITH([r],
[AS_HELP_STRING([--with-r=PATH], [To enable python support or Specifies an alternative directory for R installation, disabled by default])],
[R_PATH="$withval"; R_ENABLED="-DUSE_R"], [R_ENABLED=""])
if test -z "$R_ENABLED"
then
R_FILE=""
else
R_FILE="service_internal_r.o"
# Extract the linker and include flags
R_LDFLAGS="-L$R_PATH/lib/ -lR"
R_CPPFLAGS="-I$R_PATH/include/ -I$R_PATH/share/R/include/"
# Check headers file
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$R_CPPFLAGS"
AC_CHECK_HEADERS([Rinternals.h],
[], [AC_MSG_ERROR([could not find headers include related to R])])
# Ensure we can link against libphp
#LIBS_SAVE="$LIBS"
#LIBS="$R_LDFLAGS"
#AC_CHECK_LIB([$LIBS], [R_tryEval], [], [AC_MSG_ERROR([could not find libR])], [])
#LIBS="$LIBS_SAVE"
fi
AC_SUBST([R_CPPFLAGS])
AC_SUBST([R_LDFLAGS])
AC_SUBST([R_ENABLED])
AC_SUBST([R_FILE])
# ===========================================================================
# Detect if python is installed
......@@ -645,7 +814,7 @@ else
fi
AC_LANG([C++])
echo $JAVA_CPPFLAGS
#echo $JAVA_CPPFLAGS
# Check headers file (second time we check that in fact)
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$JAVA_CPPFLAGS"
......@@ -695,7 +864,7 @@ else
MONO_LDFLAGS=`$MONOHOME/bin/pkg-config --libs mono-2`
AC_LANG([C++])
echo $JAVA_CPPFLAGS
#echo $JAVA_CPPFLAGS
# Check headers file (second time we check that in fact)
CPPFLAGS_SAVE="$CFLAGS"
CPPFLAGS="$MONO_CFLAGS"
......@@ -830,15 +999,15 @@ else
if test "$IVERS" == "$ITKVERS"; then
ITK_LDFLAGS="-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 -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS"
else
ITK_LDFLAGS="-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 -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS"
ITK_LDFLAGS="-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 -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS"
fi
if test -a "${OTBPATH}/include/OTB-${OTBVERS}" ; then
OTB_RPATH="$OTBPATH/include/OTB-${OTBVERS}/"
OTB_CPPFLAGS="-I${OTB_RPATH}ApplicationEngine -I$OTB_RPATH/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTB_RPATH/Utilities/ITK -I$OTB_RPATH/ -I$OTB_RPATH/IO -I$OTB_RPATH/UtilitiesAdapters/OssimAdapters -I$OTB_RPATH/UtilitiesAdapters/CurlAdapters -I$OTB_RPATH/Utilities/BGL -I$OTB_RPATH/UtilitiesAdapters/ITKPendingPatches -I$OTB_RPATH/Utilities/otbconfigfile $GDAL_CFLAGS"
OTB_CPPFLAGS="-I${OTB_RPATH} -I${OTB_RPATH}ApplicationEngine -I$OTB_RPATH/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTB_RPATH/Utilities/ITK -I$OTB_RPATH/ -I$OTB_RPATH/IO -I$OTB_RPATH/UtilitiesAdapters/OssimAdapters -I$OTB_RPATH/UtilitiesAdapters/CurlAdapters -I$OTB_RPATH/Utilities/BGL -I$OTB_RPATH/UtilitiesAdapters/ITKPendingPatches -I$OTB_RPATH/Utilities/otbconfigfile $GDAL_CFLAGS"
OTB_LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -lOTBImageIO-$OTBVERS -lOTBCommon-$OTBVERS -lOTBApplicationEngine-$OTBVERS -L$ITKPATH/lib $ITK_LDFLAGS"
else
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"
OTB_CPPFLAGS="-I${OTB_RPATH} -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"
OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib $ITK_LDFLAGS"
fi
......@@ -887,6 +1056,10 @@ AC_ARG_WITH([saga],
[AS_HELP_STRING([--with-saga=PATH], [Specifies an alternative location for the SAGA-GIS library])],
[SAGAPATH="$withval"], [SAGAPATH=""])
AC_ARG_WITH([saga-version],
[AS_HELP_STRING([--with-saga-version=VERSION], [Specifies the SAGA-GIS version number])],
[SAGAVERS="$withval"], [SAGAVERS="2"])
if test -z "$SAGAPATH"
then
SAGA_LDFLAGS=""
......@@ -902,7 +1075,7 @@ else
fi
WX_ISSUE="-D_WX_WXCRTVARARG_H_"
SAGA_DEFS="-D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DMODULE_LIBRARY_PATH=\\\"$SAGAPATH/lib/saga\\\""
SAGA_CPPFLAGS=" -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE"
SAGA_CPPFLAGS="-DSAGA_VERSION=${SAGAVERS} -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE"
SAGA_LDFLAGS="-fPIC `$WXCFG --unicode=yes --static=no --libs` -lsaga_api"
SAGA_ENABLED="-DUSE_SAGA"
SAGA_FILE="service_internal_saga.o"
......@@ -913,10 +1086,18 @@ else
CPPFLAGS="$SAGA_CPPFLAGS"
LIBS_SAVE="$LIBS"
LIBS="$SAGA_LDFLAGS"
if test "$SAGAVERS" == "2"; then
AC_CHECK_HEADERS([module_library.h],
[], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "module_library.h"],[SG_Get_Module_Library_Manager();]])],
[AC_MSG_RESULT([checking for SG_Get_Module_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Module_Library_Manager... failed])])
else
AC_CHECK_HEADERS([tool_library.h],
[], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "tool_library.h"],[SG_Get_Tool_Library_Manager();]])],
[AC_MSG_RESULT([checking for SG_Get_Tool_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Tool_Library_Manager... failed])])
fi
LIBS="$LIBS_SAVE"
AC_LANG_POP([C++])
fi
......@@ -927,4 +1108,5 @@ AC_SUBST([SAGA_ENABLED])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([ZOOMakefile.opts])
AC_CONFIG_FILES([main.cfg])
AC_OUTPUT