Detect the glibc version in CMake and link librt if it is required.
For the Makefile, unconditionally link librt with no detection.
This commit is contained in:
5
Makefile
5
Makefile
@@ -15,6 +15,9 @@ CC = gcc
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
CFLAGS = -O2 -s -std=gnu99 -pedantic -Wall -D_GNU_SOURCE
|
||||
# Not required for glibc >= 2.17, but older glibcs are still common.
|
||||
# The CMake build script will perform detection, but this Makefile is simple.
|
||||
LINK_LIBS = -lrt
|
||||
|
||||
all: makedir ifchd-parse.o ncmlib.a ndhc
|
||||
|
||||
@@ -36,7 +39,7 @@ ncmlib.a: $(NCM_OBJS)
|
||||
$(RANLIB) $(BUILD_DIR)/$@
|
||||
|
||||
ndhc: $(NDHC_OBJS) ifchd-parse.o
|
||||
$(CC) $(CFLAGS) $(NCM_INC) -o $(BUILD_DIR)/$@ $(subst src/,$(OBJ_DIR)/src/,$(NDHC_OBJS)) $(BUILD_DIR)/ncmlib.a $(BUILD_DIR)/objs/src/ifchd-parse.o
|
||||
$(CC) $(CFLAGS) $(NCM_INC) -o $(BUILD_DIR)/$@ $(subst src/,$(OBJ_DIR)/src/,$(NDHC_OBJS)) $(BUILD_DIR)/ncmlib.a $(BUILD_DIR)/objs/src/ifchd-parse.o $(LINK_LIBS)
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
|
Reference in New Issue
Block a user