# compile flags

SOPE_ROOT=../..

ADDITIONAL_CPPFLAGS += -Wall
ADDITIONAL_INCLUDE_DIRS += \
	-I.. -I$(SOPE_ROOT)			\
	-I../NGObjWeb			\
	-I$(SOPE_ROOT)/sope-core/NGStreams	\
	-I$(SOPE_ROOT)/sope-core/NGExtensions	\
	-I$(SOPE_ROOT)/sope-core		\
	-I$(SOPE_ROOT)/sope-xml


libWOExtensions_SOVERSION=$(MAJOR_VERSION).$(MINOR_VERSION)
libWOExtensions_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION)


# dependencies

libWOExtensions_LIBRARIES_DEPEND_UPON += \
	-lWEExtensions	\
	-lNGObjWeb	\
	-lNGMime	\
	-lNGStreams -lNGExtensions -lEOControl \
	-lXmlRpc -lDOM -lSaxObjC

ifeq ($(frameworks),yes)
WOExtensions_LIBRARIES_DEPEND_UPON += \
	-framework WEExtensions	\
	-framework NGObjWeb	\
	-framework NGMime -framework NGMail \
	-framework NGStreams -framework NGExtensions -framework EOControl \
	-framework XmlRpc -framework DOM -framework SaxObjC
endif


# library/framework search pathes

DEP_DIRS = \
	. \
	../WEExtensions \
	../NGObjWeb	\
	$(SOPE_ROOT)/sope-mime			\
	$(SOPE_ROOT)/sope-mime/NGMail		\
	$(SOPE_ROOT)/sope-core/NGStreams	\
	$(SOPE_ROOT)/sope-core/NGExtensions	\
	$(SOPE_ROOT)/sope-core/EOControl	\
	$(SOPE_ROOT)/sope-xml/DOM		\
	$(SOPE_ROOT)/sope-xml/XmlRpc		\
	$(SOPE_ROOT)/sope-xml/SaxObjC

ifneq ($(frameworks),yes)
ADDITIONAL_LIB_DIRS += \
	$(foreach dir,$(DEP_DIRS),\
	  -L$(GNUSTEP_BUILD_DIR)/$(dir)/$(GNUSTEP_OBJ_DIR_NAME))
else
ADDITIONAL_LIB_DIRS += \
	$(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir))
endif

SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib


# bundle dependencies

ifneq ($(frameworks),yes)

WOExtensions_BUNDLE_LIBS += \
	-lWOExtensions -lWEExtensions \
	-lNGObjWeb	\
	-lNGMime	\
	-lNGStreams -lNGExtensions -lEOControl \
	-lXmlRpc -lDOM -lSaxObjC
WOExtensions_WOBUNDLE_LIBS += $(WOExtensions_BUNDLE_LIBS)

endif


# Apple

ifeq ($(FOUNDATION_LIB),apple)
libWOExtensions_PREBIND_ADDR="0xC4300000"
libWOExtensions_LDFLAGS += -seg1addr $(libWOExtensions_PREBIND_ADDR)
endif