LIBDIR := $(DESTDIR)$(PREFIX)/lib/vimb
RUNPREFIX := $(PREFIX)
EXTENSIONDIR := $(RUNPREFIX)/lib/vimb
+OS := $(shell uname -s)
# define some directories
SRCDIR = src
CFLAGS += -std=c99 -pipe -Wall -fPIC
CPPFLAGS += -DEXTENSIONDIR=\"${EXTENSIONDIR}\"
CPPFLAGS += -DPROJECT=\"vimb\" -DPROJECT_UCFIRST=\"Vimb\"
-CPPFLAGS += -D_XOPEN_SOURCE=500
-CPPFLAGS += -D__BSD_VISIBLE
CPPFLAGS += -DGSEAL_ENABLE
CPPFLAGS += -DGTK_DISABLE_SINGLE_INCLUDES
CPPFLAGS += -DGDK_DISABLE_DEPRECATED
+ifeq "$(findstring $(OS),FreeBSD DragonFly)" ""
+CPPFLAGS += -D_XOPEN_SOURCE=500
+CPPFLAGS += -D__BSD_VISIBLE
+endif
+
# flags used to build webextension
EXTTARGET = webext_main.so
EXTCFLAGS = ${CFLAGS} $(shell pkg-config --cflags webkit2gtk-web-extension-4.0)