From a2ca4fdf6c6eee2d229c8cb7770f37accd467d93 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Fri, 2 Jan 2009 17:39:26 +0100 Subject: Make it possible to compile plug-in again without eurephiadm enabled --- CMakeLists.txt | 1 + database/eurephiadb.c | 2 ++ database/eurephiadb_mapping.h | 9 ++++----- database/sqlite/CMakeLists.txt | 7 +++++-- plugin/CMakeLists.txt | 6 +++++- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dcd875..7b635f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ IF(EUREPHIADM) message(STATUS "Will build command line based admin utility") SET(subdirs ${subdirs} eurephiadm) SET(ADMIN_ENABLED on) + ADD_DEFINITIONS(-DENABLE_EUREPHIADM) ENDIF(EUREPHIADM) IF(ADMIN_ENABLED) diff --git a/database/eurephiadb.c b/database/eurephiadb.c index 63dded4..cc13c4f 100644 --- a/database/eurephiadb.c +++ b/database/eurephiadb.c @@ -92,6 +92,7 @@ int eDBlink_init(eurephiaCTX *ctx, const char *dbl, const int minver) "eurephiaDB driver API is newer than the running eurephia version. Consider " "to upgrade eurphia to take advantage of newer features in the eurephiaDB driver."); case 2: +#ifdef ENABLE_EUREPHIADM eDBadminAuth = eGetSym(ctx, ctx->eurephia_driver, "eDBadminAuth"); eDBadminValidateSession = eGetSym(ctx, ctx->eurephia_driver, "eDBadminValidateSession"); eDBadminRegisterLogin = eGetSym(ctx, ctx->eurephia_driver, "eDBadminRegisterLogin"); @@ -116,6 +117,7 @@ int eDBlink_init(eurephiaCTX *ctx, const char *dbl, const int minver) eDBadminGetLastlog = eGetSym(ctx, ctx->eurephia_driver, "eDBadminGetLastlog"); eDBadminGetAttemptsLog = eGetSym(ctx, ctx->eurephia_driver, "eDBadminGetAttemptsLog"); +#endif case 1: // Setup eDBlink functions diff --git a/database/eurephiadb_mapping.h b/database/eurephiadb_mapping.h index 4549292..eedb979 100644 --- a/database/eurephiadb_mapping.h +++ b/database/eurephiadb_mapping.h @@ -24,10 +24,6 @@ #ifndef EUREPHIADB_MAPPING_H # define EUREPHIADB_MAPPING_H -#ifdef HAVE_LIBXML2 -#include - - typedef enum eDBfieldType_e { ft_UNDEF, ft_INT, ft_STRING, ft_DATETIME, ft_PASSWD, ft_SETNULL } eDBfieldType; typedef struct _eDBfieldMap_s { @@ -144,9 +140,12 @@ static eDBfieldMap eTblMap_usercerts[] = { #endif // #ifdef EUREPHIADB_MAPPING_C +#ifdef HAVE_LIBXML2 +#include + void eDBfreeMapping(eDBfieldMap *p); eDBfieldMap *eDBxmlMapping(eurephiaCTX *ctx, eDBfieldMap *dbmap, const char *tblalias, xmlNode *fmap_n); char *eDBmkSortKeyString(eDBfieldMap *tfmap, const char *skeys_str); -#endif +#endif // HAVE_LIBXML2 #endif // !EUREPHIADB_MAPPING_H diff --git a/database/sqlite/CMakeLists.txt b/database/sqlite/CMakeLists.txt index 72e2b20..07e964f 100644 --- a/database/sqlite/CMakeLists.txt +++ b/database/sqlite/CMakeLists.txt @@ -7,7 +7,6 @@ SET(edb_sqlite_SRC edb-sqlite.c ) SET(COMMON - ../eurephiadb_mapping.c ../../common/eurephia_log.c ../../common/eurephiadb_session_common.c ../../common/eurephia_values.c @@ -34,7 +33,11 @@ IF(NOT SQLITE3BIN) ENDIF(NOT SQLITE3BIN) IF(ADMIN_ENABLED) - SET(edb_sqlite_SRC ${edb_sqlite_SRC} ../../common/eurephia_xml.c administration.c) + SET(edb_sqlite_SRC ${edb_sqlite_SRC} + ../../common/eurephia_xml.c + ../eurephiadb_mapping.c + administration.c + ) ENDIF(ADMIN_ENABLED) INCLUDE_DIRECTORIES(BEFORE ../../common/ ../../plugin/ ../../plugin/firewall ../) diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt index 8a1b43f..bf0202d 100644 --- a/plugin/CMakeLists.txt +++ b/plugin/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT(eurephia-auth C) +PROJECT(eurephia-plugin C) cmake_minimum_required(VERSION 2.6) SET(eurephia_auth_SRC ../common/certinfo.c @@ -21,6 +21,10 @@ IF(FW_IPTABLES) SET(subdirs firewall/iptables) ENDIF(FW_IPTABLES) +IF(ENABLE_EUREPHIADM) + REMOVE_DEFINITIONS(-DENABLE_EUREPHIADM) +ENDIF(ENABLE_EUREPHIADM) + CHECK_LIBRARY_EXISTS(rt sem_wait "" HAVE_RT_SEM_WAIT) CHECK_LIBRARY_EXISTS(rt sem_timedwait "" HAVE_RT_SEM_TIMEDWAIT) CHECK_LIBRARY_EXISTS(rt sem_post "" HAVE_RT_SEM_POST) -- cgit