Jelajahi Sumber

librt is not present on Mac. Only link it on Linux builds.

Based on the prior commit introducing linking with the rt lib,
it was added because Linux (ubuntu) needed it for clock_gettime.

Only add -lrt when linking on Linux.
Keith Kyzivat 10 tahun lalu
induk
melakukan
fd412a3867
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      Makefile

+ 2 - 2
Makefile

@@ -62,7 +62,7 @@ endif
 # only set main compile options if none were chosen
 # only set main compile options if none were chosen
 CFLAGS += -W -Wall -O2 -D$(TARGET_OS) -Iinclude $(COPT) -DUSE_STACK_SIZE=102400
 CFLAGS += -W -Wall -O2 -D$(TARGET_OS) -Iinclude $(COPT) -DUSE_STACK_SIZE=102400
 
 
-LIBS = -lpthread -lm -lrt
+LIBS = -lpthread -lm
 
 
 ifdef WITH_DEBUG
 ifdef WITH_DEBUG
   CFLAGS += -g -DDEBUG_ENABLED
   CFLAGS += -g -DDEBUG_ENABLED
@@ -119,7 +119,7 @@ MAIN_OBJECTS = $(addprefix $(BUILD_DIR)/, $(APP_SOURCES:.c=.o))
 LIB_OBJECTS = $(filter-out $(MAIN_OBJECTS), $(BUILD_OBJECTS))
 LIB_OBJECTS = $(filter-out $(MAIN_OBJECTS), $(BUILD_OBJECTS))
 
 
 ifeq ($(TARGET_OS),LINUX)
 ifeq ($(TARGET_OS),LINUX)
-  LIBS += -ldl
+  LIBS += -lrt -ldl
   CAN_INSTALL = 1
   CAN_INSTALL = 1
 endif
 endif