Skip to content

Commit 03f4db8

Browse files
committed
Rename "cups-locald" to "cupslocald" - D-Bus doesn't support dashes in the name.
Update transform to support all ipptransform attributes.
1 parent 4ed8121 commit 03f4db8

14 files changed

+139
-65
lines changed

.gitignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
/config.log
1919
/config.status
2020
/configure~
21-
/daemon/cups-locald
22-
/daemon/cups-locald-dbus.service
23-
/daemon/cups-locald-systemd.service
24-
/daemon/org.openprinting.cups-locald.plist
21+
/daemon/cupslocald
22+
/daemon/cupslocald-dbus.service
23+
/daemon/cupslocald-systemd.service
24+
/daemon/org.openprinting.cupslocald.plist
2525
/Makedefs

configure

+34-13
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ with_dbusdir
693693
with_systemddir
694694
enable_debug
695695
enable_maintainer
696-
enable_sanitizer
696+
with_sanitizer
697697
with_ldflags
698698
'
699699
ac_precious_vars='build_alias
@@ -1329,13 +1329,14 @@ Optional Features:
13291329
--disable-dbus build without D-Bus support
13301330
--enable-debug turn on debugging, default=no
13311331
--enable-maintainer turn on maintainer mode, default=no
1332-
--enable-sanitizer build with AddressSanitizer, default=no
13331332
13341333
Optional Packages:
13351334
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
13361335
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
13371336
--with-dbusdir set D-Bus configuration directory
13381337
--with-systemddir set systemd configuration directory
1338+
--with-sanitizer build with address, leak, memory, thread, or
1339+
undefined sanitizer, default=no
13391340
--with-ldflags=... Specify additional LDFLAGS
13401341
13411342
Some influential environment variables:
@@ -3985,12 +3986,26 @@ then :
39853986
enableval=$enable_maintainer;
39863987
fi
39873988

3988-
# Check whether --enable-sanitizer was given.
3989-
if test ${enable_sanitizer+y}
3989+
3990+
# Check whether --with-sanitizer was given.
3991+
if test ${with_sanitizer+y}
39903992
then :
3991-
enableval=$enable_sanitizer;
3993+
withval=$with_sanitizer;
3994+
else $as_nop
3995+
with_sanitizer=no
39923996
fi
39933997

3998+
if test "x$with_sanitizer" = xyes
3999+
then :
4000+
4001+
with_sanitizer="address"
4002+
4003+
elif test "$with_sanitizer" != address -a "$with_sanitizer" != leak -a "$with_sanitizer" != memory -a "$with_sanitizer" != no -a "$with_sanitizer" != thread -a "$with_sanitizer" != undefined
4004+
then :
4005+
4006+
as_fn_error $? "Unsupported --with-sanitizer value \"$with_sanitizer\" specified." "$LINENO" 5
4007+
4008+
fi
39944009

39954010
if test x$enable_debug = xyes
39964011
then :
@@ -4013,20 +4028,26 @@ WARNINGS=""
40134028
if test -n "$GCC"
40144029
then :
40154030

4016-
if test x$enable_sanitizer = xyes
4031+
if test x$with_sanitizer != xno
4032+
then :
4033+
4034+
# Use -fsanitize=FOO with debugging...
4035+
OPTIM="$OPTIM -fsanitize=$with_sanitizer"
4036+
4037+
elif echo "$CPPFLAGS $CFLAGS" | grep -q _FORTIFY_SOURCE
40174038
then :
40184039

4019-
# Use -fsanitize=address with debugging...
4020-
OPTIM="$OPTIM -fsanitize=address"
4040+
# Don't add _FORTIFY_SOURCE if it is already there
40214041

40224042
else $as_nop
40234043

40244044
# Otherwise use the Fortify enhancements to catch any unbounded
40254045
# string operations...
4026-
CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
4046+
CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=3"
40274047

40284048
fi
40294049

4050+
40304051
WARNINGS="-Wall -Wunused"
40314052

40324053
for warning in char-subscripts format-truncation format-y2k switch unused-result; do
@@ -4235,7 +4256,7 @@ printf "%s\n" "#define CUPS_LOCAL_DATADIR \"$datadir/cups-local\"" >>confdefs.h
42354256

42364257

42374258

4238-
ac_config_files="$ac_config_files Makedefs daemon/cups-locald-dbus.service daemon/cups-locald-systemd.service daemon/org.openprinting.cups-locald.plist"
4259+
ac_config_files="$ac_config_files Makedefs daemon/cupslocald-dbus.service daemon/cupslocald-systemd.service daemon/org.openprinting.cupslocald.plist"
42394260

