# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-echo
echo
echo Running the configure script to create config.mk
echo
--prefix)
PREFIX=$v
;;
- --bindir)
- BINDIR=$v
- ;;
--ctdldir)
CTDLDIR=$v
;;
echo $0 : unknown option $k
echo
echo Valid options are:
- echo ' --prefix=PREFIX Install files in PREFIX [/usr/local]'
- echo ' --bindir=DIR Install executables in DIR [PREFIX/bin]'
- echo ' --ctdldir=DIR Look for Citadel server in DIR [/usr/local/citadel]'
+ echo ' --ctdldir=DIR Install Citadel server to DIR [/usr/local/citadel]'
echo ' --with-ssl Force build with OpenSSL support [normally autodetected]'
echo ' --without-ssl Force build without OpenSSL support [normally autodetected]'
exit 1
# Set any missing values (FIXME remove the ultra-fatal -W options when finished converting from autotools)
-[ "$PREFIX" = "" ] && PREFIX=/usr/local/citadel
-[ "$BINDIR" = "" ] && BINDIR=${PREFIX}
-[ "$CTDLDIR" = "" ] && CTDLDIR=${PREFIX}
+# Accept PREFIX as a substitute for CTDLDIR, but only if CTDLDIR is not already set
+[ "$CTDLDIR" = "" ] && [ "$PREFIX" != "" ] && CTDLDIR=$PREFIX
+
+# Configure the directory into which Citadel Server will be installed.
+[ "$CTDLDIR" = "" ] && CTDLDIR=/usr/local/citadel
+
+# Permit override of CFLAGS and LDFLAGS using environment variables
[ "$CFLAGS" = "" ] && CFLAGS='-ggdb -Werror -Wfatal-errors -Wno-discarded-qualifiers'
[ "$LDFLAGS" = "" ] && LDFLAGS=''
# Output the config.mk
(
+ echo # config.mk is generated by configure
+ echo "CTDLDIR := ${CTDLDIR}"
echo "CFLAGS := ${CFLAGS}"
echo "LDFLAGS := ${LDFLAGS}"
- echo "PREFIX := ${PREFIX}"
- echo "BINDIR := ${BINDIR}"
- echo "CTDLDIR := ${CTDLDIR}"
) >config.mk
cat config.mk