]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-directories.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-directories.m4
1 dnl
2 dnl "$Id: cups-directories.m4 5023 2006-01-29 14:39:44Z mike $"
3 dnl
4 dnl Directory stuff for the Common UNIX Printing System (CUPS).
5 dnl
6 dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
7 dnl
8 dnl These coded instructions, statements, and computer programs are the
9 dnl property of Easy Software Products and are protected by Federal
10 dnl copyright law. Distribution and use rights are outlined in the file
11 dnl "LICENSE.txt" which should have been included with this file. If this
12 dnl file is missing or damaged please contact Easy Software Products
13 dnl at:
14 dnl
15 dnl Attn: CUPS Licensing Information
16 dnl Easy Software Products
17 dnl 44141 Airport View Drive, Suite 204
18 dnl Hollywood, Maryland 20636 USA
19 dnl
20 dnl Voice: (301) 373-9600
21 dnl EMail: cups-info@cups.org
22 dnl WWW: http://www.cups.org
23 dnl
24
25 AC_PREFIX_DEFAULT(/)
26
27 dnl Fix "prefix" variable if it hasn't been specified...
28 if test "$prefix" = "NONE"; then
29 prefix="/"
30 fi
31
32 dnl Fix "exec_prefix" variable if it hasn't been specified...
33 if test "$exec_prefix" = "NONE"; then
34 if test "$prefix" = "/"; then
35 exec_prefix="/usr"
36 else
37 exec_prefix="$prefix"
38 fi
39 fi
40
41 dnl Fix "bindir" variable...
42 if test "$bindir" = "\${exec_prefix}/bin"; then
43 bindir="$exec_prefix/bin"
44 fi
45
46 AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir")
47
48 dnl Fix "sbindir" variable...
49 if test "$sbindir" = "\${exec_prefix}/sbin"; then
50 sbindir="$exec_prefix/sbin"
51 fi
52
53 AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir")
54
55 dnl Fix "sharedstatedir" variable if it hasn't been specified...
56 if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
57 sharedstatedir="/usr/com"
58 fi
59
60 dnl Fix "datadir" variable if it hasn't been specified...
61 if test "$datadir" = "\${prefix}/share"; then
62 if test "$prefix" = "/"; then
63 datadir="/usr/share"
64 else
65 datadir="$prefix/share"
66 fi
67 fi
68
69 dnl Fix "includedir" variable if it hasn't been specified...
70 if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then
71 includedir="/usr/include"
72 fi
73
74 dnl Fix "localstatedir" variable if it hasn't been specified...
75 if 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
85 fi
86
87 dnl Fix "sysconfdir" variable if it hasn't been specified...
88 if 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
98 fi
99
100 dnl Fix "libdir" variable for IRIX 6.x...
101 if 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
107 fi
108
109 dnl Setup init.d locations...
110 AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
111
112 if 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=""
129 AC_CHECK_PROG(INITDDIR, launchd,
130 "/System/Library/LaunchDaemons",
131 "/System/Library/StartupItems/PrintingServices")
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
169 else
170 INITDIR=""
171 INITDDIR="$rcdir"
172 fi
173
174 AC_SUBST(INITDIR)
175 AC_SUBST(INITDDIR)
176
177 dnl Setup default locations...
178 # Cache data...
179 AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
180
181 if test x$cachedir = x; then
182 if test "x$uname" = xDarwin; then
183 CUPS_CACHEDIR="$localstatedir/tmp/cups"
184 else
185 CUPS_CACHEDIR="$localstatedir/cache/cups"
186 fi
187 else
188 CUPS_CACHEDIR="$cachedir"
189 fi
190 AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
191 AC_SUBST(CUPS_CACHEDIR)
192
193 # Data files
194 CUPS_DATADIR="$datadir/cups"
195 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
196 AC_SUBST(CUPS_DATADIR)
197
198 # Documentation files
199 AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
200
201 if test x$docdir = x; then
202 CUPS_DOCROOT="$datadir/doc/cups"
203 docdir="$datadir/doc/cups"
204 else
205 CUPS_DOCROOT="$docdir"
206 fi
207
208 AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
209 AC_SUBST(CUPS_DOCROOT)
210
211 # Fonts
212 AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
213
214 if test "x$fontpath" = "x"; then
215 CUPS_FONTPATH="$datadir/cups/fonts"
216 else
217 CUPS_FONTPATH="$fontpath"
218 fi
219
220 AC_SUBST(CUPS_FONTPATH)
221 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
222
223 # Locale data
224 case "$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 ;;
237 esac
238
239 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
240 AC_SUBST(CUPS_LOCALEDIR)
241
242 # Log files...
243 AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
244
245 if test x$logdir = x; then
246 CUPS_LOGDIR="$localstatedir/log/cups"
247 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
248 else
249 CUPS_LOGDIR="$logdir"
250 fi
251 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
252 AC_SUBST(CUPS_LOGDIR)
253
254 # Longer-term spool data
255 CUPS_REQUESTS="$localstatedir/spool/cups"
256 AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
257 AC_SUBST(CUPS_REQUESTS)
258
259 # Server executables...
260 case "$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 ;;
271 esac
272
273 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
274 AC_SUBST(CUPS_SERVERBIN)
275 AC_SUBST(INSTALL_SYSV)
276
277 # Configuration files
278 CUPS_SERVERROOT="$sysconfdir/cups"
279 AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
280 AC_SUBST(CUPS_SERVERROOT)
281
282 # Transient run-time state
283 CUPS_STATEDIR="$localstatedir/run/cups"
284 AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
285 AC_SUBST(CUPS_STATEDIR)
286
287 dnl
288 dnl End of "$Id: cups-directories.m4 5023 2006-01-29 14:39:44Z mike $".
289 dnl