Source: repsnapper
Severity: normal
Dear Maintainer,
The package repsnapper fails to build from source on ppc64el with the
following errors:
src/printer/custom_baud.cpp: In function 'bool set_custom_baudrate(int, int)':
src/printer/custom_baud.cpp:15:19: error: aggregate 'set_custom_baudrate(int,
int)::termios2 options' has incomplete type and cannot be defined
struct termios2 options;
^
src/printer/custom_baud.cpp:17:26: error: 'TCGETS2' was not declared in this
scope
if ( ioctl( device_fd, TCGETS2, &options ) < 0 ) {
^
src/printer/custom_baud.cpp:27:26: error: 'TCSETS2' was not declared in this
scope
if ( ioctl( device_fd, TCSETS2, &options ) < 0 ) {
That is probably because, although the type and macros in the errors are
defined within termios.h from asm-generic, that header is not included within
arch specific headers (eg asm/termbits.h) for ppc64el.
It is possible to force usage of those, but I am not sure that is the proper
approach to fix this (aka I don't know if it will work).
There is a patch attached that allows it to build.
I tested the patch on ppc64el and x86_64
Thanks and regards.
Fernando
-- System Information:
Debian Release: 8.0
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'unstable'), (500, 'stable'), (1,
'experimental')
Architecture: ppc64el (ppc64le)
Kernel: Linux 3.16.0-4-powerpc64le (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Index: repsnapper-2.4a0/src/printer/custom_baud.cpp
===================================================================
--- repsnapper-2.4a0.orig/src/printer/custom_baud.cpp
+++ repsnapper-2.4a0/src/printer/custom_baud.cpp
@@ -6,7 +6,12 @@
#include <cstdlib>
#include <fcntl.h>
#include <sys/ioctl.h>
-#include <asm/termbits.h>
+#if !defined(__PPC64__) && !defined(__LITTLE_ENDIAN__)
+# include <asm/termbits.h>
+#else
+# include <asm-generic/ioctls.h>
+# include <asm-generic/termbits.h>
+#endif //ppc64
#endif
bool set_custom_baudrate( int device_fd, int baudrate ) {