Skip to content

Commit

Permalink
Rename "cups-locald" to "cupslocald" - D-Bus doesn't support dashes i…
Browse files Browse the repository at this point in the history
…n the name.

Update transform to support all ipptransform attributes.
  • Loading branch information
michaelrsweet committed Mar 26, 2024
1 parent 4ed8121 commit 03f4db8
Show file tree
Hide file tree
Showing 14 changed files with 139 additions and 65 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
/config.log
/config.status
/configure~
/daemon/cups-locald
/daemon/cups-locald-dbus.service
/daemon/cups-locald-systemd.service
/daemon/org.openprinting.cups-locald.plist
/daemon/cupslocald
/daemon/cupslocald-dbus.service
/daemon/cupslocald-systemd.service
/daemon/org.openprinting.cupslocald.plist
/Makedefs
47 changes: 34 additions & 13 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ with_dbusdir
with_systemddir
enable_debug
enable_maintainer
enable_sanitizer
with_sanitizer
with_ldflags
'
ac_precious_vars='build_alias
Expand Down Expand Up @@ -1329,13 +1329,14 @@ Optional Features:
--disable-dbus build without D-Bus support
--enable-debug turn on debugging, default=no
--enable-maintainer turn on maintainer mode, default=no
--enable-sanitizer build with AddressSanitizer, default=no
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-dbusdir set D-Bus configuration directory
--with-systemddir set systemd configuration directory
--with-sanitizer build with address, leak, memory, thread, or
undefined sanitizer, default=no
--with-ldflags=... Specify additional LDFLAGS
Some influential environment variables:
Expand Down Expand Up @@ -3985,12 +3986,26 @@ then :
enableval=$enable_maintainer;
fi

# Check whether --enable-sanitizer was given.
if test ${enable_sanitizer+y}

# Check whether --with-sanitizer was given.
if test ${with_sanitizer+y}
then :
enableval=$enable_sanitizer;
withval=$with_sanitizer;
else $as_nop
with_sanitizer=no
fi

if test "x$with_sanitizer" = xyes
then :

with_sanitizer="address"

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
then :

as_fn_error $? "Unsupported --with-sanitizer value \"$with_sanitizer\" specified." "$LINENO" 5

fi

if test x$enable_debug = xyes
then :
Expand All @@ -4013,20 +4028,26 @@ WARNINGS=""
if test -n "$GCC"
then :

if test x$enable_sanitizer = xyes
if test x$with_sanitizer != xno
then :

# Use -fsanitize=FOO with debugging...
OPTIM="$OPTIM -fsanitize=$with_sanitizer"

elif echo "$CPPFLAGS $CFLAGS" | grep -q _FORTIFY_SOURCE
then :

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

else $as_nop

# Otherwise use the Fortify enhancements to catch any unbounded
# string operations...
CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=3"

fi


WARNINGS="-Wall -Wunused"

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



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

cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
Expand Down Expand Up @@ -4924,9 +4945,9 @@ do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"Makedefs") CONFIG_FILES="$CONFIG_FILES Makedefs" ;;
"daemon/cups-locald-dbus.service") CONFIG_FILES="$CONFIG_FILES daemon/cups-locald-dbus.service" ;;
"daemon/cups-locald-systemd.service") CONFIG_FILES="$CONFIG_FILES daemon/cups-locald-systemd.service" ;;
"daemon/org.openprinting.cups-locald.plist") CONFIG_FILES="$CONFIG_FILES daemon/org.openprinting.cups-locald.plist" ;;
"daemon/cupslocald-dbus.service") CONFIG_FILES="$CONFIG_FILES daemon/cupslocald-dbus.service" ;;
"daemon/cupslocald-systemd.service") CONFIG_FILES="$CONFIG_FILES daemon/cupslocald-systemd.service" ;;
"daemon/org.openprinting.cupslocald.plist") CONFIG_FILES="$CONFIG_FILES daemon/org.openprinting.cupslocald.plist" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
Expand Down
24 changes: 16 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ AC_SUBST([SYSTEMDDIR])
dnl Extra compiler options...
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [turn on debugging, default=no]))
AC_ARG_ENABLE([maintainer], AS_HELP_STRING([--enable-maintainer], [turn on maintainer mode, default=no]))
AC_ARG_ENABLE([sanitizer], AS_HELP_STRING([--enable-sanitizer], [build with AddressSanitizer, default=no]))
AC_ARG_WITH([sanitizer], AS_HELP_STRING([--with-sanitizer], [build with address, leak, memory, thread, or undefined sanitizer, default=no]), [], [with_sanitizer=no])
AS_IF([test "x$with_sanitizer" = xyes], [
with_sanitizer="address"
], [test "$with_sanitizer" != address -a "$with_sanitizer" != leak -a "$with_sanitizer" != memory -a "$with_sanitizer" != no -a "$with_sanitizer" != thread -a "$with_sanitizer" != undefined], [
AC_MSG_ERROR([Unsupported --with-sanitizer value "$with_sanitizer" specified.])
])

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

