-dir=compat
-extra_cflags += -I$(dir)
+# -*- makefile -*-
-notmuch_compat_srcs =
+dir := compat
+extra_cflags += -I$(srcdir)/$(dir)
+
+notmuch_compat_srcs :=
ifneq ($(HAVE_GETLINE),1)
notmuch_compat_srcs += $(dir)/getline.c $(dir)/getdelim.c
endif
+
+ifneq ($(HAVE_STRCASESTR),1)
+notmuch_compat_srcs += $(dir)/strcasestr.c
+endif
+
+SRCS := $(SRCS) $(notmuch_compat_srcs)