]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - config-scripts/cups-directories.m4
Import changes from CUPS 1.4svn-r8704.
[thirdparty/cups.git] / config-scripts / cups-directories.m4
index 7728746c9197f23fda05c1d15bc4b658b54c6557..6f969aae272f0d943b3623bfe34073d747bf6dfc 100644 (file)
@@ -1,25 +1,16 @@
 dnl
-dnl "$Id: cups-directories.m4 6351 2007-03-19 04:53:49Z mike $"
+dnl "$Id: cups-directories.m4 7799 2008-07-25 20:06:08Z mike $"
 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(/)
@@ -108,17 +99,23 @@ if test "$sysconfdir" = "\${prefix}/etc"; then
        fi
 fi
 
-dnl Fix "libdir" variable for IRIX 6.x...
+dnl Fix "libdir" variable...
 if test "$libdir" = "\${exec_prefix}/lib"; then
-       if test "$uname" = "IRIX"; then
-               libdir="$exec_prefix/lib32"
-       else
-               if test "$uname" = Linux -a -d /usr/lib64; then
-                       libdir="$exec_prefix/lib64"
-               else
-                       libdir="$exec_prefix/lib"
-               fi
-       fi
+       case "$uname" in
+               IRIX*)
+                       libdir="$exec_prefix/lib32"
+                       ;;
+               Linux*)
+                       if test -d /usr/lib64; then
+                               libdir="$exec_prefix/lib64"
+                       fi
+                       ;;
+               HP-UX*)
+                       if test -d /usr/lib/hpux32; then
+                               libdir="$exec_prefix/lib/hpux32"
+                       fi
+                       ;;
+       esac
 fi
 
 dnl Setup init.d locations...
@@ -126,12 +123,14 @@ AC_ARG_WITH(rcdir, [  --with-rcdir            set path for rc scripts],rcdir="$w
 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")
+AC_ARG_WITH(smfmanifestdir, [  --with-smfmanifestdir   set path for Solaris SMF manifest],smfmanifestdir="$withval",smfmanifestdir="")
 
 INITDIR=""
 INITDDIR=""
 RCLEVELS="$rclevels"
 RCSTART="$rcstart"
 RCSTOP="$rcstop"
+SMFMANIFESTDIR=""
 
 if test x$rcdir = x; then
        case "$uname" in
@@ -155,8 +154,8 @@ if test x$rcdir = x; then
                HP-UX*)
                        INITDIR="/sbin"
                        RCLEVELS="2"
-                       RCSTART="620"
-                       RCSTOP="380"
+                       RCSTART="380"
+                       RCSTOP="620"
                        ;;
 
                IRIX*)
@@ -166,7 +165,7 @@ if test x$rcdir = x; then
                        RCSTOP="25"
                        ;;
 
-               Linux | GNU)
+               Linux | GNU | GNU/k*BSD*)
                        # Linux/HURD seems to choose an init.d directory at random...
                        if test -d /sbin/init.d; then
                                # SuSE
@@ -195,8 +194,12 @@ if test x$rcdir = x; then
 
                SunOS*)
                        # Solaris
-                       INITDIR="/etc"
-                       RCSTART="81"
+                       if test "x$smfmanifestdir" != x; then
+                               SMFMANIFESTDIR=$smfmanifestdir
+                       else
+                               INITDIR="/etc"
+                               RCSTART="81"
+                       fi
                        ;;
 
                *)
@@ -204,7 +207,7 @@ if test x$rcdir = x; then
                        ;;
 
        esac
-else
+elif test "x$rcdir" != xno; then
        if test "x$rclevels" = x; then
                INITDDIR="$rcdir"
        else
@@ -217,6 +220,7 @@ AC_SUBST(INITDDIR)
 AC_SUBST(RCLEVELS)
 AC_SUBST(RCSTART)
 AC_SUBST(RCSTOP)
+AC_SUBST(SMFMANIFESTDIR)
 
 dnl Xinetd support...
 AC_ARG_WITH(xinetd, [  --with-xinetd           set path for xinetd config files],XINETD="$withval",XINETD="")
@@ -228,10 +232,53 @@ if test "x$XINETD" = x -a ! -x /sbin/launchd; then
                        break
                fi
        done
+elif test "x$XINETD" = xno; then
+       XINETD=""
 fi
 
 AC_SUBST(XINETD)
 
+dnl LPD sharing support...
+AC_ARG_WITH(lpdconfig, [  --with-lpdconfig        set URI for LPD config file],
+       LPDCONFIG="$withval", LPDCONFIG="")
+
+if test "x$LPDCONFIG" = x; then
+       if test -f /System/Library/LaunchDaemons/org.cups.cups-lpd.plist; then
+               LPDCONFIG="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
+       elif test "x$XINETD" != x; then
+               LPDCONFIG="xinetd://$XINETD/cups-lpd"
+       fi
+fi
+
+if test "x$LPDCONFIG" = xoff; then
+       AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "")
+else
+       AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "$LPDCONFIG")
+fi
+
+dnl SMB sharing support...
+AC_ARG_WITH(smbconfig, [  --with-smbconfig        set URI for Samba config file],
+       SMBCONFIG="$withval", SMBCONFIG="")
+
+if test "x$SMBCONFIG" = x; then
+       if test -f /System/Library/LaunchDaemons/smbd.plist; then
+               SMBCONFIG="launchd:///System/Library/LaunchDaemons/smbd.plist"
+       else
+               for dir in /etc /etc/samba /usr/local/etc; do
+                       if test -f $dir/smb.conf; then
+                               SMBCONFIG="samba://$dir/smb.conf"
+                               break
+                       fi
+               done
+       fi
+fi
+
+if test "x$SMBCONFIG" = xoff; then
+       AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "")
+else
+       AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "$SMBCONFIG")
+fi
+
 dnl Setup default locations...
 # Cache data...
 AC_ARG_WITH(cachedir, [  --with-cachedir         set path for cache files],cachedir="$withval",cachedir="")
@@ -301,20 +348,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)
@@ -360,10 +411,19 @@ AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
 AC_SUBST(CUPS_SERVERROOT)
 
 # Transient run-time state
-CUPS_STATEDIR="$localstatedir/run/cups"
-AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
+case "$uname" in
+       Darwin*)
+               # Darwin (Mac OS X)
+               CUPS_STATEDIR="$CUPS_SERVERROOT"
+               ;;
+       *)
+               # All others
+               CUPS_STATEDIR="$localstatedir/run/cups"
+               ;;
+esac
+AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
 AC_SUBST(CUPS_STATEDIR)
 
 dnl
-dnl End of "$Id: cups-directories.m4 6351 2007-03-19 04:53:49Z mike $".
+dnl End of "$Id: cups-directories.m4 7799 2008-07-25 20:06:08Z mike $".
 dnl