Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ lib_LTLIBRARIES = libcupsfilters.la

check_SCRIPTS = \
cupsfilters/testfilters.sh \
cupsfilters/test-pclm-overflow.sh \
cupsfilters/test-pdftoraster-copy-height.sh
cupsfilters/test-pclm-overflow.sh

check_PROGRAMS = \
testcmyk \
Expand All @@ -106,7 +105,8 @@ check_PROGRAMS = \
test-analyze \
test-pdf \
test-ps \
testfilters
testfilters \
test-pdftoraster-copy-height

TESTS = \
testdither \
Expand All @@ -115,9 +115,9 @@ TESTS = \
test-analyze \
test-pdf \
test-ps \
test-pdftoraster-copy-height \
cupsfilters/testfilters.sh \
cupsfilters/test-pclm-overflow.sh \
cupsfilters/test-pdftoraster-copy-height.sh
cupsfilters/test-pclm-overflow.sh

# testcmyk # fails as it opens some image.ppm which is nowerhe to be found.
# testimage # requires also some ppm file as argument
Expand Down Expand Up @@ -323,6 +323,9 @@ test_ps_SOURCES = cupsfilters/fontembed/test-ps.c
test_ps_LDADD = libcupsfilters.la $(CUPS_LIBS)
test_ps_CFLAGS = $(CUPS_CFLAGS)

test_pdftoraster_copy_height_SOURCES = \
cupsfilters/test-pdftoraster-copy-height.c

testfilters_SOURCES = \
cupsfilters/testfilters.c \
$(pkgfiltersinclude_DATA)
Expand Down
18 changes: 16 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,14 @@ AS_IF([$PKGCONFIG --exists cups3], [
AC_SUBST(CUPS_CFLAGS)
AC_SUBST(CUPS_LIBS)

CUPS_DATADIR="$($PKGCONFIG --variable=prefix cups3)/share/cups"
# Prefer the datadir cups3.pc exports directly. Reconstructing it from
# --variable=prefix is wrong when CUPS was built with an architecture-
# specific prefix (e.g. /usr/x86_64-pc-linux-gnu): the data lives in the
# arch-independent /usr/share/cups, which the .pc records in cups_datadir.
# Fall back to the prefix-relative path for a .pc without it. (#201)
CUPS_DATADIR="$($PKGCONFIG --variable=cups_datadir cups3)"
AS_IF([test "x$CUPS_DATADIR" = x],
[CUPS_DATADIR="$($PKGCONFIG --variable=prefix cups3)/share/cups"])
AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$CUPS_DATADIR", [CUPS datadir])
AC_SUBST(CUPS_DATADIR)

Expand Down Expand Up @@ -128,7 +135,14 @@ AS_IF([$PKGCONFIG --exists cups3], [
cups_prefix="$($PKGCONFIG --variable=prefix cups)"
AS_IF([test "x$cups_prefix" = x], [cups_prefix=/usr])

CUPS_DATADIR="$cups_prefix/share/cups"
# Prefer the datadir cups.pc exports directly. Reconstructing it from
# --variable=prefix is wrong when CUPS was built with an architecture-
# specific prefix (e.g. /usr/x86_64-pc-linux-gnu): the data lives in the
# arch-independent /usr/share/cups, which the .pc records in cups_datadir.
# Fall back to the prefix-relative path for a .pc without it. (#201)
CUPS_DATADIR="$($PKGCONFIG --variable=cups_datadir cups)"
AS_IF([test "x$CUPS_DATADIR" = x],
[CUPS_DATADIR="$cups_prefix/share/cups"])
AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$CUPS_DATADIR", [CUPS datadir])
AC_SUBST(CUPS_DATADIR)

Expand Down
11 changes: 11 additions & 0 deletions cupsfilters/test-pclm-overflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ LIBTOOL="${BUILD_ROOT}/libtool"
CC="${CC:-cc}"
SAN_FLAGS="${SAN_FLAGS:--fsanitize=address -fno-omit-frame-pointer}"

# AddressSanitizer is what makes this test meaningful. When libasan is not
# installed the compiler still accepts -fsanitize=address but the link fails
# (missing libasan_preinit.o / -lasan) -- that is an environment gap, not a
# libcupsfilters bug. Skip (Automake exit 77) instead of failing; a real
# failure is reported only when ASan IS available and the sanitizer fires.
if ! printf 'int main(void){return 0;}\n' \
| "${CC}" ${SAN_FLAGS} -x c - -o /dev/null >/dev/null 2>&1; then
echo "AddressSanitizer not available (cannot link ${SAN_FLAGS}); skipping." >&2
exit 77
fi

if [[ ! -x "${LIBTOOL}" ]]; then
echo "libtool helper not found at ${LIBTOOL}" >&2
exit 99
Expand Down
16 changes: 0 additions & 16 deletions cupsfilters/test-pdftoraster-copy-height.sh

This file was deleted.

Loading