config/external/icu/Makefile.in
author Tooru Fujisawa <arai_a@mac.com>
Fri, 10 Oct 2014 02:55:00 -0400
changeset 226961 e945f3ffeb7e49b1c0f53705b957b1fe6d0b894e
parent 212598 6b285759568cb0b743cb9497e021f6552cc7e349
child 227312 cbe9f4f915991b9a5a922b140f065ab1fd4ecbae
permissions -rw-r--r--
Bug 1080910 - Add USE_ICU variable separated from ENABLE_INTL_API. r=glandium

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

# Ensure that this happens before including rules.mk
ifdef USE_ICU
  ifndef MOZ_NATIVE_ICU
  # Library names: On Windows, ICU uses modified library names for static
  # and debug libraries.
    ifdef MOZ_SHARED_ICU
      ifeq ($(OS_ARCH),WINNT)
        ifdef JS_SHARED_LIBRARY
          ICU_FILES := $(foreach libname,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(libname)$(MOZ_ICU_DBG_SUFFIX)$(MOZ_ICU_VERSION).dll)
        endif
      else # ! WINNT
        ifeq ($(OS_ARCH),Darwin)
          ifdef JS_SHARED_LIBRARY
            ICU_FILES := $(foreach libname,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(libname).$(MOZ_ICU_VERSION)$(DLL_SUFFIX))
          endif
        else # ! Darwin
          ifdef JS_SHARED_LIBRARY
            ICU_FILES := $(foreach libname,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(libname)$(DLL_SUFFIX).$(MOZ_ICU_VERSION))
          endif
        endif
      endif # WINNT
      ifdef ICU_FILES
        ICU_DEST := $(DIST)/bin
        INSTALL_TARGETS += ICU
        $(ICU_FILES): buildicu
        ICU_TARGET := target
      endif
    else # !MOZ_SHARED_ICU
      ifeq ($(OS_ARCH),WINNT)
        ICU_LIB_RENAME = $(foreach libname,$(ICU_LIB_NAMES),\
                             cp -p $(DEPTH)/intl/icu/target/lib/s$(libname)$(MOZ_ICU_DBG_SUFFIX).lib $(DEPTH)/intl/icu/target/lib/$(libname)$(MOZ_ICU_DBG_SUFFIX).lib;)
      endif
    endif # MOZ_SHARED_ICU
  endif # !MOZ_NATIVE_ICU
endif # USE_ICU

include $(topsrcdir)/config/rules.mk

ifdef USE_ICU
ifndef MOZ_NATIVE_ICU
target:: buildicu
$(STATIC_LIBS): buildicu

# - Force ICU to use the standard suffix for object files because expandlibs
#   will discard all files with a non-standard suffix (bug 857450).
# - Options for genrb: -k strict parsing; -R omit collation tailoring rules.
buildicu::
# ICU's build system is full of races, so force non-parallel build.
# Msys screws up GENRBOPTS when it contains spaces, so all genrb flags need
# to be stuck together. See https://bugzilla.mozilla.org/show_bug.cgi?id=1034594#c34
ifdef CROSS_COMPILE
	+$(MAKE) -j1 -C $(DEPTH)/intl/icu/host STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-kRC'
endif
	+$(MAKE) -j1 -C $(DEPTH)/intl/icu/target STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-kR'
	$(ICU_LIB_RENAME)

distclean clean::
ifdef CROSS_COMPILE
	+$(MAKE) -C $(DEPTH)/intl/icu/host $@ STATIC_O=$(OBJ_SUFFIX)
endif
	+$(MAKE) -C $(DEPTH)/intl/icu/target $@ STATIC_O=$(OBJ_SUFFIX)

endif
endif