]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
5a1d7a17 | 2 | dnl Directory stuff for CUPS. |
ef416fc2 | 3 | dnl |
76b6aade | 4 | dnl Copyright © 2020-2024 by OpenPrinting. |
8cc87381 MS |
5 | dnl Copyright © 2007-2017 by Apple Inc. |
6 | dnl Copyright © 1997-2007 by Easy Software Products, all rights reserved. | |
ef416fc2 | 7 | dnl |
e3101897 | 8 | dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information. |
ef416fc2 | 9 | dnl |
10 | ||
ef416fc2 | 11 | dnl Fix "prefix" variable if it hasn't been specified... |
a86819ab MS |
12 | AS_IF([test "$prefix" = NONE], [ |
13 | # Default prefix isn't bound until AC_OUTPUT... | |
14 | realprefix="/usr/local" | |
15 | ], [ | |
16 | realprefix="$prefix" | |
8cc87381 | 17 | ]) |
ef416fc2 | 18 | |
19 | dnl Fix "exec_prefix" variable if it hasn't been specified... | |
8cc87381 MS |
20 | AS_IF([test "$exec_prefix" = "NONE"], [ |
21 | AS_IF([test "$prefix" = "/"], [ | |
22 | exec_prefix="/usr" | |
23 | ], [ | |
a86819ab | 24 | exec_prefix="$realprefix" |
8cc87381 MS |
25 | ]) |
26 | ]) | |
ef416fc2 | 27 | |
28 | dnl Fix "bindir" variable... | |
8cc87381 MS |
29 | AS_IF([test "$bindir" = "\${exec_prefix}/bin"], [ |
30 | bindir="$exec_prefix/bin" | |
31 | ]) | |
ef416fc2 | 32 | |
8cc87381 | 33 | AC_DEFINE_UNQUOTED([CUPS_BINDIR], ["$bindir"], [Location of CUPS user programs.]) |
fa73b229 | 34 | |
ef416fc2 | 35 | dnl Fix "sbindir" variable... |
8cc87381 MS |
36 | AS_IF([test "$sbindir" = "\${exec_prefix}/sbin"], [ |
37 | sbindir="$exec_prefix/sbin" | |
38 | ]) | |
ef416fc2 | 39 | |
8cc87381 | 40 | AC_DEFINE_UNQUOTED([CUPS_SBINDIR], ["$sbindir"], [Location of CUPS admin programs.]) |
ef416fc2 | 41 | |
d09495fa | 42 | dnl Fix "datarootdir" variable if it hasn't been specified... |
8cc87381 MS |
43 | AS_IF([test "$datarootdir" = "\${prefix}/share"], [ |
44 | AS_IF([test "$prefix" = "/"], [ | |
45 | datarootdir="/usr/share" | |
46 | ], [ | |
a86819ab | 47 | datarootdir="$realprefix/share" |
8cc87381 MS |
48 | ]) |
49 | ]) | |
d09495fa | 50 | |
ef416fc2 | 51 | dnl Fix "datadir" variable if it hasn't been specified... |
8cc87381 MS |
52 | AS_IF([test "$datadir" = "\${prefix}/share"], [ |
53 | AS_IF([test "$prefix" = "/"], [ | |
54 | datadir="/usr/share" | |
55 | ], [ | |
a86819ab | 56 | datadir="$realprefix/share" |
8cc87381 MS |
57 | ]) |
58 | ], [test "$datadir" = "\${datarootdir}"], [ | |
59 | datadir="$datarootdir" | |
60 | ]) | |
ef416fc2 | 61 | |
62 | dnl Fix "includedir" variable if it hasn't been specified... | |
a86819ab MS |
63 | AS_IF([test "$includedir" = "\${prefix}/include"], [ |
64 | AS_IF([test "$prefix" = "/"], [ | |
65 | includedir="/usr/include/libcups2" | |
66 | ], [ | |
67 | includedir="$realprefix/include/libcups2" | |
68 | ]) | |
8cc87381 | 69 | ]) |
2e9bd60d MS |
70 | AS_IF([test "$includedir" != "/usr/include"], [ |
71 | PKGCONFIG_CFLAGS="$PKGCONFIG_CFLAGS -I$includedir" | |
72 | ]) | |
ef416fc2 | 73 | |
74 | dnl Fix "localstatedir" variable if it hasn't been specified... | |
8cc87381 MS |
75 | AS_IF([test "$localstatedir" = "\${prefix}/var"], [ |
76 | AS_IF([test "$prefix" = "/"], [ | |
77 | AS_IF([test "$host_os_name" = darwin], [ | |
78 | localstatedir="/private/var" | |
79 | ], [ | |
80 | localstatedir="/var" | |
81 | ]) | |
82 | ], [ | |
a86819ab | 83 | localstatedir="$realprefix/var" |
8cc87381 MS |
84 | ]) |
85 | ]) | |
ef416fc2 | 86 | |
87 | dnl Fix "sysconfdir" variable if it hasn't been specified... | |
8cc87381 MS |
88 | AS_IF([test "$sysconfdir" = "\${prefix}/etc"], [ |
89 | AS_IF([test "$prefix" = "/"], [ | |
90 | AS_IF([test "$host_os_name" = darwin], [ | |
91 | sysconfdir="/private/etc" | |
92 | ], [ | |
93 | sysconfdir="/etc" | |
94 | ]) | |
95 | ], [ | |
a86819ab | 96 | sysconfdir="$realprefix/etc" |
8cc87381 MS |
97 | ]) |
98 | ]) | |
ef416fc2 | 99 | |
c277e2f8 | 100 | dnl Fix "libdir" variable... |
8cc87381 MS |
101 | AS_IF([test "$libdir" = "\${exec_prefix}/lib"], [ |
102 | AS_CASE(["$host_os_name"], [linux*], [ | |
103 | AS_IF([test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot], [ | |
104 | libdir="$exec_prefix/lib64" | |
2e9bd60d MS |
105 | ], [ |
106 | libdir="$exec_prefix/lib" | |
8cc87381 | 107 | ]) |
2e9bd60d MS |
108 | ], [*], [ |
109 | libdir="$exec_prefix/lib" | |
8cc87381 MS |
110 | ]) |
111 | ]) | |
2e9bd60d MS |
112 | AS_IF([test "$libdir" = "/usr/lib"], [ |
113 | PKGCONFIG_LIBS="-lcups" | |
114 | ], [ | |
115 | PKGCONFIG_LIBS="-L$libdir -lcups" | |
116 | ]) | |
2e4ff8af | 117 | |
ef416fc2 | 118 | dnl Setup default locations... |
119 | # Cache data... | |
8cc87381 MS |
120 | AC_ARG_WITH([cachedir], AS_HELP_STRING([--with-cachedir], [set path for cache files]), [ |
121 | cachedir="$withval" | |
122 | ], [ | |
123 | cachedir="" | |
124 | ]) | |
125 | ||
126 | AS_IF([test x$cachedir = x], [ | |
127 | AS_IF([test "x$host_os_name" = xdarwin], [ | |
128 | CUPS_CACHEDIR="$localstatedir/spool/cups/cache" | |
129 | ], [ | |
130 | CUPS_CACHEDIR="$localstatedir/cache/cups" | |
131 | ]) | |
132 | ], [ | |
133 | CUPS_CACHEDIR="$cachedir" | |
134 | ]) | |
135 | AC_DEFINE_UNQUOTED([CUPS_CACHEDIR], ["$CUPS_CACHEDIR"], [Location of cache files.]) | |
136 | AC_SUBST([CUPS_CACHEDIR]) | |
ef416fc2 | 137 | |
138 | # Data files | |
139 | CUPS_DATADIR="$datadir/cups" | |
8cc87381 MS |
140 | AC_DEFINE_UNQUOTED([CUPS_DATADIR], ["$datadir/cups"], [Location of data files.]) |
141 | AC_SUBST([CUPS_DATADIR]) | |
ef416fc2 | 142 | |
f7deaa1a | 143 | # Icon directory |
8cc87381 MS |
144 | AC_ARG_WITH([icondir], AS_HELP_STRING([--with-icondir], [set path for application icons]), [ |
145 | icondir="$withval" | |
146 | ], [ | |
147 | icondir="" | |
148 | ]) | |
f7deaa1a | 149 | |
8cc87381 MS |
150 | AS_IF([test "x$icondir" = x], [ |
151 | ICONDIR="/usr/share/icons" | |
152 | ], [ | |
153 | ICONDIR="$icondir" | |
154 | ]) | |
f7deaa1a | 155 | |
8cc87381 | 156 | AC_SUBST([ICONDIR]) |
f7deaa1a | 157 | |
158 | # Menu directory | |
8cc87381 MS |
159 | AC_ARG_WITH([menudir], AS_HELP_STRING([--with-menudir], [set path for application menus]), [ |
160 | menudir="$withval" | |
161 | ], [ | |
162 | menudir="" | |
163 | ]) | |
f7deaa1a | 164 | |
8cc87381 MS |
165 | AS_IF([test "x$menudir" = x], [ |
166 | MENUDIR="/usr/share/applications" | |
167 | ], [ | |
168 | MENUDIR="$menudir" | |
169 | ]) | |
f7deaa1a | 170 | |
8cc87381 | 171 | AC_SUBST([MENUDIR]) |
f7deaa1a | 172 | |
ef416fc2 | 173 | # Documentation files |
8cc87381 MS |
174 | AC_ARG_WITH([docdir], AS_HELP_STRING([--with-docdir], [set path for documentation]), [ |
175 | docdir="$withval" | |
176 | ], [ | |
177 | docdir="" | |
178 | ]) | |
179 | ||
180 | AS_IF([test x$docdir = x], [ | |
181 | CUPS_DOCROOT="$datadir/doc/cups" | |
182 | docdir="$datadir/doc/cups" | |
183 | ], [ | |
184 | CUPS_DOCROOT="$docdir" | |
185 | ]) | |
186 | ||
187 | AC_DEFINE_UNQUOTED([CUPS_DOCROOT], ["$docdir"], [Location of documentation files.]) | |
188 | AC_SUBST([CUPS_DOCROOT]) | |
ef416fc2 | 189 | |
2e4ff8af | 190 | # Locale data |
8cc87381 | 191 | AS_IF([test "$localedir" = "\${datarootdir}/locale"], [ |
2bc20b79 | 192 | AS_CASE(["$host_os_name"], [linux* | gnu* | *bsd* | darwin* | solaris*], [ |
8cc87381 MS |
193 | CUPS_LOCALEDIR="$datarootdir/locale" |
194 | ], [*], [ | |
195 | # This is the standard System V location... | |
196 | CUPS_LOCALEDIR="$exec_prefix/lib/locale" | |
197 | ]) | |
198 | ], [ | |
199 | CUPS_LOCALEDIR="$localedir" | |
200 | ]) | |
201 | ||
202 | AC_DEFINE_UNQUOTED([CUPS_LOCALEDIR], ["$CUPS_LOCALEDIR"], [Location of localization files.]) | |
203 | AC_SUBST([CUPS_LOCALEDIR]) | |
ef416fc2 | 204 | |
3e573834 | 205 | |
206 | # cups.pc file... | |
207 | AC_ARG_WITH([pkgconfpath], AS_HELP_STRING([--with-pkgconfpath], [set path for cups.pc file]), [ | |
208 | pkgconfpath="$withval" | |
209 | ], [ | |
210 | pkgconfpath="" | |
211 | ]) | |
212 | ||
213 | AS_IF([test x$pkgconfpath = x], [ | |
214 | CUPS_PKGCONFPATH="$exec_prefix/lib/pkgconfig" | |
215 | ], [ | |
216 | CUPS_PKGCONFPATH="$pkgconfpath" | |
217 | ]) | |
218 | AC_DEFINE_UNQUOTED([CUPS_PKGCONFPATH], ["$CUPS_PKGCONFPATH"], [Location of cups.pc file.]) | |
219 | AC_SUBST([CUPS_PKGCONFPATH]) | |
220 | ||
221 | ||
222 | ||
ef416fc2 | 223 | # Log files... |
8cc87381 MS |
224 | AC_ARG_WITH([logdir], AS_HELP_STRING([--with-logdir], [set path for log files]), [ |
225 | logdir="$withval" | |
226 | ], [ | |
227 | logdir="" | |
228 | ]) | |
229 | ||
230 | AS_IF([test x$logdir = x], [ | |
231 | CUPS_LOGDIR="$localstatedir/log/cups" | |
232 | ], [ | |
233 | CUPS_LOGDIR="$logdir" | |
234 | ]) | |
235 | AC_DEFINE_UNQUOTED([CUPS_LOGDIR], ["$CUPS_LOGDIR"], [Location of log files.]) | |
236 | AC_SUBST([CUPS_LOGDIR]) | |
ef416fc2 | 237 | |
238 | # Longer-term spool data | |
239 | CUPS_REQUESTS="$localstatedir/spool/cups" | |
8cc87381 MS |
240 | AC_DEFINE_UNQUOTED([CUPS_REQUESTS], ["$localstatedir/spool/cups"], [Location of spool directory.]) |
241 | AC_SUBST([CUPS_REQUESTS]) | |
ef416fc2 | 242 | |
243 | # Server executables... | |
8cc87381 MS |
244 | AS_CASE(["$host_os_name"], [*-gnu], [ |
245 | # GNUs | |
246 | INSTALL_SYSV="install-sysv" | |
247 | CUPS_SERVERBIN="$exec_prefix/lib/cups" | |
248 | ], [*bsd* | darwin*], [ | |
249 | # *BSD and Darwin (macOS) | |
250 | INSTALL_SYSV="" | |
251 | CUPS_SERVERBIN="$exec_prefix/libexec/cups" | |
252 | ], [*], [ | |
253 | # All others | |
254 | INSTALL_SYSV="install-sysv" | |
255 | CUPS_SERVERBIN="$exec_prefix/lib/cups" | |
256 | ]) | |
257 | ||
258 | AC_DEFINE_UNQUOTED([CUPS_SERVERBIN], ["$CUPS_SERVERBIN"], [Location of server programs.]) | |
259 | AC_SUBST([CUPS_SERVERBIN]) | |
260 | AC_SUBST([INSTALL_SYSV]) | |
ef416fc2 | 261 | |
262 | # Configuration files | |
263 | CUPS_SERVERROOT="$sysconfdir/cups" | |
8cc87381 MS |
264 | AC_DEFINE_UNQUOTED([CUPS_SERVERROOT], ["$sysconfdir/cups"], [Location of server configuration files.]) |
265 | AC_SUBST([CUPS_SERVERROOT]) | |
ef416fc2 | 266 | |
267 | # Transient run-time state | |
8cc87381 MS |
268 | AC_ARG_WITH([rundir], AS_HELP_STRING([--with-rundir], [set transient run-time state directory]), [ |
269 | CUPS_STATEDIR="$withval" | |
270 | ], [ | |
271 | AS_CASE(["$host_os_name"], [darwin*], [ | |
272 | # Darwin (macOS) | |
273 | CUPS_STATEDIR="$CUPS_SERVERROOT" | |
e1cfb900 | 274 | ], [sunos* | solaris*], [ |
2bc20b79 MR |
275 | AS_IF([test -d /system/volatile], [ |
276 | CUPS_STATEDIR="/system/volatile/cups" | |
e1cfb900 MR |
277 | ], [ |
278 | CUPS_STATEDIR="$localstatedir/run/cups" | |
2bc20b79 | 279 | ]) |
8cc87381 MS |
280 | ], [*], [ |
281 | # All others | |
282 | CUPS_STATEDIR="$localstatedir/run/cups" | |
283 | ]) | |
284 | ]) | |
285 | AC_DEFINE_UNQUOTED([CUPS_STATEDIR], ["$CUPS_STATEDIR"], [Location of transient state files.]) | |
286 | AC_SUBST([CUPS_STATEDIR]) |