diff options
-rw-r--r-- | CMakeLists.txt | 25 | ||||
-rwxr-xr-x | configure | 40 |
2 files changed, 60 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c90b7a..f5907f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,15 +16,29 @@ SET(eurephia_auth_SRC ) OPTION(DEBUG "Add more verbose debug information" OFF) OPTION(SHOW_SECRETS "Show passwords as clear text in logs." OFF) -OPTION(SQLITE3 "Build database driver for SQLite3" ON) +OPTION(SQLITE3 "Build database driver for SQLite3" OFF) -IF(NOT SQLITE3) - message(FATAL_ERROR "Cannot build eurephia without any database drivers (-DSQLITE3=ON)") -ENDIF(NOT SQLITE3) + +IF(SQLITE3) + message(STATUS "Will build database interface for SQLite") + SET(subdirs ${subdirs} database/sqlite) + SET(DATABASE ON) +ENDIF(SQLITE3) + +IF(FW_IPTABLES) + message(STATUS "Will build iptables firewall module") + SET(subdirs ${subdirs} firewall/iptables) +ENDIF(FW_IPTABLES) + +IF(NOT DATABASE) + message(FATAL_ERROR "Cannot build eurephia without any database drivers.") +ENDIF(NOT DATABASE) IF(DEBUG) + message(STATUS "DEBUG enabled - might be a security issue") ADD_DEFINITIONS(-DENABLE_DEBUG) IF(SHOW_SECRETS) + message(STATUS "SHOW_SECRETS ENABLED -- THIS WILL LOG PASSWORDS IN CLEAR TEXT") ADD_DEFINITIONS(-DSHOW_SECRETS) ENDIF(SHOW_SECRETS) ENDIF(DEBUG) @@ -82,4 +96,5 @@ ADD_DEFINITIONS(-g -Wall) ADD_LIBRARY(eurephia-auth MODULE ${eurephia_auth_SRC}) TARGET_LINK_LIBRARIES(eurephia-auth dl pthread rt crypto) SET_TARGET_PROPERTIES(eurephia-auth PROPERTIES OUTPUT_NAME eurephia-auth PREFIX "") -SUBDIRS(database/sqlite firewall/iptables) + +SUBDIRS(${subdirs}) @@ -8,11 +8,16 @@ configure help for eurephia --openvpn-src <path> | -s <path> -- OpenVPN source directory (needed for building) --debug | -D -- Enable verbose debug logging --show-secrets | -S -- Log passwords as clear text in log files + | (only available when debug is enabled) + --fw-iptables | -- Build iptables firewall module + --db-sqlite3 | -- Build SQLite3 database module EOF } PARAMS="" +DB="" +FW="" export OPENVPN_SRC_DIR="" while [ ! -z "$1" ]; do case $1 in @@ -26,9 +31,19 @@ while [ ! -z "$1" ]; do ;; -D|--debug) PARAMS="${PARAMS} -DDEBUG=ON" + DEBUG_WARN=1 ;; -S|--show-secrets) PARAMS="${PARAMS} -DSHOW_SECRETS=ON" + SECRETS_WARN=1 + ;; + --fw-iptables) + PARAMS="${PARAMS} -DFW_IPTABLES=ON" + FW="iptables " + ;; + --db-sqlite3) + PARAMS="${PARAMS} -DSQLITE3=ON" + DB="SQLite3 " ;; *) echo "Unkown option: $1" @@ -48,6 +63,31 @@ if [ -z ${OPENVPN_SRC_DIR} ]; then exit 1; fi +if [ ${DB} = 0 ]; then + echo "You need to activate at least one database driver" + exit 1; +fi + rm -f CMakeCache.txt cmake . ${PARAMS} +ec=$? +if [ $ec = 0 ]; then + echo + echo + echo "eurephia will be built with support for: " + echo + echo " Database: ${DB}" + echo " Firewall: ${FW:-"None"}" + echo + if [ "$DEBUG_WARN" = 1 ]; then + echo + echo " ******* DEBUG is enabled. This might be a security issue *******" + echo + if [ "$SECRETS_WARN" = 1 ]; then + echo + echo " ******* SHOW_SECRETS is enabled. THIS WILL LOG PASSWORDS IN CLEAR TEXT IN LOG FILES *******" + echo + fi + fi +fi exit $? |