[Debburn-devel] patch: port to Mac OS X

Ray Kohler ataraxia at cmu.edu
Thu Oct 23 00:17:55 UTC 2008


I made a small change to the build in order to make cdrkit link on Mac  
OS X. There are two parts to this:

1 - Don't assume that systems without realtime-scheduling in libc have  
it in librt. Do a compile test on librt instead. OS X does not support  
realtime-scheduling.

2 - If the platform is OS X, consumers of libusal have to link the  
CoreFoundation and IOKit frameworks.

I am not subscribed to this list, so send any replies directly.

Index: include/AddScgBits.cmake
===================================================================
--- include/AddScgBits.cmake	(revision 817)
+++ include/AddScgBits.cmake	(working copy)
@@ -58,8 +58,18 @@
     CHECK_C_SOURCE_COMPILES("${TESTSRC}" LIBC_SCHED)

  IF(NOT LIBC_SCHED)
-   LIST(APPEND EXTRA_LIBS -lrt)
-   #MESSAGE("Using librt for realtime functions")
+   SET(CMAKE_REQUIRED_LIBRARIES librt)
+      CHECK_C_SOURCE_COMPILES("${TESTSRC}" LIBRT_SCHED)
+   IF(LIBRT_SCHED)
+      LIST(APPEND EXTRA_LIBS -lrt)
+      #MESSAGE("Using librt for realtime functions")
+   ENDIF(LIBRT_SCHED)
  ENDIF(NOT LIBC_SCHED)

+IF(APPLE)
+   FIND_LIBRARY(COREFOUNDATION CoreFoundation)
+   FIND_LIBRARY(IOKIT IOKit)
+   LIST(APPEND EXTRA_LIBS ${COREFOUNDATION} ${IOKIT})
+ENDIF(APPLE)
+
  ENDIF(NOT GUARD_SCGCONFIG)




More information about the Debburn-devel mailing list