summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jacob Myers2010-06-11 21:58:38 -0400
committerGravatar Hector Martin2010-06-12 04:28:57 +0200
commit6eef4b8c6263af1938ea52bc6e3c6976678225ff (patch)
tree21d79d5e749715d845754bb81444c33d50e48bcb
parent433f675157bfcbbb43cf93ac8cadb0120084098b (diff)
downloadusbmuxd-6eef4b8c6263af1938ea52bc6e3c6976678225ff.tar.gz
usbmuxd-6eef4b8c6263af1938ea52bc6e3c6976678225ff.tar.bz2
These patches get usbmuxd compiling/working on FreeBSD. With minor changes, it could work on other BSD's also.
-rw-r--r--CMakeLists.txt4
-rw-r--r--Modules/FindUSB.cmake15
-rw-r--r--daemon/main.c2
-rw-r--r--tools/iproxy.c1
4 files changed, 16 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 93fa715..8ed2e37 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ set(LIBUSBMUXD_SOVERSION "1")
13message("-- Configuring usbmuxd v${VERSION_TAG}") 13message("-- Configuring usbmuxd v${VERSION_TAG}")
14 14
15if(NOT DEFINED LIB_SUFFIX) 15if(NOT DEFINED LIB_SUFFIX)
16 if(CMAKE_SIZEOF_VOID_P EQUAL 8) 16 if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
17 set(LIB_SUFFIX "64" CACHE STRING "Define suffix of library directory name (32/64)" ) 17 set(LIB_SUFFIX "64" CACHE STRING "Define suffix of library directory name (32/64)" )
18 else() 18 else()
19 set(LIB_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) 19 set(LIB_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
@@ -67,7 +67,7 @@ add_definitions(-Wall)
67add_subdirectory (libusbmuxd) 67add_subdirectory (libusbmuxd)
68if (WITH_USBMUXD) 68if (WITH_USBMUXD)
69 add_subdirectory (daemon) 69 add_subdirectory (daemon)
70 if (NOT WIN32 AND NOT APPLE) 70 if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
71 add_subdirectory (udev) 71 add_subdirectory (udev)
72 endif() 72 endif()
73endif() 73endif()
diff --git a/Modules/FindUSB.cmake b/Modules/FindUSB.cmake
index d1d705a..486864f 100644
--- a/Modules/FindUSB.cmake
+++ b/Modules/FindUSB.cmake
@@ -9,8 +9,17 @@ include(LibFindMacros)
9 9
10# Dependencies 10# Dependencies
11 11
12# Use pkg-config to get hints about paths 12# pkg-config + libusb fails on FreeBSD, though libusb is in base
13libfind_pkg_check_modules(USB_PKGCONF libusb-1.0>=1.0.3) 13if(NOT(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD"))
14 # Use pkg-config to get hints about paths
15 libfind_pkg_check_modules(USB_PKGCONF libusb-1.0>=1.0.3)
16 # We want to look for libusb-1.0
17 set(USB_LIBRARY_NAME usb-1.0)
18else()
19 set(USB_PKGCONF_INCLUDE_DIRS /usr/include)
20 set(USB_PKGCONF_LIBRARY_DIRS /usr/lib)
21 set(USB_LIBRARY_NAME usb)
22endif()
14 23
15# Include dir 24# Include dir
16find_path(USB_INCLUDE_DIR 25find_path(USB_INCLUDE_DIR
@@ -20,7 +29,7 @@ find_path(USB_INCLUDE_DIR
20 29
21# Finally the library itself 30# Finally the library itself
22find_library(USB_LIBRARY 31find_library(USB_LIBRARY
23 NAMES usb-1.0 32 NAMES ${USB_LIBRARY_NAME}
24 PATHS ${USB_PKGCONF_LIBRARY_DIRS} 33 PATHS ${USB_PKGCONF_LIBRARY_DIRS}
25) 34)
26 35
diff --git a/daemon/main.c b/daemon/main.c
index 789a202..140bee1 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -147,7 +147,7 @@ void set_signal_handlers(void)
147 sigaction(SIGUSR2, &sa, NULL); 147 sigaction(SIGUSR2, &sa, NULL);
148} 148}
149 149
150#ifdef __APPLE__ 150#if defined(__FreeBSD__) || defined(__APPLE__)
151static int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout, const sigset_t *sigmask) 151static int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout, const sigset_t *sigmask)
152{ 152{
153 int ready; 153 int ready;
diff --git a/tools/iproxy.c b/tools/iproxy.c
index 1855c67..4469c48 100644
--- a/tools/iproxy.c
+++ b/tools/iproxy.c
@@ -42,6 +42,7 @@ typedef unsigned int socklen_t;
42#include <arpa/inet.h> 42#include <arpa/inet.h>
43#endif 43#endif
44#include <pthread.h> 44#include <pthread.h>
45#include <netinet/in.h>
45#include "sock_stuff.h" 46#include "sock_stuff.h"
46#include "usbmuxd.h" 47#include "usbmuxd.h"
47 48