]> git.ipfire.org Git - thirdparty/cups.git/blame - INSTALL.md
Rename README, INSTALL, CHANGES, and CREDITS files to .md (markdown).
[thirdparty/cups.git] / INSTALL.md
CommitLineData
2a20b512
MS
1INSTALL - CUPS v2.2.4 - 2017-05-01
2==================================
3
4This file describes how to compile and install CUPS from source code. For more
5information on CUPS see the file called "README.txt". A complete change log can
6be found in "CHANGES.txt".
7
8> USING CUPS REQUIRES ADDITIONAL THIRD-PARTY SUPPORT SOFTWARE AND PRINTER
9> DRIVERS. THESE ARE TYPICALLY INCLUDED WITH YOUR OPERATING SYSTEM
10> DISTRIBUTION. APPLE DOES NOT ENDORSE OR SUPPORT THIRD-PARTY SUPPORT SOFTWARE
11> FOR CUPS.
12
13
14BEFORE YOU BEGIN
15----------------
16
17You'll need ANSI-compliant C and C++ compilers, plus a make program and POSIX-
18compliant shell (/bin/sh). The GNU compiler tools and Bash work well and we
19have tested the current CUPS code against several versions of GCC with excellent
20results.
21
22The makefiles used by the project should work with most versions of make. We've
23tested them with GNU make as well as the make programs shipped by Compaq, HP,
24SGI, and Sun. BSD users should use GNU make (gmake) since BSD make does not
25support "include".
26
27Besides these tools you'll want ZLIB library for compression support, the GNU
28TLS library for encryption support on platforms other than iOS, macOS, or
29Windows, and either MIT (1.6.3 or higher) or Heimdal Kerberos for Kerberos
30support. CUPS will compile and run without these, however you'll miss out on
31many of the features provided by CUPS.
32
33Also, please note that CUPS does not include print filters to support PDF or
34raster printing. You *must* download GPL Ghostscript and/or the Open Printing
35CUPS filters package separately to print on operating systems other than macOS.
36
37
38CONFIGURATION
39-------------
40
41CUPS uses GNU autoconf, so you should find the usual "configure" script in the
42main CUPS source directory. To configure CUPS for your system, type:
43
44 ./configure
45
46The default installation will put the CUPS software in the "/etc", "/usr", and
47"/var" directories on your system, which will overwrite any existing printing
48commands on your system. Use the "--prefix" option to install the CUPS software
49in another location:
50
51 ./configure --prefix=/some/directory
52
53To see a complete list of configuration options, use the --help option:
54
55 ./configure --help
56
57If any of the dependent libraries are not installed in a system default location
58(typically "/usr/include" and "/usr/lib") you'll need to set the CFLAGS,
59CPPFLAGS, CXXFLAGS, DSOFLAGS, and LDFLAGS environment variables prior to running
60configure:
61
62 setenv CFLAGS "-I/some/directory"
63 setenv CPPFLAGS "-I/some/directory"
64 setenv CXXFLAGS "-I/some/directory"
65 setenv DSOFLAGS "-L/some/directory"
66 setenv LDFLAGS "-L/some/directory"
67 ./configure ...
68
69or:
70
71 CFLAGS="-I/some/directory" \
72 CPPFLAGS="-I/some/directory" \
73 CXXFLAGS="-I/some/directory" \
74 DSOFLAGS="-L/some/directory" \
75 LDFLAGS="-L/some/directory" \
76 ./configure ...
77
78The "--enable-debug" option compiles CUPS with debugging information enabled.
79Additional debug logging support can be enabled using the
80"--enable-debug-printfs" option - these debug messages are enabled using the
81CUPS_DEBUG_LOG environment variable at run-time.
82
83CUPS also includes an extensive set of unit tests that can be used to find and
84diagnose a variety of common problems - use the "--enable-unit-tests" configure
85option to run them at build time.
86
87On macOS, use the "--with-archflags" option to build with the correct set of
88architectures:
89
90 ./configure --with-archflags="-arch i386 -arch x86_64" ...
91
92> Note: Current versions of macOS DO NOT allow installation to /usr with the
93> default system integrity settings. In addition, we do not recommend replacing
94> the CUPS supplied with macOS because not all versions of CUPS are compatible
95> with every macOS release, and because software updates will replace parts
96> of your local installation potentially rendering your system unusable.
97
98Once you have configured things, just type:
99
100 make ENTER
101
102or if you have FreeBSD, NetBSD, or OpenBSD type:
103
104 gmake ENTER
105
106to build the software.
107
108
109TESTING THE SOFTWARE
110--------------------
111
112Aside from the built-in unit tests, CUPS includes an automated test framework
113for testing the entire printing system. To run the tests, just type:
114
115 make check ENTER
116
117or if you have FreeBSD, NetBSD, or OpenBSD type:
118
119 gmake check ENTER
120
121The test framework runs a copy of the CUPS scheduler (cupsd) on port 8631 in
122/tmp/cups-$USER and produces a nice HTML report of the results.
123
124
125INSTALLING THE SOFTWARE
126-----------------------
127
128Once you have built the software you need to install it. The "install" target
129provides a quick way to install the software on your local system:
130
131 make install ENTER
132
133or for FreeBSD, NetBSD, or OpenBSD:
134
135 gmake install ENTER
136
137Use the BUILDROOT variable to install to an alternate root directory:
138
139 make BUILDROOT=/some/other/root/directory install ENTER
140
141You can also build binary packages that can be installed on other machines using
142the RPM spec file ("packaging/cups.spec") or EPM list file
143("packaging/cups.list"). The latter also supports building of binary RPMs, so
144it may be more convenient to use.
145
146You can find the RPM software at:
147
148 http://www.rpm.org/
149
150The EPM software is available at:
151
152 https://michaelrsweet.github.io/epm
153
154
155CREATING BINARY DISTRIBUTIONS WITH EPM
156--------------------------------------
157
158The top level makefile supports generation of many types of binary distributions
159using EPM. To build a binary distribution type:
160
161 make <format> ENTER
162
163or
164
165 gmake <format> ENTER
166
167for FreeBSD, NetBSD, and OpenBSD. The <format> target is one of the following:
168
169- "epm": Builds a script + tarfile package
170- "bsd": Builds a *BSD package
171- "deb": Builds a Debian package
172- "pkg": Builds a Solaris package
173- "rpm": Builds a RPM package
174- "slackware": Build a Slackware package
175
176
177GETTING DEBUG LOGGING FROM CUPS
178-------------------------------
179
180When configured with the "--enable-debug-printfs" option, CUPS compiles in
181additional debug logging support in the scheduler, CUPS API, and CUPS Imaging
182API. The following environment variables are used to enable and control debug
183logging:
184
185- `CUPS_DEBUG_FILTER`: Specifies a POSIX regular expression to control which
186 messages are logged.
187- `CUPS_DEBUG_LEVEL`: Specifies a number from 0 to 9 to control the verbosity of
188 the logging. The default level is 1.
189- `CUPS_DEBUG_LOG`: Specifies a log file to use. Specify the name "-" to send
190 the messages to stderr. Prefix a filename with "+" to append to an existing
191 file.
192
193
194REPORTING PROBLEMS
195------------------
196
197If you have problems, READ THE DOCUMENTATION FIRST! If the documentation does
198not solve your problems, please post a message on the users forum at:
199
200 https://www.cups.org/
201
202Include your operating system and version, compiler and version, and any errors
203or problems you've run into. The "config.log" file and the output from the
204configure script and make should also be sent, as it often helps to determine
205the cause of your problem.
206
207If you are running a version of Linux, be sure to provide the Linux distribution
208you have, too.