mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-03 04:37:06 -08:00
This not only builds but works on ppc64. I tested this on my system with serial ports in use using the below program:
$ cat Main.java
import gnu.io.*;
import java.util.*;
public class Main {
/**
* @return A HashSet containing the CommPortIdentifier for all serial ports that are not currently being used.
*/
public static HashSet<CommPortIdentifier> getAvailableSerialPorts() {
HashSet<CommPortIdentifier> h = new HashSet<CommPortIdentifier>();
Enumeration thePorts = CommPortIdentifier.getPortIdentifiers();
while (thePorts.hasMoreElements()) {
CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement();
switch (com.getPortType()) {
case CommPortIdentifier.PORT_SERIAL:
try {
CommPort thePort = com.open("CommUtil", 50);
thePort.close();
h.add(com);
} catch (PortInUseException e) {
System.out.println("Port, " + com.getName() + ", is in use.");
} catch (Exception e) {
System.err.println("Failed to open port " + com.getName());
e.printStackTrace();
}
}
}
return h;
}
public static void main(String[] args) {
for (CommPortIdentifier element : getAvailableSerialPorts())
{
System.out.println(element.getName());
}
}
}
$ javac -cp /usr/share/rxtx-2/lib/RXTXcomm.jar Main.java
$ java -Djava.library.path=/usr/lib64/rxtx-2 -cp .:/usr/share/rxtx-2/lib/RXTXcomm.jar Main
/dev/ttyUSB0
/dev/ttyUSB1
Closes: https://bugs.gentoo.org/454608
Signed-off-by: matoro <matoro@users.noreply.github.com>
Closes: https://github.com/gentoo/gentoo/pull/25356
Signed-off-by: Sam James <sam@gentoo.org>
17 lines
422 B
Diff
17 lines
422 B
Diff
diff --git a/src/RawImp.c b/src/RawImp.c
|
|
index 077f30e..813fcf9 100644
|
|
--- a/src/RawImp.c
|
|
+++ b/src/RawImp.c
|
|
@@ -99,10 +99,8 @@
|
|
# include <linux/serial.h>
|
|
# include <linux/version.h>
|
|
#endif
|
|
-#ifndef __APPLE__ /* dima */
|
|
-#ifndef PPC
|
|
+#if !defined(__APPLE__) && !defined(PPC) && !defined(__powerpc__) && !defined(__powerpc64__) /* dima */
|
|
#include <sys/io.h>
|
|
-#endif /* PPC */
|
|
#endif /* dima */
|
|
|
|
extern int errno;
|