From e3a479e4098dddbf0b075bbe81b0baca5fe0e3df Mon Sep 17 00:00:00 2001 From: Michael Grunder Date: Thu, 16 Dec 2021 12:36:05 -0800 Subject: FreeBSD build fixes + CI (#1026) * BSD linkage fix proposal * Touch up the Makefile to fix BSD builds Fixes #984 * Add a build in FreeBSD to GitHub Actions Lots of people use hiredis in FreeBSD so this should reduce some pain moving forward. Co-authored-by: David Carlier --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f30c2ac..37432ac 100644 --- a/Makefile +++ b/Makefile @@ -92,6 +92,16 @@ else SSL_LDFLAGS+=-L$(OPENSSL_PREFIX)/lib -lssl -lcrypto endif +ifeq ($(uname_S),FreeBSD) + LDFLAGS+=-lm + IS_GCC=$(shell sh -c '$(CC) --version 2>/dev/null |egrep -i -c "gcc"') + ifeq ($(IS_GCC),1) + REAL_CFLAGS+=-pedantic + endif +else + REAL_CFLAGS+=-pedantic +endif + ifeq ($(uname_S),SunOS) IS_SUN_CC=$(shell sh -c '$(CC) -V 2>&1 |egrep -i -c "sun|studio"') ifeq ($(IS_SUN_CC),1) @@ -231,7 +241,7 @@ check: hiredis-test TEST_SSL=$(USE_SSL) ./test.sh .c.o: - $(CC) -std=c99 -pedantic -c $(REAL_CFLAGS) $< + $(CC) -std=c99 -c $(REAL_CFLAGS) $< clean: rm -rf $(DYLIBNAME) $(STLIBNAME) $(SSL_DYLIBNAME) $(SSL_STLIBNAME) $(TESTS) $(PKGCONFNAME) examples/hiredis-example* *.o *.gcda *.gcno *.gcov -- cgit v1.2.3