2 dnl Directory stuff for CUPS.
4 dnl Copyright © 2020-2024 by OpenPrinting.
5 dnl Copyright © 2007-2017 by Apple Inc.
6 dnl Copyright © 1997-2007 by Easy Software Products, all rights reserved.
8 dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
11 dnl Fix "prefix" variable if it hasn't been specified...
12 AS_IF([test "$prefix" = NONE], [
13 # Default prefix isn't bound until AC_OUTPUT...
14 realprefix="/usr/local"
19 dnl Fix "exec_prefix" variable if it hasn't been specified...
20 AS_IF([test "$exec_prefix" = "NONE"], [
21 AS_IF([test "$prefix" = "/"], [
24 exec_prefix="$realprefix"
28 dnl Fix "bindir" variable...
29 AS_IF([test "$bindir" = "\${exec_prefix}/bin"], [
30 bindir="$exec_prefix/bin"
33 AC_DEFINE_UNQUOTED([CUPS_BINDIR], ["$bindir"], [Location of CUPS user programs.])
35 dnl Fix "sbindir" variable...
36 AS_IF([test "$sbindir" = "\${exec_prefix}/sbin"], [
37 sbindir="$exec_prefix/sbin"
40 AC_DEFINE_UNQUOTED([CUPS_SBINDIR], ["$sbindir"], [Location of CUPS admin programs.])
42 dnl Fix "datarootdir" variable if it hasn't been specified...
43 AS_IF([test "$datarootdir" = "\${prefix}/share"], [
44 AS_IF([test "$prefix" = "/"], [
45 datarootdir="/usr/share"
47 datarootdir="$realprefix/share"
51 dnl Fix "datadir" variable if it hasn't been specified...
52 AS_IF([test "$datadir" = "\${prefix}/share"], [
53 AS_IF([test "$prefix" = "/"], [
56 datadir="$realprefix/share"
58 ], [test "$datadir" = "\${datarootdir}"], [
59 datadir="$datarootdir"
62 dnl Fix "includedir" variable if it hasn't been specified...
63 AS_IF([test "$includedir" = "\${prefix}/include"], [
64 AS_IF([test "$prefix" = "/"], [
65 includedir="/usr/include/libcups2"
67 includedir="$realprefix/include/libcups2"
70 AS_IF([test "$includedir" != "/usr/include"], [
71 PKGCONFIG_CFLAGS="$PKGCONFIG_CFLAGS -I$includedir"
74 dnl Fix "localstatedir" variable if it hasn't been specified...
75 AS_IF([test "$localstatedir" = "\${prefix}/var"], [
76 AS_IF([test "$prefix" = "/"], [
77 AS_IF([test "$host_os_name" = darwin], [
78 localstatedir="/private/var"
83 localstatedir="$realprefix/var"
87 dnl Fix "sysconfdir" variable if it hasn't been specified...
88 AS_IF([test "$sysconfdir" = "\${prefix}/etc"], [
89 AS_IF([test "$prefix" = "/"], [
90 AS_IF([test "$host_os_name" = darwin], [
91 sysconfdir="/private/etc"
96 sysconfdir="$realprefix/etc"
100 dnl Fix "libdir" variable...
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"
106 libdir="$exec_prefix/lib"
109 libdir="$exec_prefix/lib"
112 AS_IF([test "$libdir" = "/usr/lib"], [
113 PKGCONFIG_LIBS="-lcups"
115 PKGCONFIG_LIBS="-L$libdir -lcups"
118 dnl Setup default locations...
120 AC_ARG_WITH([cachedir], AS_HELP_STRING([--with-cachedir], [set path for cache files]), [
126 AS_IF([test x$cachedir = x], [
127 AS_IF([test "x$host_os_name" = xdarwin], [
128 CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
130 CUPS_CACHEDIR="$localstatedir/cache/cups"
133 CUPS_CACHEDIR="$cachedir"
135 AC_DEFINE_UNQUOTED([CUPS_CACHEDIR], ["$CUPS_CACHEDIR"], [Location of cache files.])
136 AC_SUBST([CUPS_CACHEDIR])
139 CUPS_DATADIR="$datadir/cups"
140 AC_DEFINE_UNQUOTED([CUPS_DATADIR], ["$datadir/cups"], [Location of data files.])
141 AC_SUBST([CUPS_DATADIR])
144 AC_ARG_WITH([icondir], AS_HELP_STRING([--with-icondir], [set path for application icons]), [
150 AS_IF([test "x$icondir" = x], [
151 ICONDIR="/usr/share/icons"
159 AC_ARG_WITH([menudir], AS_HELP_STRING([--with-menudir], [set path for application menus]), [
165 AS_IF([test "x$menudir" = x], [
166 MENUDIR="/usr/share/applications"
173 # Documentation files
174 AC_ARG_WITH([docdir], AS_HELP_STRING([--with-docdir], [set path for documentation]), [
180 AS_IF([test x$docdir = x], [
181 CUPS_DOCROOT="$datadir/doc/cups"
182 docdir="$datadir/doc/cups"
184 CUPS_DOCROOT="$docdir"
187 AC_DEFINE_UNQUOTED([CUPS_DOCROOT], ["$docdir"], [Location of documentation files.])
188 AC_SUBST([CUPS_DOCROOT])
191 AS_IF([test "$localedir" = "\${datarootdir}/locale"], [
192 AS_CASE(["$host_os_name"], [linux* | gnu* | *bsd* | darwin* | solaris*], [
193 CUPS_LOCALEDIR="$datarootdir/locale"
195 # This is the standard System V location...
196 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
199 CUPS_LOCALEDIR="$localedir"
202 AC_DEFINE_UNQUOTED([CUPS_LOCALEDIR], ["$CUPS_LOCALEDIR"], [Location of localization files.])
203 AC_SUBST([CUPS_LOCALEDIR])
207 AC_ARG_WITH([pkgconfpath], AS_HELP_STRING([--with-pkgconfpath], [set path for cups.pc file]), [
208 pkgconfpath="$withval"
213 AS_IF([test x$pkgconfpath = x], [
214 CUPS_PKGCONFPATH="$exec_prefix/lib/pkgconfig"
216 CUPS_PKGCONFPATH="$pkgconfpath"
218 AC_DEFINE_UNQUOTED([CUPS_PKGCONFPATH], ["$CUPS_PKGCONFPATH"], [Location of cups.pc file.])
219 AC_SUBST([CUPS_PKGCONFPATH])
224 AC_ARG_WITH([logdir], AS_HELP_STRING([--with-logdir], [set path for log files]), [
230 AS_IF([test x$logdir = x], [
231 CUPS_LOGDIR="$localstatedir/log/cups"
233 CUPS_LOGDIR="$logdir"
235 AC_DEFINE_UNQUOTED([CUPS_LOGDIR], ["$CUPS_LOGDIR"], [Location of log files.])
236 AC_SUBST([CUPS_LOGDIR])
238 # Longer-term spool data
239 CUPS_REQUESTS="$localstatedir/spool/cups"
240 AC_DEFINE_UNQUOTED([CUPS_REQUESTS], ["$localstatedir/spool/cups"], [Location of spool directory.])
241 AC_SUBST([CUPS_REQUESTS])
243 # Server executables...
244 AS_CASE(["$host_os_name"], [*-gnu], [
246 INSTALL_SYSV="install-sysv"
247 CUPS_SERVERBIN="$exec_prefix/lib/cups"
248 ], [*bsd* | darwin*], [
249 # *BSD and Darwin (macOS)
251 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
254 INSTALL_SYSV="install-sysv"
255 CUPS_SERVERBIN="$exec_prefix/lib/cups"
258 AC_DEFINE_UNQUOTED([CUPS_SERVERBIN], ["$CUPS_SERVERBIN"], [Location of server programs.])
259 AC_SUBST([CUPS_SERVERBIN])
260 AC_SUBST([INSTALL_SYSV])
262 # Configuration files
263 CUPS_SERVERROOT="$sysconfdir/cups"
264 AC_DEFINE_UNQUOTED([CUPS_SERVERROOT], ["$sysconfdir/cups"], [Location of server configuration files.])
265 AC_SUBST([CUPS_SERVERROOT])
267 # Transient run-time state
268 AC_ARG_WITH([rundir], AS_HELP_STRING([--with-rundir], [set transient run-time state directory]), [
269 CUPS_STATEDIR="$withval"
271 AS_CASE(["$host_os_name"], [darwin*], [
273 CUPS_STATEDIR="$CUPS_SERVERROOT"
274 ], [sunos* | solaris*], [
275 AS_IF([test -d /system/volatile], [
276 CUPS_STATEDIR="/system/volatile/cups"
278 CUPS_STATEDIR="$localstatedir/run/cups"
282 CUPS_STATEDIR="$localstatedir/run/cups"
285 AC_DEFINE_UNQUOTED([CUPS_STATEDIR], ["$CUPS_STATEDIR"], [Location of transient state files.])
286 AC_SUBST([CUPS_STATEDIR])