17871dc3eSAndrew Rist#************************************************************** 27871dc3eSAndrew Rist# 37871dc3eSAndrew Rist# Licensed to the Apache Software Foundation (ASF) under one 47871dc3eSAndrew Rist# or more contributor license agreements. See the NOTICE file 57871dc3eSAndrew Rist# distributed with this work for additional information 67871dc3eSAndrew Rist# regarding copyright ownership. The ASF licenses this file 77871dc3eSAndrew Rist# to you under the Apache License, Version 2.0 (the 87871dc3eSAndrew Rist# "License"); you may not use this file except in compliance 97871dc3eSAndrew Rist# with the License. You may obtain a copy of the License at 107871dc3eSAndrew Rist# 117871dc3eSAndrew Rist# http://www.apache.org/licenses/LICENSE-2.0 127871dc3eSAndrew Rist# 137871dc3eSAndrew Rist# Unless required by applicable law or agreed to in writing, 147871dc3eSAndrew Rist# software distributed under the License is distributed on an 157871dc3eSAndrew Rist# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 167871dc3eSAndrew Rist# KIND, either express or implied. See the License for the 177871dc3eSAndrew Rist# specific language governing permissions and limitations 187871dc3eSAndrew Rist# under the License. 197871dc3eSAndrew Rist# 207871dc3eSAndrew Rist#************************************************************** 217871dc3eSAndrew Rist 227871dc3eSAndrew Rist 23cdf0e10cSrcweirPRJ=. 24cdf0e10cSrcweir 25cdf0e10cSrcweirPRJNAME=icu 26cdf0e10cSrcweirTARGET=so_icu 27cdf0e10cSrcweir 28cdf0e10cSrcweir# --- Settings ----------------------------------------------------- 29cdf0e10cSrcweir 30cdf0e10cSrcweir.INCLUDE : settings.mk 31cdf0e10cSrcweir 32cdf0e10cSrcweir# --- Files -------------------------------------------------------- 33cdf0e10cSrcweir 34cdf0e10cSrcweir.INCLUDE : icuversion.mk 35cdf0e10cSrcweir 36cdf0e10cSrcweir.IF "$(ICU_MICRO)"!="0" 37cdf0e10cSrcweirTARFILE_NAME=icu4c-$(ICU_MAJOR)_$(ICU_MINOR)_$(ICU_MICRO)-src 38cdf0e10cSrcweirTARFILE_MD5=2f6ecca935948f7db92d925d88d0d078 39cdf0e10cSrcweir.ELSE 40cdf0e10cSrcweirTARFILE_NAME=icu4c-$(ICU_MAJOR)_$(ICU_MINOR)-src 41cdf0e10cSrcweirTARFILE_MD5= 42cdf0e10cSrcweir.ENDIF 43cdf0e10cSrcweirTARFILE_ROOTDIR=icu 44cdf0e10cSrcweir 45*744a105aSarielchPATCH_FILES=${TARFILE_NAME}.patch icu-mp.patch icu-win-layoutex.patch 46cdf0e10cSrcweir 47cdf0e10cSrcweir# ADDITIONAL_FILES= 48cdf0e10cSrcweir 49cdf0e10cSrcweir.IF "$(GUI)"=="UNX" 50cdf0e10cSrcweir.IF "$(COMNAME)"=="sunpro5" 51cdf0e10cSrcweir#.IF "$(BUILD_TOOLS)$/cc"=="$(shell +-which cc)" 52cdf0e10cSrcweir#CC:=$(COMPATH)$/bin$/cc 53cdf0e10cSrcweir#CXX:=$(COMPATH)$/bin$/CC 54cdf0e10cSrcweir#.ENDIF # "$(BUILD_TOOLS)$/cc"=="$(shell +-which cc)" 55cdf0e10cSrcweir.ENDIF # "$(COMNAME)"=="sunpro5" 56cdf0e10cSrcweir 57cdf0e10cSrcweir.IF "$(SYSBASE)"!="" 58cdf0e10cSrcweiricu_CFLAGS+=-I$(SYSBASE)$/usr$/include 59cdf0e10cSrcweir.IF "$(COMNAME)"=="sunpro5" 60cdf0e10cSrcweiricu_CFLAGS+=$(C_RESTRICTIONFLAGS) 61cdf0e10cSrcweir.ENDIF # "$(COMNAME)"=="sunpro5" 62cdf0e10cSrcweir# add SYSBASE libraries and make certain that they are found *after* the 63cdf0e10cSrcweir# icu build internal libraries - in case that icu is available in SYSBASE 64cdf0e10cSrcweir# as well 65cdf0e10cSrcweiricu_LDFLAGS+= -L../lib -L../../lib -L../stubdata -L../../stubdata -L$(SYSBASE)$/usr$/lib 66cdf0e10cSrcweir.ENDIF # "$(SYSBASE)"!="" 67cdf0e10cSrcweir 68cdf0e10cSrcweiricu_CFLAGS+=-O $(ARCH_FLAGS) $(EXTRA_CDEFS) 69cdf0e10cSrcweiricu_LDFLAGS+=$(EXTRA_LINKFLAGS) 70cdf0e10cSrcweiricu_CXXFLAGS+=-O $(ARCH_FLAGS) $(EXTRA_CDEFS) 71cdf0e10cSrcweir 72cdf0e10cSrcweir# remove conversion and transliteration data to reduce binary size. 73cdf0e10cSrcweirCONFIGURE_ACTION=rm data/mappings/ucm*.mk data/translit/trn*.mk ; 74cdf0e10cSrcweir 75cdf0e10cSrcweir# until someone introduces SOLARIS 64-bit builds 76cdf0e10cSrcweir.IF "$(OS)"=="SOLARIS" 77cdf0e10cSrcweirDISABLE_64BIT=--enable-64bit-libs=no 78cdf0e10cSrcweir.ENDIF # "$(OS)"=="SOLARIS" 79cdf0e10cSrcweir 80cdf0e10cSrcweir.IF "$(HAVE_LD_HASH_STYLE)" == "TRUE" 81cdf0e10cSrcweirLDFLAGSADD += -Wl,--hash-style=both 82cdf0e10cSrcweir.ENDIF 83cdf0e10cSrcweir 84cdf0e10cSrcweir.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE" 85cdf0e10cSrcweirLDFLAGSADD += -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo 86cdf0e10cSrcweir.ENDIF 87cdf0e10cSrcweir 88cdf0e10cSrcweirCONFIGURE_DIR=source 89cdf0e10cSrcweir 90cdf0e10cSrcweirCONFIGURE_ACTION+=sh -c 'CFLAGS="$(icu_CFLAGS)" CXXFLAGS="$(icu_CXXFLAGS)" LDFLAGS="$(icu_LDFLAGS) $(LDFLAGSADD)" ./configure --enable-layout --enable-static --enable-shared=yes $(DISABLE_64BIT)' 91cdf0e10cSrcweir 92cdf0e10cSrcweir#CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no 93cdf0e10cSrcweirCONFIGURE_FLAGS= 94cdf0e10cSrcweir 95cdf0e10cSrcweir# Use of 96cdf0e10cSrcweir# CONFIGURE_ACTION=sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' 97cdf0e10cSrcweir# CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no 98cdf0e10cSrcweir# doesn't work as it would result in 99cdf0e10cSrcweir# sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' --enable-layout ... 100cdf0e10cSrcweir# note the position of the single quotes. 101cdf0e10cSrcweir 102cdf0e10cSrcweirBUILD_DIR=$(CONFIGURE_DIR) 103cdf0e10cSrcweirBUILD_ACTION=$(AUGMENT_LIBRARY_PATH) $(GNUMAKE) -j$(EXTMAXPROCESS) 104cdf0e10cSrcweirOUT2LIB= \ 105cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicudata$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \ 106cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicudata$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \ 107cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicudata$(DLLPOST) \ 108cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicuuc$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \ 109cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicuuc$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \ 110cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicuuc$(DLLPOST) \ 111cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicui18n$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \ 112cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicui18n$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \ 113cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicui18n$(DLLPOST) \ 114cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicule$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \ 115cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicule$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \ 116cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicule$(DLLPOST) \ 117cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicutu$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \ 118cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicutu$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \ 119cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicutu$(DLLPOST) 120cdf0e10cSrcweir 121cdf0e10cSrcweirOUT2BIN= \ 122cdf0e10cSrcweir $(BUILD_DIR)$/bin$/genccode \ 123cdf0e10cSrcweir $(BUILD_DIR)$/bin$/genbrk \ 124cdf0e10cSrcweir $(BUILD_DIR)$/bin$/gencmn 125cdf0e10cSrcweir 126cdf0e10cSrcweir.ENDIF 127cdf0e10cSrcweir 128cdf0e10cSrcweir.IF "$(GUI)"=="WNT" 129cdf0e10cSrcweirCONFIGURE_DIR=source 130cdf0e10cSrcweir.IF "$(COM)"=="GCC" 131cdf0e10cSrcweirCONFIGURE_ACTION=rm data/mappings/ucm*.mk data/translit/trn*.mk ; 132cdf0e10cSrcweir.IF "$(MINGW_SHARED_GCCLIB)"=="YES" 133cdf0e10cSrcweiricu_LDFLAGS+=-shared-libgcc 134cdf0e10cSrcweir.ENDIF 135cdf0e10cSrcweir.IF "$(USE_MINGW)"=="cygwin" 136cdf0e10cSrcweiricu_LDFLAGS+=-L$(COMPATH)/lib/mingw -L$(COMPATH)/lib/w32api 137cdf0e10cSrcweir.ENDIF 138cdf0e10cSrcweiricu_LDFLAGS+=-L$(COMPATH)$/lib 139cdf0e10cSrcweiricu_LIBS= 140cdf0e10cSrcweir.IF "$(MINGW_SHARED_GXXLIB)"=="YES" 141cdf0e10cSrcweiricu_LIBS+=$(MINGW_SHARED_LIBSTDCPP) 142cdf0e10cSrcweir.ENDIF 143cdf0e10cSrcweiricu_LDFLAGS+=-Wl,--enable-runtime-pseudo-reloc-v2 144cdf0e10cSrcweirCONFIGURE_ACTION+=sh -c 'CFLAGS="-O -D_MT" CXXFLAGS="-O -D_MT" LDFLAGS="$(icu_LDFLAGS)" LIBS="$(icu_LIBS)" ./configure --build=i586-pc-mingw32 --enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no' 145cdf0e10cSrcweir 146cdf0e10cSrcweir#CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no 147cdf0e10cSrcweirCONFIGURE_FLAGS= 148cdf0e10cSrcweir 149cdf0e10cSrcweir# Use of 150cdf0e10cSrcweir# CONFIGURE_ACTION=sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' 151cdf0e10cSrcweir# CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no 152cdf0e10cSrcweir# doesn't work as it would result in 153cdf0e10cSrcweir# sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' --enable-layout ... 154cdf0e10cSrcweir# note the position of the single quotes. 155cdf0e10cSrcweir 156cdf0e10cSrcweirBUILD_DIR=$(CONFIGURE_DIR) 157cdf0e10cSrcweirBUILD_ACTION=$(GNUMAKE) 158cdf0e10cSrcweirOUT2LIB= 159cdf0e10cSrcweir 160cdf0e10cSrcweirOUT2BIN= \ 161cdf0e10cSrcweir $(BUILD_DIR)$/lib$/icudt$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \ 162cdf0e10cSrcweir $(BUILD_DIR)$/lib$/icuuc$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \ 163cdf0e10cSrcweir $(BUILD_DIR)$/lib$/icuin$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \ 164cdf0e10cSrcweir $(BUILD_DIR)$/lib$/icule$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \ 165cdf0e10cSrcweir $(BUILD_DIR)$/lib$/icutu$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \ 166cdf0e10cSrcweir $(BUILD_DIR)$/bin$/genccode.exe \ 167cdf0e10cSrcweir $(BUILD_DIR)$/bin$/genbrk.exe \ 168cdf0e10cSrcweir $(BUILD_DIR)$/bin$/gencmn.exe 169cdf0e10cSrcweir 170cdf0e10cSrcweir.ELSE 171cdf0e10cSrcweirBUILD_DIR=source 172cdf0e10cSrcweir.IF "full_debug" == "" 173cdf0e10cSrcweir 174cdf0e10cSrcweir# Activating the debug mechanism produces incompatible libraries, you'd have 175cdf0e10cSrcweir# at least to relink all modules that are directly using ICU. Note that library 176cdf0e10cSrcweir# names get a 'd' appended and you'd have to edit the solenv/inc/libs.mk 177cdf0e10cSrcweir# ICU*LIB macros as well. Normally you don't want all this. 178cdf0e10cSrcweir# 179cdf0e10cSrcweir# Instead, use the normal already existing Release build and edit the 180cdf0e10cSrcweir# corresponding *.vcproj file of the section you're interested in. Make sure 181cdf0e10cSrcweir# that 182cdf0e10cSrcweir# - for the VCCLCompilerTool section the following line exists: 183cdf0e10cSrcweir# DebugInformationFormat="3" 184cdf0e10cSrcweir# - and for the VCLinkerTool the line 185cdf0e10cSrcweir# GenerateDebugInformation="TRUE" 186cdf0e10cSrcweir# Then delete the corresponding Release output directory, and delete the target 187cdf0e10cSrcweir# flag files 188cdf0e10cSrcweir# $(OUTPATH)/misc/build/so_built_so_icu 189cdf0e10cSrcweir# $(OUTPATH)/misc/build/so_predeliver_so_icu 190cdf0e10cSrcweir# and run dmake again, after which you may copy the resulting libraries to your 191cdf0e10cSrcweir# OOo/SO installation. 192cdf0e10cSrcweirICU_BUILD_VERSION=Debug 193cdf0e10cSrcweirICU_BUILD_LIBPOST=d 194cdf0e10cSrcweir.ELSE 195cdf0e10cSrcweirICU_BUILD_VERSION=Release 196cdf0e10cSrcweirICU_BUILD_LIBPOST= 197cdf0e10cSrcweir.ENDIF 198cdf0e10cSrcweir 199cdf0e10cSrcweirCONFIGURE_ACTION+= $(PERL) ..$/..$/..$/..$/..$/createmak.pl ..$/..$/..$/..$/..$/createmak.cfg . 200cdf0e10cSrcweir 201cdf0e10cSrcweir.IF "$(CCNUMVER)"<="001400000000" 202cdf0e10cSrcweirBUILD_ACTION=cd allinone && nmake /f all.mak EXFLAGS="-EHsc" && cd ..$/.. 203cdf0e10cSrcweir.ELSE 204cdf0e10cSrcweirBUILD_ACTION=cd allinone && nmake /f all.mak EXFLAGS="-EHa -Zc:wchar_t-" && cd ..$/.. 205cdf0e10cSrcweir.ENDIF 206cdf0e10cSrcweir 207cdf0e10cSrcweirOUT2LIB= \ 208cdf0e10cSrcweir $(BUILD_DIR)$/..$/lib$/icudata.lib \ 209cdf0e10cSrcweir $(BUILD_DIR)$/..$/lib$/icuin$(ICU_BUILD_LIBPOST).lib \ 210cdf0e10cSrcweir $(BUILD_DIR)$/..$/lib$/icuuc$(ICU_BUILD_LIBPOST).lib \ 211cdf0e10cSrcweir $(BUILD_DIR)$/..$/lib$/icule$(ICU_BUILD_LIBPOST).lib \ 212cdf0e10cSrcweir $(BUILD_DIR)$/..$/lib$/icutu$(ICU_BUILD_LIBPOST).lib 213cdf0e10cSrcweir 214cdf0e10cSrcweirOUT2BIN= \ 215cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/icudt$(ICU_MAJOR)$(ICU_MINOR).dll \ 216cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/icuin$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \ 217cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/icuuc$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \ 218cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/icule$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \ 219cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/icutu$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \ 220cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/genccode.exe \ 221cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/genbrk.exe \ 222cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/gencmn.exe 223cdf0e10cSrcweir 224cdf0e10cSrcweir.ENDIF 225cdf0e10cSrcweir.ENDIF # "$(GUI)"=="WNT" 226cdf0e10cSrcweir 227cdf0e10cSrcweir# --- Targets ------------------------------------------------------ 228cdf0e10cSrcweir 229cdf0e10cSrcweir.INCLUDE : set_ext.mk 230cdf0e10cSrcweir.INCLUDE : target.mk 231cdf0e10cSrcweir.INCLUDE : tg_ext.mk 232cdf0e10cSrcweir 233cdf0e10cSrcweir.IF "$(BINARY_PATCH_FILES)"!="" 234cdf0e10cSrcweir 235cdf0e10cSrcweir$(PACKAGE_DIR)$/so_add_binary : $(PACKAGE_DIR)$/$(ADD_FILES_FLAG_FILE) 236cdf0e10cSrcweir cd $(PACKAGE_DIR) && gunzip -c $(BACK_PATH)$(BINARY_PATCH_FILES) | tar -xvf - 237cdf0e10cSrcweir $(TOUCH) $(PACKAGE_DIR)$/so_add_binary 238cdf0e10cSrcweir 239cdf0e10cSrcweir$(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)$/so_add_binary 240cdf0e10cSrcweir 241cdf0e10cSrcweir.ENDIF 242cdf0e10cSrcweir 243cdf0e10cSrcweir.IF "$(GUI)$(COM)"=="WNTGCC" 244cdf0e10cSrcweirALLTAR : \ 245cdf0e10cSrcweir $(LB)$/icudata.lib \ 246cdf0e10cSrcweir $(LB)$/icuin$(ICU_BUILD_LIBPOST).lib \ 247cdf0e10cSrcweir $(LB)$/icuuc$(ICU_BUILD_LIBPOST).lib \ 248cdf0e10cSrcweir $(LB)$/icule$(ICU_BUILD_LIBPOST).lib \ 249cdf0e10cSrcweir $(LB)$/icutu$(ICU_BUILD_LIBPOST).lib 250cdf0e10cSrcweir 251cdf0e10cSrcweir$(LB)$/icudata.lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 252cdf0e10cSrcweir $(TOUCH) $@ 253cdf0e10cSrcweir 254cdf0e10cSrcweir$(LB)$/icuin$(ICU_BUILD_LIBPOST).lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 255cdf0e10cSrcweir $(TOUCH) $@ 256cdf0e10cSrcweir 257cdf0e10cSrcweir$(LB)$/icuuc$(ICU_BUILD_LIBPOST).lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 258cdf0e10cSrcweir $(TOUCH) $@ 259cdf0e10cSrcweir 260cdf0e10cSrcweir$(LB)$/icule$(ICU_BUILD_LIBPOST).lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 261cdf0e10cSrcweir $(TOUCH) $@ 262cdf0e10cSrcweir 263cdf0e10cSrcweir$(LB)$/icutu$(ICU_BUILD_LIBPOST).lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 264cdf0e10cSrcweir $(TOUCH) $@ 265cdf0e10cSrcweir.ENDIF 266cdf0e10cSrcweir 267cdf0e10cSrcweir# Since you never know what will be in a patch (for example, it may already 268cdf0e10cSrcweir# patch at configure level) or in the case of a binary patch, we remove the 269cdf0e10cSrcweir# entire package directory if a patch is newer. 270cdf0e10cSrcweir# Changes in this makefile could also make a complete build necessary if 271cdf0e10cSrcweir# configure is affected. 272cdf0e10cSrcweir$(PACKAGE_DIR)$/$(UNTAR_FLAG_FILE) : makefile.mk 273cdf0e10cSrcweir 274