/db/sqlite3/src/Makefile.in

http://github.com/zpao/v8monkey · Autoconf · 171 lines · 82 code · 23 blank · 66 comment · 0 complexity · 82d29269dbab8410474a1c20f01bcb62 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 sqlite3 code.
  16. #
  17. # The Initial Developer of the Original Code is
  18. # sqlite3
  19. # Portions created by the Initial Developer are Copyright (C) 2004
  20. # the Initial Developer. All Rights Reserved.
  21. #
  22. # Contributor(s):
  23. # Vladimir Vukicevic <vladimir.vukicevic@oracle.com>
  24. # Shawn Wilsher <me@shawnwilsher.com>
  25. # Ryan VanderMeulen <ryanvm@gmail.com>
  26. #
  27. # Alternatively, the contents of this file may be used under the terms of
  28. # either of the GNU General Public License Version 2 or later (the "GPL"),
  29. # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  30. # in which case the provisions of the GPL or the LGPL are applicable instead
  31. # of those above. If you wish to allow use of your version of this file only
  32. # under the terms of either the GPL or the LGPL, and not to allow others to
  33. # use your version of this file under the terms of the MPL, indicate your
  34. # decision by deleting the provisions above and replace them with the notice
  35. # and other provisions required by the GPL or the LGPL. If you do not delete
  36. # the provisions above, a recipient may use your version of this file under
  37. # the terms of any one of the MPL, the GPL or the LGPL.
  38. #
  39. # ***** END LICENSE BLOCK *****
  40. DEPTH = ../../..
  41. topsrcdir = @top_srcdir@
  42. srcdir = @srcdir@
  43. VPATH = @srcdir@
  44. include $(DEPTH)/config/autoconf.mk
  45. MODULE = sqlite3
  46. LIBRARY_NAME = mozsqlite3
  47. SHORT_LIBNAME = mozsqlt3
  48. FORCE_SHARED_LIB = 1
  49. VISIBILITY_FLAGS =
  50. LIB_IS_C_ONLY = 1
  51. ifeq ($(OS_ARCH),WINNT)
  52. ifndef GNU_CC
  53. DEFFILE = $(CURDIR)/sqlite-processed.def
  54. RCFILE = sqlite.rc
  55. RESFILE = sqlite.res
  56. GARBAGE += \
  57. sqlite-version.h \
  58. $(DEFFILE) \
  59. $(NULL)
  60. # We generate the appropriate version header file with our python script.
  61. sqlite-version.h: sqlite-version.py sqlite3.h
  62. $(PYTHON) $^ > $@
  63. # We have to preprocess our def file because we need different symbols in debug
  64. # builds exposed that are not built in non-debug builds.
  65. $(DEFFILE): sqlite.def
  66. @$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) \
  67. $(srcdir)/sqlite.def > $(DEFFILE)
  68. export:: sqlite-version.h
  69. endif
  70. endif
  71. ifeq (Darwin,$(OS_TARGET))
  72. # On OSX, with jemalloc enabled, having sqlite linked against mozglue
  73. # causes crashes in NSS standalone tools.
  74. MOZ_GLUE_LDFLAGS =
  75. endif
  76. # XXX Force -O2 optimisation on Mac because using the default -O3 causes
  77. # crashes. See bug 676499.
  78. ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
  79. MODULE_OPTIMIZE_FLAGS = -O2
  80. endif
  81. # Force /O2 optimisation on Windows because using the default /O1 causes
  82. # crashes with MSVC2005 and PGO. See bug 719584.
  83. ifeq ($(OS_ARCH),WINNT)
  84. MODULE_OPTIMIZE_FLAGS = -O2
  85. endif
  86. EXPORTS = \
  87. sqlite3.h \
  88. $(NULL)
  89. CSRCS = \
  90. sqlite3.c \
  91. $(NULL)
  92. # -DSQLITE_SECURE_DELETE=1 will cause SQLITE to 0-fill delete data so we
  93. # don't have to vacuum to make sure the data is not visible in the file.
  94. # -DSQLITE_ENABLE_FTS3=1 enables the full-text index module.
  95. # -DSQLITE_CORE=1 statically links that module into the SQLite library.
  96. # -DSQLITE_DEFAULT_PAGE_SIZE=32768 and SQLITE_MAX_DEFAULT_PAGE_SIZE=32768
  97. # increases the page size from 1k, see bug 416330. The value must stay in sync
  98. # with mozIStorageConnection::DEFAULT_PAGE_SIZE.
  99. # -DSQLITE_MAX_SCHEMA_RETRY increases the times SQLite may try to reparse
  100. # statements when the schema changes. This is important when supporting lots of
  101. # concurrent connections, especially when they use shared cache.
  102. # Note: Be sure to update the configure.in checks when these change!
  103. DEFINES = \
  104. -DSQLITE_SECURE_DELETE=1 \
  105. -DSQLITE_THREADSAFE=1 \
  106. -DSQLITE_CORE=1 \
  107. -DSQLITE_ENABLE_FTS3=1 \
  108. -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
  109. -DSQLITE_DEFAULT_PAGE_SIZE=32768 \
  110. -DSQLITE_MAX_DEFAULT_PAGE_SIZE=32768 \
  111. -DSQLITE_MAX_SCHEMA_RETRY=25 \
  112. $(NULL)
  113. # -DSQLITE_ENABLE_LOCKING_STYLE=1 to help with AFP folders
  114. ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
  115. DEFINES += -DSQLITE_ENABLE_LOCKING_STYLE=1
  116. endif
  117. # Turn on SQLite's assertions in debug builds.
  118. ifdef MOZ_DEBUG
  119. DEFINES += -DSQLITE_DEBUG=1
  120. endif
  121. # disable PGO for Sun Studio
  122. ifdef SOLARIS_SUNPRO_CC
  123. NO_PROFILE_GUIDED_OPTIMIZE = 1
  124. endif
  125. ifeq ($(OS_ARCH),OS2)
  126. ifdef MOZ_OS2_HIGH_MEMORY
  127. DEFINES += -DOS2_HIGH_MEMORY
  128. endif
  129. endif
  130. ifeq ($(OS_TARGET),Android)
  131. # default to user readable only to fit Android security model
  132. DEFINES += -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600
  133. endif
  134. # Force using malloc_usable_size when building with jemalloc because _msize
  135. # causes assertions on Win64. See bug 719579.
  136. ifeq ($(OS_ARCH),WINNT)
  137. ifdef MOZ_MEMORY
  138. DEFINES += -DHAVE_MALLOC_USABLE_SIZE
  139. endif
  140. endif
  141. include $(topsrcdir)/config/rules.mk
  142. # next line allows use of MOZ_OBJDIR in .mozconfig with older gcc on BeOS, maybe others
  143. LOCAL_INCLUDES += -I$(srcdir)
  144. ifeq ($(OS_ARCH),OS2)
  145. ADD_TO_DEF_FILE = $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) \
  146. $(srcdir)/sqlite.def | sed -e '1,/^EXPORTS$$/ d' -e 's,sqlite3,_\0,' \
  147. -e 's,\ DATA.*$$,,' >> $(DEF_FILE)
  148. endif