]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-directories.m4
Miscellaneous build fixes for NetBSD (STR #788)
[thirdparty/cups.git] / config-scripts / cups-directories.m4
1 dnl
2 dnl "$Id: cups-directories.m4,v 1.12 2004/06/29 03:44:52 mike Exp $"
3 dnl
4 dnl Directory stuff for the Common UNIX Printing System (CUPS).
5 dnl
6 dnl Copyright 1997-2004 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-3142 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 AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
28 AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
29 AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
30 AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
31
32 dnl Fix "prefix" variable if it hasn't been specified...
33 if test "$prefix" = "NONE"; then
34 prefix="/"
35 fi
36
37 dnl Fix "exec_prefix" variable if it hasn't been specified...
38 if test "$exec_prefix" = "NONE"; then
39 if test "$prefix" = "/"; then
40 exec_prefix="/usr"
41 else
42 exec_prefix="$prefix"
43 fi
44 fi
45
46 dnl Fix "sharedstatedir" variable if it hasn't been specified...
47 if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
48 sharedstatedir="/usr/com"
49 fi
50
51 dnl Fix "datadir" variable if it hasn't been specified...
52 if test "$datadir" = "\${prefix}/share"; then
53 if test "$prefix" = "/"; then
54 datadir="/usr/share"
55 else
56 datadir="$prefix/share"
57 fi
58 fi
59
60 dnl Fix "includedir" variable if it hasn't been specified...
61 if test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"; then
62 includedir="/usr/include"
63 fi
64
65 dnl Fix "localstatedir" variable if it hasn't been specified...
66 if test "$localstatedir" = "\${prefix}/var"; then
67 if test "$prefix" = "/"; then
68 localstatedir="/var"
69 else
70 localstatedir="$prefix/var"
71 fi
72 fi
73
74 dnl Fix "sysconfdir" variable if it hasn't been specified...
75 if test "$sysconfdir" = "\${prefix}/etc"; then
76 if test "$prefix" = "/"; then
77 sysconfdir="/etc"
78 else
79 sysconfdir="$prefix/etc"
80 fi
81 fi
82
83 dnl Fix "libdir" variable for IRIX 6.x...
84 if test "$libdir" = "\${exec_prefix}/lib"; then
85 libdir="$exec_prefix/lib"
86 fi
87
88 if test "$uname" = "IRIX" -a $uversion -ge 62; then
89 libdir="$exec_prefix/lib32"
90 fi
91
92 dnl Fix "fontpath" variable...
93 if test "x$fontpath" = "x"; then
94 fontpath="$datadir/cups/fonts"
95 fi
96
97 dnl Setup init.d locations...
98 if test x$rcdir = x; then
99 case "$uname" in
100 FreeBSD* | OpenBSD*)
101 # FreeBSD and OpenBSD
102 INITDIR=""
103 INITDDIR=""
104 ;;
105
106 NetBSD*)
107 # NetBSD
108 INITDIR=""
109 INITDDIR="/etc/rc.d"
110 ;;
111
112 Darwin*)
113 # Darwin and MacOS X...
114 INITDIR=""
115 INITDDIR="/System/Library/StartupItems/PrintingServices"
116 ;;
117
118 Linux*)
119 # Linux seems to choose an init.d directory at random...
120 if test -d /sbin/init.d; then
121 # SuSE
122 INITDIR="/sbin/init.d"
123 INITDDIR=".."
124 else
125 if test -d /etc/rc.d; then
126 # RedHat
127 INITDIR="/etc/rc.d"
128 INITDDIR="../init.d"
129 else
130 # Others
131 INITDIR="/etc"
132 INITDDIR="../init.d"
133 fi
134 fi
135 ;;
136
137 OSF1* | HP-UX*)
138 INITDIR="/sbin"
139 INITDDIR="../init.d"
140 ;;
141
142 AIX*)
143 INITDIR="/etc/rc.d"
144 INITDDIR=".."
145 ;;
146
147 *)
148 INITDIR="/etc"
149 INITDDIR="../init.d"
150 ;;
151
152 esac
153 else
154 INITDIR=""
155 INITDDIR="$rcdir"
156 fi
157
158 AC_SUBST(INITDIR)
159 AC_SUBST(INITDDIR)
160
161 dnl Setup default locations...
162 CUPS_SERVERROOT="$sysconfdir/cups"
163 CUPS_REQUESTS="$localstatedir/spool/cups"
164
165 AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
166 AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
167
168 if test x$logdir = x; then
169 CUPS_LOGDIR="$localstatedir/log/cups"
170 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
171 else
172 CUPS_LOGDIR="$logdir"
173 AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$logdir")
174 fi
175
176 dnl See what directory to put server executables...
177 case "$uname" in
178 *BSD* | Darwin*)
179 # *BSD and Darwin (MacOS X)
180 INSTALL_SYSV=""
181 CUPS_SERVERBIN="$exec_prefix/libexec/cups"
182 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$exec_prefix/libexec/cups")
183 ;;
184 *)
185 # All others
186 INSTALL_SYSV="install-sysv"
187 CUPS_SERVERBIN="$libdir/cups"
188 AC_DEFINE_UNQUOTED(CUPS_SERVERBIN, "$libdir/cups")
189 ;;
190 esac
191
192 AC_SUBST(INSTALL_SYSV)
193 AC_SUBST(CUPS_SERVERROOT)
194 AC_SUBST(CUPS_SERVERBIN)
195 AC_SUBST(CUPS_LOGDIR)
196 AC_SUBST(CUPS_REQUESTS)
197
198 dnl Set the CUPS_LOCALE directory...
199 case "$uname" in
200 Linux* | *BSD* | Darwin*)
201 CUPS_LOCALEDIR="$datadir/locale"
202 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$datadir/locale")
203 ;;
204
205 OSF1* | AIX*)
206 CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
207 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$exec_prefix/lib/nls/msg")
208 ;;
209
210 *)
211 # This is the standard System V location...
212 CUPS_LOCALEDIR="$exec_prefix/lib/locale"
213 AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$exec_prefix/lib/locale")
214 ;;
215 esac
216
217 AC_SUBST(CUPS_LOCALEDIR)
218
219 dnl Set the CUPS_DATADIR directory...
220 CUPS_DATADIR="$datadir/cups"
221 AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
222 AC_SUBST(CUPS_DATADIR)
223
224 dnl Set the CUPS_DOCROOT directory...
225 if test x$docdir = x; then
226 CUPS_DOCROOT="$datadir/doc/cups"
227 docdir="$datadir/doc/cups"
228 else
229 CUPS_DOCROOT="$docdir"
230 fi
231
232 AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
233 AC_SUBST(CUPS_DOCROOT)
234
235 dnl Set the CUPS_FONTPATH directory...
236 CUPS_FONTPATH="$fontpath"
237 AC_SUBST(CUPS_FONTPATH)
238 AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$fontpath")
239
240 dnl
241 dnl End of "$Id: cups-directories.m4,v 1.12 2004/06/29 03:44:52 mike Exp $".
242 dnl