You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mxe/src/icu4c.mk

56 lines
2.1 KiB

# This file is part of MXE. See LICENSE.md for licensing information.
11 years ago
PKG := icu4c
5 years ago
$(PKG)_WEBSITE := https://github.com/unicode-org/icu
$(PKG)_DESCR := ICU4C
11 years ago
$(PKG)_IGNORE :=
$(PKG)_VERSION := 56.1
$(PKG)_MAJOR := $(word 1,$(subst ., ,$($(PKG)_VERSION)))
$(PKG)_CHECKSUM := 3a64e9105c734dcf631c0b3ed60404531bce6c0f5a64bfe1a6402a4cc2314816
11 years ago
$(PKG)_SUBDIR := icu
$(PKG)_FILE := $(PKG)-$(subst .,_,$($(PKG)_VERSION))-src.tgz
$(PKG)_URL := https://sourceforge.net/projects/icu/files/ICU4C/$($(PKG)_VERSION)/$($(PKG)_FILE)
$(PKG)_DEPS := cc
11 years ago
define $(PKG)_UPDATE
$(WGET) -q -O- 'https://sourceforge.net/projects/icu/files/ICU4C/' | \
$(SED) -n 's,.*/projects/.*/.*/.*/\([0-9]\+[^"]*\)/".*,\1,p' | \
$(SORT) -Vr | \
head -1
11 years ago
endef
define $(PKG)_BUILD_COMMON
cd '$(1)/source' && autoreconf -fi
mkdir '$(1).native' && cd '$(1).native' && '$(1)/source/configure' \
CC=$(BUILD_CC) CXX=$(BUILD_CXX)
11 years ago
$(MAKE) -C '$(1).native' -j '$(JOBS)'
mkdir '$(1).cross' && cd '$(1).cross' && '$(1)/source/configure' \
$(MXE_CONFIGURE_OPTS) \
11 years ago
--with-cross-build='$(1).native' \
CFLAGS=-DU_USING_ICU_NAMESPACE=0 \
CXXFLAGS='--std=gnu++0x' \
11 years ago
SHELL=bash
$(MAKE) -C '$(1).cross' -j '$(JOBS)' install
ln -sf '$(PREFIX)/$(TARGET)/bin/icu-config' '$(PREFIX)/bin/$(TARGET)-icu-config'
endef
define $(PKG)_BUILD_SHARED
$($(PKG)_BUILD_COMMON)
# icu4c installs its DLLs to lib/. Move them to bin/.
mv -fv $(PREFIX)/$(TARGET)/lib/icu*.dll '$(PREFIX)/$(TARGET)/bin/'
# add symlinks icu*<version>.dll.a to icu*.dll.a
for lib in `ls '$(PREFIX)/$(TARGET)/lib/' | grep 'icu.*\.dll\.a' | cut -d '.' -f 1 | tr '\n' ' '`; \
do \
ln -fs "$(PREFIX)/$(TARGET)/lib/$${lib}.dll.a" "$(PREFIX)/$(TARGET)/lib/$${lib}$($(PKG)_MAJOR).dll.a"; \
done
endef
define $(PKG)_BUILD
$($(PKG)_BUILD_COMMON)
# Static libs are prefixed with an `s` but the config script
# doesn't detect it properly, despite the STATIC_PREFIX="s" line
$(SED) -i 's,ICUPREFIX="icu",ICUPREFIX="sicu",' '$(PREFIX)/$(TARGET)/bin/icu-config'
11 years ago
endef