From 9d0a8ac2c199ddcbb20ff4607817e2dc39c7c8ad Mon Sep 17 00:00:00 2001 From: thib Date: Thu, 14 Sep 2000 19:01:06 +0000 Subject: [PATCH] define manually MANDIR and DOCDIR --- configure.in | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index f4c2142..c67027e 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,8 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(allow.c) -AC_PREFIX_DEFAULT(/usr) +prefix="/usr" +AC_PREFIX_DEFAULT($prefix) AC_CONFIG_HEADER(config.h) AC_PREREQ(2.7) @@ -282,7 +283,7 @@ Without proc, you won't be able to use the lavg* options proc="/proc" AC_MSG_RESULT(/proc) else - AC_MSG_ERROR(Cannot determine value for proc directory try option --with-proc=PATH) + AC_MSG_ERROR(Cannot determine value for proc directory: try option --with-proc=PATH) fi ) PROC="$proc" @@ -307,6 +308,102 @@ AC_ARG_WITH(debug, ) +AC_MSG_CHECKING(location of man directory) +AC_ARG_WITH(MANDIR, +[ --with-mandir=PATH Root directory for manual pages.], +[ case "$withval" in + no) + AC_MSG_ERROR(Need MANDIR.) + ;; + yes) + if test -d "$prefix/man" ; then + mandir="$prefix/man" + AC_MSG_RESULT($prefix/man) + elif test -d "$prefix/share/man" ; then + mandir="$prefix/share/man" + AC_MSG_RESULT($prefix/share/man) + elif test -d "$prefix/local/share/man" ; then + mandir="$prefix/local/share/man" + AC_MSG_RESULT($prefix/local/share/man) + else + AC_MSG_ERROR(Cannot determine value for man directory: try option --with-man=PATH) + fi + ;; + *) + if test -d "$withval"; then + mandir="$withval" + AC_MSG_RESULT($withval) + else + AC_MSG_ERROR(directory $withval does not exist) + fi + ;; + esac ], + if test -d "$prefix/man" ; then + mandir="$prefix/man" + AC_MSG_RESULT($prefix/man) + elif test -d "$prefix/share/man" ; then + mandir="$prefix/share/man" + AC_MSG_RESULT($prefix/share/man) + elif test -d "$prefix/local/share/man" ; then + mandir="$prefix/local/share/man" + AC_MSG_RESULT($prefix/local/share/man) + else + AC_MSG_ERROR(Cannot determine value for man directory: try option --with-man=PATH) + fi +) +MANDIR="$mandir" +AC_DEFINE_UNQUOTED(MANDIR, "$mandir") +AC_SUBST(MANDIR) + + +AC_MSG_CHECKING(location of doc directory) +AC_ARG_WITH(DOCDIR, +[ --with-docdir=PATH Directory containing documentation.], +[ case "$withval" in + no) + AC_MSG_ERROR(Need DOCDIR.) + ;; + yes) + if test -d "$prefix/doc" ; then + docdir="$prefix/doc" + AC_MSG_RESULT($prefix/doc) + elif test -d "$prefix/share/doc" ; then + docdir="$prefix/share/doc" + AC_MSG_RESULT($prefix/share/doc) + elif test -d "$prefix/local/share/doc" ; then + docdir="$prefix/local/share/doc" + AC_MSG_RESULT($prefix/local/share/doc) + else + AC_MSG_ERROR(Cannot determine value for doc directory: try option --with-doc=PATH) + fi + ;; + *) + if test -d "$withval"; then + docdir="$withval" + AC_MSG_RESULT($withval) + else + AC_MSG_ERROR(directory $withval does not exist) + fi + ;; + esac ], + if test -d "$prefix/doc" ; then + docdir="$prefix/doc" + AC_MSG_RESULT($prefix/doc) + elif test -d "$prefix/share/doc" ; then + docdir="$prefix/share/doc" + AC_MSG_RESULT($prefix/share/doc) + elif test -d "$prefix/local/share/doc" ; then + docdir="$prefix/local/share/doc" + AC_MSG_RESULT($prefix/local/share/doc) + else + AC_MSG_ERROR(Cannot determine value for doc directory: try option --with-doc=PATH) + fi +) +DOCDIR="$docdir" +AC_DEFINE_UNQUOTED(DOCDIR, "$docdir") +AC_SUBST(DOCDIR) + + AC_OUTPUT(Makefile) -- 2.40.0