aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index ae8a59e..044e2b4 100644
--- a/Makefile
+++ b/Makefile
@@ -29,12 +29,18 @@ endef
PROBED:= \
$(call probe_fun,string.h,memmem) \
- $(call probe_fun,string.h,strdup) \
- $(call probe_fun,stdio.h,fileno)
+ $(call probe_fun,string.h,strdup)
CFLAGS+=$(PROBED)
TESTS_CFLAGS+=$(PROBED)
+FS_FLAG:=$(shell printf '#include "compat.h"\n#include <stdio.h>\nint main(void){\n#ifdef _WIN32\n_fileno;\n#else\nfileno;\n#endif\nreturn 0;}' \
+ | $(CC) $(CFLAGS) -x c - -o /dev/null 2>/dev/null \
+ || echo -DNO_FS)
+
+CFLAGS+=$(FS_FLAG)
+TESTS_CFLAGS+=$(FS_FLAG)
+
both: CLEANUP=true
both: clean shared static
@$(MAKE) clean --no-print-directory