42404261
cat >confcache <<\_ACEOF
42414262
# This file is a shell script that caches the results of configure
@@ -4924,9 +4945,9 @@ do
49244945
case $ac_config_target in
49254946
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
49264947
"Makedefs") CONFIG_FILES="$CONFIG_FILES Makedefs" ;;
4927-
"daemon/cups-locald-dbus.service") CONFIG_FILES="$CONFIG_FILES daemon/cups-locald-dbus.service" ;;
4928-
"daemon/cups-locald-systemd.service") CONFIG_FILES="$CONFIG_FILES daemon/cups-locald-systemd.service" ;;
4929-
"daemon/org.openprinting.cups-locald.plist") CONFIG_FILES="$CONFIG_FILES daemon/org.openprinting.cups-locald.plist" ;;
4948+
"daemon/cupslocald-dbus.service") CONFIG_FILES="$CONFIG_FILES daemon/cupslocald-dbus.service" ;;
4949+
"daemon/cupslocald-systemd.service") CONFIG_FILES="$CONFIG_FILES daemon/cupslocald-systemd.service" ;;
4950+
"daemon/org.openprinting.cupslocald.plist") CONFIG_FILES="$CONFIG_FILES daemon/org.openprinting.cupslocald.plist" ;;
49304951
49314952
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
49324953
esac

configure.ac

+16-8
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ AC_SUBST([SYSTEMDDIR])
166166
dnl Extra compiler options...
167167
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [turn on debugging, default=no]))
168168
AC_ARG_ENABLE([maintainer], AS_HELP_STRING([--enable-maintainer], [turn on maintainer mode, default=no]))
169-
AC_ARG_ENABLE([sanitizer], AS_HELP_STRING([--enable-sanitizer], [build with AddressSanitizer, default=no]))
169+
AC_ARG_WITH([sanitizer], AS_HELP_STRING([--with-sanitizer], [build with address, leak, memory, thread, or undefined sanitizer, default=no]), [], [with_sanitizer=no])
170+
AS_IF([test "x$with_sanitizer" = xyes], [
171+
with_sanitizer="address"
172+
], [test "$with_sanitizer" != address -a "$with_sanitizer" != leak -a "$with_sanitizer" != memory -a "$with_sanitizer" != no -a "$with_sanitizer" != thread -a "$with_sanitizer" != undefined], [
173+
AC_MSG_ERROR([Unsupported --with-sanitizer value "$with_sanitizer" specified.])
174+
])
170175

