-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathMakefile.am
More file actions
490 lines (439 loc) · 12 KB
/
Copy pathMakefile.am
File metadata and controls
490 lines (439 loc) · 12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
ACLOCAL_AMFLAGS = -I m4
pkgconfdir = $(libdir)/pkgconfig
pkgconf_DATA = \
libppd.pc
doc_DATA = \
ABOUT-NLS \
AUTHORS \
COPYING \
CHANGES.md \
CHANGES-1.x.md \
INSTALL.md \
LICENSE \
NOTICE \
README.md \
DEVELOPING.md \
CONTRIBUTING.md
EXTRA_DIST = \
$(doc_DATA) \
autogen.sh \
config.rpath \
libppd.pc.in
EXTRA_DIST += \
ppd/testdriver.c \
ppd/test-internal.h
# =========
# Utilities
# =========
pkgutilsdir = $(bindir)
pkgutils_PROGRAMS =
# ==========================
# PPD legacy support library
# ==========================
pkgppdincludedir = $(includedir)/ppd
pkgppdinclude_DATA = \
ppd/ppd.h \
ppd/ppdc.h \
ppd/ppd-filter.h
pkgppddefsdir = $(datadir)/ppdc
pkgppddefs_DATA = \
ppd/epson.h \
ppd/hp.h \
ppd/label.h \
ppd/font.defs \
ppd/media.defs \
ppd/raster.defs
lib_LTLIBRARIES = libppd.la
check_PROGRAMS = \
testppd \
test_ppd_localize \
test_ppd_cache \
test_ppd_ipp \
test_ppd_mark \
test_ppd_custom \
test_ppd_attr \
test_ppd_page \
test_ppd_conflicts \
test_ppd_emit \
test_ppd_filter \
test_ppd_generator \
test_ppd_load_profile
TESTS = \
testppd \
test_ppd_localize \
test_ppd_cache \
test_ppd_ipp \
test_ppd_mark \
test_ppd_custom \
test_ppd_attr \
test_ppd_page \
test_ppd_conflicts \
test_ppd_emit \
test_ppd_filter \
test_ppd_generator \
test_ppd_load_profile
libppd_la_SOURCES = \
ppd/ppd-attr.c \
ppd/ppd.c \
ppd/ppd-cache.c \
ppd/ppd-collection.cxx \
ppd/ppd-conflicts.c \
ppd/ppd-custom.c \
ppd/ppd-emit.c \
ppd/ppd-filter.c \
ppd/ppd-generator.c \
ppd/ppd-load-profile.c \
ppd/ppd-localize.c \
ppd/ppd-mark.c \
ppd/ppd-page.c \
ppd/ppd-ipp.c \
ppd/ppd-test.c \
ppd/array.c \
ppd/array-private.h \
ppd/debug.c \
ppd/debug-internal.h \
ppd/debug-private.h \
ppd/encode.c \
ppd/file.c \
ppd/file-private.h \
ppd/imagetops-pstops.c \
ppd/ipp-private.h \
ppd/libcups2.c \
ppd/libcups2-private.h \
ppd/pdftops.c \
ppd/raster-interpret.c \
ppd/raster-error.c \
ppd/raster-private.h \
ppd/rastertops.c \
ppd/string.c \
ppd/snprintf.c \
ppd/string-private.h \
ppd/thread.c \
ppd/thread-private.h \
ppd/ppdc-array.cxx \
ppd/ppdc-attr.cxx \
ppd/ppdc-catalog.cxx \
ppd/ppdc-choice.cxx \
ppd/ppdc-constraint.cxx \
ppd/ppdc-driver.cxx \
ppd/ppdc-file.cxx \
ppd/ppdc-filter.cxx \
ppd/ppdc-font.cxx \
ppd/ppdc-group.cxx \
ppd/ppdc-import.cxx \
ppd/ppdc-mediasize.cxx \
ppd/ppdc-message.cxx \
ppd/ppdc-option.cxx \
ppd/ppdc-private.h \
ppd/ppdc-profile.cxx \
ppd/ppdc-shared.cxx \
ppd/ppdc-source.cxx \
ppd/ppdc-string.cxx \
ppd/ppdc-variable.cxx \
$(pkgppdinclude_DATA) \
$(pkgppddefs_DATA)
libppd_la_LIBADD = \
$(LIBCUPSFILTERS_LIBS) \
$(ZLIB_LIBS) \
$(CUPS_LIBS)
libppd_la_CFLAGS = \
$(LIBCUPSFILTERS_CFLAGS) \
$(ZLIB_CFLAGS) \
$(CUPS_CFLAGS)
libppd_la_CXXFLAGS = \
$(libppd_la_CFLAGS)
libppd_la_LDFLAGS = \
-no-undefined \
-version-info 2
testppd_SOURCES = ppd/testppd.c
testppd_LDADD = \
libppd.la \
$(CUPS_LIBS)
testppd_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)
test_ppd_localize_SOURCES = ppd/test_ppd_localize.c
test_ppd_localize_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_localize_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)
test_ppd_cache_SOURCES = ppd/test_ppd_cache.c
test_ppd_cache_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_cache_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)
test_ppd_ipp_SOURCES = ppd/test_ppd_ipp.c
test_ppd_ipp_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_ipp_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)
test_ppd_mark_SOURCES = ppd/test_ppd_mark.c
test_ppd_mark_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_mark_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)
test_ppd_custom_SOURCES = ppd/test_ppd_custom.c
test_ppd_custom_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_custom_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)
test_ppd_attr_SOURCES = ppd/test_ppd_attr.c
test_ppd_attr_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_attr_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)
test_ppd_page_SOURCES = ppd/test_ppd_page.c
test_ppd_page_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_page_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)
test_ppd_conflicts_SOURCES = ppd/test_ppd_conflicts.c
test_ppd_conflicts_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_conflicts_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)
test_ppd_emit_SOURCES = ppd/test_ppd_emit.c
test_ppd_emit_LDADD = \
libppd.la \
$(CUPS_LIBS)
test_ppd_emit_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS)
test_ppd_filter_SOURCES = ppd/test_ppd_filter.c
test_ppd_filter_LDADD = \
libppd.la \
$(LIBCUPSFILTERS_LIBS) \
$(CUPS_LIBS)
test_ppd_filter_CFLAGS = \
-I$(srcdir)/ppd/ \
$(LIBCUPSFILTERS_CFLAGS) \
$(CUPS_CFLAGS)
test_ppd_generator_SOURCES = ppd/test_ppd_generator.c
test_ppd_generator_LDADD = \
libppd.la \
$(LIBCUPSFILTERS_LIBS) \
$(CUPS_LIBS)
test_ppd_generator_CFLAGS = \
-I$(srcdir)/ppd/ \
$(LIBCUPSFILTERS_CFLAGS) \
$(CUPS_CFLAGS)
test_ppd_load_profile_SOURCES = ppd/test_ppd_load_profile.c
test_ppd_load_profile_LDADD = \
libppd.la \
$(CUPS_LIBS) \
$(LIBCUPSFILTERS_LIBS)
test_ppd_load_profile_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS) \
$(LIBCUPSFILTERS_CFLAGS)
EXTRA_DIST += \
$(pkgppdinclude_DATA) \
$(pkgppddefs_DATA) \
ppd/test.ppd \
ppd/test2.ppd \
ppd/README.md
# ================
# PPD test utility
# ================
if ENABLE_TESTPPDFILE
pkgutils_PROGRAMS += \
testppdfile
testppdfile_SOURCES = ppd/testppdfile.c
testppdfile_LDADD = \
libppd.la \
$(CUPS_LIBS) \
$(LIBCUPSFILTERS_LIBS)
testppdfile_CFLAGS = \
-I$(srcdir)/ppd/ \
$(CUPS_CFLAGS) \
$(LIBCUPSFILTERS_CFLAGS)
endif
# ===========================
# ppdc PPD compiler utilities
# ===========================
if ENABLE_PPDC_UTILS
pkgutils_PROGRAMS += \
ppdc \
ppdhtml \
ppdi \
ppdmerge \
ppdpo
endif
if ENABLE_GENSTRINGS
pkgutils_PROGRAMS += \
genstrings
endif
genstrings_SOURCES = \
ppd/genstrings.cxx
genstrings_LDADD = \
libppd.la \
$(CUPS_LIBS)
# These utilities are built from C++ (.cxx) sources, so their per-target
# compiler flags must be *_CXXFLAGS - Automake ignores *_CFLAGS for C++.
# Without this the CUPS include path is dropped, which only fails for a
# source-installed CUPS whose headers are not in the default search path.
genstrings_CXXFLAGS = \
-I$(srcdir)/ppd/ \
$(LIBCUPSFILTERS_CFLAGS) \
$(CUPS_CFLAGS)
ppdc_SOURCES = \
ppd/ppdc.cxx
ppdc_LDADD = \
libppd.la \
$(CUPS_LIBS)
ppdc_CXXFLAGS = \
-I$(srcdir)/ppd/ \
$(LIBCUPSFILTERS_CFLAGS) \
$(CUPS_CFLAGS)
ppdhtml_SOURCES = \
ppd/ppdhtml.cxx
ppdhtml_LDADD = \
libppd.la \
$(CUPS_LIBS)
ppdhtml_CXXFLAGS = \
-I$(srcdir)/ppd/ \
$(LIBCUPSFILTERS_CFLAGS) \
$(CUPS_CFLAGS)
ppdi_SOURCES = \
ppd/ppdi.cxx
ppdi_LDADD = \
libppd.la \
$(CUPS_LIBS)
ppdi_CXXFLAGS = \
-I$(srcdir)/ppd/ \
$(LIBCUPSFILTERS_CFLAGS) \
$(CUPS_CFLAGS)
ppdmerge_SOURCES = \
ppd/ppdmerge.cxx
ppdmerge_LDADD = \
libppd.la \
$(CUPS_LIBS)
ppdmerge_CXXFLAGS = \
-I$(srcdir)/ppd/ \
$(LIBCUPSFILTERS_CFLAGS) \
$(CUPS_CFLAGS)
ppdpo_SOURCES = \
ppd/ppdpo.cxx
ppdpo_LDADD = \
libppd.la \
$(CUPS_LIBS)
ppdpo_CXXFLAGS = \
-I$(srcdir)/ppd/ \
$(LIBCUPSFILTERS_CFLAGS) \
$(CUPS_CFLAGS)
distclean-local:
rm -rf *.cache *~
clean-local:
rm -rf $(CIROOT)
SUBDIRS =
# ============================================================
# Staged-install downstream autopkgtests (DESTDIR staging)
# ============================================================
# Install the just-built tree into an ephemeral root ($(CIROOT)) with
# `make install DESTDIR=`, top up the bits that `make install` does not ship
# but the downstream Debian autopkgtests require, fix up the staged .pc, then
# run the unmodified downstream scripts against that tree.
CIROOT = $(abs_top_builddir)/_ciroot
EXTRA_DIST += \
ci/autopkgtest/run.sh \
ci/autopkgtest/debian-tests/control \
ci/autopkgtest/debian-tests/libppd-2-dev \
ci/autopkgtest/debian-tests/libppd-2-ppd-handling
# Fix A: check_PROGRAMS are build-only under Automake and are never copied by
# `make install`. The downstream PPD-handling test executes the test driver
# as an *installed* binary (/usr/bin/testppd), so build it and stage it into
# $(CIROOT)$(bindir). Uses libtool --mode=install so the binary is relinked
# cleanly against $(libdir) (LD_LIBRARY_PATH then forces the staged library).
STAGED_TEST_BINARIES = testppd
install-test-programs: $(STAGED_TEST_BINARIES)
$(MKDIR_P) "$(CIROOT)$(bindir)"
@for p in $(STAGED_TEST_BINARIES); do \
echo " STAGE $$p -> $(CIROOT)$(bindir)/$$p"; \
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) "$$p" "$(CIROOT)$(bindir)/$$p" || exit 1; \
done
# Fix C (data seeding): the downstream PPD-handling test copies its PPDs from
# the installed $(datadir)/ppd/testppd directory, which upstream `make install`
# does not ship. Seed every test PPD the current testppd binary opens
# (test.ppd, test2.ppd, sbo_test.ppd) so the unmodified script finds them.
STAGED_TEST_PPDS = \
ppd/test.ppd \
ppd/test2.ppd \
ppd/sbo_test.ppd
install-test-data:
$(MKDIR_P) "$(CIROOT)$(datadir)/ppd/testppd"
@for f in $(STAGED_TEST_PPDS); do \
echo " STAGE $$f -> $(CIROOT)$(datadir)/ppd/testppd/"; \
$(INSTALL_DATA) "$(srcdir)/$$f" "$(CIROOT)$(datadir)/ppd/testppd/" || exit 1; \
done
@# The libppd-2-dev test exercises the text -> PDF path, whose texttopdf
@# filter (from libcupsfilters) reads charsets/pdf.<charset> from the CUPS
@# data directory. The wrapper points CUPS_DATADIR at the staging tree, so
@# seed the charset data (installed by libcupsfilters into the real
@# $(CUPS_DATADIR)/charsets) into the staged tree.
@if [ -d "$(CUPS_DATADIR)/charsets" ]; then \
echo " STAGE $(CUPS_DATADIR)/charsets -> $(CIROOT)$(datadir)/charsets/"; \
$(MKDIR_P) "$(CIROOT)$(datadir)/charsets"; \
cp -a "$(CUPS_DATADIR)/charsets/." "$(CIROOT)$(datadir)/charsets/" || exit 1; \
fi
# Build everything, DESTDIR-install it, top up the test-only programs/data,
# then rewrite the staged libppd.pc prefix so a downstream consumer resolves
# THIS build (not a system copy) while the system dependency .pc files
# (libcupsfilters, cups) keep resolving normally.
stage-ciroot: all
rm -rf "$(CIROOT)"
$(MAKE) $(AM_MAKEFLAGS) install DESTDIR="$(CIROOT)"
$(MAKE) $(AM_MAKEFLAGS) install-test-programs install-test-data
@pc="$(CIROOT)$(libdir)/pkgconfig/libppd.pc"; \
if [ -f "$$pc" ]; then \
sed -i.bak -E "s#^(prefix|exec_prefix|libdir|includedir)=(/.*)#\1=$(CIROOT)\2#" "$$pc"; \
rm -f "$$pc.bak"; \
echo "stage-ciroot: rewrote staged-tree paths in $$pc"; \
fi
# Common environment for the wrapper. PPDC_DATADIR / CUPS_DATADIR point ppdc
# at the staged *.defs so `ppdc test.drv` resolves <font.defs> / <media.defs>
# from the staging tree. LIBPPD_TESTPPD / LIBPPD_PPDDIR point the PPD-handling
# test at the staged binary and data instead of the system /usr paths, so it
# needs no absolute-path redirection (no root, no proot) and runs identically
# on native and QEMU-emulated architectures.
# NB: libppd configures with a split prefix (prefix=/ but exec_prefix=/usr and
# everything installs under /usr), so the staging root the wrapper points at is
# $(CIROOT)$(exec_prefix), not $(CIROOT)$(prefix).
CIROOT_ENV = \
CIROOT="$(CIROOT)" \
CIPREFIX="$(exec_prefix)" \
TOP_BUILDDIR="$(abs_top_builddir)" \
PPDC_DATADIR="$(CIROOT)$(datadir)/ppdc" \
CUPS_DATADIR="$(CIROOT)$(datadir)" \
LIBPPD_TESTPPD="$(CIROOT)$(bindir)/testppd" \
LIBPPD_PPDDIR="$(CIROOT)$(datadir)/ppd/testppd"
# Full downstream suite in a single wrapper invocation, so the run produces one
# aggregate PASS/FAIL summary across both tests. Neither test needs privilege
# or path redirection, so this is identical on every architecture.
test-autopkgtest: stage-ciroot
$(CIROOT_ENV) \
$(SHELL) $(srcdir)/ci/autopkgtest/run.sh libppd-2-dev libppd-2-ppd-handling
# Single-test convenience targets (handy for debugging one case in isolation).
test-autopkgtest-dev: stage-ciroot
$(CIROOT_ENV) \
$(SHELL) $(srcdir)/ci/autopkgtest/run.sh libppd-2-dev
test-autopkgtest-ppd: stage-ciroot
$(CIROOT_ENV) \
$(SHELL) $(srcdir)/ci/autopkgtest/run.sh libppd-2-ppd-handling
.PHONY: stage-ciroot install-test-programs install-test-data \
test-autopkgtest test-autopkgtest-dev test-autopkgtest-ppd