aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.mk3
-rwxr-xr-xscripts/cflags.sh14
2 files changed, 16 insertions, 1 deletions
diff --git a/config.mk b/config.mk
index 2d963aa..498aeb7 100644
--- a/config.mk
+++ b/config.mk
@@ -9,6 +9,7 @@ OBJ = ${SRC:.c=.o}
LIBNAME = liblog
LIBVER = 0.0.0-a1
-CFLAGS = -Wall -ansi --std=c89 -pedantic ${OPT} -DLIBVER=\"${LIBVER}\"
+CFLAGS != scripts/cflags.sh
+CFLAGS += -Wall -ansi --std=c89 -pedantic ${OPT} -DLIBVER=\"${LIBVER}\"
PKG_CONFIG_PATH != pkg-config --variable pc_path pkg-config | sed -E "s|.*(${PREFIX}[^:]*)[:].*|\1|g"
diff --git a/scripts/cflags.sh b/scripts/cflags.sh
new file mode 100755
index 0000000..bc8e3a8
--- /dev/null
+++ b/scripts/cflags.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+Linux_cflags()
+{
+ echo -D_GNU_SOURCE
+}
+
+FreeBSD_cflags()
+{
+ echo -D_BSD_SOURCE
+}
+
+$(uname)_cflags
+