Index: branches/prototype-v0/zoo-project/zoo-kernel/configure.ac
===================================================================
--- branches/prototype-v0/zoo-project/zoo-kernel/configure.ac	(revision 873)
+++ branches/prototype-v0/zoo-project/zoo-kernel/configure.ac	(revision 877)
@@ -68,18 +68,20 @@
     [AS_HELP_STRING([--with-json=PATH], [Specifies an alternative location for the json-c library])],
     [JSON_DIR="$withval"], [JSON_DIR="/usr/"])
-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"
-echo $CPPFLAGS
-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"
+if test "x$JSON_DIR" != "x"
+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"
+fi
 AC_SUBST([JSON_CPPFLAGS])
 AC_SUBST([JSON_LDFLAGS])
@@ -112,9 +114,10 @@
 #============================================================================
 
-#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"
+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"
@@ -232,4 +235,9 @@
         [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"
@@ -237,4 +245,18 @@
 	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
 
@@ -244,24 +266,4 @@
 AC_SUBST([HPC_FILES])
 
-AC_ARG_WITH([ssh2],
-        [AS_HELP_STRING([--with-ssh2=PATH], [Specifies an alternative location for the ssh2 library])],
-        [SSH2PATH="$withval"], [SSH2PATH="/usr"])
-
-# 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"
-echo $CPPFLAGS
-echo $LIBS
-
-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"
 AC_SUBST([SSH2_CPPFLAGS])
 AC_SUBST([SSH2_LDFLAGS])
@@ -805,5 +807,5 @@
 
 	AC_LANG([C++])
-	echo $JAVA_CPPFLAGS
+	#echo $JAVA_CPPFLAGS
 	# Check headers file (second time we check that in fact)
 	CPPFLAGS_SAVE="$CPPFLAGS"
@@ -855,5 +857,5 @@
 
 	AC_LANG([C++])
-	echo $JAVA_CPPFLAGS
+	#echo $JAVA_CPPFLAGS
 	# Check headers file (second time we check that in fact)
 	CPPFLAGS_SAVE="$CFLAGS"
