]> 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 4873 2005-12-07 01:46:54Z 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 dnl Fix "sbindir" variable...
47 if test "$sbindir" = "\${exec_prefix}/sbin"; then
48 sbindir="$exec_prefix/sbin"
49 fi
50
51 dnl Fix "sharedstatedir" variable if it hasn't been specified...
52 if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
53 sharedstatedir="/usr/com"
54 fi
55
56 dnl Fix "datadir" variable if it hasn't been specified...
57 if test "$datadir" = "\${prefix}/share"; then
58 if test "$prefix" = "/"; then
59 datadir="/usr/share"
60 else
61 datadir="$prefix/share"
62 fi
63 fi
64
65 dnl Fix "includedir" variable if it hasn't been specified...
66 if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then
67 includedir="/usr/include"
68 fi
69
70 dnl Fix "localstatedir" variable if it hasn't been specified...
71 if test "$localstatedir" = "\${prefix}/var"; then
72 if test "$prefix" = "/"; then
73 if test "$uname" = Darwin; then
74 localstatedir="/private/var"
75 else
76 localstatedir="/var"
77 fi
78 else
79 localstatedir="$prefix/var"
80 fi
81 fi
82
83 dnl Fix "sysconfdir" variable if it hasn't been specified...
84 if test "$sysconfdir" = "\${prefix}/etc"; then
85 if test "$prefix" = "/"; then
86 if test "$uname" = Darwin; then
87 sysconfdir="/private/etc"
88 else
89 sysconfdir="/etc"
90 fi
91 else
92 sysconfdir="$prefix/etc"
93 fi
94 fi
95
96 dnl Fix "libdir" variable for IRIX 6.x...
97 if test "$libdir" = "\${exec_prefix}/lib"; then
98 if test "$uname" = "IRIX" -a $uversion -ge 62; then
99 libdir="$exec_prefix/lib32"
100 else
101 libdir="$exec_prefix/lib"
102 fi
103 fi
104
105 dnl Setup init.d locations...
106 AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
107
108 if test x$rcdir = x; then
109 case "$uname" in
110 FreeBSD* | OpenBSD*)
111 # FreeBSD and OpenBSD
112 INITDIR=""
113 INITDDIR=""
114 ;;
115
116 NetBSD*)
117 # NetBSD
118 INITDIR=""
119 INITDDIR="/etc/rc.d"
120 ;;
121
122 Darwin*)
123 # Darwin and MacOS X...
124 INITDIR=""
125 INITDDIR="/System/Library/StartupItems/PrintingServices"
126 ;;
127
128 Linux | GNU)
129 # Linux/HURD seems to choose an init.d directory at random...
130 if test -d /sbin/init.d; then
131 # SuSE
132 INITDIR="/sbin/init.d"
133 INITDDIR=".."
134 else
135 if test -d /etc/init.d; then
136 # Others
137 INITDIR="/etc"
138 INITDDIR="../init.d"
139 else
140 # RedHat
141 INITDIR="/etc/rc.d"
142 INITDDIR="../init.d"
143 fi
144 fi
145 ;;
146
147 OSF1* | HP-UX*)
148 INITDIR="/sbin"
149 INITDDIR="../init.d"
150 ;;
151
152 AIX*)
153 INITDIR="/etc/rc.d"
154 INITDDIR=".."
155 ;;
156
157 *)
158 INITDIR="/etc"
159 INITDDIR="../init.d"
160 ;;
161
162 esac
163 else
164 INITDIR=""
165 INITDDIR="$rcdir"
166 fi
167
168 AC_SUBST(INITDIR)
169 AC_SUBST(INITDDIR)
170
171 dnl Setup default locations...
172 # Cache data...
173 AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
174
175 if test x$cachedir = x; then
176 CUPS_CACHEDIR="$localstatedir/cache/cups"
177 else
178 CUPS_CACHEDIR="$cachedir"
179 fi
180 AC_DEFINE_UNQUOTED(CUPS_CACHEDIR, "$CUPS_CACHEDIR")
181 AC_SUBST(CUPS_CACHEDIR)
182
183 # Data files
184 CUPS_DATADIR="$datadir/cups"
185 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
186 AC_SUBST(CUPS_DATADIR)
187
188 # Documentation files
189 AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
190
191 if test x$docdir = x; then
192 CUPS_DOCROOT="$datadir/doc/cups"
193 docdir="$datadir/doc/cups"
194 else
195 CUPS_DOCROOT="$docdir"
196 fi
197
198 AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
199 AC_SUBST(CUPS_DOCROOT)
200
201 # Fonts
202 AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
203
204 if test "x$fontpath" = "x"; then
205 CUPS_FONTPATH="$datadir/cups/fonts"
206 else
207 CUPS_FONTPATH="$fontpath"
208 fi
209
210 AC_SUBST(CUPS_FONTPATH)
211 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
212
213 # Locale data
214 case "$uname" in
215 Linux | GNU | *BSD* | Darwin*)
216 CUPS_LOCALEDIR="$datadir/locale"
217 ;;
218
219 OSF1* | AIX*)
220 CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
221 ;;
222
223 *)
224 # This is the standard System V location...
225 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
226 ;;
227 esac
228
229 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$CUPS_LOCALEDIR")
230 AC_SUBST(CUPS_LOCALEDIR)
231
232 # Log files...
233 AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
234
235 if test x$logdir = x; then
236 CUPS_LOGDIR="$localstatedir/log/cups"
237 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
238 else
239 CUPS_LOGDIR="$logdir"
240 fi
241 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$CUPS_LOGDIR")
242 AC_SUBST(CUPS_LOGDIR)
243
244 # Longer-term spool data
245 CUPS_REQUESTS="$localstatedir/spool/cups"
246 AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
247 AC_SUBST(CUPS_REQUESTS)
248
249 # Server executables...
250 case "$uname" in
251 *BSD* | Darwin*)
252 # *BSD and Darwin (MacOS X)
253 INSTALL_SYSV=""
254 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
255 ;;
256 *)
257 # All others
258 INSTALL_SYSV="install-sysv"
259 CUPS_SERVERBIN="$libdir/cups"
260 ;;
261 esac
262
263 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$CUPS_SERVERBIN")
264 AC_SUBST(CUPS_SERVERBIN)
265 AC_SUBST(INSTALL_SYSV)
266
267 # Configuration files
268 CUPS_SERVERROOT="$sysconfdir/cups"
269 AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
270 AC_SUBST(CUPS_SERVERROOT)
271
272 # Transient run-time state
273 CUPS_STATEDIR="$localstatedir/run/cups"
274 AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
275 AC_SUBST(CUPS_STATEDIR)
276
277 dnl
278 dnl End of "$Id: cups-directories.m4 4873 2005-12-07 01:46:54Z mike $".
279 dnl