]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - config-scripts/cups-directories.m4
Support for GNU/kFreeBSD (STR #2367)
[thirdparty/cups.git] / config-scripts / cups-directories.m4
index f1afe6b340f6d2b15f0cc4e73968b0985e7aa0b6..1babc48a75ab820d8fa613268e3ed2c7115de432 100644 (file)
@@ -3,23 +3,14 @@ dnl "$Id$"
 dnl
 dnl   Directory stuff for the Common UNIX Printing System (CUPS).
 dnl
+dnl   Copyright 2007 by Apple Inc.
 dnl   Copyright 1997-2007 by Easy Software Products, all rights reserved.
 dnl
 dnl   These coded instructions, statements, and computer programs are the
-dnl   property of Easy Software Products and are protected by Federal
-dnl   copyright law.  Distribution and use rights are outlined in the file
-dnl   "LICENSE.txt" which should have been included with this file.  If this
-dnl   file is missing or damaged please contact Easy Software Products
-dnl   at:
-dnl
-dnl       Attn: CUPS Licensing Information
-dnl       Easy Software Products
-dnl       44141 Airport View Drive, Suite 204
-dnl       Hollywood, Maryland 20636 USA
-dnl
-dnl       Voice: (301) 373-9600
-dnl       EMail: cups-info@cups.org
-dnl         WWW: http://www.cups.org
+dnl   property of Apple Inc. and are protected by Federal copyright
+dnl   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+dnl   which should have been included with this file.  If this file is
+dnl   file is missing or damaged, see the license at "http://www.cups.org/".
 dnl
 
 AC_PREFIX_DEFAULT(/)
@@ -123,24 +114,24 @@ fi
 
 dnl Setup init.d locations...
 AC_ARG_WITH(rcdir, [  --with-rcdir            set path for rc scripts],rcdir="$withval",rcdir="")
+AC_ARG_WITH(rclevels, [  --with-rclevels         set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
+AC_ARG_WITH(rcstart, [  --with-rcstart          set start number for rc scripts],rcstart="$withval",rcstart="99")
+AC_ARG_WITH(rcstop, [  --with-rcstop           set stop number for rc scripts],rcstop="$withval",rcstop="00")
+
+INITDIR=""
+INITDDIR=""
+RCLEVELS="$rclevels"
+RCSTART="$rcstart"
+RCSTOP="$rcstop"
 
 if test x$rcdir = x; then
        case "$uname" in
-               FreeBSD* | OpenBSD* | MirBsD* | ekkoBSD*)
-                       # FreeBSD and OpenBSD
-                       INITDIR=""
-                       INITDDIR=""
-                       ;;
-
-               NetBSD*)
-                       # NetBSD
-                       INITDIR=""
-                       INITDDIR="/etc/rc.d"
+               AIX*)
+                       INITDIR="/etc/rc.d"
                        ;;
 
                Darwin*)
                        # Darwin and MacOS X...
-                       INITDIR=""
                        if test -x /sbin/launchd; then
                                INITDDIR="/System/Library/LaunchDaemons"
                        else 
@@ -148,48 +139,75 @@ if test x$rcdir = x; then
                        fi
                        ;;
 
-               Linux | GNU)
+               FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*)
+                       # FreeBSD and OpenBSD
+                       ;;
+
+               HP-UX*)
+                       INITDIR="/sbin"
+                       RCLEVELS="2"
+                       RCSTART="620"
+                       RCSTOP="380"
+                       ;;
+
+               IRIX*)
+                       # IRIX
+                       INITDIR="/etc"
+                       RCSTART="60"
+                       RCSTOP="25"
+                       ;;
+
+               Linux | GNU | GNU/k*BSD*)
                        # Linux/HURD seems to choose an init.d directory at random...
                        if test -d /sbin/init.d; then
                                # SuSE
                                INITDIR="/sbin/init.d"
-                               INITDDIR=".."
                        else
                                if test -d /etc/init.d; then
                                        # Others
                                        INITDIR="/etc"
-                                       INITDDIR="../init.d"
                                else
                                        # RedHat
                                        INITDIR="/etc/rc.d"
-                                       INITDDIR="../init.d"
                                fi
                        fi
+                       RCSTART="81"
+                       RCSTOP="36"
+                       ;;
+
+               NetBSD*)
+                       # NetBSD
+                       INITDDIR="/etc/rc.d"
                        ;;
 
-               OSF1* | HP-UX*)
+               OSF1*)
                        INITDIR="/sbin"
-                       INITDDIR="../init.d"
                        ;;
 
-               AIX*)
-                       INITDIR="/etc/rc.d"
-                       INITDDIR=".."
+               SunOS*)
+                       # Solaris
+                       INITDIR="/etc"
+                       RCSTART="81"
                        ;;
 
                *)
                        INITDIR="/etc"
-                       INITDDIR="../init.d"
                        ;;
 
        esac
 else
-       INITDIR=""
-       INITDDIR="$rcdir"
+       if test "x$rclevels" = x; then
+               INITDDIR="$rcdir"
+       else
+               INITDIR="$rcdir"
+       fi
 fi
 
 AC_SUBST(INITDIR)
 AC_SUBST(INITDDIR)
+AC_SUBST(RCLEVELS)
+AC_SUBST(RCSTART)
+AC_SUBST(RCSTOP)
 
 dnl Xinetd support...
 AC_ARG_WITH(xinetd, [  --with-xinetd           set path for xinetd config files],XINETD="$withval",XINETD="")
@@ -274,20 +292,24 @@ AC_SUBST(CUPS_FONTPATH)
 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
 
 # Locale data
-case "$uname" in
-       Linux | GNU | *BSD* | Darwin*)
-               CUPS_LOCALEDIR="$datadir/locale"
-               ;;
+if test "$localedir" = "\${datarootdir}/locale"; then
+       case "$uname" in
+               Linux | GNU | *BSD* | Darwin*)
+                       CUPS_LOCALEDIR="$datarootdir/locale"
+                       ;;
 
-       OSF1* | AIX*)
-               CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
-               ;;
+               OSF1* | AIX*)
+                       CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
+                       ;;
 
-       *)
-               # This is the standard System V location...
-               CUPS_LOCALEDIR="$exec_prefix/lib/locale"
-               ;;
-esac
+               *)
+                       # This is the standard System V location...
+                       CUPS_LOCALEDIR="$exec_prefix/lib/locale"
+                       ;;
+       esac
+else
+       CUPS_LOCALEDIR="$localedir"
+fi
 
 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
 AC_SUBST(CUPS_LOCALEDIR)