[icinga-checkins] icinga.org: icinga-web/mhein/default: * Checking for the api on configure

git at icinga.org git at icinga.org
Fri Apr 16 17:26:44 CEST 2010


Module: icinga-web
Branch: mhein/default
Commit: 5bec9d119bad6d345afcd1b7ea488a45691c6e5b
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=5bec9d119bad6d345afcd1b7ea488a45691c6e5b

Author: Marius Hein <marius.hein at netways.de>
Date:   Fri Apr 16 14:56:46 2010 +0200

* Checking for the api on configure

---

 aclocal.m4   |   14 ++++++++----
 configure    |   59 +++++++++++++++++++++++++++++++++------------------------
 configure.ac |    9 ++++++-
 3 files changed, 50 insertions(+), 32 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 283a7fd..0c9d990 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -22,10 +22,14 @@ AC_DEFUN([ACICINGA_GROUP_GUESS],[
 AC_DEFUN([ACICINGA_CHECK_BIN], [
    AC_PATH_PROG([$1],[$2],[not found])
 
-   AS_IF([ test "$2"  == "not found" ],
-	 [ AC_MSG_ERROR([binary $3 not found in PATH]) ])
-
-   AS_IF([ test -x "$2" ],
-	 [ AC_MSG_ERROR([$3 not executable]) ])
+   AS_IF([ test "$2" == "not found" ],
+	 [ AC_MSG_WARN([binary $3 not found in PATH]) ])
+    
 ])
 
+AC_DEFUN([ACICINGA_CHECK_API], [
+	AC_MSG_CHECKING([for IcingaApi])
+	AS_IF([ test -e $1/IcingaApi.php && $GREP -q "class IcingaApi" $1/IcingaApi.php ],
+		[ AC_MSG_RESULT([found])    ],
+		[ AC_MSG_WARN([not found]) ])
+])
\ No newline at end of file
diff --git a/configure b/configure
index 000c766..380d902 100755
--- a/configure
+++ b/configure
@@ -1262,7 +1262,7 @@ Optional Packages:
 Some influential environment variables:
   PHP         php cli binary
   MYSQL       mysql client binary
-  PHING       phing build tooö
+  PHING       phing build tool
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1992,13 +1992,11 @@ fi
 
 
 
-   if  test "php"  == "not found" ; then :
-   as_fn_error "binary  not found in PATH" "$LINENO" 5
+   if  test "php" == "not found" ; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: binary  not found in PATH" >&5
+$as_echo "$as_me: WARNING: binary  not found in PATH" >&2;}
 fi
 
-   if  test -x "php" ; then :
-   as_fn_error " not executable" "$LINENO" 5
-fi
 
 
 # Check for mysql
@@ -2046,13 +2044,11 @@ fi
 
 
 
-   if  test "mysql"  == "not found" ; then :
-   as_fn_error "binary  not found in PATH" "$LINENO" 5
+   if  test "mysql" == "not found" ; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: binary  not found in PATH" >&5
+$as_echo "$as_me: WARNING: binary  not found in PATH" >&2;}
 fi
 
-   if  test -x "mysql" ; then :
-   as_fn_error " not executable" "$LINENO" 5
-fi
 
 
 # Check for phing
@@ -2062,12 +2058,12 @@ fi
 set dummy phing; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_MYSQL+set}" = set; then :
+if test "${ac_cv_path_PHING+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
-  case $MYSQL in
+  case $PHING in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_MYSQL="$MYSQL" # Let the user override the test with a path.
+  ac_cv_path_PHING="$PHING" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -2077,7 +2073,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_MYSQL="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_PHING="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -2085,14 +2081,14 @@ done
   done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_MYSQL" && ac_cv_path_MYSQL="not found"
+  test -z "$ac_cv_path_PHING" && ac_cv_path_PHING="not found"
   ;;
 esac
 fi
-MYSQL=$ac_cv_path_MYSQL
-if test -n "$MYSQL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL" >&5
-$as_echo "$MYSQL" >&6; }
+PHING=$ac_cv_path_PHING
+if test -n "$PHING"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHING" >&5
+$as_echo "$PHING" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -2100,13 +2096,11 @@ fi
 
 
 
-   if  test "phing"  == "not found" ; then :
-   as_fn_error "binary  not found in PATH" "$LINENO" 5
+   if  test "phing" == "not found" ; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: binary  not found in PATH" >&5
+$as_echo "$as_me: WARNING: binary  not found in PATH" >&2;}
 fi
 
-   if  test -x "phing" ; then :
-   as_fn_error " not executable" "$LINENO" 5
-fi
 
 
 # Checks for libraries.
@@ -2119,6 +2113,7 @@ fi
 
 # Define install options
 
+# Users for webfiles
 
 # Check whether --with-web_user was given.
 if test "${with_web_user+set}" = set; then :
@@ -2185,6 +2180,7 @@ else
 fi
 
 
+# Api related
 
 # Check whether --with-icinga_api was given.
 if test "${with_icinga_api+set}" = set; then :
@@ -2196,6 +2192,19 @@ fi
 
 
 
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IcingaApi" >&5
+$as_echo_n "checking for IcingaApi... " >&6; }
+	if  test -e $icinga_api/IcingaApi.php && $GREP -q "class IcingaApi" $icinga_api/IcingaApi.php ; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: not found" >&5
+$as_echo "$as_me: WARNING: not found" >&2;}
+fi
+
+
+# Web database switches
+
 # Check whether --with-db_type was given.
 if test "${with_db_type+set}" = set; then :
   withval=$with_db_type; db_type=$withval
diff --git a/configure.ac b/configure.ac
index 609dadd..d953696 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,8 +23,8 @@ AC_ARG_VAR([MYSQL],[mysql client binary])
 ACICINGA_CHECK_BIN([MYSQL], [mysql])
 
 # Check for phing
-AC_ARG_VAR([PHING],[phing build tooö])
-ACICINGA_CHECK_BIN([MYSQL], [phing])
+AC_ARG_VAR([PHING],[phing build tool])
+ACICINGA_CHECK_BIN([PHING], [phing])
 
 # Checks for libraries.
 
@@ -36,6 +36,7 @@ ACICINGA_CHECK_BIN([MYSQL], [phing])
 
 # Define install options
 
+# Users for webfiles
 AC_ARG_WITH([web_user],
 	AS_HELP_STRING([--with-web-user=<user>], [username for web writable files (default www-data)]),
 	web_user=$withval,
@@ -60,12 +61,16 @@ AC_ARG_WITH([bin_group],
 	bin_group=bin
 )
 
+# Api related
 AC_ARG_WITH([icinga_api],
 	AS_HELP_STRING([--with-icinga-api=<string>], [Path to icinga-api]),
 	icinga_api=$withval,
 	icinga_api=/usr/local/icinga-api
 )
 
+ACICINGA_CHECK_API([$icinga_api])
+
+# Web database switches
 AC_ARG_WITH([db_type],
 	AS_HELP_STRING([--with-db-type=<string>], [Type of dbms (default mysql)]),
 	db_type=$withval,





More information about the icinga-checkins mailing list