From: Viktor M. <mih...@us...> - 2005-06-06 16:05:38
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27953 Modified Files: Makefile.am configure.ac control.c sfcBroker.c Log Message: Added configuration flags and conditional compilation support for the JDBC adapter. Index: control.c =================================================================== RCS file: /cvsroot/sblim/sfcb/control.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- control.c 3 Jun 2005 10:31:57 -0000 1.7 +++ control.c 6 Jun 2005 16:05:23 -0000 1.8 @@ -27,6 +27,10 @@ #include <ctype.h> #include <string.h> +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifndef SFCB_CONFDIR #define SFCB_CONFDIR "/etc/sfcb" @@ -48,14 +52,19 @@ Control init[] = { {"httpPort", 1, "5988"}, - {"dbpPort", 1, "5980"}, {"enableHttp", 2, "true"}, {"httpProcs", 1, "8"}, - {"dbpProcs", 1, "8"}, {"httpsPort", 1, "5989"}, - {"httpsPort", 1, "5981"}, {"enableHttps", 2, "false"}, {"httpsProcs", 1, "8"}, +#ifdef HAVE_JDBC + {"dbpPort", 1, "5980"}, + {"enableDbp", 2, "true"}, + {"dbpProcs", 1, "8"}, + {"dbpsPort", 1, "5981"}, + {"enableDbps", 2, "true"}, + {"dbpsProcs", 1, "8"}, +#endif {"provProcs", 1, "32"}, {"basicAuthLib", 0, "sfcBasicAuthentication"}, {"doBasicAuth", 2, "false"}, Index: sfcBroker.c =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcBroker.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- sfcBroker.c 3 Jun 2005 10:31:57 -0000 1.12 +++ sfcBroker.c 6 Jun 2005 16:05:23 -0000 1.13 @@ -40,6 +40,10 @@ #include "sfcVersion.h" #include "control.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + extern void setExFlag(unsigned long f); extern char *parseTarget(const char *target); extern UtilStringBuffer *instanceToString(CMPIInstance * ci, char **props); @@ -59,6 +63,11 @@ extern unsigned long exFlags; int startHttp = 0; + +#ifdef HAVE_JDBC +int startDbp = 1; +#endif + char *name; extern int collectStat; @@ -306,6 +315,7 @@ return 0; } +#ifdef HAVE_JDBC extern int dbpDaemon(int argc, char *argv[], int sslMode, int sfcbPid); int startDbpd(int argc, char *argv[], int sslMode) @@ -330,7 +340,7 @@ return 0; } - +#endif int main(int argc, char *argv[]) { @@ -461,14 +471,15 @@ startHttpd(argc, argv,0); } - //Start dbProtocol-Daemon - if (startHttp) { +#ifdef HAVE_JDBC + //Start dbProtocol-Daemon + if (startDbp) { if (sslMode) startDbpd(argc, argv,1); if (!sslOMode) startDbpd(argc, argv,0); } - +#endif setSignal(SIGSEGV, handleSigSegv,SA_ONESHOT); setSignal(SIGCHLD, handleSigChld,0); Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/sfcb/configure.ac,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- configure.ac 3 Jun 2005 10:31:57 -0000 1.11 +++ configure.ac 6 Jun 2005 16:05:23 -0000 1.12 @@ -35,10 +35,25 @@ [AC_HELP_STRING([--enable-ssl], [include ssl support for SFCB.])]) -if test "$enable_debug" != "no"; then +AC_ARG_ENABLE(jdbc, + [AC_HELP_STRING([--enable-jdbc], + [include server-side JDBC support for SFCB - EXPERIMENTAL.])]) + +AC_ARG_ENABLE(indications, + [AC_HELP_STRING([--disable-indications], + [disable indication support for SFCB - currently not working.])], + [enable_indications=$enableval], + [enable_indications="yes"] + ) + +if test "$enable_debug" == "yes"; then CPPFLAGS="-D SFCB_DEBUG $CPPFLAGS" fi +if test "$enable_jdbc" == "yes"; then + AC_DEFINE(HAVE_JDBC,,[JDBC support enabled.]) +fi + AC_CANONICAL_HOST case $host_os in openedition*) SFCB_CMPI_PLATFORM="-D CMPI_PLATFORM_LINUX_GENERIC_GNU" @@ -79,6 +94,9 @@ # Checks for libraries. AC_CHECK_LIB(pthread,main) AC_CHECK_LIB(dl,main) +if test "$enable_indications" = "yes"; then + AC_CHECK_LIB(curl,main) +fi if test "$enable_ssl" = "yes"; then AC_CHECK_LIB(ssl,main) @@ -133,5 +151,16 @@ AC_SUBST(MOFC_DIR) fi +AM_CONDITIONAL(JDBC,[test "$enable_jdbc" == "yes"]) + AC_CONFIG_FILES([Makefile sfcb.spec sfcbrepos.sh sfcbstage.sh sfcbunstage.sh sfcb.cfg.pre getSchema.sh.pre sfcb.init-redhat sfcb.init-suse sfcb.init-none]) AC_OUTPUT + +echo ====================================================== +echo sfcb configuration complete +echo configuration features: +echo -e "debug"\\t"${enable_debug:-no}" +echo -e "indications"\\t"yes (cannot be disabled currently)" +echo -e "ssl"\\t"${enable_ssl:-no}" +echo -e "jdbc"\\t"${enable_jdbc:-no}" +echo ====================================================== Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/sfcb/Makefile.am,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Makefile.am 6 Jun 2005 11:12:59 -0000 1.24 +++ Makefile.am 6 Jun 2005 16:05:23 -0000 1.25 @@ -48,6 +48,7 @@ sbin_PROGRAMS = \ sfcbd +if JDBC libsfcBrokerCore_la_SOURCES = \ args.c \ array.c \ @@ -92,14 +93,58 @@ sqlParser.y \ sqlStatement.c \ avltree.c + +else +libsfcBrokerCore_la_SOURCES = \ + args.c \ + array.c \ + brokerEnc.c \ + brokerUpc.c \ + brokerOs.c \ + context.c \ + datetime.c \ + enumeration.c \ + instance.c \ + objectpath.c \ + result.c \ + selectexp.c \ + selectcond.c \ + subcond.c \ + predicate.c \ + string.c \ + value.c \ + support.c \ + providerRegister.c \ + objectImpl.c \ + constClass.c \ + hashtable.c \ + genericlist.c \ + utilHashtable.c \ + utilStringBuffer.c \ + utilFactory.c \ + msgqueue.c \ + providerMgr.c \ + providerDrv.c \ + trace.c \ + control.c \ + queryParser.y \ + queryLexer.l \ + queryOperation.c \ + queryStatement.c \ + cimXmlGen.c \ + mrwlock.c \ + mlog.c +endif libsfcBrokerCore_la_CFLAGS = @SFCB_CMPI_OS@ @SFCB_CMPI_PLATFORM@ +if JDBC sqlLexer.c: sqlLexer.l sqlParser.y lex -t sqlLexer.l | sed -e "s/yy/sfcSql/g" > sqlLexer.c sqlParser.c: sqlLexer.l sqlParser.y bison -p sfcSql -d -o sqlParser.c sqlParser.y +endif queryLexer.c: queryLexer.l queryParser.y lex -t queryLexer.l | sed -e "s/yy/sfcQuery/g" > queryLexer.c |