purplexpcom/src/Makefile.in
author Florian Quèze <florian@queze.net>
Thu, 24 Jul 2014 07:42:00 -0400
changeset 740 e69eedb84ede0de75f4a1e394ea14aa37abc87d8
parent 727 336d872cd3a43940173534497271df339e1fde52
child 741 e62dedb0bc176ddb1c09a8f2f8b892a0ffb9f9c9
permissions -rw-r--r--
Bug 1043045 - Port |Bug 1036894 - Move in-tree library linkage information to moz.build| to purple. r=clokep

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

DEPTH		= @DEPTH@
topsrcdir	= @top_srcdir@
srcdir		= @srcdir@
VPATH		= @srcdir@
# relativesrcdir is needed for xpcshell_tests.
relativesrcdir = @relativesrcdir@

include $(DEPTH)/config/autoconf.mk

ifeq (,$(filter WINNT Darwin,$(OS_ARCH)))
LOCAL_INCLUDES	= $(GLIB_CFLAGS)
EXTRA_LIBS	= $(GLIB_LIBS) $(GLIB_GMODULE_LIBS) -lz $(LIBXML2_LIBS)
else
LOCAL_INCLUDES  += -I$(DIST)/include/glib
ifneq ($(OS_ARCH),WINNT)
EXTRA_LIBS	= -lz -liconv

# For SIPE.
ifdef GSSAPI
EXTRA_LIBS	+= $(KRB5_LIBS)
endif
else
DEFINES += -DGLIB_STATIC_COMPILATION
EXTRA_LIBS	= ws2_32.lib

ifdef PURPLE_BONJOUR
EXTRA_LIBS	+= netapi32.lib
endif

DSO_LDOPTS	+= -DEF:../../libpurple/purple.def
endif
endif

EXTRA_LIBS	+= $(NSS_LIBS) $(NSPR_LIBS)

ifeq (,$(filter WINNT FreeBSD,$(OS_ARCH)))
EXTRA_LIBS	+= -lresolv
endif

ifdef PURPLE_PLUGINS
DEFINES 	+= -DPURPLE_PLUGINS
endif

ifeq ($(OS_ARCH),Darwin)
# On Mac we need to hack EXTRA_DSO_LDOPTS to replace -bundle with -dynamiclib
# so that dynamic prpls can load libpurple symbols from libpurplexpcom.dylib.
# For that, we need to hack around config.mk's freezing of the variables.
EXTERNALLY_MANAGED_MAKE_FILE := 1
include $(topsrcdir)/config/config.mk
GLOBAL_DEPS += backend.mk
include backend.mk

include $(topsrcdir)/config/rules.mk

EXTRA_DSO_LDOPTS := $(subst -bundle,-dynamiclib -install_name @executable_path/components/$(SHARED_LIBRARY),$(EXTRA_DSO_LDOPTS))
else

include $(topsrcdir)/config/rules.mk

ifneq ($(OS_ARCH),WINNT)
# Export more than just the NSModule symbol
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS =
else
DELETE_AFTER_LINK =

CXXFLAGS	+= -wd4624 -wd4068

module.ver: module.ver.in $(GLOBAL_DEPS)
	sed 's/@''PURPLE_MAJOR_VERSION@/$(PURPLE_MAJOR_VERSION)/;s/@''PURPLE_MINOR_VERSION@/$(PURPLE_MINOR_VERSION)/;s/@''PURPLE_MICRO_VERSION@/$(PURPLE_MICRO_VERSION)/' $< > $@

_RC_STRING += -SRCDIR .
module.rc: module.ver

GARBAGE += module.ver
endif
endif

libs:: $(SHARED_LIBRARY)
ifeq ($(OS_ARCH),WINNT)
	-mv fake.lib $(LIBRARY_NAME).$(LIB_SUFFIX)
endif