Index: /trunk/thirds/otb2zcfg/otb2zcfg.cxx
===================================================================
--- /trunk/thirds/otb2zcfg/otb2zcfg.cxx	(revision 554)
+++ /trunk/thirds/otb2zcfg/otb2zcfg.cxx	(revision 555)
@@ -130,5 +130,5 @@
     for (std::vector<std::string>::const_iterator it = list.begin(); it != list.end(); ++it){
       std::string filename= *it + ".zcfg";
-      std::ofstream out(filename);
+      std::ofstream out(filename.c_str(),std::ofstream::out);
       std::streambuf *coutbuf = std::cout.rdbuf();
       std::cout.rdbuf(out.rdbuf());
Index: /trunk/zoo-project/zoo-kernel/Makefile.in
===================================================================
--- /trunk/zoo-project/zoo-kernel/Makefile.in	(revision 554)
+++ /trunk/zoo-project/zoo-kernel/Makefile.in	(revision 555)
@@ -46,5 +46,5 @@
 
 service_internal_otb.o: service_internal_otb.c service.h
-	g++ ${OTBCFLAGS} ${CFLAGS} -c service_internal_otb.c
+	g++ ${XML2CFLAGS} ${OTBCFLAGS} ${CFLAGS} -c service_internal_otb.c
 
 otbRunner.o: otbRunner.cxx otbRunner.h service.h
Index: /trunk/zoo-project/zoo-kernel/configure.ac
===================================================================
--- /trunk/zoo-project/zoo-kernel/configure.ac	(revision 554)
+++ /trunk/zoo-project/zoo-kernel/configure.ac	(revision 555)
@@ -87,4 +87,12 @@
 # ===========================================================================
 
+AC_ARG_WITH([itk],
+        [AS_HELP_STRING([--with-itk=PATH], [specify an alternative location for the itk library])],
+        [ITKPATH="$withval"], [ITKPATH=""])
+
+AC_ARG_WITH([itk-version],
+        [AS_HELP_STRING([--with-itk-version=VERSION], [specify an alternative version for the itk library])],
+        [ITKVERS="$withval"], [ITKVERS=""])
+
 AC_ARG_WITH([otb],
         [AS_HELP_STRING([--with-otb=PATH], [specify an alternative location for the otb library])],
@@ -98,8 +106,11 @@
 	OTB_ENABLED=""
 else
-
+    if test -z "$ITKVERS" 
+    then
+        ITKVERS="4.5"
+    fi
 	OTB_ENABLED="-DUSE_OTB"
-	OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -lITKBiasCorrection-4.5 -lITKCommon-4.5 -lITKIOImageBase-4.5 -lITKKLMRegionGrowing-4.5 -lITKLabelMap-4.5 -lITKMesh-4.5 -lITKMetaIO-4.5 -lITKOptimizers-4.5 -lITKPath-4.5 -lITKPolynomials-4.5 -lITKQuadEdgeMesh-4.5 -lITKSpatialObjects-4.5 -lITKStatistics-4.5 -lITKVNLInstantiation-4.5 -lITKWatersheds-4.5 -litkNetlibSlatec-4.5 -litksys-4.5 -litkdouble-conversion-4.5 -litkv3p_lsqr-4.5 -litkv3p_netlib-4.5 -litkvcl-4.5 -litkvnl-4.5 -litkvnl_algo-4.5 -litkzlib-4.5"
-	OTB_CPPFLAGS="-I$OTBPATH/include/otb/ApplicationEngine -I$OTBPATH/include/otb/Common -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"
+	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"
+	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_FILE="service_internal_otb.o" #otbZooWatcher.o otbRunner.o"
 	
@@ -110,10 +121,7 @@
 	LDFLAGS_SAVE="$LDFLAGS"
 	LDFLAGS="$OTB_LDFLAGS"
-	for i in otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h; do
-	    AC_CHECK_HEADERS([$i],
+	AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h],
 			[], [AC_MSG_ERROR([could not find header file $i related to OTB])])
-	done
 	AC_LANG_POP([C++])
-	##,otbWrapperInputImageListParameter,otbFilterWatcherBase.h,itksys/SystemTools.hxx,itkCommand.h,itkProcessObject.h,itkTimeProbe.h
 fi
 AC_SUBST([OTB_CPPFLAGS])
Index: /trunk/zoo-project/zoo-kernel/service_internal_otb.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/service_internal_otb.c	(revision 554)
+++ /trunk/zoo-project/zoo-kernel/service_internal_otb.c	(revision 555)
@@ -24,5 +24,4 @@
 
 #include "service_internal_otb.h"
-#include "otbWrapperInputImageListParameter.h"
 #include <vector>
 #include <string>
@@ -40,11 +39,7 @@
 
 int zoo_otb_support(maps** main_conf,map* request,service* s,maps **real_inputs,maps **real_outputs){
-  char *pythonpath;
-  char *python_path;
   maps* m=*main_conf;
   maps* inputs=*real_inputs;
   maps* outputs=*real_outputs;
-  map* tmp0=getMapFromMaps(*main_conf,"lenv","cwd");
-  char *ntmp=tmp0->value;
   map* tmp=NULL;
   int res=-1;
@@ -182,5 +177,5 @@
 		    int len=atoi(tmpPath->value);
 		    for(int k=1;k<len;k++){
-		      char tmp[10];
+		      char tmp[15];
 		      sprintf(tmp,"cache_file_%d",k);
 		      map* tmpVal=getMapFromMaps(inputs,paramKey.c_str(),tmp);
Index: /trunk/zoo-project/zoo-kernel/service_internal_otb.h
===================================================================
--- /trunk/zoo-project/zoo-kernel/service_internal_otb.h	(revision 554)
+++ /trunk/zoo-project/zoo-kernel/service_internal_otb.h	(revision 555)
@@ -30,4 +30,5 @@
 #include "otbWrapperApplication.h"
 #include "otbWrapperApplicationRegistry.h"
+#include "otbWrapperInputImageListParameter.h"
 #include "service_internal.h"
 #include "service.h"
