]> git.ipfire.org Git - thirdparty/fcron.git/commitdiff
define manually MANDIR and DOCDIR
authorThibault Godouet <yo8192@users.noreply.github.com>
Thu, 14 Sep 2000 19:01:06 +0000 (19:01 +0000)
committerThibault Godouet <yo8192@users.noreply.github.com>
Thu, 14 Sep 2000 19:01:06 +0000 (19:01 +0000)
configure.in

index f4c2142dc5ec279767301431cc8a81741e43ec9e..c67027e9a076f11bc8a106f776bee20bb4ed9953 100644 (file)
@@ -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)