]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-directories.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-directories.m4
CommitLineData
ef416fc2 1dnl
f301802f 2dnl "$Id: cups-directories.m4 5546 2006-05-19 12:44:15Z mike $"
ef416fc2 3dnl
4dnl Directory stuff for the Common UNIX Printing System (CUPS).
5dnl
e1d6a774 6dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
ef416fc2 7dnl
8dnl These coded instructions, statements, and computer programs are the
9dnl property of Easy Software Products and are protected by Federal
10dnl copyright law. Distribution and use rights are outlined in the file
11dnl "LICENSE.txt" which should have been included with this file. If this
12dnl file is missing or damaged please contact Easy Software Products
13dnl at:
14dnl
15dnl Attn: CUPS Licensing Information
16dnl Easy Software Products
17dnl 44141 Airport View Drive, Suite 204
18dnl Hollywood, Maryland 20636 USA
19dnl
20dnl Voice: (301) 373-9600
21dnl EMail: cups-info@cups.org
22dnl WWW: http://www.cups.org
23dnl
24
25AC_PREFIX_DEFAULT(/)
26
27dnl Fix "prefix" variable if it hasn't been specified...
28if test "$prefix" = "NONE"; then
29 prefix="/"
30fi
31
32dnl Fix "exec_prefix" variable if it hasn't been specified...
33if test "$exec_prefix" = "NONE"; then
34 if test "$prefix" = "/"; then
35 exec_prefix="/usr"
36 else
37 exec_prefix="$prefix"
38 fi
39fi
40
41dnl Fix "bindir" variable...
42if test "$bindir" = "\${exec_prefix}/bin"; then
43 bindir="$exec_prefix/bin"
44fi
45
fa73b229 46AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir")
47
ef416fc2 48dnl Fix "sbindir" variable...
49if test "$sbindir" = "\${exec_prefix}/sbin"; then
50 sbindir="$exec_prefix/sbin"
51fi
52
fa73b229 53AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir")
54
ef416fc2 55dnl Fix "sharedstatedir" variable if it hasn't been specified...
56if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
57 sharedstatedir="/usr/com"
58fi
59
60dnl Fix "datadir" variable if it hasn't been specified...
61if test "$datadir" = "\${prefix}/share"; then
62 if test "$prefix" = "/"; then
63 datadir="/usr/share"
64 else
65 datadir="$prefix/share"
66 fi
67fi
68
69dnl Fix "includedir" variable if it hasn't been specified...
70if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then
71 includedir="/usr/include"
72fi
73
74dnl Fix "localstatedir" variable if it hasn't been specified...
75if test "$localstatedir" = "\${prefix}/var"; then
76 if test "$prefix" = "/"; then
77 if test "$uname" = Darwin; then
78 localstatedir="/private/var"
79 else
80 localstatedir="/var"
81 fi
82 else
83 localstatedir="$prefix/var"
84 fi
85fi
86
87dnl Fix "sysconfdir" variable if it hasn't been specified...
88if test "$sysconfdir" = "\${prefix}/etc"; then
89 if test "$prefix" = "/"; then
90 if test "$uname" = Darwin; then
91 sysconfdir="/private/etc"
92 else
93 sysconfdir="/etc"
94 fi
95 else
96 sysconfdir="$prefix/etc"
97 fi
98fi
99
100dnl Fix "libdir" variable for IRIX 6.x...
101if test "$libdir" = "\${exec_prefix}/lib"; then
e1d6a774 102 if test "$uname" = "IRIX"; then
ef416fc2 103 libdir="$exec_prefix/lib32"
104 else
e1d6a774 105 if test "$uname" = Linux -a -d /usr/lib64; then
106 libdir="$exec_prefix/lib64"
107 else
108 libdir="$exec_prefix/lib"
109 fi
ef416fc2 110 fi
111fi
112
113dnl Setup init.d locations...
114AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
115
116if test x$rcdir = x; then
117 case "$uname" in
118 FreeBSD* | OpenBSD*)
119 # FreeBSD and OpenBSD
120 INITDIR=""
121 INITDDIR=""
122 ;;
123
124 NetBSD*)
125 # NetBSD
126 INITDIR=""
127 INITDDIR="/etc/rc.d"
128 ;;
129
130 Darwin*)
131 # Darwin and MacOS X...
132 INITDIR=""
f301802f 133 if test -x /sbin/launchd; then
134 INITDDIR="/System/Library/LaunchDaemons"
135 else
136 INITDDIR="/System/Library/StartupItems/PrintingServices"
137 fi
ef416fc2 138 ;;
139
140 Linux | GNU)
141 # Linux/HURD seems to choose an init.d directory at random...
142 if test -d /sbin/init.d; then
143 # SuSE
144 INITDIR="/sbin/init.d"
145 INITDDIR=".."
146 else
147 if test -d /etc/init.d; then
148 # Others
149 INITDIR="/etc"
150 INITDDIR="../init.d"
151 else
152 # RedHat
153 INITDIR="/etc/rc.d"
154 INITDDIR="../init.d"
155 fi
156 fi
157 ;;
158
159 OSF1* | HP-UX*)
160 INITDIR="/sbin"
161 INITDDIR="../init.d"
162 ;;
163
164 AIX*)
165 INITDIR="/etc/rc.d"
166 INITDDIR=".."
167 ;;
168
169 *)
170 INITDIR="/etc"
171 INITDDIR="../init.d"
172 ;;
173
174 esac
175else
176 INITDIR=""
177 INITDDIR="$rcdir"
178fi
179
180AC_SUBST(INITDIR)
181AC_SUBST(INITDDIR)
182
e1d6a774 183dnl Xinetd support...
184XINETD=""
185for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
186 if test -d $dir; then
187 XINETD="$dir"
188 break
189 fi
190done
191
192AC_SUBST(XINETD)
193
ef416fc2 194dnl Setup default locations...
195# Cache data...
196AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
197
198if test x$cachedir = x; then
a4d04587 199 if test "x$uname" = xDarwin; then
200 CUPS_CACHEDIR="$localstatedir/tmp/cups"
201 else
202 CUPS_CACHEDIR="$localstatedir/cache/cups"
203 fi
ef416fc2 204else
205 CUPS_CACHEDIR="$cachedir"
206fi
207AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
208AC_SUBST(CUPS_CACHEDIR)
209
210# Data files
211CUPS_DATADIR="$datadir/cups"
212AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
213AC_SUBST(CUPS_DATADIR)
214
215# Documentation files
216AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
217
218if test x$docdir = x; then
219 CUPS_DOCROOT="$datadir/doc/cups"
220 docdir="$datadir/doc/cups"
221else
222 CUPS_DOCROOT="$docdir"
223fi
224
225AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
226AC_SUBST(CUPS_DOCROOT)
227
228# Fonts
229AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
230
231if test "x$fontpath" = "x"; then
232 CUPS_FONTPATH="$datadir/cups/fonts"
233else
234 CUPS_FONTPATH="$fontpath"
235fi
236
237AC_SUBST(CUPS_FONTPATH)
238AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
239
240# Locale data
241case "$uname" in
242 Linux | GNU | *BSD* | Darwin*)
243 CUPS_LOCALEDIR="$datadir/locale"
244 ;;
245
246 OSF1* | AIX*)
247 CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
248 ;;
249
250 *)
251 # This is the standard System V location...
252 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
253 ;;
254esac
255
256AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
257AC_SUBST(CUPS_LOCALEDIR)
258
259# Log files...
260AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
261
262if test x$logdir = x; then
263 CUPS_LOGDIR="$localstatedir/log/cups"
264 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
265else
266 CUPS_LOGDIR="$logdir"
267fi
268AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
269AC_SUBST(CUPS_LOGDIR)
270
271# Longer-term spool data
272CUPS_REQUESTS="$localstatedir/spool/cups"
273AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
274AC_SUBST(CUPS_REQUESTS)
275
276# Server executables...
277case "$uname" in
278 *BSD* | Darwin*)
279 # *BSD and Darwin (MacOS X)
280 INSTALL_SYSV=""
281 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
282 ;;
283 *)
284 # All others
285 INSTALL_SYSV="install-sysv"
e1d6a774 286 CUPS_SERVERBIN="$exec_prefix/lib/cups"
ef416fc2 287 ;;
288esac
289
290AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
291AC_SUBST(CUPS_SERVERBIN)
292AC_SUBST(INSTALL_SYSV)
293
294# Configuration files
295CUPS_SERVERROOT="$sysconfdir/cups"
296AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
297AC_SUBST(CUPS_SERVERROOT)
298
299# Transient run-time state
300CUPS_STATEDIR="$localstatedir/run/cups"
301AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
302AC_SUBST(CUPS_STATEDIR)
303
304dnl
f301802f 305dnl End of "$Id: cups-directories.m4 5546 2006-05-19 12:44:15Z mike $".
ef416fc2 306dnl