#
# 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/.

LIB_IS_C_ONLY    = 1

ifeq ($(OS_ARCH),WINNT)
DEFFILE = $(CURDIR)/sqlite-processed.def

GARBAGE += \
  sqlite-version.h \
  $(DEFFILE) \
  $(NULL)

# We generate the appropriate version header file with our python script.
sqlite-version.h: sqlite-version.py sqlite3.h
	$(PYTHON) $^ > $@

# We have to preprocess our def file because we need different symbols in debug
# builds exposed that are not built in non-debug builds.
$(DEFFILE): sqlite.def
	@$(call py_action,preprocessor,$(DEFINES) \
	  $(srcdir)/sqlite.def -o $(DEFFILE))

export:: sqlite-version.h
endif

ifeq (Darwin,$(OS_TARGET))
# On OSX, with jemalloc enabled, having sqlite linked against mozglue
# causes crashes in NSS standalone tools.
MOZ_GLUE_LDFLAGS =
endif

# XXX Force -O2 optimisation on Mac because using the default -O3 causes
# crashes. See bug 676499.
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
MODULE_OPTIMIZE_FLAGS = -O2
endif

# Force /O2 optimisation on Windows because using the default /O1 causes
# crashes with MSVC2005 and PGO. See bug 719584.
ifeq ($(OS_ARCH),WINNT)
MODULE_OPTIMIZE_FLAGS = -O2
endif

include $(topsrcdir)/config/rules.mk
