PageRenderTime 67ms CodeModel.GetById 37ms RepoModel.GetById 0ms app.codeStats 0ms

/server/src/mozilla/memory/jemalloc/Makefile.in

https://github.com/absynce/Jaxer
Autoconf | 111 lines | 46 code | 14 blank | 51 comment | 3 complexity | ef55be330c6fab8357e74d238fd8e541 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. # Mozilla Foundation
  19. # Portions created by the Initial Developer are Copyright (C) 2008
  20. # the Initial Developer. All Rights Reserved.
  21. #
  22. # Contributor(s):
  23. # Ted Mielczarek <ted.mielczarek@gmail.com>
  24. #
  25. # Alternatively, the contents of this file may be used under the terms of
  26. # either of the GNU General Public License Version 2 or later (the "GPL"),
  27. # or 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. MODULE = jemalloc
  44. ifeq (WINNT,$(OS_TARGET))
  45. # Two options for Windows, either you build the CRT from source,
  46. # or you use a pre-built DLL.
  47. ifneq (,$(WIN32_CRT_SRC_DIR))
  48. # Building the CRT from source
  49. CRT_OBJ_DIR=./$(shell basename "$(WIN32_CRT_SRC_DIR)")
  50. libs:: $(CRT_OBJ_DIR)/build/intel/mozcrt19.dll
  51. $(INSTALL) $< $(FINAL_TARGET)
  52. # patch if necessary
  53. $(CRT_OBJ_DIR)/jemalloc.c: $(srcdir)/crtsp1.diff
  54. rm -rf $(CRT_OBJ_DIR)
  55. cp -R "$(WIN32_CRT_SRC_DIR)" .
  56. # per http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1189363&SiteID=1
  57. for i in dll mt xdll xmt; do \
  58. pushd $(CRT_OBJ_DIR)/intel/$${i}_lib && lib -extract:..\\build\\intel\\$${i}_obj\\unhandld.obj eh.lib && popd; \
  59. done
  60. # truly awful
  61. #XXX: get ed into mozillabuild, bug 415123
  62. $(PERL) $(srcdir)/apply-ed-patches.pl $(srcdir)/crtsp1.diff \
  63. $(CRT_OBJ_DIR) $(srcdir)/ed.exe
  64. $(CRT_OBJ_DIR)/build/intel/mozcrt19.dll: \
  65. $(CRT_OBJ_DIR)/jemalloc.c $(srcdir)/jemalloc.c $(srcdir)/tree.h
  66. cp $(srcdir)/jemalloc.c $(srcdir)/tree.h $(CRT_OBJ_DIR)
  67. # this pretty much sucks, but nmake and make don't play well together
  68. $(PYTHON) $(srcdir)/build-crt.py $(CRT_OBJ_DIR)
  69. #XXX: these don't link right for some reason
  70. rm $(CRT_OBJ_DIR)/build/intel/{libcmt,libcpmt}.lib
  71. else
  72. # Using a pre-built DLL, so just install it.
  73. libs:: $(WIN32_CUSTOM_CRT_DIR)/mozcrt19.dll
  74. $(INSTALL) $< $(FINAL_TARGET)
  75. endif
  76. else
  77. MODULE_OPTIMIZE_FLAGS = -O2
  78. ifeq ($(OS_ARCH),SunOS)
  79. ifndef GNU_CC
  80. MODULE_OPTIMIZE_FLAGS = -xO5
  81. endif
  82. endif
  83. LIBRARY_NAME = jemalloc
  84. # Build jemalloc as a shared lib. This is mandatory for Darwin, since a library
  85. # init function is used on that platform.
  86. FORCE_SHARED_LIB= 1
  87. CSRCS = \
  88. jemalloc.c \
  89. $(NULL)
  90. #XXX: PGO on Linux causes problems here
  91. # See bug 419470
  92. NO_PROFILE_GUIDED_OPTIMIZE = 1
  93. endif
  94. include $(topsrcdir)/config/rules.mk
  95. ifeq (Darwin,$(OS_TARGET))
  96. LDFLAGS += -init _jemalloc_darwin_init
  97. endif