Selaa lähdekoodia

Merge pull request #798 from mklingn/0.2

Compile on OpenBSD
Julius Pfrommer 8 vuotta sitten
vanhempi
commit
d5f82e32ab
4 muutettua tiedostoa jossa 39 lisäystä ja 7 poistoa
  1. 26 0
      doc/building.rst
  2. 6 6
      doc/tutorial_noderelations.rst
  3. 4 1
      plugins/ua_network_tcp.c
  4. 3 0
      plugins/ua_network_udp.c

+ 26 - 0
doc/building.rst

@@ -87,6 +87,32 @@ Building on OS X
 
 Follow Ubuntu instructions without the ``apt-get`` commands as these are taken care of by the above packages.
 
+Building on OpenBSD
+-------------------
+The procedure below works on OpenBSD 5.8 with gcc version 4.8.4, cmake version 3.2.3 and Python version 2.7.10.
+
+- Install a recent gcc, python and cmake:
+
+.. code-block:: bash
+   
+   pkg_add gcc python cmake
+
+- Tell the system to actually use the recent gcc (it gets installed as egcc on OpenBSD): 
+
+.. code-block:: bash
+   
+   export CC=egcc CXX=eg++
+
+- Now procede as described for Ubuntu/Debian:
+
+.. code-block:: bash
+
+   cd open62541
+   mkdir build
+   cd build
+   cmake ..
+   make
+
 Build Options
 -------------
 

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 6 - 6
doc/tutorial_noderelations.rst


+ 4 - 1
plugins/ua_network_tcp.c

@@ -42,13 +42,16 @@
 # ifdef __QNX__
 #  include <sys/socket.h>
 # endif
+# ifdef __OpenBSD__
+#  include <sys/socket.h>
+# endif
 # ifndef __CYGWIN__
 #  include <netinet/tcp.h>
 # endif
 #endif
 
 /* unsigned int for windows and workaround to a glibc bug */
-#if defined(_WIN32) || (defined(__GNU_LIBRARY__) && (__GNU_LIBRARY__ <= 6) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 16))
+#if defined(_WIN32) || defined(__OpenBSD__) || (defined(__GNU_LIBRARY__) && (__GNU_LIBRARY__ <= 6) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 16))
 # define UA_fd_set(fd, fds) FD_SET((unsigned int)fd, fds)
 # define UA_fd_isset(fd, fds) FD_ISSET((unsigned int)fd, fds)
 #else

+ 3 - 0
plugins/ua_network_udp.c

@@ -24,6 +24,9 @@
 #ifdef __QNX__
 #include <sys/socket.h>
 #endif
+#ifdef __OpenBSD__
+#include <sys/socket.h>
+#endif 
 # define CLOSESOCKET(S) close(S)
 
 #define MAXBACKLOG 100