AS_IF([test -n "$GCC"], [
AS_IF([test x$enable_sanitizer = xyes], [
# Use -fsanitize=address with debugging...
OPTIM="$OPTIM -fsanitize=address"
AS_IF([test x$with_sanitizer != xno], [
# Use -fsanitize=FOO with debugging...
OPTIM="$OPTIM -fsanitize=$with_sanitizer"
], [echo "$CPPFLAGS $CFLAGS" | grep -q _FORTIFY_SOURCE], [
# Don't add _FORTIFY_SOURCE if it is already there
], [
# Otherwise use the Fortify enhancements to catch any unbounded
# string operations...
CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=3"
])
dnl Show all standard warnings + unused variables when compiling...
WARNINGS="-Wall -Wunused"
Expand Down Expand Up @@ -296,8 +304,8 @@ AC_SUBST([CUPS_LOCAL_DATADIR])
dnl Generate a bunch of files...
AC_CONFIG_FILES([
Makedefs
daemon/cups-locald-dbus.service
daemon/cups-locald-systemd.service
daemon/org.openprinting.cups-locald.plist
daemon/cupslocald-dbus.service
daemon/cupslocald-systemd.service
daemon/org.openprinting.cupslocald.plist
])
AC_OUTPUT
30 changes: 25 additions & 5 deletions daemon/Dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
main.o: main.c cups-locald.h ../config.h \
main.o: main.c cupslocald.h ../config.h \
\
\
\
\
\
\
\
\
\
Expand All @@ -15,7 +21,12 @@ main.o: main.c cups-locald.h ../config.h \
\
\

dbus.o: dbus.c cups-locald.h ../config.h \
dbus.o: dbus.c cupslocald.h ../config.h \
\
\
\
\
\
\
\
\
Expand All @@ -32,7 +43,7 @@ dbus.o: dbus.c cups-locald.h ../config.h \
\
\

drivers.o: drivers.c cups-locald.h ../config.h \
drivers.o: drivers.c cupslocald.h ../config.h \
\
\
\
Expand All @@ -49,8 +60,17 @@ drivers.o: drivers.c cups-locald.h ../config.h \
\
\
\

transform.o: transform.c cups-locald.h ../config.h \
\
\
\
\
\
icons.h
transform.o: transform.c cupslocald.h ../config.h \
\
\
\
\
\
\
\
Expand Down
28 changes: 14 additions & 14 deletions daemon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include ../Makedefs


TARGETS = \
cups-locald
cupslocald
OBJS = \
main.o \
dbus.o \
Expand Down Expand Up @@ -54,24 +54,24 @@ depend:
#

install:
echo Installing cups-locald to $(BUILDROOT)$(sbindir)
echo Installing cupslocald to $(BUILDROOT)$(sbindir)
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(sbindir)
$(INSTALL_BIN) cups-locald $(BUILDROOT)$(sbindir)
$(INSTALL_BIN) cupslocald $(BUILDROOT)$(sbindir)
if test "x$(DBUSDIR)" != x; then \
echo Installing D-Bus files to $(BUILDROOT)$(DBUSDIR); \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/interfaces; \
$(INSTALL_DATA) org.openprinting.cups-locald.xml $(BUILDROOT)$(DBUSDIR)/interfaces; \
$(INSTALL_DATA) org.openprinting.cupslocald.xml $(BUILDROOT)$(DBUSDIR)/interfaces; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/services; \
$(INSTALL_DATA) cups-locald-dbus.service $(BUILDROOT)$(DBUSDIR)/services/cups-locald.service; \
$(INSTALL_DATA) cupslocald-dbus.service $(BUILDROOT)$(DBUSDIR)/services/cupslocald.service; \
fi
if test "x$$(uname)" = xDarwin; then \
echo Installing launchd files to $(BUILDROOT)/Library/LaunchAgents; \
$(INSTALL_DIR) -m 755 $(BUILDROOT)/Library/LaunchAgents; \
$(INSTALL_DATA) org.openprinting.cups-locald.plist $(BUILDROOT)/Library/LaunchAgents; \
$(INSTALL_DATA) org.openprinting.cupslocald.plist $(BUILDROOT)/Library/LaunchAgents; \
elif test "x$(SYSTEMDDIR)" != x; then \
echo Installing systemd files to $(BUILDROOT)$(SYSTEMDDIR); \
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(SYSTEMDDIR)/user; \
$(INSTALL_DATA) cups-locald-systemd.service $(BUILDROOT)$(SYSTEMDDIR)/user/cups-locald.service; \
$(INSTALL_DATA) cupslocald-systemd.service $(BUILDROOT)$(SYSTEMDDIR)/user/cupslocald.service; \
fi


Expand All @@ -80,28 +80,28 @@ install:
#

uninstall:
$(RM) $(BUILDROOT)$(sbindir)/cups-locald
$(RM) $(BUILDROOT)$(sbindir)/cupslocald
-$(RMDIR) $(BUILDROOT)$(sbindir)
if test "x$(DBUSDIR)" != x; then \
$(RM) $(BUILDROOT)$(DBUSDIR)/interfaces/org.openprinting.cups-locald.xml; \
$(RM) $(BUILDROOT)$(DBUSDIR)/interfaces/org.openprinting.cupslocald.xml; \
$(RMDIR) $(BUILDROOT)$(DBUSDIR)/interfaces; \
$(RM) $(BUILDROOT)$(DBUSDIR)/services/cups-locald.service; \
$(RM) $(BUILDROOT)$(DBUSDIR)/services/cupslocald.service; \
$(RMDIR) $(BUILDROOT)$(DBUSDIR)/services; \
fi
if test "x$$(uname)" = xDarwin; then \
$(RM) $(BUILDROOT)/Library/LaunchAgents/org.openprinting.cups-locald.plist; \
$(RM) $(BUILDROOT)/Library/LaunchAgents/org.openprinting.cupslocald.plist; \
$(RMDIR) $(BUILDROOT)/Library/LaunchAgents; \
elif test "x$(SYSTEMDDIR)" != x; then \
$(RM) $(BUILDROOT)$(SYSTEMDDIR)/user/cups-locald.service; \
$(RM) $(BUILDROOT)$(SYSTEMDDIR)/user/cupslocald.service; \
$(RMDIR) $(BUILDROOT)$(SYSTEMDDIR)/user; \
fi


#
# cups-locald
# cupslocald
#

cups-locald: $(OBJS)
cupslocald: $(OBJS)
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
$(CODE_SIGN) -s "$(CODESIGN_IDENTITY)" $@
Expand Down
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions daemon/cups-locald.h → daemon/cupslocald.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//
// Common header for cups-local.
// Common header for cupslocald.
//
// Copyright © 2023 by OpenPrinting.
// Copyright © 2023-2024 by OpenPrinting.
//
// Licensed under Apache License v2.0. See the file "LICENSE" for more
// information.
//

#ifndef CUPS_LOCALD_H
# define CUPS_LOCALD_H 1
#ifndef CUPSLOCALD_H
# define CUPSLOCALD_H 1
# include <config.h>
# include <pappl/pappl.h>

Expand All @@ -17,16 +17,16 @@
// Globals...
//

# ifdef CUPS_LOCAL_MAIN_C
# ifdef CUPSLOCALD_MAIN_C
# define VAR
# define VALUE(x) =x
# else
# define VAR extern
# define VALUE(x)
# endif // CUPS_LOCAL_MAIN_C
# endif // CUPSLOCALD_MAIN_C

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


#endif // !CUPS_LOCALD_H
#endif // !CUPSLOCALD_H
2 changes: 1 addition & 1 deletion daemon/dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// information.
//

#include "cups-locald.h"
#include "cupslocald.h"
#ifdef HAVE_DBUS
# include <dbus/dbus.h>

Expand Down
6 changes: 3 additions & 3 deletions daemon/drivers.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// Generic drivers for cups-local.
// Generic drivers for cupslocald.
//
// Copyright © 2023 by OpenPrinting.
// Copyright © 2023-2024 by OpenPrinting.
//
// Licensed under Apache License v2.0. See the file "LICENSE" for more
// information.
//

#include "cups-locald.h"
#include "cupslocald.h"
#include <cups/thread.h>
#include "icons.h"
#include <math.h>
Expand Down
8 changes: 4 additions & 4 deletions daemon/main.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//
// Main entry for cups-local.
// Main entry for cupslocald.
//
// Copyright © 2023 by OpenPrinting.
// Copyright © 2023-2024 by OpenPrinting.
//
// Licensed under Apache License v2.0. See the file "LICENSE" for more
// information.
//

#define CUPS_LOCAL_MAIN_C
#include "cups-locald.h"
#define CUPSLOCALD_MAIN_C
#include "cupslocald.h"
#include <cups/thread.h>
#ifdef __APPLE__
# include <launch.h>
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 03f4db8

Please sign in to comment.