configure
changeset 183 f8acccd11133
parent 182 223c84ec2d90
child 185 ade232db1313
     1.1 --- a/configure	Sun Jul 01 19:04:20 2007 +0000
     1.2 +++ b/configure	Sun Jul 01 20:52:34 2007 +0000
     1.3 @@ -3,11 +3,11 @@
     1.4  VERSION=$(cat version)
     1.5  DATE=$(date +%Y%m%d)
     1.6  
     1.7 -PREFIX=/usr/local
     1.8 -BINDIR="${PREFIX}/bin"
     1.9 -LIBDIR="${PREFIX}/lib"
    1.10 -DOCDIR="${PREFIX}/share/doc"
    1.11 -MANDIR="${PREFIX}/share/man"
    1.12 +PREFIX_DEFAULT=/usr/local
    1.13 +BINDIR_DEFAULT="${PREFIX}/bin"
    1.14 +LIBDIR_DEFAULT="${PREFIX}/lib"
    1.15 +DOCDIR_DEFAULT="${PREFIX}/share/doc"
    1.16 +MANDIR_DEFAULT="${PREFIX}/share/man"
    1.17  
    1.18  BINDIR_set=
    1.19  LIBDIR_set=
    1.20 @@ -72,6 +72,34 @@
    1.21      return ${ret}
    1.22  }
    1.23  
    1.24 +do_help() {
    1.25 +    cat <<__EOF__
    1.26 +\`configure' configures ct-ng ${VERSION} to adapt to many kind of systems.
    1.27 +
    1.28 +USAGE: ./configure [OPTION]...
    1.29 +
    1.30 +Defaults for the options are specified in brackets.
    1.31 +
    1.32 +Configuration:
    1.33 +  -h, --help              display this help and exit                                                                                                                  
    1.34 +  --prefix=PREFIX         install architecture-independent files in PREFIX
    1.35 +                          [${PREFIX_DEFAULT}]
    1.36 +
    1.37 +By default, \`make install' will install all the files in
    1.38 +\`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc.  You can specify
    1.39 +an installation prefix other than \`${PREFIX_DEFAULT}' using \`--prefix',
    1.40 +for instance \`--prefix=\${HOME}'.
    1.41 +
    1.42 +For better control, use the options below.
    1.43 +
    1.44 +Fine tuning of the installation directories:
    1.45 +  --bindir=DIR           user executables [PREFIX/bin]
    1.46 +  --libdir=DIR           object code libraries [PREFIX/lib]
    1.47 +  --docdir=DIR           info documentation [PREFIX/share/doc]
    1.48 +  --mandir=DIR           man documentation [PREFIX/share/man]
    1.49 +__EOF__
    1.50 +}
    1.51 +
    1.52  while [ $# -ne 0 ]; do
    1.53      case "$1" in
    1.54          --prefix*)  set_prefix "$1" "$2" && shift || shift 2;;
    1.55 @@ -79,9 +107,13 @@
    1.56          --libdir*)  set_libdir "$1" "$2" && shift || shift 2;;
    1.57          --docdir*)  set_docdir "$1" "$2" && shift || shift 2;;
    1.58          --mandir*)  set_mandir "$1" "$2" && shift || shift 2;;
    1.59 +        --help|-h)  do_help; exit 0;;
    1.60 +        *)          do_help; exit 1;;
    1.61      esac
    1.62  done
    1.63  
    1.64 +[ -z "${PREFIX}" ] && set_prefix --prefix "${PREFIX_DEFAULT}"
    1.65 +
    1.66  sed -r -e "s,@@BINDIR@@,${BINDIR},g;"   \
    1.67         -e "s,@@LIBDIR@@,${LIBDIR},g;"   \
    1.68         -e "s,@@DOCDIR@@,${DOCDIR},g;"   \