]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-directories.m4
Remove support for AIX, HP-UX, and OSF/1.
[thirdparty/cups.git] / config-scripts / cups-directories.m4
CommitLineData
ef416fc2 1dnl
5ec1fd3d 2dnl "$Id$"
ef416fc2 3dnl
5a1d7a17 4dnl Directory stuff for CUPS.
ef416fc2 5dnl
5a1d7a17
MS
6dnl Copyright 2007-2013 by Apple Inc.
7dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 8dnl
5a1d7a17
MS
9dnl These coded instructions, statements, and computer programs are the
10dnl property of Apple Inc. and are protected by Federal copyright
11dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
12dnl which should have been included with this file. If this file is
13dnl file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 14dnl
15
16AC_PREFIX_DEFAULT(/)
17
18dnl Fix "prefix" variable if it hasn't been specified...
19if test "$prefix" = "NONE"; then
20 prefix="/"
21fi
22
23dnl Fix "exec_prefix" variable if it hasn't been specified...
24if test "$exec_prefix" = "NONE"; then
25 if test "$prefix" = "/"; then
26 exec_prefix="/usr"
27 else
28 exec_prefix="$prefix"
29 fi
30fi
31
32dnl Fix "bindir" variable...
33if test "$bindir" = "\${exec_prefix}/bin"; then
34 bindir="$exec_prefix/bin"
35fi
36
fa73b229 37AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir")
38
ef416fc2 39dnl Fix "sbindir" variable...
40if test "$sbindir" = "\${exec_prefix}/sbin"; then
41 sbindir="$exec_prefix/sbin"
42fi
43
fa73b229 44AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir")
45
ef416fc2 46dnl Fix "sharedstatedir" variable if it hasn't been specified...
47if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
48 sharedstatedir="/usr/com"
49fi
50
d09495fa 51dnl Fix "datarootdir" variable if it hasn't been specified...
52if test "$datarootdir" = "\${prefix}/share"; then
53 if test "$prefix" = "/"; then
54 datarootdir="/usr/share"
55 else
56 datarootdir="$prefix/share"
57 fi
58fi
59
ef416fc2 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
d09495fa 67elif test "$datadir" = "\${datarootdir}"; then
68 datadir="$datarootdir"
ef416fc2 69fi
70
71dnl Fix "includedir" variable if it hasn't been specified...
72if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then
73 includedir="/usr/include"
74fi
75
76dnl Fix "localstatedir" variable if it hasn't been specified...
77if test "$localstatedir" = "\${prefix}/var"; then
78 if test "$prefix" = "/"; then
79 if test "$uname" = Darwin; then
80 localstatedir="/private/var"
81 else
82 localstatedir="/var"
83 fi
84 else
85 localstatedir="$prefix/var"
86 fi
87fi
88
89dnl Fix "sysconfdir" variable if it hasn't been specified...
90if test "$sysconfdir" = "\${prefix}/etc"; then
91 if test "$prefix" = "/"; then
92 if test "$uname" = Darwin; then
93 sysconfdir="/private/etc"
94 else
95 sysconfdir="/etc"
96 fi
97 else
98 sysconfdir="$prefix/etc"
99 fi
100fi
101
c277e2f8 102dnl Fix "libdir" variable...
ef416fc2 103if test "$libdir" = "\${exec_prefix}/lib"; then
c277e2f8 104 case "$uname" in
c277e2f8 105 Linux*)
5a9febac 106 if test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot; then
c277e2f8
MS
107 libdir="$exec_prefix/lib64"
108 fi
109 ;;
c277e2f8 110 esac
ef416fc2 111fi
112
71e16022 113dnl Setup private include directory...
5180a04c 114AC_ARG_WITH(privateinclude, [ --with-privateinclude set path for private include files, default=none],privateinclude="$withval",privateinclude="")
71e16022
MS
115if test "x$privateinclude" != x -a "x$privateinclude" != xnone; then
116 PRIVATEINCLUDE="$privateinclude/cups"
117else
118 privateinclude=""
119 PRIVATEINCLUDE=""
120fi
121AC_SUBST(privateinclude)
122AC_SUBST(PRIVATEINCLUDE)
123
ef416fc2 124dnl Setup init.d locations...
125AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
f7deaa1a 126AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
127AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="99")
128AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="00")
749b1e90 129AC_ARG_WITH(smfmanifestdir, [ --with-smfmanifestdir set path for Solaris SMF manifest],smfmanifestdir="$withval",smfmanifestdir="")
f7deaa1a 130
131INITDIR=""
132INITDDIR=""
133RCLEVELS="$rclevels"
134RCSTART="$rcstart"
135RCSTOP="$rcstop"
749b1e90 136SMFMANIFESTDIR=""
ef416fc2 137
138if test x$rcdir = x; then
139 case "$uname" in
ef416fc2 140 Darwin*)
141 # Darwin and MacOS X...
f301802f 142 if test -x /sbin/launchd; then
143 INITDDIR="/System/Library/LaunchDaemons"
321d8d57 144 else
f301802f 145 INITDDIR="/System/Library/StartupItems/PrintingServices"
146 fi
ef416fc2 147 ;;
148
7594b224 149 FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*)
f7deaa1a 150 # FreeBSD and OpenBSD
151 ;;
152
2e4ff8af 153 Linux | GNU | GNU/k*BSD*)
ef416fc2 154 # Linux/HURD seems to choose an init.d directory at random...
155 if test -d /sbin/init.d; then
156 # SuSE
157 INITDIR="/sbin/init.d"
ef416fc2 158 else
159 if test -d /etc/init.d; then
160 # Others
161 INITDIR="/etc"
ef416fc2 162 else
163 # RedHat
164 INITDIR="/etc/rc.d"
ef416fc2 165 fi
166 fi
f7deaa1a 167 RCSTART="81"
168 RCSTOP="36"
ef416fc2 169 ;;
170
f7deaa1a 171 NetBSD*)
172 # NetBSD
173 INITDDIR="/etc/rc.d"
174 ;;
175
f7deaa1a 176 SunOS*)
177 # Solaris
749b1e90
MS
178 if test "x$smfmanifestdir" != x; then
179 SMFMANIFESTDIR=$smfmanifestdir
180 else
181 INITDIR="/etc"
182 RCSTART="81"
183 fi
ef416fc2 184 ;;
185
186 *)
187 INITDIR="/etc"
ef416fc2 188 ;;
189
190 esac
e4572d57 191elif test "x$rcdir" != xno; then
f7deaa1a 192 if test "x$rclevels" = x; then
193 INITDDIR="$rcdir"
194 else
195 INITDIR="$rcdir"
196 fi
ef416fc2 197fi
198
199AC_SUBST(INITDIR)
200AC_SUBST(INITDDIR)
f7deaa1a 201AC_SUBST(RCLEVELS)
202AC_SUBST(RCSTART)
203AC_SUBST(RCSTOP)
749b1e90 204AC_SUBST(SMFMANIFESTDIR)
ef416fc2 205
e1d6a774 206dnl Xinetd support...
f7deaa1a 207AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],XINETD="$withval",XINETD="")
d09495fa 208
f7deaa1a 209if test "x$XINETD" = x -a ! -x /sbin/launchd; then
d09495fa 210 for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
211 if test -d $dir; then
212 XINETD="$dir"
213 break
214 fi
215 done
e4572d57
MS
216elif test "x$XINETD" = xno; then
217 XINETD=""
d09495fa 218fi
e1d6a774 219
220AC_SUBST(XINETD)
221
2e4ff8af
MS
222dnl LPD sharing support...
223AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file],
224 LPDCONFIG="$withval", LPDCONFIG="")
225
226if test "x$LPDCONFIG" = x; then
227 if test -f /System/Library/LaunchDaemons/org.cups.cups-lpd.plist; then
228 LPDCONFIG="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
229 elif test "x$XINETD" != x; then
230 LPDCONFIG="xinetd://$XINETD/cups-lpd"
231 fi
232fi
233
234if test "x$LPDCONFIG" = xoff; then
235 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "")
236else
237 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG, "$LPDCONFIG")
238fi
239
240dnl SMB sharing support...
241AC_ARG_WITH(smbconfig, [ --with-smbconfig set URI for Samba config file],
242 SMBCONFIG="$withval", SMBCONFIG="")
243
244if test "x$SMBCONFIG" = x; then
245 if test -f /System/Library/LaunchDaemons/smbd.plist; then
246 SMBCONFIG="launchd:///System/Library/LaunchDaemons/smbd.plist"
247 else
248 for dir in /etc /etc/samba /usr/local/etc; do
249 if test -f $dir/smb.conf; then
250 SMBCONFIG="samba://$dir/smb.conf"
251 break
252 fi
253 done
254 fi
255fi
256
257if test "x$SMBCONFIG" = xoff; then
258 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "")
259else
260 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG, "$SMBCONFIG")
261fi
262
ef416fc2 263dnl Setup default locations...
264# Cache data...
265AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
266
267if test x$cachedir = x; then
a4d04587 268 if test "x$uname" = xDarwin; then
d09495fa 269 CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
a4d04587 270 else
271 CUPS_CACHEDIR="$localstatedir/cache/cups"
272 fi
ef416fc2 273else
274 CUPS_CACHEDIR="$cachedir"
275fi
276AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
277AC_SUBST(CUPS_CACHEDIR)
278
279# Data files
280CUPS_DATADIR="$datadir/cups"
281AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
282AC_SUBST(CUPS_DATADIR)
283
f7deaa1a 284# Icon directory
285AC_ARG_WITH(icondir, [ --with-icondir set path for application icons],icondir="$withval",icondir="")
286
287if test "x$icondir" = x -a -d /usr/share/icons; then
288 ICONDIR="/usr/share/icons"
289else
290 ICONDIR="$icondir"
291fi
292
293AC_SUBST(ICONDIR)
294
295# Menu directory
296AC_ARG_WITH(menudir, [ --with-menudir set path for application menus],menudir="$withval",menudir="")
297
298if test "x$menudir" = x -a -d /usr/share/applications; then
299 MENUDIR="/usr/share/applications"
300else
301 MENUDIR="$menudir"
302fi
303
304AC_SUBST(MENUDIR)
305
ef416fc2 306# Documentation files
307AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
308
309if test x$docdir = x; then
310 CUPS_DOCROOT="$datadir/doc/cups"
311 docdir="$datadir/doc/cups"
312else
313 CUPS_DOCROOT="$docdir"
314fi
315
316AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
317AC_SUBST(CUPS_DOCROOT)
318
319# Fonts
320AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
321
322if test "x$fontpath" = "x"; then
323 CUPS_FONTPATH="$datadir/cups/fonts"
324else
325 CUPS_FONTPATH="$fontpath"
326fi
327
328AC_SUBST(CUPS_FONTPATH)
329AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
330
2e4ff8af
MS
331# Locale data
332if test "$localedir" = "\${datarootdir}/locale"; then
db1f069b
MS
333 case "$uname" in
334 Linux | GNU | *BSD* | Darwin*)
2e4ff8af 335 CUPS_LOCALEDIR="$datarootdir/locale"
db1f069b 336 ;;
ef416fc2 337
db1f069b
MS
338 *)
339 # This is the standard System V location...
340 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
341 ;;
342 esac
343else
344 CUPS_LOCALEDIR="$localedir"
345fi
ef416fc2 346
347AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
348AC_SUBST(CUPS_LOCALEDIR)
349
350# Log files...
351AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
352
353if test x$logdir = x; then
354 CUPS_LOGDIR="$localstatedir/log/cups"
355 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
356else
357 CUPS_LOGDIR="$logdir"
358fi
359AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
360AC_SUBST(CUPS_LOGDIR)
361
362# Longer-term spool data
363CUPS_REQUESTS="$localstatedir/spool/cups"
364AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
365AC_SUBST(CUPS_REQUESTS)
366
367# Server executables...
368case "$uname" in
369 *BSD* | Darwin*)
370 # *BSD and Darwin (MacOS X)
371 INSTALL_SYSV=""
372 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
373 ;;
374 *)
375 # All others
376 INSTALL_SYSV="install-sysv"
e1d6a774 377 CUPS_SERVERBIN="$exec_prefix/lib/cups"
ef416fc2 378 ;;
379esac
380
381AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
382AC_SUBST(CUPS_SERVERBIN)
383AC_SUBST(INSTALL_SYSV)
384
385# Configuration files
386CUPS_SERVERROOT="$sysconfdir/cups"
387AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
388AC_SUBST(CUPS_SERVERROOT)
389
390# Transient run-time state
6961465f
MS
391AC_ARG_WITH(rundir, [ --with-rundir set transient run-time state directory],CUPS_STATEDIR="$withval",[
392 case "$uname" in
393 Darwin*)
394 # Darwin (OS X)
395 CUPS_STATEDIR="$CUPS_SERVERROOT"
396 ;;
397 *)
398 # All others
399 CUPS_STATEDIR="$localstatedir/run/cups"
400 ;;
401 esac])
e07d4801 402AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
ef416fc2 403AC_SUBST(CUPS_STATEDIR)
404
405dnl
5ec1fd3d 406dnl End of "$Id$".
ef416fc2 407dnl