]> 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
a4d04587 2dnl "$Id: cups-directories.m4 5023 2006-01-29 14:39:44Z mike $"
ef416fc2 3dnl
4dnl Directory stuff for the Common UNIX Printing System (CUPS).
5dnl
6dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
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
102 if test "$uname" = "IRIX" -a $uversion -ge 62; then
103 libdir="$exec_prefix/lib32"
104 else
105 libdir="$exec_prefix/lib"
106 fi
107fi
108
109dnl Setup init.d locations...
110AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
111
112if test x$rcdir = x; then
113 case "$uname" in
114 FreeBSD* | OpenBSD*)
115 # FreeBSD and OpenBSD
116 INITDIR=""
117 INITDDIR=""
118 ;;
119
120 NetBSD*)
121 # NetBSD
122 INITDIR=""
123 INITDDIR="/etc/rc.d"
124 ;;
125
126 Darwin*)
127 # Darwin and MacOS X...
128 INITDIR=""
a4d04587 129 AC_CHECK_PROG(INITDDIR, launchd,
130 "/System/Library/LaunchDaemons",
131 "/System/Library/StartupItems/PrintingServices")
ef416fc2 132 ;;
133
134 Linux | GNU)
135 # Linux/HURD seems to choose an init.d directory at random...
136 if test -d /sbin/init.d; then
137 # SuSE
138 INITDIR="/sbin/init.d"
139 INITDDIR=".."
140 else
141 if test -d /etc/init.d; then
142 # Others
143 INITDIR="/etc"
144 INITDDIR="../init.d"
145 else
146 # RedHat
147 INITDIR="/etc/rc.d"
148 INITDDIR="../init.d"
149 fi
150 fi
151 ;;
152
153 OSF1* | HP-UX*)
154 INITDIR="/sbin"
155 INITDDIR="../init.d"
156 ;;
157
158 AIX*)
159 INITDIR="/etc/rc.d"
160 INITDDIR=".."
161 ;;
162
163 *)
164 INITDIR="/etc"
165 INITDDIR="../init.d"
166 ;;
167
168 esac
169else
170 INITDIR=""
171 INITDDIR="$rcdir"
172fi
173
174AC_SUBST(INITDIR)
175AC_SUBST(INITDDIR)
176
177dnl Setup default locations...
178# Cache data...
179AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
180
181if test x$cachedir = x; then
a4d04587 182 if test "x$uname" = xDarwin; then
183 CUPS_CACHEDIR="$localstatedir/tmp/cups"
184 else
185 CUPS_CACHEDIR="$localstatedir/cache/cups"
186 fi
ef416fc2 187else
188 CUPS_CACHEDIR="$cachedir"
189fi
190AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
191AC_SUBST(CUPS_CACHEDIR)
192
193# Data files
194CUPS_DATADIR="$datadir/cups"
195AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
196AC_SUBST(CUPS_DATADIR)
197
198# Documentation files
199AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
200
201if test x$docdir = x; then
202 CUPS_DOCROOT="$datadir/doc/cups"
203 docdir="$datadir/doc/cups"
204else
205 CUPS_DOCROOT="$docdir"
206fi
207
208AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
209AC_SUBST(CUPS_DOCROOT)
210
211# Fonts
212AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
213
214if test "x$fontpath" = "x"; then
215 CUPS_FONTPATH="$datadir/cups/fonts"
216else
217 CUPS_FONTPATH="$fontpath"
218fi
219
220AC_SUBST(CUPS_FONTPATH)
221AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
222
223# Locale data
224case "$uname" in
225 Linux | GNU | *BSD* | Darwin*)
226 CUPS_LOCALEDIR="$datadir/locale"
227 ;;
228
229 OSF1* | AIX*)
230 CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
231 ;;
232
233 *)
234 # This is the standard System V location...
235 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
236 ;;
237esac
238
239AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
240AC_SUBST(CUPS_LOCALEDIR)
241
242# Log files...
243AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
244
245if test x$logdir = x; then
246 CUPS_LOGDIR="$localstatedir/log/cups"
247 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
248else
249 CUPS_LOGDIR="$logdir"
250fi
251AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
252AC_SUBST(CUPS_LOGDIR)
253
254# Longer-term spool data
255CUPS_REQUESTS="$localstatedir/spool/cups"
256AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
257AC_SUBST(CUPS_REQUESTS)
258
259# Server executables...
260case "$uname" in
261 *BSD* | Darwin*)
262 # *BSD and Darwin (MacOS X)
263 INSTALL_SYSV=""
264 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
265 ;;
266 *)
267 # All others
268 INSTALL_SYSV="install-sysv"
269 CUPS_SERVERBIN="$libdir/cups"
270 ;;
271esac
272
273AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
274AC_SUBST(CUPS_SERVERBIN)
275AC_SUBST(INSTALL_SYSV)
276
277# Configuration files
278CUPS_SERVERROOT="$sysconfdir/cups"
279AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
280AC_SUBST(CUPS_SERVERROOT)
281
282# Transient run-time state
283CUPS_STATEDIR="$localstatedir/run/cups"
284AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
285AC_SUBST(CUPS_STATEDIR)
286
287dnl
a4d04587 288dnl End of "$Id: cups-directories.m4 5023 2006-01-29 14:39:44Z mike $".
ef416fc2 289dnl