summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-09-02 00:07:37 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-09-02 00:07:37 +0200
commit5e058d5d4e7d449accc5039b893b7d0decdb40df (patch)
tree3f0f448ce11dd5418fa8d69ddf0071762d8461db
parent217a558a2443a74217ca4631f5ea2a8e71d867e2 (diff)
downloadeurephia-5e058d5d4e7d449accc5039b893b7d0decdb40df.tar.gz
eurephia-5e058d5d4e7d449accc5039b893b7d0decdb40df.tar.xz
eurephia-5e058d5d4e7d449accc5039b893b7d0decdb40df.zip
Added a some comments to ./configure
-rwxr-xr-xconfigure48
1 files changed, 47 insertions, 1 deletions
diff --git a/configure b/configure
index a4403d3..9635174 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,27 @@
#!/bin/sh
+#
+# Simple cmake wrapper script to make it behave more like autotools
+#
+# GPLv2 only - Copyright (C) 2008-2009
+# David Sommerseth <dazo@users.sourceforge.net>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+
+# Some default variables
PREFIX="/usr/local"
BINDIR="${PREFIX}/bin"
BINDIR_SET=0
@@ -11,6 +33,9 @@ EUREPHIADM_XSLT="${XSLTPATH}/eurephiadm"
EUREPHIADM_XSLT_SET=0
SQLITE3PREFIX="/etc/openvpn"
+#
+# Misc functions
+#
usage() {
cat <<EOF
configure help for eurephia
@@ -50,6 +75,7 @@ configure help for eurephia
EOF
}
+# Initialise variables which we will use later on
PARAMS=""
DB=""
FW=""
@@ -58,6 +84,7 @@ OPENVPN_SRC_DIR=""
PLUGIN=""
CONFIGUREPARAMS="$*"
+# Parse all arguments
while [ ! -z "$1" ]; do
case $1 in
-h|--help)
@@ -67,12 +94,15 @@ while [ ! -z "$1" ]; do
--prefix)
PREFIX="$2";
shift
+ # Apply prefix to BINDIR only if it's not been set explicitly earlier
if [ "${BINDIR_SET}" = "0" ]; then
BINDIR="${PREFIX}/bin";
fi
+ # Apply prefix to PLUGINDIR only if it's not been set explicitly earlier
if [ "${PLUGINDIR_SET}" = "0" ]; then
PLUGINDIR="${PREFIX}/lib/eurephia"
fi
+ # Apply prefix to XSLTPATHs only if it's not been set explicitly earlier
if [ "${XSLTPATH_SET}" = "0" ]; then
XSLTPATH="${PREFIX}/share/eurephia/xslt"
if [ "${EUREPHIADM_XSLT_SET}" = "0" ]; then
@@ -87,6 +117,7 @@ while [ ! -z "$1" ]; do
;;
-X|--xslt-path)
XSLTPATH="$2"
+ # Apply prefix to EUREPJIADM_XSLT path only if it's not been set explicitly earlier
if [ "${EUREPHIADM_XSLT_SET}" = "0" ]; then
EUREPHIADM_XSLT="${XSLTPATH}/eurephiadm"
fi
@@ -110,31 +141,38 @@ while [ ! -z "$1" ]; do
shift
;;
-s|--openvpn-src)
+ # Needs to point at at directory with the openvpn source code
OPENVPN_SRC_DIR="$2"
PARAMS="${PARAMS} -DOPENVPN_SRC:STRING=$2"
shift
;;
--fw-iptables)
+ # Enable iptables support
PARAMS="${PARAMS} -DFW_IPTABLES=ON"
FW="iptables "
;;
--db-sqlite3)
+ # Enable the SQLite3 database driver
PARAMS="${PARAMS} -DSQLITE3=ON"
DB="SQLite3 "
;;
--sp|--sqlite3-path)
+ # Sets the install directory of the SQLite3 eurephia database file
SQLITE3PREFIX="$2"
shift
;;
--eurephiadm|-A)
+ # Enable the eurephiadm console admin utility
PARAMS="${PARAMS} -DEUREPHIADM=ON"
ADMIN="${ADMIN}eurephiadm "
;;
--eurephiadm-fw)
+ # Enable firewall features of the eurephiadm console utility
PARAMS="${PARAMS} -DFIREWALL=ON"
;;
--eurephiadm-xslt)
- EUREPHIADM_XSLT="$2"
+ # Set the path where XSLT files used by eurephiadm will be installed
+ EUREPHIADM_XSLT="$2"
EUREPHIADM_XSLT_SET=1
shift
;;
@@ -146,25 +184,30 @@ while [ ! -z "$1" ]; do
shift
done
+# Make sure we have cmake available
if [ -z "$(which cmake)" ]; then
echo "To build eurephia, you need to install cmake (at least version 2.6)"
exit 1;
fi
+# If we're building the openvpn plug-in, we need the openvpn source code too.
if [ ! -z "${PLUGIN}" -a -z "${OPENVPN_SRC_DIR}" ]; then
echo "You need to give the --openvpn-src <path> option when building the eurephia plug-in"
exit 1;
fi
+# Make sure at least one database driver is enabled.
if [ -z "${DB}" ]; then
echo "You need to activate at least one database driver"
exit 1;
fi
+# Set default parameters for the SQLite3 database
if [ ${DB} = "SQLite3" ]; then
PARAMS="${PARAMS} -DSQLITE3PREFIX:STIRNG=${SQLITE3PREFIX}"
fi
+# Run cmake with our parameters, and create a configure.log file at the same time
rm -f CMakeCache.txt
{
cat <<EOF
@@ -180,6 +223,7 @@ EOF
-DEUREPHIADM_XSLT_PATH:STRING=${EUREPHIADM_XSLT} -DXSLTROOT:STRING=${XSLTPATH}
export ec=$?
+ # If cmake exited without failure, provide some info about the configuration
if [ "$ec" = "0" ]; then
echo
echo
@@ -203,6 +247,7 @@ EOF
echo
echo
+ # Make sure user is aware of enabled debug features.
if [ "$DEBUG_WARN" = 1 ]; then
echo
echo " ******* DEBUG is enabled. This might be a security issue *******"
@@ -229,6 +274,7 @@ uninstall :
@echo "Uninstalling eurephia: "
cat install_manifest.txt | xargs rm -vf
EOF
+ # If SQLite3 driver is enabled, add some extra clean up rules for the uninstall rules
if [ ! -z ${DB} ]; then
if [ ${SQLITE3PREFIX} != ${PREFIX} ]; then
cat >> Makefile <<EOF