--- host/libhackrf/CMakeLists.txt.orig	2014-08-28 17:34:30 UTC
+++ host/libhackrf/CMakeLists.txt
@@ -34,7 +34,7 @@ if(MSVC)
 	set(THREADS_USE_PTHREADS_WIN32 true)
 else()
 	add_definitions(-Wall)
-	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu90")
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
 
 	INCLUDE(TestBigEndian)
 	TEST_BIG_ENDIAN(BIGENDIAN)
@@ -68,8 +68,13 @@ ENDIF(CMAKE_CROSSCOMPILING)
 
 set(prefix ${CMAKE_INSTALL_PREFIX})
 set(exec_prefix \${prefix})
-set(libdir \${exec_prefix}/lib)
+set(libdir \${exec_prefix}/lib${LIB_SUFFIX})
 set(includedir \${prefix}/include)
+set(libpkgdata "lib"${LIB_SUFFIX})
+
+if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+    set(libpkgdata "libdata")
+endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
 
 CONFIGURE_FILE(
     ${CMAKE_CURRENT_SOURCE_DIR}/libhackrf.pc.in
@@ -78,7 +83,7 @@ CONFIGURE_FILE(
 
 INSTALL(
     FILES ${CMAKE_CURRENT_BINARY_DIR}/libhackrf.pc
-    DESTINATION lib/pkgconfig
+    DESTINATION ${libpkgdata}/pkgconfig
 )
 
 ########################################################################
@@ -100,9 +105,13 @@ endif()
 ########################################################################
 option(INSTALL_UDEV_RULES "Install udev rules for HackRF" OFF)
 if (INSTALL_UDEV_RULES)
+    if (NOT UDEV_INSTALL_DIR)
+        set (UDEV_INSTALL_DIR "/etc/udev/rules.d")
+    endif (NOT UDEV_INSTALL_DIR)
+
     install (
         FILES 53-hackrf.rules
-        DESTINATION "/etc/udev/rules.d"
+        DESTINATION ${UDEV_INSTALL_DIR}
         COMPONENT "udev"
         )
 else (INSTALL_UDEV_RULES)
