#!/bin/sh usage() { cat < | -s -- 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="" OPENVPN_SRC_DIR="" while [ ! -z "$1" ]; do case $1 in -h|--help) usage exit 0 ;; -s|--openvpn-src) OPENVPN_SRC_DIR="$2" PARAMS="${PARAMS} -DOPENVPN_SRC:STRING=$2" shift ;; -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" exit 2 ;; esac shift done if [ -z "$(which cmake)" ]; then echo "To build eurephia, you need to install cmake (at least version 2.6)" exit 1; fi if [ -z "${OPENVPN_SRC_DIR}" ]; then echo "You need to give the --openvpn-src option" exit 1; fi if [ -z "${DB}" ]; 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 cat >> Makefile <