/security/manager/Makefile.in

http://github.com/zpao/v8monkey · Autoconf · 420 lines · 323 code · 33 blank · 64 comment · 4 complexity · 1c388b65a4f11b1a4eb99d6a774ffd3f MD5 · raw file

  1. #
  2. # ***** BEGIN LICENSE BLOCK *****
  3. # Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4. #
  5. # The contents of this file are subject to the Mozilla Public License Version
  6. # 1.1 (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. # http://www.mozilla.org/MPL/
  9. #
  10. # Software distributed under the License is distributed on an "AS IS" basis,
  11. # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12. # for the specific language governing rights and limitations under the
  13. # License.
  14. #
  15. # The Original Code is mozilla.org code.
  16. #
  17. # The Initial Developer of the Original Code is
  18. # Netscape Communications Corporation.
  19. # Portions created by the Initial Developer are Copyright (C) 1998
  20. # the Initial Developer. All Rights Reserved.
  21. #
  22. # Contributor(s):
  23. # Brian Ryner <bryner@brianryner.com>
  24. #
  25. # Alternatively, the contents of this file may be used under the terms of
  26. # either the GNU General Public License Version 2 or later (the "GPL"), or
  27. # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28. # in which case the provisions of the GPL or the LGPL are applicable instead
  29. # of those above. If you wish to allow use of your version of this file only
  30. # under the terms of either the GPL or the LGPL, and not to allow others to
  31. # use your version of this file under the terms of the MPL, indicate your
  32. # decision by deleting the provisions above and replace them with the notice
  33. # and other provisions required by the GPL or the LGPL. If you do not delete
  34. # the provisions above, a recipient may use your version of this file under
  35. # the terms of any one of the MPL, the GPL or the LGPL.
  36. #
  37. # ***** END LICENSE BLOCK *****
  38. DEPTH = ../..
  39. topsrcdir = @top_srcdir@
  40. srcdir = @srcdir@
  41. VPATH = @srcdir@
  42. include $(DEPTH)/config/autoconf.mk
  43. CC_WRAPPER =
  44. CXX_WRAPPER =
  45. include $(topsrcdir)/config/config.mk
  46. MODULE = psm
  47. ifndef MOZ_NATIVE_NSS
  48. LOADABLE_ROOT_MODULE = $(DLL_PREFIX)nssckbi$(DLL_SUFFIX)
  49. endif
  50. NSS3_LIB = $(DLL_PREFIX)nss3$(DLL_SUFFIX)
  51. NSSUTIL3_LIB = $(DLL_PREFIX)nssutil3$(DLL_SUFFIX)
  52. SMIME3_LIB = $(DLL_PREFIX)smime3$(DLL_SUFFIX)
  53. SSL3_LIB = $(DLL_PREFIX)ssl3$(DLL_SUFFIX)
  54. SOFTOKEN3_LIB = $(DLL_PREFIX)softokn3$(DLL_SUFFIX)
  55. ifndef NSS_DISABLE_DBM
  56. NSSDBM3_LIB = $(DLL_PREFIX)nssdbm3$(DLL_SUFFIX)
  57. else
  58. NSSDBM3_LIB =
  59. endif
  60. ifndef MOZ_NATIVE_NSS
  61. ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
  62. SDK_LIBS = \
  63. $(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
  64. $(DIST)/lib/$(LIB_PREFIX)smime3.$(LIB_SUFFIX) \
  65. $(DIST)/lib/$(LIB_PREFIX)ssl3.$(LIB_SUFFIX) \
  66. $(DIST)/lib/$(LIB_PREFIX)nss3.$(LIB_SUFFIX) \
  67. $(DIST)/lib/$(LIB_PREFIX)nssutil3.$(LIB_SUFFIX) \
  68. $(NULL)
  69. else
  70. SDK_LIBS = \
  71. $(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
  72. $(DIST)/lib/$(LIB_PREFIX)smime.$(LIB_SUFFIX) \
  73. $(DIST)/lib/$(LIB_PREFIX)ssl.$(LIB_SUFFIX) \
  74. $(DIST)/lib/$(LIB_PREFIX)nss.$(LIB_SUFFIX) \
  75. $(DIST)/lib/$(LIB_PREFIX)nssutil.$(LIB_SUFFIX) \
  76. $(NULL)
  77. endif
  78. endif
  79. # Default
  80. HAVE_FREEBL_LIBS = 1
  81. # 32-bit HP-UX PA-RISC
  82. ifeq ($(OS_ARCH), HP-UX)
  83. ifneq ($(OS_TEST), ia64)
  84. ifndef HAVE_64BIT_OS
  85. HAVE_FREEBL_LIBS =
  86. HAVE_FREEBL_LIBS_32 = 1
  87. endif
  88. endif
  89. endif
  90. # SunOS SPARC
  91. ifeq ($(OS_ARCH), SunOS)
  92. ifneq (86,$(findstring 86,$(OS_TEST)))
  93. ifdef HAVE_64BIT_OS
  94. HAVE_FREEBL_LIBS =
  95. HAVE_FREEBL_LIBS_64 = 1
  96. else
  97. HAVE_FREEBL_LIBS =
  98. HAVE_FREEBL_LIBS_32 = 1
  99. HAVE_FREEBL_LIBS_32INT64 = 1
  100. endif
  101. endif
  102. endif
  103. ifdef HAVE_FREEBL_LIBS
  104. FREEBL_LIB = $(DLL_PREFIX)freebl3$(DLL_SUFFIX)
  105. endif
  106. ifdef HAVE_FREEBL_LIBS_32
  107. FREEBL_32INT_LIB = libfreebl_32int_3$(DLL_SUFFIX)
  108. FREEBL_32FPU_LIB = libfreebl_32fpu_3$(DLL_SUFFIX)
  109. endif
  110. ifdef HAVE_FREEBL_LIBS_32INT64
  111. FREEBL_32INT64_LIB = libfreebl_32int64_3$(DLL_SUFFIX)
  112. endif
  113. ifdef HAVE_FREEBL_LIBS_64
  114. FREEBL_64INT_LIB = libfreebl_64int_3$(DLL_SUFFIX)
  115. FREEBL_64FPU_LIB = libfreebl_64fpu_3$(DLL_SUFFIX)
  116. endif
  117. ABS_DIST := $(call core_abspath,$(DIST))
  118. ifeq ($(HOST_OS_ARCH),WINNT)
  119. ifdef CYGDRIVE_MOUNT
  120. ABS_DIST := $(shell cygpath -w $(ABS_DIST) | sed -e 's|\\|/|g')
  121. endif
  122. ifneq (,$(filter mingw%,$(host_os)))
  123. ABS_DIST := $(shell cd $(DIST) && pwd -W)
  124. endif
  125. endif
  126. # For all variables such as DLLFLAGS, that may contain $(DIST)
  127. DIST := $(ABS_DIST)
  128. NSPR_INCLUDE_DIR = $(firstword $(filter -I%,$(NSPR_CFLAGS)))
  129. ifneq (,$(strip $(NSPR_INCLUDE_DIR)))
  130. NSPR_INCLUDE_DIR := $(subst -I,,$(subst -I$(DIST),-I$(ABS_DIST),$(NSPR_INCLUDE_DIR)))
  131. else
  132. NSPR_INCLUDE_DIR = $(ABS_DIST)/include/nspr
  133. endif
  134. NSPR_LIB_DIR = $(firstword $(filter -L%,$(NSPR_LIBS)))
  135. ifneq (,$(strip $(NSPR_LIB_DIR)))
  136. NSPR_LIB_DIR := $(subst -L,,$(subst -L$(DIST),-L$(ABS_DIST),$(NSPR_LIB_DIR)))
  137. else
  138. NSPR_LIB_DIR = $(ABS_DIST)/lib
  139. endif
  140. # Can't pass this in DEFAULT_GMAKE_FLAGS because that overrides
  141. # definitions in NSS, so just export it into the sub-make's environment.
  142. ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_MEMORY))
  143. export DLLFLAGS
  144. endif
  145. # To get debug symbols from NSS
  146. export MOZ_DEBUG_SYMBOLS
  147. ifdef .PYMAKE
  148. NSSMAKE = $(GMAKE)
  149. else
  150. NSSMAKE = $(MAKE)
  151. endif
  152. # NSS makefiles are not safe for parallel execution.
  153. DEFAULT_GMAKE_FLAGS = MAKE="$(NSSMAKE) -j1" -j1
  154. DEFAULT_GMAKE_FLAGS += CC="$(CC)"
  155. DEFAULT_GMAKE_FLAGS += SOURCE_MD_DIR=$(ABS_DIST)
  156. DEFAULT_GMAKE_FLAGS += SOURCE_MDHEADERS_DIR=$(NSPR_INCLUDE_DIR)
  157. DEFAULT_GMAKE_FLAGS += DIST=$(ABS_DIST)
  158. DEFAULT_GMAKE_FLAGS += NSPR_INCLUDE_DIR=$(NSPR_INCLUDE_DIR)
  159. DEFAULT_GMAKE_FLAGS += NSPR_LIB_DIR=$(NSPR_LIB_DIR)
  160. DEFAULT_GMAKE_FLAGS += MOZILLA_CLIENT=1
  161. DEFAULT_GMAKE_FLAGS += NO_MDUPDATE=1
  162. DEFAULT_GMAKE_FLAGS += NSS_ENABLE_ECC=1
  163. DEFAULT_GMAKE_FLAGS += NSINSTALL="$(NSINSTALL)"
  164. ifndef MOZ_NATIVE_SQLITE
  165. DEFAULT_GMAKE_FLAGS += SQLITE_LIB_NAME=mozsqlite3
  166. DEFAULT_GMAKE_FLAGS += SQLITE_INCLUDE_DIR=$(ABS_DIST)/include
  167. endif
  168. ifdef NSS_DISABLE_DBM
  169. DEFAULT_GMAKE_FLAGS += NSS_DISABLE_DBM=1
  170. endif
  171. ABS_topsrcdir := $(call core_abspath,$(topsrcdir))
  172. ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
  173. DEFAULT_GMAKE_FLAGS += BUILD_TREE=$(MOZ_BUILD_ROOT)
  174. endif
  175. ifndef MOZ_DEBUG
  176. DEFAULT_GMAKE_FLAGS += BUILD_OPT=1 OPT_CODE_SIZE=1
  177. endif
  178. ifdef GNU_CC
  179. DEFAULT_GMAKE_FLAGS += NS_USE_GCC=1
  180. else
  181. DEFAULT_GMAKE_FLAGS += NS_USE_GCC=
  182. endif
  183. ifdef USE_N32
  184. # It is not really necessary to specify USE_PTHREADS=1. USE_PTHREADS
  185. # merely adds _PTH to coreconf's OBJDIR name.
  186. DEFAULT_GMAKE_FLAGS += USE_N32=1 USE_PTHREADS=1
  187. endif
  188. ifdef HAVE_64BIT_OS
  189. DEFAULT_GMAKE_FLAGS += USE_64=1
  190. endif
  191. ifeq ($(OS_ARCH),WINNT)
  192. DEFAULT_GMAKE_FLAGS += OS_TARGET=WIN95
  193. ifdef MOZ_DEBUG
  194. ifndef MOZ_NO_DEBUG_RTL
  195. DEFAULT_GMAKE_FLAGS += USE_DEBUG_RTL=1
  196. endif
  197. endif
  198. endif # WINNT
  199. ifeq ($(OS_ARCH),OS2)
  200. ifdef MOZ_OS2_HIGH_MEMORY
  201. DEFAULT_GMAKE_FLAGS += MOZ_OS2_HIGH_MEMORY=1
  202. endif
  203. endif # OS2
  204. ifeq ($(OS_ARCH),Darwin)
  205. # Make nsinstall use absolute symlinks by default when building NSS
  206. # for Mozilla on Mac OS X. (Bugzilla bug 193164)
  207. ifndef NSDISTMODE
  208. DEFAULT_GMAKE_FLAGS += NSDISTMODE=absolute_symlink
  209. endif
  210. ifdef MACOS_SDK_DIR
  211. DEFAULT_GMAKE_FLAGS += MACOS_SDK_DIR=$(MACOS_SDK_DIR)
  212. endif
  213. endif
  214. # Turn off TLS compression support because it requires system zlib.
  215. # See bug 580679 comment 18.
  216. DEFAULT_GMAKE_FLAGS += NSS_ENABLE_ZLIB=
  217. # Disable building of the test programs in security/nss/lib/zlib
  218. DEFAULT_GMAKE_FLAGS += PROGRAMS=
  219. # Disable creating .chk files. They will be generated from packager.mk
  220. # When bug 681624 lands, we can replace CHECKLOC= with SKIP_SHLIBSIGN=1
  221. DEFAULT_GMAKE_FLAGS += CHECKLOC=
  222. ifdef CROSS_COMPILE
  223. DEFAULT_GMAKE_FLAGS += \
  224. NATIVE_CC="$(HOST_CC)" \
  225. CC="$(CC)" \
  226. CCC="$(CXX)" \
  227. LINK="$(LD)" \
  228. AS="$(AS)" \
  229. AR='$(AR) $(AR_FLAGS:$@=$$@)' \
  230. RANLIB="$(RANLIB)" \
  231. RC="$(RC) $(RCFLAGS)" \
  232. OS_ARCH="$(OS_ARCH)" \
  233. OS_TEST="$(OS_TEST)" \
  234. CPU_ARCH="$(TARGET_CPU)" \
  235. $(NULL)
  236. # Android has pthreads integrated into -lc, so OS_PTHREAD is set to nothing
  237. ifeq ($(OS_TARGET), Android)
  238. DEFAULT_GMAKE_FLAGS += \
  239. OS_RELEASE="2.6" \
  240. OS_PTHREAD= \
  241. STANDARDS_CFLAGS="-std=gnu89" \
  242. $(NULL)
  243. DEFAULT_GMAKE_FLAGS += ARCHFLAG="$(CFLAGS) -DCHECK_FORK_GETPID -DRTLD_NOLOAD=0 -include $(ABS_topsrcdir)/security/manager/android_stub.h"
  244. endif
  245. endif
  246. ifdef WRAP_LDFLAGS
  247. DEFAULT_GMAKE_FLAGS += \
  248. LDFLAGS="$(LDFLAGS) $(WRAP_LDFLAGS)" \
  249. DSO_LDOPTS="-shared $(LDFLAGS) $(WRAP_LDFLAGS)" \
  250. $(NULL)
  251. endif
  252. DEFAULT_GMAKE_FLAGS += FREEBL_NO_DEPEND=0
  253. ifeq ($(OS_TARGET),Linux)
  254. DEFAULT_GMAKE_FLAGS += FREEBL_LOWHASH=1
  255. endif
  256. SUBMAKEFILES = boot/Makefile ssl/Makefile pki/Makefile locales/Makefile
  257. include $(topsrcdir)/config/rules.mk
  258. ifdef MOZ_NSS_PATCH
  259. # If we're applying a patch, we'll copy the NSS source to the objdir
  260. # and build it from there.
  261. NSS_SRCDIR = $(CURDIR)/nss
  262. # This will copy and patch the NSS source for every build.
  263. # Since we "cp -p", it won't force rebuilds for most files, just
  264. # for patched files, but that's easier than trying to track
  265. # dependencies for patched files.
  266. export::
  267. rm -rf $(NSS_SRCDIR)
  268. $(NSINSTALL) -D $(NSS_SRCDIR)/security
  269. cp -Rp $(topsrcdir)/security/nss $(NSS_SRCDIR)/security
  270. cp -Rp $(topsrcdir)/security/coreconf $(NSS_SRCDIR)/security
  271. cp -Rp $(topsrcdir)/security/dbm $(NSS_SRCDIR)/security
  272. cp -Rp $(topsrcdir)/dbm $(NSS_SRCDIR)
  273. (cd $(NSS_SRCDIR) && patch -p1 < $(call core_abspath,$(MOZ_NSS_PATCH)))
  274. else
  275. NSS_SRCDIR = $(topsrcdir)
  276. endif
  277. dependclean export packages chrome::
  278. $(MAKE) -C boot $@
  279. $(MAKE) -C ssl $@
  280. $(MAKE) -C locales $@
  281. ifdef MOZ_XUL
  282. $(MAKE) -C pki $@
  283. endif
  284. libs::
  285. ifndef MOZ_NATIVE_NSS
  286. ifndef NSS_DISABLE_DBM
  287. $(NSSMAKE) -C $(NSS_SRCDIR)/security/dbm $(DEFAULT_GMAKE_FLAGS)
  288. endif
  289. $(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/lib $(DEFAULT_GMAKE_FLAGS)
  290. ifdef ENABLE_TESTS
  291. # Need certutil binary for mochitest certificates generation
  292. $(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
  293. $(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/certutil $(DEFAULT_GMAKE_FLAGS)
  294. $(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/pk12util $(DEFAULT_GMAKE_FLAGS)
  295. $(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/modutil $(DEFAULT_GMAKE_FLAGS)
  296. endif
  297. ifndef ENABLE_TESTS # Just avoid secondary compile
  298. $(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
  299. endif
  300. $(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS)
  301. $(INSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DIST)/bin
  302. ifeq ($(OS_ARCH), SunOS)
  303. # has to use copy mode on Solaris, see #665509
  304. $(NSINSTALL) -t -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DIST)/bin
  305. else
  306. $(INSTALL) -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DIST)/bin
  307. endif
  308. ifndef NSS_DISABLE_DBM
  309. $(INSTALL) -m 755 $(DIST)/lib/$(NSSDBM3_LIB) $(DIST)/bin
  310. endif
  311. $(INSTALL) -m 755 $(DIST)/lib/$(NSS3_LIB) $(DIST)/bin
  312. $(INSTALL) -m 755 $(DIST)/lib/$(NSSUTIL3_LIB) $(DIST)/bin
  313. $(INSTALL) -m 755 $(DIST)/lib/$(SSL3_LIB) $(DIST)/bin
  314. $(INSTALL) -m 755 $(DIST)/lib/$(SMIME3_LIB) $(DIST)/bin
  315. $(INSTALL) -m 755 $(SDK_LIBS) $(DIST)/sdk/lib
  316. ifdef HAVE_FREEBL_LIBS
  317. $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_LIB) $(DIST)/bin
  318. endif
  319. ifdef HAVE_FREEBL_LIBS_32
  320. $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT_LIB) $(DIST)/bin
  321. $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32FPU_LIB) $(DIST)/bin
  322. endif
  323. ifdef HAVE_FREEBL_LIBS_32INT64
  324. $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT64_LIB) $(DIST)/bin
  325. endif
  326. ifdef HAVE_FREEBL_LIBS_64
  327. $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_64INT_LIB) $(DIST)/bin
  328. $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_64FPU_LIB) $(DIST)/bin
  329. endif
  330. endif
  331. ifndef MOZ_NATIVE_NSS
  332. # NSS installs headers to dist/public and we want them in dist/include
  333. $(NSINSTALL) -D $(DIST)/include/nss
  334. (cd $(DIST)/public/nss && tar $(TAR_CREATE_FLAGS) - .) | \
  335. (cd $(DIST)/include && tar -xf -)
  336. endif
  337. $(MAKE) -C boot $@
  338. $(MAKE) -C ssl $@
  339. $(MAKE) -C locales $@
  340. ifdef MOZ_XUL
  341. $(MAKE) -C pki $@
  342. endif
  343. check::
  344. $(MAKE) -C ssl $@
  345. install::
  346. ifndef MOZ_NATIVE_NSS
  347. $(SYSINSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DESTDIR)$(mozappdir)
  348. $(SYSINSTALL) -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DESTDIR)$(mozappdir)
  349. $(SYSINSTALL) -m 755 $(DIST)/lib/$(NSSDBM3_LIB) $(DESTDIR)$(mozappdir)
  350. $(SYSINSTALL) -m 755 $(DIST)/lib/$(NSS3_LIB) $(DESTDIR)$(mozappdir)
  351. $(SYSINSTALL) -m 755 $(DIST)/lib/$(NSSUTIL3_LIB) $(DESTDIR)$(mozappdir)
  352. $(SYSINSTALL) -m 755 $(DIST)/lib/$(SSL3_LIB) $(DESTDIR)$(mozappdir)
  353. $(SYSINSTALL) -m 755 $(DIST)/lib/$(SMIME3_LIB) $(DESTDIR)$(mozappdir)
  354. ifdef HAVE_FREEBL_LIBS
  355. $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_LIB) $(DESTDIR)$(mozappdir)
  356. endif
  357. ifdef HAVE_FREEBL_LIBS_32
  358. $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT_LIB) $(DESTDIR)$(mozappdir)
  359. $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32FPU_LIB) $(DESTDIR)$(mozappdir)
  360. endif
  361. ifdef HAVE_FREEBL_LIBS_32INT64
  362. $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT64_LIB) $(DESTDIR)$(mozappdir)
  363. endif
  364. ifdef HAVE_FREEBL_LIBS_64
  365. $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_64INT_LIB) $(DESTDIR)$(mozappdir)
  366. $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_64FPU_LIB) $(DESTDIR)$(mozappdir)
  367. endif
  368. endif
  369. $(MAKE) -C boot $@
  370. $(MAKE) -C ssl $@
  371. $(MAKE) -C locales $@
  372. ifdef MOZ_XUL
  373. $(MAKE) -C pki $@
  374. endif
  375. clean clobber clobber_all realclean distclean depend::
  376. $(MAKE) -C boot $@
  377. $(MAKE) -C ssl $@
  378. $(MAKE) -C locales $@
  379. ifdef MOZ_XUL
  380. $(MAKE) -C pki $@
  381. endif
  382. ifndef MOZ_NATIVE_NSS
  383. $(NSSMAKE) -C $(NSS_SRCDIR)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
  384. $(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean
  385. $(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) clean
  386. $(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean
  387. endif