[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#644456: libindi:FTBFS: libs/webcam/port.h:40:22: fatal error: sys/io.h: No such file or directory



Source: libindi
Version: 0.8-1
Severity: wishlist
Justification: fails to build from source
Tags: patch

Hi,

libindi FTBFS on Renesas sh4.
  http://buildd.debian-ports.org/status/fetch.php?pkg=libindi&arch=sh4&ver=0.8-1&stamp=1317785210

-----
/usr/bin/c++   -DHAVE_LINUX_VIDEODEV2_H -g -O2 -fstack-protector
--param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat
-Wformat-security -Werror=format-security
-I/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/obj-sh4-linux-gnu
-I/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8
-I/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/libs
-I/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/libs/webcam
-I/usr/include/libnova    -o
CMakeFiles/indi_meade_lpi.dir/drivers/video/indi_lpi.o -c
/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/drivers/video/indi_lpi.cpp
/usr/bin/cmake -E cmake_progress_report
/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/obj-sh4-linux-gnu/CMakeFiles
24
[ 24%] Building CXX object CMakeFiles/indi_meade_lpi.dir/libs/webcam/PPort.o
/usr/bin/c++   -DHAVE_LINUX_VIDEODEV2_H -g -O2 -fstack-protector
--param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat
-Wformat-security -Werror=format-security
-I/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/obj-sh4-linux-gnu
-I/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8
-I/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/libs
-I/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/libs/webcam
-I/usr/include/libnova    -o
CMakeFiles/indi_meade_lpi.dir/libs/webcam/PPort.o -c
/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/libs/webcam/PPort.cpp
In file included from
/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/libs/webcam/PPort.cpp:22:0:
/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/libs/webcam/port.h:40:22:
fatal error: sys/io.h: No such file or directory
compilation terminated.
make[3]: *** [CMakeFiles/indi_meade_lpi.dir/libs/webcam/PPort.o] Error 1
make[3]: Leaving directory
`/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/obj-sh4-linux-gnu'
make[2]: *** [CMakeFiles/indi_meade_lpi.dir/all] Error 2
make[1]: *** [all] Error 2
make[2]: Leaving directory
`/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/obj-sh4-linux-gnu'
dh_auto_build: make -j1 returned exit code 2
make[1]: Leaving directory
`/build/buildd-libindi_0.8-1-sh4-RZhOpo/libindi-0.8/obj-sh4-linux-gnu'
make: *** [build] Error 2
-----

I made patch which revise this problem. Could you apply this patch?

Best regards,
 Nobuhiro

Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
diff --git a/libs/webcam/port.cpp b/libs/webcam/port.cpp
index 1a52735..93053ce 100644
--- a/libs/webcam/port.cpp
+++ b/libs/webcam/port.cpp
@@ -37,13 +37,20 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 #endif /* LOCKING */
+#ifdef __linux__
+#if defined(arm) || defined(__hppa__) || defined(__sparc__) || defined(__ppc__) \
+	|| defined(__powerpc__) || defined(__s390__) || defined(__s390x__)\
+	|| defined(__mips__) || defined(__mc68000__) || defined(__sh__)
+#define NO_SYSIO
+#endif /* architechtures */
+#endif /* __linux__ */
 
 #ifdef __linux__
-  #if defined(arm) || defined(__hppa__) || defined(__sparc__) || defined(__ppc__) || defined(__powerpc__) || defined(__s390__) || defined(__s390x__) || defined(__mips__) || defined(__mc68000__)
+  #if defined(NO_SYSIO)
   #include <fcntl.h>
   #else
   #include <sys/io.h>
-  #endif /* arm */
+  #endif /* NO_SYSIO */
 #elif defined(QNX)
 #include <conio.h>
 #elif defined(__FreeBSD__)
@@ -76,7 +83,7 @@ port_t::port_t(int iport) {
 #endif /* LOCKING */
 
 #ifdef LINUX
-#if defined(arm) || defined(__hppa__) || defined(__sparc__) || defined(__ppc__) || defined(__powerpc__) || defined(__s390__) || defined(__s390x__) || defined(__mips__) || defined(__mc68000__)
+#ifdef NO_SYSIO
   if ((devport = open("/dev/port", O_RDWR)) < 0) {
     perror("open /dev/port");
     return;
@@ -86,7 +93,7 @@ port_t::port_t(int iport) {
     perror("ioperm()");
     return;
   }
-#endif /* arm */
+#endif /* NO_SYSIO */
 #elif defined(FREEBSD)
   if ((devio = fopen("/dev/io", "r+")) == NULL) {
     perror("fopen /dev/io");
@@ -120,7 +127,7 @@ port_t::~port_t(void) {
   unlock(port);
 #endif /* LOCKING */
 #ifdef LINUX
-#if defined(arm) || defined(__hppa__) || defined(__sparc__) || defined(__ppc__) || defined(__powerpc__) || defined(__s390__) || defined(__s390x__) || defined(__mips__) || defined(__mc68000__)
+#ifdef NO_SYSIO
   if (devport >= 0)
     close(devport);
 #else
@@ -128,7 +135,7 @@ port_t::~port_t(void) {
     if (ioperm(port, 3, 0) != 0)  // drop port permissions -- still must
                                   // be root
       perror("ioperm()");
-#endif /* arm */
+#endif /* NO_SYSIO */
 #elif defined(FREEBSD)
   if (devio != NULL)
     fclose(devio);
diff --git a/libs/webcam/port.h b/libs/webcam/port.h
index ab02785..829cb4c 100644
--- a/libs/webcam/port.h
+++ b/libs/webcam/port.h
@@ -34,11 +34,16 @@
 //#include "config.h"
 
 #include <unistd.h>
+#if defined(arm) || defined(__hppa__) || defined(__sparc__) || defined(__ppc__) \
+	|| defined(__powerpc__) || defined(__s390__) || defined(__s390x__)\
+	|| defined(__mips__) || defined(__mc68000__) || defined(__sh__)
+#define NO_SYSIO
+#endif /* arm... */
 
 #ifdef __linux__
-  #if !defined(arm) && !defined(__hppa__) && !defined(__sparc__) && !defined(__ppc__) && !defined(__powerpc__) && !defined(__s390__) && !defined(__s390x__) && !defined(__mips__) && !defined(__mc68000__)
+  #ifndef NO_SYSIO
   #include <sys/io.h>
-  #endif /* !arm */
+  #endif /* NO_SYSIO */
 #elif defined(QNX)
 #include <conio.h>
 #elif defined(__FreeBSD__)
@@ -56,7 +61,8 @@
 #error Please define a platform in the Makefile
 #endif
 
-#if defined(arm) || defined(__hppa__) || defined(__sparc__) || defined(__ppc__) || defined(__powerpc__) || defined(__s390__) || defined(__s390x__) || defined(__mips__) || defined(__mc68000__)
+#ifdef NO_SYSIO
+
 static char ports_temp;
 
 #ifdef inb
@@ -75,7 +81,7 @@ static char ports_temp;
   ports_temp = data; \
   write(devport, &ports_temp, 1);
 
-#endif /* arm, hppa */
+#endif /* NO_SYSIO */
 
 class port_t {
 public:
@@ -115,7 +121,7 @@ private:
 #ifdef FREEBSD
   FILE *devio;
 #endif
-#if defined(__linux__) && (defined(arm) || defined(__hppa__) || defined(__sparc__) || defined(__ppc__) || defined(__powerpc__) || defined(__s390__) || defined(__s390x__) || defined(__mips__) || defined(__mc68000__))
+#ifdef NO_SYSIO
   int devport;
 #endif
 };

Reply to: