From: Viktor M. <mih...@us...> - 2005-04-08 11:37:38
|
Update of /cvsroot/sblim/cmpi-base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13926 Modified Files: acinclude.m4 configure.ac Log Message: Bug 1177872: addendum, now search in includedir/sblim for the indication helper header. Index: acinclude.m4 =================================================================== RCS file: /cvsroot/sblim/cmpi-base/acinclude.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- acinclude.m4 6 Apr 2005 16:29:47 -0000 1.1 +++ acinclude.m4 8 Apr 2005 11:37:12 -0000 1.2 @@ -85,6 +85,29 @@ ]) +AC_DEFUN([_CHECK_INDHELP_HEADER], + [ + AC_MSG_CHECKING($1) + AC_TRY_COMPILE( + [ + #include <stdio.h> + #include <ind_helper.h> + ], + [ + CMPISelectExp *filter = NULL; + ind_set_select("/root/cimv2",NULL,filter); + ], + [ + have_INDHELP=yes + dnl AC_MSG_RESULT(yes) + ], + [ + have_INDHELP=no + dnl AC_MSG_RESULT(no) + ]) + +]) + dnl dnl The main function to check for CMPI headers dnl Modifies the CPPFLAGS with the right include directory and sets @@ -132,6 +155,47 @@ ) dnl +dnl The main function to check for the indication_helper header. +dnl Modifies the CPPFLAGS with the right include directory and sets +dnl the 'have_INDHELP' to either 'no' or 'yes' +dnl + +AC_DEFUN([CHECK_INDHELP_HEADER], + [ + AC_MSG_CHECKING(for indication helper header) + dnl Check just with the standard include paths + _CHECK_INDHELP_HEADER(standard) + if test "$have_INDHELP" == "yes"; then + dnl The standard include paths worked. + AC_MSG_RESULT(yes) + else + INDHELP_CPP_FLAGS="$CPPFLAGS" + _DIRS_="/usr/include/sblim \ + /usr/local/include/sblim" + for _DIR_ in $_DIRS_ + do + _cppflags=$CPPFLAGS + _include_INDHELP="$_DIR_" + CPPFLAGS="$CPPFLAGS -I$_include_INDHELP" + _CHECK_INDHELP_HEADER($_DIR_) + if test "$have_INDHELP" == "yes"; then + dnl Found it + AC_MSG_RESULT(yes) + dnl Save the new -I parameter + INDHELP_CPP_FLAGS="$CPPFLAGS" + break + fi + CPPFLAGS=$_cppflags + done + fi + CPPFLAGS="$INDHELP_CPP_FLAGS" + if test "$have_INDHELP" == "no"; then + AC_MSG_RESULT(no) + fi + ] +) + +dnl dnl The check for the CMPI provider directory dnl Sets the PROVIDERDIR variable. dnl Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/cmpi-base/configure.ac,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- configure.ac 6 Apr 2005 16:29:47 -0000 1.1 +++ configure.ac 8 Apr 2005 11:37:12 -0000 1.2 @@ -28,7 +28,6 @@ # Checks for libraries. AC_CHECK_LIB([ind_helper], [ind_start], [LINDHELP=-lind_helper], [LINDHELP=]) -AC_SUBST(LINDHELP) # Check for required CMPI header files (defined in acinclude.m4) CHECK_CMPI @@ -44,7 +43,19 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fcntl.h langinfo.h limits.h malloc.h stdlib.h string.h sys/time.h unistd.h]) -AC_CHECK_HEADER([ind_helper.h],[EVENTFLAGS=],[EVENTFLAGS=-DNOEVENTS],[]) + +# Test for indication support +EVENTFLAGS=-DNOEVENTS +if test x$LINDHELP != x; then +# Indication lib is there, what about headers + CHECK_INDHELP_HEADER + if test "$have_INDHELP" == "yes"; then + EVENTFLAGS= + else + LINDHELP= + fi +fi +AC_SUBST(LINDHELP) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST |