Use pkg-config to find needed libs for check.

Also add -lpthread explicitly
This commit is contained in:
Erik Ekman 2014-01-29 22:12:16 +01:00
parent 9ee78b6f4d
commit 46a3d82639

View File

@ -6,8 +6,8 @@ SRCOBJS = ../src/base32.o ../src/base64.o ../src/read.o ../src/dns.o ../src/enc
OS = `uname | tr "a-z" "A-Z"` OS = `uname | tr "a-z" "A-Z"`
CHECK_PATH = /usr/local CHECK_PATH = /usr/local
LDFLAGS = -L$(CHECK_PATH)/lib -lcheck `../src/osflags link` LDFLAGS = -L$(CHECK_PATH)/lib `pkg-config check --libs` -lpthread
CFLAGS = -g -Wall -D$(OS) -I../src -I$(CHECK_PATH)/include -pedantic `../src/osflags cflags` CFLAGS = -g -Wall -D$(OS) `pkg-config check --cflags` -I../src -I$(CHECK_PATH)/include -pedantic
all: $(TEST) all: $(TEST)
@LD_LIBRARY_PATH=${CHECK_PATH}/lib ./$(TEST) @LD_LIBRARY_PATH=${CHECK_PATH}/lib ./$(TEST)
@ -20,7 +20,6 @@ $(TEST): $(OBJS) $(SRCOBJS)
@echo CC $< @echo CC $<
@$(CC) $(CFLAGS) -c $< @$(CC) $(CFLAGS) -c $<
clean: clean:
@echo "Cleaning tests/" @echo "Cleaning tests/"
@rm -f *~ *.core $(TEST) $(OBJS) @rm -f *~ *.core $(TEST) $(OBJS)