summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure37
1 files changed, 26 insertions, 11 deletions
diff --git a/configure b/configure
index 0338441..3ad96af 100755
--- a/configure
+++ b/configure
@@ -4,15 +4,12 @@ VERSION=$(cat version)
DATE=$(date +%Y%m%d)
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=
DOCDIR_set=
MANDIR_set=
+LOCAL_set=
get_optval(){
local ret
@@ -34,9 +31,9 @@ set_prefix() {
PREFIX=$(get_optval "$1" "$2")
ret=$?
[ -z "${BINDIR_set}" ] && BINDIR="${PREFIX}/bin"
- [ -z "${LIBDIR_set}" ] && LIBDIR="${PREFIX}/lib"
- [ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc"
- [ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man"
+ [ -z "${LIBDIR_set}" ] && LIBDIR="${PREFIX}/lib/ct-ng-${VERSION}"
+ [ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc/ct-ng-${VERSION}"
+ [ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man/man1"
return ${ret}
}
@@ -82,8 +79,8 @@ 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}]
+ --prefix=PREFIX install files in PREFIX [${PREFIX_DEFAULT}]
+ --local don't install, and use current directory
By default, \`make install' will install all the files in
\`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc. You can specify
@@ -107,12 +104,20 @@ 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;;
+ --local) LOCAL_set=1; shift;;
--help|-h) do_help; exit 0;;
*) do_help; exit 1;;
esac
done
-[ -z "${PREFIX}" ] && set_prefix --prefix "${PREFIX_DEFAULT}"
+[ -z "${PREFIX}" ] && set_prefix "" "${PREFIX_DEFAULT}"
+if [ "${LOCAL_set}" = "1" ]; then
+ set_prefix "" $(pwd)
+ set_bindir "" $(pwd)
+ set_libdir "" $(pwd)
+ set_docdir "" $(pwd)/docs
+ set_mandir "" $(pwd)/docs
+fi
sed -r -e "s,@@BINDIR@@,${BINDIR},g;" \
-e "s,@@LIBDIR@@,${LIBDIR},g;" \
@@ -120,4 +125,14 @@ sed -r -e "s,@@BINDIR@@,${BINDIR},g;" \
-e "s,@@MANDIR@@,${MANDIR},g;" \
-e "s,@@VERSION@@,${VERSION},g;" \
-e "s,@@DATE@@,${DATE},g;" \
- Makefile.in >Makefile
+ -e "s,@@LOCAL@@,${LOCAL_set},g;" \
+ Makefile.in >Makefile
+
+cat <<__EOF__
+ct-ng configured as follows:
+ PREFIX="${PREFIX}"
+ BINDIR="${BINDIR}"
+ LIBDIR="${LIBDIR}"
+ DOCDIR="${DOCDIR}"
+ MANDIR="${MANDIR}"
+__EOF__