summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-07-01 20:52:34 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-07-01 20:52:34 (GMT)
commit5931c4dd2603cd6b2be93edb84a26fa849a5da62 (patch)
treeaea9b59f9b6764cddecbd5dcebd323f3447e0288 /configure
parent26713d42100ebb0f949777060102b8fa20c22ffd (diff)
./configure gains a help entry.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure42
1 files changed, 37 insertions, 5 deletions
diff --git a/configure b/configure
index 6e1ecc4..0338441 100755
--- a/configure
+++ b/configure
@@ -3,11 +3,11 @@
VERSION=$(cat version)
DATE=$(date +%Y%m%d)
-PREFIX=/usr/local
-BINDIR="${PREFIX}/bin"
-LIBDIR="${PREFIX}/lib"
-DOCDIR="${PREFIX}/share/doc"
-MANDIR="${PREFIX}/share/man"
+PREFIX_DEFAULT=/usr/local
+BINDIR_DEFAULT="${PREFIX}/bin"
+LIBDIR_DEFAULT="${PREFIX}/lib"
+DOCDIR_DEFAULT="${PREFIX}/share/doc"
+MANDIR_DEFAULT="${PREFIX}/share/man"
BINDIR_set=
LIBDIR_set=
@@ -72,6 +72,34 @@ set_mandir() {
return ${ret}
}
+do_help() {
+ cat <<__EOF__
+\`configure' configures ct-ng ${VERSION} to adapt to many kind of systems.
+
+USAGE: ./configure [OPTION]...
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [${PREFIX_DEFAULT}]
+
+By default, \`make install' will install all the files in
+\`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc. You can specify
+an installation prefix other than \`${PREFIX_DEFAULT}' using \`--prefix',
+for instance \`--prefix=\${HOME}'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [PREFIX/bin]
+ --libdir=DIR object code libraries [PREFIX/lib]
+ --docdir=DIR info documentation [PREFIX/share/doc]
+ --mandir=DIR man documentation [PREFIX/share/man]
+__EOF__
+}
+
while [ $# -ne 0 ]; do
case "$1" in
--prefix*) set_prefix "$1" "$2" && shift || shift 2;;
@@ -79,9 +107,13 @@ while [ $# -ne 0 ]; do
--libdir*) set_libdir "$1" "$2" && shift || shift 2;;
--docdir*) set_docdir "$1" "$2" && shift || shift 2;;
--mandir*) set_mandir "$1" "$2" && shift || shift 2;;
+ --help|-h) do_help; exit 0;;
+ *) do_help; exit 1;;
esac
done
+[ -z "${PREFIX}" ] && set_prefix --prefix "${PREFIX_DEFAULT}"
+
sed -r -e "s,@@BINDIR@@,${BINDIR},g;" \
-e "s,@@LIBDIR@@,${LIBDIR},g;" \
-e "s,@@DOCDIR@@,${DOCDIR},g;" \