171176
AS_IF([test x$enable_debug = xyes], [
172177
OPTIM="$OPTIM -g"
@@ -182,15 +187,18 @@ WARNINGS=""
182187
AC_SUBST([WARNINGS])
183188

184189
AS_IF([test -n "$GCC"], [
185-
AS_IF([test x$enable_sanitizer = xyes], [
186-
# Use -fsanitize=address with debugging...
187-
OPTIM="$OPTIM -fsanitize=address"
190+
AS_IF([test x$with_sanitizer != xno], [
191+
# Use -fsanitize=FOO with debugging...
192+
OPTIM="$OPTIM -fsanitize=$with_sanitizer"
193+
], [echo "$CPPFLAGS $CFLAGS" | grep -q _FORTIFY_SOURCE], [
194+
# Don't add _FORTIFY_SOURCE if it is already there
188195
], [
189196
# Otherwise use the Fortify enhancements to catch any unbounded
190197
# string operations...
191-
CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
198+
CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=3"
192199
])
193200
201+
194202
dnl Show all standard warnings + unused variables when compiling...
195203
WARNINGS="-Wall -Wunused"
196204
@@ -296,8 +304,8 @@ AC_SUBST([CUPS_LOCAL_DATADIR])
296304
dnl Generate a bunch of files...
297305
AC_CONFIG_FILES([
298306
Makedefs
299-
daemon/cups-locald-dbus.service
300-
daemon/cups-locald-systemd.service
301-
daemon/org.openprinting.cups-locald.plist
307+
daemon/cupslocald-dbus.service
308+
daemon/cupslocald-systemd.service
309+
daemon/org.openprinting.cupslocald.plist
302310
])
303311
AC_OUTPUT

daemon/Dependencies

+25-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
main.o: main.c cups-locald.h ../config.h \
1+
main.o: main.c cupslocald.h ../config.h \
2+
\
3+
\
4+
\
5+
\
6+
\
7+
\
28
\
39
\
410
\
@@ -15,7 +21,12 @@ main.o: main.c cups-locald.h ../config.h \
1521
\
1622
\
1723

18-
dbus.o: dbus.c cups-locald.h ../config.h \
24+
dbus.o: dbus.c cupslocald.h ../config.h \
25+
\
26+
\
27+
\
28+
\
29+
\
1930
\
2031
\
2132
\
@@ -32,7 +43,7 @@ dbus.o: dbus.c cups-locald.h ../config.h \
3243
\
3344
\
3445

35-
drivers.o: drivers.c cups-locald.h ../config.h \
46+
drivers.o: drivers.c cupslocald.h ../config.h \
3647
\
3748
\
3849
\
@@ -49,8 +60,17 @@ drivers.o: drivers.c cups-locald.h ../config.h \
4960
\
5061
\
5162
\
52-
53-
transform.o: transform.c cups-locald.h ../config.h \
63+
\
64+
\
65+
\
66+
\
67+
\
68+
icons.h
69+
transform.o: transform.c cupslocald.h ../config.h \
70+
\
71+
\
72+
\
73+
\
5474
\
5575
\
5676
\

daemon/Makefile

+14-14
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ include ../Makedefs
1111

1212

1313
TARGETS = \
14-
cups-locald
14+
cupslocald
1515
OBJS = \
1616
main.o \
1717
dbus.o \
@@ -54,24 +54,24 @@ depend:
5454
#
5555

5656
install:
57-
echo Installing cups-locald to $(BUILDROOT)$(sbindir)
57+
echo Installing cupslocald to $(BUILDROOT)$(sbindir)
5858
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(sbindir)
59-
$(INSTALL_BIN) cups-locald $(BUILDROOT)$(sbindir)
59+
$(INSTALL_BIN) cupslocald $(BUILDROOT)$(sbindir)
6060
if test "x$(DBUSDIR)" != x; then \
6161
echo Installing D-Bus files to $(BUILDROOT)$(DBUSDIR); \
6262
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/interfaces; \
63-
$(INSTALL_DATA) org.openprinting.cups-locald.xml $(BUILDROOT)$(DBUSDIR)/interfaces; \
63+
$(INSTALL_DATA) org.openprinting.cupslocald.xml $(BUILDROOT)$(DBUSDIR)/interfaces; \
6464
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/services; \
65-
$(INSTALL_DATA) cups-locald-dbus.service $(BUILDROOT)$(DBUSDIR)/services/cups-locald.service; \
65+
$(INSTALL_DATA) cupslocald-dbus.service $(BUILDROOT)$(DBUSDIR)/services/cupslocald.service; \
6666
fi
6767
if test "x$$(uname)" = xDarwin; then \
6868
echo Installing launchd files to $(BUILDROOT)/Library/LaunchAgents; \
6969
$(INSTALL_DIR) -m 755 $(BUILDROOT)/Library/LaunchAgents; \
70-
$(INSTALL_DATA) org.openprinting.cups-locald.plist $(BUILDROOT)/Library/LaunchAgents; \
70+
$(INSTALL_DATA) org.openprinting.cupslocald.plist $(BUILDROOT)/Library/LaunchAgents; \
7171
elif test "x$(SYSTEMDDIR)" != x; then \
7272
echo Installing systemd files to $(BUILDROOT)$(SYSTEMDDIR); \
7373
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(SYSTEMDDIR)/user; \
74-
$(INSTALL_DATA) cups-locald-systemd.service $(BUILDROOT)$(SYSTEMDDIR)/user/cups-locald.service; \
74+
$(INSTALL_DATA) cupslocald-systemd.service $(BUILDROOT)$(SYSTEMDDIR)/user/cupslocald.service; \
7575
fi
7676

7777

@@ -80,28 +80,28 @@ install:
8080
#
8181

8282
uninstall:
83-
$(RM) $(BUILDROOT)$(sbindir)/cups-locald
83+
$(RM) $(BUILDROOT)$(sbindir)/cupslocald
8484
-$(RMDIR) $(BUILDROOT)$(sbindir)
8585
if test "x$(DBUSDIR)" != x; then \
86-
$(RM) $(BUILDROOT)$(DBUSDIR)/interfaces/org.openprinting.cups-locald.xml; \
86+
$(RM) $(BUILDROOT)$(DBUSDIR)/interfaces/org.openprinting.cupslocald.xml; \
8787
$(RMDIR) $(BUILDROOT)$(DBUSDIR)/interfaces; \
88-
$(RM) $(BUILDROOT)$(DBUSDIR)/services/cups-locald.service; \
88+
$(RM) $(BUILDROOT)$(DBUSDIR)/services/cupslocald.service; \
8989
$(RMDIR) $(BUILDROOT)$(DBUSDIR)/services; \
9090
fi
9191
if test "x$$(uname)" = xDarwin; then \
92-
$(RM) $(BUILDROOT)/Library/LaunchAgents/org.openprinting.cups-locald.plist; \
92+
$(RM) $(BUILDROOT)/Library/LaunchAgents/org.openprinting.cupslocald.plist; \
9393
$(RMDIR) $(BUILDROOT)/Library/LaunchAgents; \
9494
elif test "x$(SYSTEMDDIR)" != x; then \
95-
$(RM) $(BUILDROOT)$(SYSTEMDDIR)/user/cups-locald.service; \
95+
$(RM) $(BUILDROOT)$(SYSTEMDDIR)/user/cupslocald.service; \
9696
$(RMDIR) $(BUILDROOT)$(SYSTEMDDIR)/user; \
9797
fi
9898

9999

100100
#
101-
# cups-locald
101+
# cupslocald
102102
#
103103

104-
cups-locald: $(OBJS)
104+
cupslocald: $(OBJS)
105105
echo Linking $@...
106106
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
107107
$(CODE_SIGN) -s "$(CODESIGN_IDENTITY)" $@
File renamed without changes.
File renamed without changes.

daemon/cups-locald.h daemon/cupslocald.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//
2-
// Common header for cups-local.
2+
// Common header for cupslocald.
33
//
4-
// Copyright © 2023 by OpenPrinting.
4+
// Copyright © 2023-2024 by OpenPrinting.
55
//
66
// Licensed under Apache License v2.0. See the file "LICENSE" for more
77
// information.
88
//
99

10-
#ifndef CUPS_LOCALD_H
11-
# define CUPS_LOCALD_H 1
10+
#ifndef CUPSLOCALD_H
11+
# define CUPSLOCALD_H 1
1212
# include <config.h>
1313
# include <pappl/pappl.h>
1414

@@ -17,16 +17,16 @@
1717
// Globals...
1818
//
1919

20-
# ifdef CUPS_LOCAL_MAIN_C
20+
# ifdef CUPSLOCALD_MAIN_C
2121
# define VAR
2222
# define VALUE(x) =x
2323
# else
2424
# define VAR extern
2525
# define VALUE(x)
26-
# endif // CUPS_LOCAL_MAIN_C
26+
# endif // CUPSLOCALD_MAIN_C
2727

2828
VAR pappl_pr_driver_t LocalDrivers[7]
29-
# ifdef CUPS_LOCAL_MAIN_C
29+
# ifdef CUPSLOCALD_MAIN_C
3030
= {
3131
{ "everywhere", "IPP Everywhere™", NULL, NULL },
3232
{ "pcl", "Generic PCL", NULL, NULL },
@@ -36,7 +36,7 @@ VAR pappl_pr_driver_t LocalDrivers[7]
3636
{ "ps_duplex", "Generic PostScript w/Duplexer", NULL, NULL },
3737
{ "ps_color_duplex", "Generic Color PostScript w/Duplexer", NULL, NULL }
3838
}
39-
# endif // CUPS_LOCAL_MAIN_C
39+
# endif // CUPSLOCALD_MAIN_C
4040
;
4141
VAR char LocalSocket[256] VALUE("");
4242
// Domain socket path
@@ -59,4 +59,4 @@ extern bool LocalDriverCallback(pappl_system_t *system, const char *driver_name
5959
extern bool LocalTransformFilter(pappl_job_t *job, int doc_number, pappl_pr_options_t *options, pappl_device_t *device, void *data);
6060

6161

62-
#endif // !CUPS_LOCALD_H
62+
#endif // !CUPSLOCALD_H

daemon/dbus.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// information.
88
//
99

10-
#include "cups-locald.h"
10+
#include "cupslocald.h"
1111
#ifdef HAVE_DBUS
1212
# include <dbus/dbus.h>
1313

daemon/drivers.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//
2-
// Generic drivers for cups-local.
2+
// Generic drivers for cupslocald.
33
//
4-
// Copyright © 2023 by OpenPrinting.
4+
// Copyright © 2023-2024 by OpenPrinting.
55
//
66
// Licensed under Apache License v2.0. See the file "LICENSE" for more
77
// information.
88
//
99

10-
#include "cups-locald.h"
10+
#include "cupslocald.h"
1111
#include <cups/thread.h>
1212
#include "icons.h"
1313
#include <math.h>

daemon/main.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//
2-
// Main entry for cups-local.
2+
// Main entry for cupslocald.
33
//
4-
// Copyright © 2023 by OpenPrinting.
4+
// Copyright © 2023-2024 by OpenPrinting.
55
//
66
// Licensed under Apache License v2.0. See the file "LICENSE" for more
77
// information.
88
//
99

10-
#define CUPS_LOCAL_MAIN_C
11-
#include "cups-locald.h"
10+
#define CUPSLOCALD_MAIN_C
11+
#include "cupslocald.h"
1212
#include <cups/thread.h>
1313
#ifdef __APPLE__
1414
# include <launch.h>
File renamed without changes.

0 commit comments

Comments
 (0)