Skip to content

Commit

Permalink
Various build fixes for OpenBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
brad0 committed Dec 23, 2024
1 parent c6483e5 commit 0b8453b
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cmake_modules/CMakeCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ IF (UNIX OR APPLE OR ANDROID)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SEC_COMP_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEC_COMP_FLAGS}")
SET(SEC_LINK_FLAGS "")
IF (NOT APPLE AND NOT CYGWIN AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
IF (NOT APPLE AND NOT CYGWIN AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|OpenBSD")
SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now")
ENDIF ()
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SEC_LINK_FLAGS}")
Expand Down
2 changes: 1 addition & 1 deletion drivers/auxiliary/skysafari.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <arpa/inet.h>
#include <sys/socket.h>

#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <netinet/in.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion drivers/telescope/lx200driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 - 1301 USA
#include <termios.h>
#endif

#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <string.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion drivers/video/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ########## INDI::CCD V4L Driver ###############

IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD")
SET(v4l2driverccd_SRC
lx/Lx.cpp
v4l2driver.cpp
Expand Down
2 changes: 1 addition & 1 deletion libs/hid/hid_libusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extern "C" {
} while (0)
#endif

#ifndef __FreeBSD__
#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
#define DETACH_KERNEL_DRIVER
#endif

Expand Down
6 changes: 3 additions & 3 deletions libs/indibase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ list(APPEND ${PROJECT_NAME}_LIBS
${CURL}
)

# Add Iconv - FreeBSD needs to find the correct GNU iconv library.
if(CYGWIN OR UNIX OR (CMAKE_SYSTEM_NAME MATCHES "FreeBSD"))
# Add Iconv - FreeBSD/OpenBSD need to find the correct GNU iconv library.
if(CYGWIN OR UNIX OR (CMAKE_SYSTEM_NAME MATCHES "FreeBSD|OpenBSD"))
find_package(Iconv REQUIRED)
list(APPEND ${PROJECT_NAME}_LIBS ${Iconv_LIBRARIES})
endif()
Expand Down Expand Up @@ -105,7 +105,7 @@ if(UNIX)
COMPONENT Devel
)

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD")
list(APPEND ${PROJECT_NAME}_SOURCES
webcam/v4l2_colorspace.c
webcam/v4l2_base.cpp
Expand Down
2 changes: 1 addition & 1 deletion libs/indibase/connectionplugins/connectiontcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <unistd.h>
#include <regex>

#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
Expand Down
2 changes: 1 addition & 1 deletion libs/indibase/webcam/pwc-ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

#pragma once

#ifndef __FreeBSD__
#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
#include <linux/types.h>
#else
#include <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion libs/indibase/webcam/v4l2_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <asm/types.h> /* for videodev2.h */
/* Kernel headers version */
#include <linux/version.h>
#elif __FreeBSD__
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
#define LINUX_VERSION_CODE 1
#define KERNEL_VERSION(...) 1
#endif
Expand Down
2 changes: 1 addition & 1 deletion libs/indicore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if(UNIX)
list(APPEND ${PROJECT_NAME}_SOURCES
sharedblob_parse.cpp
shm_open_anon.c)
if(UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
target_link_libraries(${PROJECT_NAME} rt)
endif()
endif()
Expand Down
4 changes: 2 additions & 2 deletions libs/indicore/indicom.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <string.h>
#include <time.h>

#if defined(__linux__) || defined(__NetBSD__)
#if defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/ioctl.h>
#endif

Expand Down Expand Up @@ -793,7 +793,7 @@ int tty_connect(const char *device, int bit_rate, int word_size, int parity, int
case 57600: bps = B57600; break;
case 115200: bps = B115200; break;
case 230400: bps = B230400; break;
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
case 460800: bps = B460800; break;
case 576000: bps = B576000; break;
case 921600: bps = B921600; break;
Expand Down

0 comments on commit 0b8453b

Please sign in to comment.