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)
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"
)
+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)