moz_lib_dir := \
$(shell pkg-config --variable=prefix mozilla-gtkmozembed)/lib/mozilla
+moz_version := \
+ $(shell sed 's/\#define MOZILLA_VERSION "\(.*\)"/\1/; t; d' \
+ < $(moz_include_dir)/mozilla-config.h)
+moz_version_major := $(word 1,$(subst ., ,$(moz_version)))
+moz_version_minor := $(word 2,$(subst ., ,$(moz_version)))
+moz_version_patchlevel := $(word 3,$(subst ., ,$(moz_version)))
+
CFLAGS := -Wall
CPPFLAGS := -D_REENTRANT
# Non-virtual destructors are fine in XPCOM interface classes since
browserwidget.% : CPPFLAGS += -DMOZ_LIB_DIR='"$(moz_lib_dir)"'
-webdvd.% : CPPFLAGS += -DWEBDVD_LIB_DIR='"$(webdvd_lib_dir)"'
+webdvd.% \
+ : CPPFLAGS += -DWEBDVD_LIB_DIR='"$(webdvd_lib_dir)"' \
+ -DMOZ_VERSION_MAJOR=$(moz_version_major) \
+ -DMOZ_VERSION_MINOR=$(moz_version_minor) \
+ -DMOZ_VERSION_PATCHLEVEL=$(moz_version_patchlevel)
browserwidget.% pixbufs.% temp_file.% webdvd.% \
: CPPFLAGS += $(shell pkg-config --cflags gtkmm-2.0)