2002-03-27 00:54:41 +03:00
|
|
|
#
|
2003-10-10 19:03:52 +04:00
|
|
|
# ***** BEGIN LICENSE BLOCK *****
|
2003-10-15 21:26:10 +04:00
|
|
|
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2003-10-10 19:03:52 +04:00
|
|
|
#
|
2003-10-15 21:26:10 +04:00
|
|
|
# The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
# http://www.mozilla.org/MPL/
|
2003-10-10 19:03:52 +04:00
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
# for the specific language governing rights and limitations under the
|
|
|
|
# License.
|
|
|
|
#
|
2002-03-27 00:54:41 +03:00
|
|
|
# The Original Code is Mozilla Communicator client code, released
|
|
|
|
# March 31, 1998.
|
|
|
|
#
|
2003-10-10 19:03:52 +04:00
|
|
|
# The Initial Developer of the Original Code is
|
|
|
|
# Netscape Communications Corporation.
|
|
|
|
# Portions created by the Initial Developer are Copyright (C) 1998-1999
|
|
|
|
# the Initial Developer. All Rights Reserved.
|
2002-03-27 00:54:41 +03:00
|
|
|
#
|
2003-10-10 19:03:52 +04:00
|
|
|
# Contributor(s):
|
|
|
|
#
|
|
|
|
# Alternatively, the contents of this file may be used under the terms of
|
|
|
|
# either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
# in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
# of those above. If you wish to allow use of your version of this file only
|
|
|
|
# under the terms of either the GPL or the LGPL, and not to allow others to
|
2003-10-15 21:26:10 +04:00
|
|
|
# use your version of this file under the terms of the MPL, indicate your
|
2003-10-10 19:03:52 +04:00
|
|
|
# decision by deleting the provisions above and replace them with the notice
|
|
|
|
# and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
# the provisions above, a recipient may use your version of this file under
|
2003-10-15 21:26:10 +04:00
|
|
|
# the terms of any one of the MPL, the GPL or the LGPL.
|
2003-10-10 19:03:52 +04:00
|
|
|
#
|
|
|
|
# ***** END LICENSE BLOCK *****
|
2002-03-27 00:54:41 +03:00
|
|
|
|
|
|
|
# some vendors may wish to override COMPVERSIONDIR from the command-line
|
|
|
|
#
|
|
|
|
ifdef USE_AUTOCONF
|
|
|
|
COMPVERSIONDIR = $(topsrcdir)
|
|
|
|
else
|
|
|
|
COMPVERSIONDIR = $(DEPTH)/directory/c-sdk
|
|
|
|
endif
|
|
|
|
|
|
|
|
DEFAULT_VENDOR_NAME=mozilla.org
|
2007-06-20 23:22:32 +04:00
|
|
|
DEFAULT_VENDOR_VERSION=604
|
2002-03-27 00:54:41 +03:00
|
|
|
|
|
|
|
ifndef VENDOR_NAME
|
|
|
|
VENDOR_NAME = $(DEFAULT_VENDOR_NAME)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef VENDOR_VERSION
|
|
|
|
VENDOR_VERSION = $(DEFAULT_VENDOR_VERSION)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
COMPONENT_PULL_METHOD=FTP
|
2005-06-02 08:21:17 +04:00
|
|
|
win_srcdir:=$(subst $(topsrcdir),$(WIN_TOP_SRC),$(srcdir))
|
2002-03-27 00:54:41 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
# component tags for internal build only
|
|
|
|
include $(COMPVERSIONDIR)/component_versions.mk
|
|
|
|
|
|
|
|
# Ldap library
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
LDAP_LIBNAME = nsldap32v$(LDAPVERS)
|
|
|
|
else
|
|
|
|
LDAP_LIBNAME = ldap$(LDAPVERS)
|
|
|
|
endif
|
|
|
|
DIR_VERSION = $(LDAPVERS_SUFFIX)
|
|
|
|
DIRSDK_VERSION = $(LDAPVERS_SUFFIX)
|
|
|
|
|
|
|
|
# PrLdap library
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
PRLDAP_LIBNAME = nsldappr32v$(PRLDAPVERS)
|
|
|
|
else
|
|
|
|
PRLDAP_LIBNAME = prldap$(PRLDAPVERS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# lber library
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
LBER_LIBNAME = nslber32v$(LBERVERS)
|
|
|
|
else
|
|
|
|
LBER_LIBNAME = lber$(LBERVERS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# ldif library
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
LDIF_LIBNAME = nsldif32v$(LDIFVERS)
|
|
|
|
else
|
|
|
|
LDIF_LIBNAME = ldif$(LDIFVERS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# iutil library
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
IUTIL_LIBNAME = nsiutil32v$(IUTILVERS)
|
|
|
|
else
|
|
|
|
IUTIL_LIBNAME = iutil$(IUTILVERS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# util library
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
UTIL_LIBNAME = nsutil32v$(UTILVERS)
|
|
|
|
else
|
|
|
|
UTIL_LIBNAME = util$(UTILVERS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# ssl library
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
SSLDAP_LIBNAME = nsldapssl32v$(SSLDAPVERS)
|
|
|
|
else
|
|
|
|
SSLDAP_LIBNAME = ssldap$(SSLDAPVERS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# nss library
|
|
|
|
NSS_LIBNAME = nss$(NSSVERS)
|
|
|
|
ifeq ($(NSS_DYNAMIC_SOFTOKN),1)
|
|
|
|
SOFTOKN_LIBNAME = softokn$(NSSVERS)
|
|
|
|
endif
|
|
|
|
SSL_LIBNAME = ssl$(NSSVERS)
|
2006-01-11 23:20:13 +03:00
|
|
|
|
2006-02-03 22:28:32 +03:00
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
DYNAMICNSS = $(addsuffix .$(LIB_SUFFIX),$(SSL_LIBNAME) $(NSS_LIBNAME))
|
|
|
|
else
|
2006-01-11 23:20:13 +03:00
|
|
|
DYNAMICNSS = $(addprefix -l,$(SSL_LIBNAME) $(NSS_LIBNAME) $(SOFTOKN_LIBNAME))
|
2006-02-03 22:28:32 +03:00
|
|
|
endif
|
2006-01-11 23:20:13 +03:00
|
|
|
NSSLINK = $(NSS_LIBS) $(DYNAMICNSS)
|
|
|
|
|
2002-03-27 00:54:41 +03:00
|
|
|
HYBRID_LIBNAME = freebl_hybrid_$(NSSVERS)
|
|
|
|
PURE32_LIBNAME = freebl_pure32_$(NSSVERS)
|
|
|
|
|
|
|
|
ifneq ($(USE_64), 1)
|
|
|
|
ifeq ($(OS_ARCH), SunOS)
|
|
|
|
ifneq ($(OS_TEST),i86pc)
|
|
|
|
COPYFREEBL = 1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifeq ($(OS_ARCH), HP-UX)
|
2006-01-09 23:08:59 +03:00
|
|
|
ifneq ($(OS_TEST),ia64)
|
2002-03-27 00:54:41 +03:00
|
|
|
COPYFREEBL = 1
|
|
|
|
endif
|
|
|
|
endif
|
2006-01-09 23:08:59 +03:00
|
|
|
endif
|
2002-03-27 00:54:41 +03:00
|
|
|
|
|
|
|
# svrcore library
|
|
|
|
SVRCOREVERS =
|
|
|
|
SVRCOREVERS_SUFFIX =
|
|
|
|
SVRCORE_LIBNAME = svrcore$(SVRCOREVERS)
|
2006-02-03 22:28:32 +03:00
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
SVRCORE_LINK = $(SVRCORE_LIBS) $(SVRCORE_LIBNAME).$(LIB_SUFFIX)
|
|
|
|
else
|
|
|
|
SVRCORE_LINK = $(SVRCORE_LIBS) -l$(SVRCORE_LIBNAME)
|
|
|
|
endif
|
2002-03-27 00:54:41 +03:00
|
|
|
|
2006-10-04 00:43:42 +04:00
|
|
|
# sasl library
|
2007-01-24 23:53:02 +03:00
|
|
|
ifdef SASL_LIBS
|
2006-10-04 00:43:42 +04:00
|
|
|
SASL_LINK = $(SASL_LIBS)
|
|
|
|
endif
|
|
|
|
|
2002-03-27 00:54:41 +03:00
|
|
|
#
|
|
|
|
# NSPR library
|
|
|
|
#
|
|
|
|
|
|
|
|
PLCBASE=plc$(NSPR_LIBVERSION)
|
|
|
|
PLDSBASE=plds$(NSPR_LIBVERSION)
|
|
|
|
NSPRBASE=nspr$(NSPR_LIBVERSION)
|
|
|
|
|
2006-02-04 04:32:39 +03:00
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
2006-01-11 23:20:13 +03:00
|
|
|
PLC_BASENAME=lib$(PLCBASE)
|
|
|
|
PLDS_BASENAME=lib$(PLDSBASE)
|
|
|
|
NSPR_BASENAME=lib$(NSPRBASE)
|
2006-02-03 22:28:32 +03:00
|
|
|
DYNAMICNSPR = $(PLC_BASENAME).$(LIB_SUFFIX) $(PLDS_BASENAME).$(LIB_SUFFIX) $(NSPR_BASENAME).$(LIB_SUFFIX)
|
2006-02-04 04:32:39 +03:00
|
|
|
else
|
|
|
|
PLC_BASENAME=$(PLCBASE)
|
|
|
|
PLDS_BASENAME=$(PLDSBASE)
|
|
|
|
NSPR_BASENAME=$(NSPRBASE)
|
|
|
|
DYNAMICNSPR = -l$(PLCBASE) -l$(PLDSBASE) -l$(NSPRBASE)
|
2006-01-11 23:20:13 +03:00
|
|
|
endif
|
2002-03-27 00:54:41 +03:00
|
|
|
|
2006-01-11 23:20:13 +03:00
|
|
|
# use the NSPRLINK macro in other makefiles to define the linker command line
|
2006-02-11 02:08:16 +03:00
|
|
|
# the mozilla client build likes to set the makefile macro directly
|
|
|
|
ifdef LIBS_ALREADY_SET
|
|
|
|
NSPRLINK = $(NSPR_LIBS)
|
|
|
|
else
|
2006-01-11 23:20:13 +03:00
|
|
|
NSPRLINK = $(NSPR_LIBS) $(DYNAMICNSPR)
|
2006-02-11 02:08:16 +03:00
|
|
|
endif
|
2006-01-11 23:20:13 +03:00
|
|
|
|
|
|
|
# why the redundant definitions? apparently, all of these basename/libname macros are so that
|
|
|
|
# the ldapsdk can create a package containing all of the nspr shared libs/dlls - I don't think
|
|
|
|
# we should do this anymore, we should just depend on the user installing nspr first - then we
|
|
|
|
# can get rid of all of this junk
|
|
|
|
PLC_LIBNAME=$(PLCBASE)
|
|
|
|
PLDS_LIBNAME=$(PLDSBASE)
|
|
|
|
NSPR_LIBNAME=$(NSPRBASE)
|
2002-03-27 00:54:41 +03:00
|
|
|
|
|
|
|
RM = rm -f
|
|
|
|
SED = sed
|
|
|
|
|
|
|
|
# uncomment to enable support for LDAP referrals
|
|
|
|
LDAP_REFERRALS = -DLDAP_REFERRALS
|
|
|
|
DEFNETSSL = -DNET_SSL
|
|
|
|
NOLIBLCACHE = -DNO_LIBLCACHE
|
|
|
|
NSDOMESTIC = -DNS_DOMESTIC
|
|
|
|
|
|
|
|
|
|
|
|
ifdef BUILD_OPT
|
|
|
|
LDAP_DEBUG =
|
|
|
|
else
|
|
|
|
LDAP_DEBUG = -DLDAP_DEBUG
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifdef BUILD_CLU
|
|
|
|
BUILDCLU = 1
|
|
|
|
else
|
|
|
|
BUILDCLU =
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# DEFS are included in CFLAGS
|
|
|
|
#
|
2006-10-04 00:43:42 +04:00
|
|
|
DEFS = $(PLATFORMCFLAGS) $(LDAP_DEBUG) \
|
2002-03-27 00:54:41 +03:00
|
|
|
$(CLDAP) $(DEFNETSSL) $(NOLIBLCACHE) \
|
|
|
|
$(LDAP_REFERRALS) $(LDAP_DNS) $(STR_TRANSLATION) \
|
|
|
|
$(LIBLDAP_CHARSETS) $(LIBLDAP_DEF_CHARSET) \
|
|
|
|
$(NSDOMESTIC) $(LDAPSSLIO)
|
|
|
|
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
DIRVER_PROG=$(COMMON_OBJDIR)/dirver.exe
|
|
|
|
else
|
|
|
|
DIRVER_PROG=$(COMMON_OBJDIR)/dirver
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
EXE_SUFFIX=.exe
|
|
|
|
RSC=rc
|
2003-03-08 00:12:09 +03:00
|
|
|
ifdef NS_USE_GCC
|
|
|
|
OFFLAG=-o #
|
|
|
|
else
|
2002-03-27 00:54:41 +03:00
|
|
|
OFFLAG=/Fo
|
2007-06-20 21:57:12 +04:00
|
|
|
MT = mt.exe
|
2003-03-08 00:12:09 +03:00
|
|
|
endif
|
2002-03-27 00:54:41 +03:00
|
|
|
else
|
|
|
|
OFFLAG=-o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), Linux)
|
|
|
|
DEFS += -DLINUX2_0 -DLINUX1_2 -DLINUX2_1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
2003-03-08 00:12:09 +03:00
|
|
|
ifndef NS_USE_GCC
|
2005-06-01 18:28:35 +04:00
|
|
|
DLLEXPORTS_PREFIX=-DEF:
|
2002-03-27 00:54:41 +03:00
|
|
|
USE_DLL_EXPORTS_FILE = 1
|
|
|
|
endif
|
2003-03-08 00:12:09 +03:00
|
|
|
endif
|
2002-03-27 00:54:41 +03:00
|
|
|
|
2003-04-01 22:11:26 +04:00
|
|
|
ifeq ($(OS_ARCH), OS2)
|
|
|
|
USE_DLL_EXPORTS_FILE = 1
|
|
|
|
endif
|
|
|
|
|
2002-03-27 00:54:41 +03:00
|
|
|
ifeq ($(OS_ARCH), SunOS)
|
2006-01-18 06:46:52 +03:00
|
|
|
ifndef NS_USE_GCC
|
2002-03-27 00:54:41 +03:00
|
|
|
DLLEXPORTS_PREFIX=-Blocal -M
|
|
|
|
USE_DLL_EXPORTS_FILE = 1
|
2006-01-18 06:46:52 +03:00
|
|
|
# else
|
|
|
|
# use the --version-script GNU ld argument - need to add support for
|
|
|
|
# GNU (linux and solaris and ???) to genexports.pl et. al.
|
|
|
|
endif # NS_USE_GCC
|
2002-03-27 00:54:41 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), IRIX)
|
|
|
|
DLLEXPORTS_PREFIX=-exports_file
|
|
|
|
USE_DLL_EXPORTS_FILE = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), HP-UX)
|
|
|
|
DEFS += -Dhpux -D_REENTRANT
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH),AIX)
|
|
|
|
DLLEXPORTS_PREFIX=-bE:
|
|
|
|
DL=-ldl
|
|
|
|
USE_DLL_EXPORTS_FILE = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH),OSF1)
|
|
|
|
DEFS += -DOSF1V4
|
|
|
|
DL=
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH),ReliantUNIX)
|
|
|
|
DL=-ldl
|
2006-08-01 19:47:14 +04:00
|
|
|
ifdef RPATHFLAG
|
2004-07-09 22:09:39 +04:00
|
|
|
USE_LD_RUN_PATH=1
|
2006-08-01 19:47:14 +04:00
|
|
|
endif
|
2004-07-09 22:09:39 +04:00
|
|
|
USE_CCC_TO_LINK=1
|
|
|
|
CCC=$(CXX)
|
2002-03-27 00:54:41 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH),UnixWare)
|
|
|
|
DL=
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), SunOS)
|
|
|
|
|
|
|
|
# flag to pass to cc when linking to set runtime shared library search path
|
|
|
|
# this is used like this, for example: $(RPATHFLAG_PREFIX)../..
|
2004-07-09 22:09:39 +04:00
|
|
|
# Also, use the C++ compiler to link for 64-bit builds.
|
|
|
|
ifeq ($(USE_64), 1)
|
|
|
|
USE_CCC_TO_LINK=1
|
2006-08-01 19:47:14 +04:00
|
|
|
ifdef RPATHFLAG
|
2004-07-09 22:09:39 +04:00
|
|
|
RPATHFLAG_PREFIX=-R:
|
2006-08-01 19:47:14 +04:00
|
|
|
endif
|
2004-07-09 22:09:39 +04:00
|
|
|
else
|
2006-08-01 19:47:14 +04:00
|
|
|
ifdef RPATHFLAG
|
2002-03-27 00:54:41 +03:00
|
|
|
RPATHFLAG_PREFIX=-Wl,-R,
|
2004-07-09 22:09:39 +04:00
|
|
|
endif
|
2006-08-01 19:47:14 +04:00
|
|
|
endif
|
2002-03-27 00:54:41 +03:00
|
|
|
|
2005-05-11 00:07:34 +04:00
|
|
|
ifdef NS_USE_GCC
|
|
|
|
USE_CCC_TO_LINK=1
|
2006-08-01 19:47:14 +04:00
|
|
|
ifdef RPATHFLAG
|
2006-01-18 06:46:52 +03:00
|
|
|
RPATHFLAG_PREFIX=-Wl,-R,
|
2005-05-11 00:07:34 +04:00
|
|
|
endif
|
2006-08-01 19:47:14 +04:00
|
|
|
endif
|
2005-05-11 00:07:34 +04:00
|
|
|
|
2002-03-27 00:54:41 +03:00
|
|
|
# flag to pass to ld when linking to set runtime shared library search path
|
|
|
|
# this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
|
2006-08-01 19:47:14 +04:00
|
|
|
ifdef RPATHFLAG
|
2002-03-27 00:54:41 +03:00
|
|
|
LDRPATHFLAG_PREFIX=-R
|
2006-08-01 19:47:14 +04:00
|
|
|
endif
|
2002-03-27 00:54:41 +03:00
|
|
|
|
|
|
|
# OS network libraries
|
|
|
|
PLATFORMLIBS+=-lresolv -lsocket -lnsl -lgen -ldl -lposix4
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), OSF1)
|
2004-07-09 22:09:39 +04:00
|
|
|
# Use the C++ compiler to link
|
|
|
|
USE_CCC_TO_LINK=1
|
|
|
|
|
2002-03-27 00:54:41 +03:00
|
|
|
# flag to pass to cc when linking to set runtime shared library search path
|
|
|
|
# this is used like this, for example: $(RPATHFLAG_PREFIX)../..
|
2006-08-01 19:47:14 +04:00
|
|
|
ifdef RPATHFLAG
|
2002-03-27 00:54:41 +03:00
|
|
|
RPATHFLAG_PREFIX=-Wl,-rpath,
|
|
|
|
|
|
|
|
# flag to pass to ld when linking to set runtime shared library search path
|
|
|
|
# this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
|
|
|
|
LDRPATHFLAG_PREFIX=-rpath
|
2006-08-01 19:47:14 +04:00
|
|
|
endif
|
2002-03-27 00:54:41 +03:00
|
|
|
|
|
|
|
# allow for unresolved symbols
|
|
|
|
DLL_LDFLAGS += -expect_unresolved "*"
|
|
|
|
endif # OSF1
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), AIX)
|
|
|
|
# Flags to set runtime shared library search path. For example:
|
|
|
|
# $(CC) $(RPATHFLAG_PREFIX)../..$(RPATHFLAG_EXTRAS)
|
2006-08-01 19:47:14 +04:00
|
|
|
ifdef RPATHFLAG
|
2002-03-27 00:54:41 +03:00
|
|
|
RPATHFLAG_PREFIX=-blibpath:
|
|
|
|
RPATHFLAG_EXTRAS=:/usr/lib:/lib
|
|
|
|
|
|
|
|
# flag to pass to ld when linking to set runtime shared library search path
|
|
|
|
# this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
|
|
|
|
LDRPATHFLAG_PREFIX=-blibpath:/usr/lib:/lib:
|
2006-08-01 19:47:14 +04:00
|
|
|
endif
|
|
|
|
|
2002-03-27 00:54:41 +03:00
|
|
|
DLL_LDFLAGS= -bM:SRE -bnoentry \
|
|
|
|
-L.:/usr/lib/threads:/usr/lpp/xlC/lib:/usr/lib:/lib
|
|
|
|
DLL_EXTRA_LIBS= -bI:/usr/lib/lowsys.exp -lC_r -lC -lpthreads -lc_r -lm \
|
|
|
|
/usr/lib/libc.a
|
|
|
|
|
|
|
|
EXE_EXTRA_LIBS= -bI:/usr/lib/syscalls.exp -lsvld -lpthreads
|
|
|
|
endif # AIX
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), HP-UX)
|
2004-07-09 22:09:39 +04:00
|
|
|
# Use the C++ compiler to link
|
|
|
|
USE_CCC_TO_LINK=1
|
|
|
|
|
2006-08-01 19:47:14 +04:00
|
|
|
ifdef RPATHFLAG
|
2002-03-27 00:54:41 +03:00
|
|
|
# flag to pass to cc when linking to set runtime shared library search path
|
|
|
|
# this is used like this, for example: $(RPATHFLAG_PREFIX)../..
|
|
|
|
RPATHFLAG_PREFIX=-Wl,+s,+b,
|
|
|
|
|
|
|
|
# flag to pass to ld when linking to set runtime shared library search path
|
|
|
|
# this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
|
|
|
|
LDRPATHFLAG_PREFIX=+s +b
|
2006-08-01 19:47:14 +04:00
|
|
|
endif
|
2002-03-27 00:54:41 +03:00
|
|
|
|
|
|
|
# we need to link in the rt library to get sem_*()
|
|
|
|
PLATFORMLIBS += -lrt
|
|
|
|
PLATFORMCFLAGS=
|
|
|
|
|
|
|
|
endif # HP-UX
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), Linux)
|
2004-07-09 22:09:39 +04:00
|
|
|
# Use the C++ compiler to link
|
|
|
|
USE_CCC_TO_LINK=1
|
|
|
|
|
2002-03-27 00:54:41 +03:00
|
|
|
# flag to pass to cc when linking to set runtime shared library search path
|
|
|
|
# this is used like this, for example: $(RPATHFLAG_PREFIX)../..
|
2006-08-01 19:47:14 +04:00
|
|
|
ifdef RPATHFLAG
|
2002-03-27 00:54:41 +03:00
|
|
|
RPATHFLAG_PREFIX=-Wl,-rpath,
|
|
|
|
|
|
|
|
# flag to pass to ld when linking to set runtime shared library search path
|
|
|
|
# this is used like this, for example: $(LDRPATHFLAG_PREFIX)../..
|
|
|
|
# note, there is a trailing space
|
|
|
|
LDRPATHFLAG_PREFIX=-rpath
|
2006-08-01 19:47:14 +04:00
|
|
|
endif # RPATHFLAG
|
2002-03-27 00:54:41 +03:00
|
|
|
endif # Linux
|
|
|
|
|
2006-02-11 02:14:00 +03:00
|
|
|
ifeq ($(OS_ARCH), Darwin)
|
|
|
|
# Darwin doesn't use RPATH.
|
2006-08-01 19:47:14 +04:00
|
|
|
#ifdef RPATHFLAG
|
2006-02-11 02:14:00 +03:00
|
|
|
RPATHFLAG_PREFIX=
|
2006-08-01 19:47:14 +04:00
|
|
|
#endif
|
2006-02-11 02:14:00 +03:00
|
|
|
|
|
|
|
# Use the C++ compiler to link
|
|
|
|
USE_CCC_TO_LINK=1
|
|
|
|
endif # Darwin
|
2004-07-09 22:09:39 +04:00
|
|
|
|
|
|
|
# Use the C++ compiler to link... or not.
|
|
|
|
ifdef USE_CCC_TO_LINK
|
|
|
|
CC_FOR_LINK=$(CCC)
|
|
|
|
else
|
|
|
|
CC_FOR_LINK=$(CC)
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2002-03-27 00:54:41 +03:00
|
|
|
#
|
|
|
|
# XXX: does anyone know of a better way to solve the "LINK_LIB2" problem? -mcs
|
|
|
|
#
|
|
|
|
# Link to produce a console/windows exe on Windows
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
|
2003-03-08 00:12:09 +03:00
|
|
|
ifdef NS_USE_GCC
|
2006-01-13 18:35:45 +03:00
|
|
|
LINK_EXE = $(CC_FOR_LINK) -o $@ $(LDFLAGS) $(LCFLAGS) $(DEPLIBS) \
|
|
|
|
$(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
2003-03-08 00:12:09 +03:00
|
|
|
LINK_LIB = $(AR) cr $@ $(OBJS)
|
2004-07-09 22:09:39 +04:00
|
|
|
LINK_DLL = $(CC_FOR_LINK) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(@:.$(DLL_SUFFIX)=.$(LIB_SUFFIX)) $(LLFLAGS) $(DLL_LDFLAGS) -o $@ $(OBJS) $(EXTRA_LIBS) $(EXTRA_DLL_LIBS)
|
2003-03-08 00:12:09 +03:00
|
|
|
else
|
2005-06-01 18:28:35 +04:00
|
|
|
DEBUG_LINK_OPT=-DEBUG
|
2002-03-27 00:54:41 +03:00
|
|
|
ifeq ($(BUILD_OPT), 1)
|
2004-08-27 17:24:29 +04:00
|
|
|
ifndef MOZ_DEBUG_SYMBOLS
|
|
|
|
DEBUG_LINK_OPT=
|
|
|
|
endif
|
|
|
|
DEBUG_LINK_OPT += -OPT:REF
|
2002-03-27 00:54:41 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
SUBSYSTEM=CONSOLE
|
2004-08-27 17:24:29 +04:00
|
|
|
ifndef MOZ_DEBUG_SYMBOLS
|
2005-06-15 01:29:42 +04:00
|
|
|
DEBUG_FLAGS=-PDB:NONE
|
2004-08-27 17:24:29 +04:00
|
|
|
endif
|
|
|
|
|
2005-06-01 18:28:35 +04:00
|
|
|
LINK_EXE = $(CYGWIN_WRAPPER) link $(DEBUG_LINK_OPT) -OUT:"$@" -MAP $(ALDFLAGS) $(LDFLAGS) $(ML_DEBUG) \
|
|
|
|
$(LCFLAGS) -NOLOGO $(DEBUG_FLAGS) -INCREMENTAL:NO \
|
|
|
|
-NODEFAULTLIB:MSVCRTD -SUBSYSTEM:$(SUBSYSTEM) $(DEPLIBS) \
|
2007-06-20 21:57:12 +04:00
|
|
|
$(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS) msvcrt.lib
|
|
|
|
|
|
|
|
ifdef MT
|
|
|
|
LINK_EXE += ; if test -f $@.manifest ; then \
|
|
|
|
$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
|
|
|
|
rm -f $@.manifest ; fi
|
|
|
|
endif # MSVC with manifest tool - from NSS rules.mk
|
2006-02-03 22:28:32 +03:00
|
|
|
|
|
|
|
# AR is set when doing an autoconf build
|
|
|
|
ifdef AR
|
|
|
|
LINK_LIB = $(CYGWIN_WRAPPER) $(AR) $(OBJS)
|
|
|
|
else
|
2004-03-15 09:17:21 +03:00
|
|
|
LINK_LIB = $(CYGWIN_WRAPPER) lib -OUT:"$@" $(OBJS)
|
2006-02-03 22:28:32 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef LD
|
|
|
|
LD=link
|
|
|
|
endif
|
|
|
|
|
|
|
|
LINK_DLL = $(CYGWIN_WRAPPER) $(LD) $(DEBUG_LINK_OPT) -nologo -MAP -DLL $(DEBUG_FLAGS) \
|
2005-06-01 18:28:35 +04:00
|
|
|
$(ML_DEBUG) -SUBSYSTEM:$(SUBSYSTEM) $(LLFLAGS) $(DLL_LDFLAGS) \
|
|
|
|
$(EXTRA_LIBS) -out:"$@" $(OBJS)
|
2003-03-08 00:12:09 +03:00
|
|
|
endif # NS_USE_GCC
|
2002-03-27 00:54:41 +03:00
|
|
|
else # WINNT
|
|
|
|
#
|
|
|
|
# UNIX link commands
|
|
|
|
#
|
2002-04-18 01:53:50 +04:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
2004-03-15 09:25:32 +03:00
|
|
|
LINK_LIB = -$(RM) $@ && $(AR) $(AR_FLAGS) $(OBJS) && $(RANLIB) $@
|
|
|
|
LINK_LIB2 = -$(RM) $@ && $(AR) $@ $(OBJS2) && $(RANLIB) $@
|
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
2002-04-18 01:53:50 +04:00
|
|
|
LINK_DLL = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS) $(OBJS)
|
2004-03-15 09:25:32 +03:00
|
|
|
else
|
|
|
|
LINK_DLL = $(LD) $(DSO_LDOPTS) $(ALDFLAGS) $(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS) \
|
|
|
|
-o $@ $(OBJS)
|
|
|
|
endif
|
2002-04-18 01:53:50 +04:00
|
|
|
|
|
|
|
else
|
|
|
|
|
2002-03-27 00:54:41 +03:00
|
|
|
LINK_LIB = $(RM) $@; $(AR) $(AR_FLAGS) $(OBJS); $(RANLIB) $@
|
|
|
|
LINK_LIB2 = $(RM) $@; $(AR) $@ $(OBJS2); $(RANLIB) $@
|
2007-01-27 11:49:53 +03:00
|
|
|
ifneq ($(LD),$(CC))
|
2002-03-27 00:54:41 +03:00
|
|
|
ifdef SONAMEFLAG_PREFIX
|
2007-01-27 11:49:53 +03:00
|
|
|
LINK_DLL = $(LD) $(DSO_LDOPTS) $(LDRPATHFLAG_PREFIX)$(RPATHFLAG) $(ALDFLAGS) \
|
|
|
|
$(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS) \
|
2002-03-27 00:54:41 +03:00
|
|
|
-o $@ $(SONAMEFLAG_PREFIX)$(notdir $@) $(OBJS)
|
|
|
|
else # SONAMEFLAG_PREFIX
|
2007-01-27 11:49:53 +03:00
|
|
|
LINK_DLL = $(LD) $(DSO_LDOPTS) $(LDRPATHFLAG_PREFIX)$(RPATHFLAG) $(ALDFLAGS) \
|
|
|
|
$(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS) \
|
|
|
|
-o $@ $(OBJS)
|
|
|
|
endif # SONAMEFLAG_PREFIX
|
|
|
|
else # $(CC) is used to link libs
|
|
|
|
ifdef SONAMEFLAG_PREFIX
|
|
|
|
LINK_DLL = $(LD) $(DSO_LDOPTS) $(RPATHFLAG_PREFIX)$(RPATHFLAG) $(ALDFLAGS) \
|
|
|
|
$(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS) \
|
|
|
|
-o $@ $(SONAMEFLAG_PREFIX)$(notdir $@) $(OBJS)
|
|
|
|
else # SONAMEFLAG_PREFIX
|
|
|
|
LINK_DLL = $(LD) $(DSO_LDOPTS) $(RPATHFLAG_PREFIX)$(RPATHFLAG) $(ALDFLAGS) \
|
|
|
|
$(DLL_LDFLAGS) $(DLL_EXPORT_FLAGS) \
|
2002-03-27 00:54:41 +03:00
|
|
|
-o $@ $(OBJS)
|
|
|
|
endif # SONAMEFLAG_PREFIX
|
2007-01-27 11:49:53 +03:00
|
|
|
endif # LD!CC
|
2002-04-18 01:53:50 +04:00
|
|
|
endif #!os2
|
2002-03-27 00:54:41 +03:00
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), OSF1)
|
|
|
|
# The linker on OSF/1 gets confused if it finds an so_locations file
|
|
|
|
# that doesn't meet its expectations, so we arrange to remove it before
|
|
|
|
# linking.
|
|
|
|
SO_FILES_TO_REMOVE=so_locations
|
|
|
|
endif
|
|
|
|
|
2002-06-14 02:02:08 +04:00
|
|
|
ifneq (,$(filter BeOS Darwin NetBSD,$(OS_ARCH)))
|
2002-04-18 01:53:50 +04:00
|
|
|
LINK_DLL = $(MKSHLIB) $(OBJS)
|
|
|
|
endif
|
|
|
|
|
2002-03-27 00:54:41 +03:00
|
|
|
ifeq ($(OS_ARCH), HP-UX)
|
|
|
|
# On HPUX, we need a couple of changes:
|
|
|
|
# 1) Use the C++ compiler for linking, which will pass the +eh flag on down to the
|
|
|
|
# linker so the correct exception-handling-aware libC gets used (libnshttpd.sl
|
|
|
|
# needs this).
|
|
|
|
# 2) Add a "-Wl,-E" option so the linker gets a "-E" flag. This makes symbols
|
|
|
|
# in an executable visible to shared libraries loaded at runtime.
|
2006-01-13 18:35:45 +03:00
|
|
|
LINK_EXE = $(CC_FOR_LINK) -Wl,-E $(ALDFLAGS) $(LDFLAGS) $(RPATHFLAG_PREFIX)$(RPATHFLAG) -o $@ $(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
2002-03-27 00:54:41 +03:00
|
|
|
|
|
|
|
ifeq ($(USE_64), 1)
|
2006-01-09 23:08:59 +03:00
|
|
|
ifeq ($(OS_RELEASE), B.11.23)
|
2006-01-18 22:38:33 +03:00
|
|
|
LINK_EXE = $(CC_FOR_LINK) -DHPUX_ACC -D__STDC_EXT__ -D_POSIX_C_SOURCE=199506L +DD64 -Wl,-E $(ALDFLAGS) $(LDFLAGS) $(RPATHFLAG_PREFIX)$(RPATHFLAG) -o $@ $(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
2006-01-09 23:08:59 +03:00
|
|
|
else
|
2006-01-13 18:35:45 +03:00
|
|
|
LINK_EXE = $(CC_FOR_LINK) -DHPUX_ACC -D__STDC_EXT__ -D_POSIX_C_SOURCE=199506L +DA2.0W +DS2.0 -Wl,-E $(ALDFLAGS) $(LDFLAGS) $(RPATHFLAG_PREFIX)$(RPATHFLAG) -o $@ $(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
2002-03-27 00:54:41 +03:00
|
|
|
endif
|
2006-01-09 23:08:59 +03:00
|
|
|
endif
|
2002-03-27 00:54:41 +03:00
|
|
|
|
|
|
|
else # HP-UX
|
|
|
|
# everything except HPUX
|
|
|
|
|
|
|
|
ifdef USE_LD_RUN_PATH
|
|
|
|
#does RPATH differently. instead we export RPATHFLAG as LD_RUN_PATH
|
|
|
|
#see ns/netsite/ldap/clients/tools/Makefile for an example
|
|
|
|
export LD_RUN_PATH=$(RPATHFLAG)
|
2004-07-09 22:09:39 +04:00
|
|
|
LINK_EXE = $(CC_FOR_LINK) $(ALDFLAGS) $(LDFLAGS) \
|
2006-01-13 18:35:45 +03:00
|
|
|
-o $@ $(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
2004-07-09 22:09:39 +04:00
|
|
|
LINK_EXE_NOLIBSOBJS = $(CC_FOR_LINK) $(ALDFLAGS) $(LDFLAGS) -o $@
|
2002-03-27 00:54:41 +03:00
|
|
|
else # USE_LD_RUN_PATH
|
2004-07-09 22:09:39 +04:00
|
|
|
LINK_EXE = $(CC_FOR_LINK) $(ALDFLAGS) $(LDFLAGS) \
|
2002-03-27 00:54:41 +03:00
|
|
|
$(RPATHFLAG_PREFIX)$(RPATHFLAG)$(RPATHFLAG_EXTRAS) \
|
2006-01-13 18:35:45 +03:00
|
|
|
-o $@ $(filter %.$(OBJ_SUFFIX),$^) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
|
2004-07-09 22:09:39 +04:00
|
|
|
LINK_EXE_NOLIBSOBJS = $(CC_FOR_LINK) $(ALDFLAGS) $(LDFLAGS) \
|
2002-03-27 00:54:41 +03:00
|
|
|
$(RPATHFLAG_PREFIX)$(RPATHFLAG)$(RPATHFLAG_EXTRAS) -o $@
|
|
|
|
endif # USE_LD_RUN_PATH
|
|
|
|
endif # HP-UX
|
|
|
|
endif # WINNT
|
|
|
|
|
2002-05-09 20:50:55 +04:00
|
|
|
ifndef PERL
|
|
|
|
PERL = perl
|
|
|
|
endif
|
|
|
|
|
2002-03-27 00:54:41 +03:00
|
|
|
#
|
|
|
|
# shared library symbol export definitions
|
|
|
|
#
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
GENEXPORTS=cmd /c $(PERL) $(LDAP_SRC)/build/genexports.pl
|
|
|
|
else
|
|
|
|
GENEXPORTS=$(PERL) $(LDAP_SRC)/build/genexports.pl
|
|
|
|
endif
|
|
|
|
|