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 45744a105aSarielchPATCH_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 88*bdb58f77SDon Lewis# FreeBSD with gcc from ports needs -Wl,-rpath= to find the matching libstdc++ 89*bdb58f77SDon Lewis.IF "$(OS)"=="FREEBSD" 90*bdb58f77SDon LewisLDFLAGSADD+=$(FBSD_GCC_RPATH) 91*bdb58f77SDon Lewis.ENDIF 92*bdb58f77SDon Lewis 93cdf0e10cSrcweirCONFIGURE_DIR=source 94cdf0e10cSrcweir 95cdf0e10cSrcweirCONFIGURE_ACTION+=sh -c 'CFLAGS="$(icu_CFLAGS)" CXXFLAGS="$(icu_CXXFLAGS)" LDFLAGS="$(icu_LDFLAGS) $(LDFLAGSADD)" ./configure --enable-layout --enable-static --enable-shared=yes $(DISABLE_64BIT)' 96cdf0e10cSrcweir 97cdf0e10cSrcweir#CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no 98cdf0e10cSrcweirCONFIGURE_FLAGS= 99cdf0e10cSrcweir 100cdf0e10cSrcweir# Use of 101cdf0e10cSrcweir# CONFIGURE_ACTION=sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' 102cdf0e10cSrcweir# CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no 103cdf0e10cSrcweir# doesn't work as it would result in 104cdf0e10cSrcweir# sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' --enable-layout ... 105cdf0e10cSrcweir# note the position of the single quotes. 106cdf0e10cSrcweir 107cdf0e10cSrcweirBUILD_DIR=$(CONFIGURE_DIR) 108cdf0e10cSrcweirBUILD_ACTION=$(AUGMENT_LIBRARY_PATH) $(GNUMAKE) -j$(EXTMAXPROCESS) 109cdf0e10cSrcweirOUT2LIB= \ 110cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicudata$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \ 111cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicudata$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \ 112cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicudata$(DLLPOST) \ 113cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicuuc$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \ 114cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicuuc$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \ 115cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicuuc$(DLLPOST) \ 116cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicui18n$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \ 117cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicui18n$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \ 118cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicui18n$(DLLPOST) \ 119cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicule$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \ 120cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicule$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \ 121cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicule$(DLLPOST) \ 122cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicutu$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \ 123cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicutu$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \ 124cdf0e10cSrcweir $(BUILD_DIR)$/lib$/libicutu$(DLLPOST) 125cdf0e10cSrcweir 126cdf0e10cSrcweirOUT2BIN= \ 127cdf0e10cSrcweir $(BUILD_DIR)$/bin$/genccode \ 128cdf0e10cSrcweir $(BUILD_DIR)$/bin$/genbrk \ 129cdf0e10cSrcweir $(BUILD_DIR)$/bin$/gencmn 130cdf0e10cSrcweir 131cdf0e10cSrcweir.ENDIF 132cdf0e10cSrcweir 133cdf0e10cSrcweir.IF "$(GUI)"=="WNT" 134cdf0e10cSrcweirCONFIGURE_DIR=source 135cdf0e10cSrcweir.IF "$(COM)"=="GCC" 136cdf0e10cSrcweirCONFIGURE_ACTION=rm data/mappings/ucm*.mk data/translit/trn*.mk ; 137cdf0e10cSrcweir.IF "$(MINGW_SHARED_GCCLIB)"=="YES" 138cdf0e10cSrcweiricu_LDFLAGS+=-shared-libgcc 139cdf0e10cSrcweir.ENDIF 140cdf0e10cSrcweir.IF "$(USE_MINGW)"=="cygwin" 141cdf0e10cSrcweiricu_LDFLAGS+=-L$(COMPATH)/lib/mingw -L$(COMPATH)/lib/w32api 142cdf0e10cSrcweir.ENDIF 143cdf0e10cSrcweiricu_LDFLAGS+=-L$(COMPATH)$/lib 144cdf0e10cSrcweiricu_LIBS= 145cdf0e10cSrcweir.IF "$(MINGW_SHARED_GXXLIB)"=="YES" 146cdf0e10cSrcweiricu_LIBS+=$(MINGW_SHARED_LIBSTDCPP) 147cdf0e10cSrcweir.ENDIF 148cdf0e10cSrcweiricu_LDFLAGS+=-Wl,--enable-runtime-pseudo-reloc-v2 149cdf0e10cSrcweirCONFIGURE_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' 150cdf0e10cSrcweir 151cdf0e10cSrcweir#CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no 152cdf0e10cSrcweirCONFIGURE_FLAGS= 153cdf0e10cSrcweir 154cdf0e10cSrcweir# Use of 155cdf0e10cSrcweir# CONFIGURE_ACTION=sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' 156cdf0e10cSrcweir# CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no 157cdf0e10cSrcweir# doesn't work as it would result in 158cdf0e10cSrcweir# sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' --enable-layout ... 159cdf0e10cSrcweir# note the position of the single quotes. 160cdf0e10cSrcweir 161cdf0e10cSrcweirBUILD_DIR=$(CONFIGURE_DIR) 162cdf0e10cSrcweirBUILD_ACTION=$(GNUMAKE) 163cdf0e10cSrcweirOUT2LIB= 164cdf0e10cSrcweir 165cdf0e10cSrcweirOUT2BIN= \ 166cdf0e10cSrcweir $(BUILD_DIR)$/lib$/icudt$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \ 167cdf0e10cSrcweir $(BUILD_DIR)$/lib$/icuuc$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \ 168cdf0e10cSrcweir $(BUILD_DIR)$/lib$/icuin$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \ 169cdf0e10cSrcweir $(BUILD_DIR)$/lib$/icule$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \ 170cdf0e10cSrcweir $(BUILD_DIR)$/lib$/icutu$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \ 171cdf0e10cSrcweir $(BUILD_DIR)$/bin$/genccode.exe \ 172cdf0e10cSrcweir $(BUILD_DIR)$/bin$/genbrk.exe \ 173cdf0e10cSrcweir $(BUILD_DIR)$/bin$/gencmn.exe 174cdf0e10cSrcweir 175cdf0e10cSrcweir.ELSE 176cdf0e10cSrcweirBUILD_DIR=source 177cdf0e10cSrcweir.IF "full_debug" == "" 178cdf0e10cSrcweir 179cdf0e10cSrcweir# Activating the debug mechanism produces incompatible libraries, you'd have 180cdf0e10cSrcweir# at least to relink all modules that are directly using ICU. Note that library 181cdf0e10cSrcweir# names get a 'd' appended and you'd have to edit the solenv/inc/libs.mk 182cdf0e10cSrcweir# ICU*LIB macros as well. Normally you don't want all this. 183cdf0e10cSrcweir# 184cdf0e10cSrcweir# Instead, use the normal already existing Release build and edit the 185cdf0e10cSrcweir# corresponding *.vcproj file of the section you're interested in. Make sure 186cdf0e10cSrcweir# that 187cdf0e10cSrcweir# - for the VCCLCompilerTool section the following line exists: 188cdf0e10cSrcweir# DebugInformationFormat="3" 189cdf0e10cSrcweir# - and for the VCLinkerTool the line 190cdf0e10cSrcweir# GenerateDebugInformation="TRUE" 191cdf0e10cSrcweir# Then delete the corresponding Release output directory, and delete the target 192cdf0e10cSrcweir# flag files 193cdf0e10cSrcweir# $(OUTPATH)/misc/build/so_built_so_icu 194cdf0e10cSrcweir# $(OUTPATH)/misc/build/so_predeliver_so_icu 195cdf0e10cSrcweir# and run dmake again, after which you may copy the resulting libraries to your 196cdf0e10cSrcweir# OOo/SO installation. 197cdf0e10cSrcweirICU_BUILD_VERSION=Debug 198cdf0e10cSrcweirICU_BUILD_LIBPOST=d 199cdf0e10cSrcweir.ELSE 200cdf0e10cSrcweirICU_BUILD_VERSION=Release 201cdf0e10cSrcweirICU_BUILD_LIBPOST= 202cdf0e10cSrcweir.ENDIF 203cdf0e10cSrcweir 204cdf0e10cSrcweirCONFIGURE_ACTION+= $(PERL) ..$/..$/..$/..$/..$/createmak.pl ..$/..$/..$/..$/..$/createmak.cfg . 205cdf0e10cSrcweir 206cdf0e10cSrcweir.IF "$(CCNUMVER)"<="001400000000" 207cdf0e10cSrcweirBUILD_ACTION=cd allinone && nmake /f all.mak EXFLAGS="-EHsc" && cd ..$/.. 208cdf0e10cSrcweir.ELSE 209cdf0e10cSrcweirBUILD_ACTION=cd allinone && nmake /f all.mak EXFLAGS="-EHa -Zc:wchar_t-" && cd ..$/.. 210cdf0e10cSrcweir.ENDIF 211cdf0e10cSrcweir 212cdf0e10cSrcweirOUT2LIB= \ 213cdf0e10cSrcweir $(BUILD_DIR)$/..$/lib$/icudata.lib \ 214cdf0e10cSrcweir $(BUILD_DIR)$/..$/lib$/icuin$(ICU_BUILD_LIBPOST).lib \ 215cdf0e10cSrcweir $(BUILD_DIR)$/..$/lib$/icuuc$(ICU_BUILD_LIBPOST).lib \ 216cdf0e10cSrcweir $(BUILD_DIR)$/..$/lib$/icule$(ICU_BUILD_LIBPOST).lib \ 217cdf0e10cSrcweir $(BUILD_DIR)$/..$/lib$/icutu$(ICU_BUILD_LIBPOST).lib 218cdf0e10cSrcweir 219cdf0e10cSrcweirOUT2BIN= \ 220cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/icudt$(ICU_MAJOR)$(ICU_MINOR).dll \ 221cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/icuin$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \ 222cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/icuuc$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \ 223cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/icule$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \ 224cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/icutu$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \ 225cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/genccode.exe \ 226cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/genbrk.exe \ 227cdf0e10cSrcweir $(BUILD_DIR)$/..$/bin$/gencmn.exe 228cdf0e10cSrcweir 229cdf0e10cSrcweir.ENDIF 230cdf0e10cSrcweir.ENDIF # "$(GUI)"=="WNT" 231cdf0e10cSrcweir 232cdf0e10cSrcweir# --- Targets ------------------------------------------------------ 233cdf0e10cSrcweir 234cdf0e10cSrcweir.INCLUDE : set_ext.mk 235cdf0e10cSrcweir.INCLUDE : target.mk 236cdf0e10cSrcweir.INCLUDE : tg_ext.mk 237cdf0e10cSrcweir 238cdf0e10cSrcweir.IF "$(BINARY_PATCH_FILES)"!="" 239cdf0e10cSrcweir 240cdf0e10cSrcweir$(PACKAGE_DIR)$/so_add_binary : $(PACKAGE_DIR)$/$(ADD_FILES_FLAG_FILE) 241cdf0e10cSrcweir cd $(PACKAGE_DIR) && gunzip -c $(BACK_PATH)$(BINARY_PATCH_FILES) | tar -xvf - 242cdf0e10cSrcweir $(TOUCH) $(PACKAGE_DIR)$/so_add_binary 243cdf0e10cSrcweir 244cdf0e10cSrcweir$(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)$/so_add_binary 245cdf0e10cSrcweir 246cdf0e10cSrcweir.ENDIF 247cdf0e10cSrcweir 248cdf0e10cSrcweir.IF "$(GUI)$(COM)"=="WNTGCC" 249cdf0e10cSrcweirALLTAR : \ 250cdf0e10cSrcweir $(LB)$/icudata.lib \ 251cdf0e10cSrcweir $(LB)$/icuin$(ICU_BUILD_LIBPOST).lib \ 252cdf0e10cSrcweir $(LB)$/icuuc$(ICU_BUILD_LIBPOST).lib \ 253cdf0e10cSrcweir $(LB)$/icule$(ICU_BUILD_LIBPOST).lib \ 254cdf0e10cSrcweir $(LB)$/icutu$(ICU_BUILD_LIBPOST).lib 255cdf0e10cSrcweir 256cdf0e10cSrcweir$(LB)$/icudata.lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 257cdf0e10cSrcweir $(TOUCH) $@ 258cdf0e10cSrcweir 259cdf0e10cSrcweir$(LB)$/icuin$(ICU_BUILD_LIBPOST).lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 260cdf0e10cSrcweir $(TOUCH) $@ 261cdf0e10cSrcweir 262cdf0e10cSrcweir$(LB)$/icuuc$(ICU_BUILD_LIBPOST).lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 263cdf0e10cSrcweir $(TOUCH) $@ 264cdf0e10cSrcweir 265cdf0e10cSrcweir$(LB)$/icule$(ICU_BUILD_LIBPOST).lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 266cdf0e10cSrcweir $(TOUCH) $@ 267cdf0e10cSrcweir 268cdf0e10cSrcweir$(LB)$/icutu$(ICU_BUILD_LIBPOST).lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) 269cdf0e10cSrcweir $(TOUCH) $@ 270cdf0e10cSrcweir.ENDIF 271cdf0e10cSrcweir 272cdf0e10cSrcweir# Since you never know what will be in a patch (for example, it may already 273cdf0e10cSrcweir# patch at configure level) or in the case of a binary patch, we remove the 274cdf0e10cSrcweir# entire package directory if a patch is newer. 275cdf0e10cSrcweir# Changes in this makefile could also make a complete build necessary if 276cdf0e10cSrcweir# configure is affected. 277cdf0e10cSrcweir$(PACKAGE_DIR)$/$(UNTAR_FLAG_FILE) : makefile.mk 278cdf0e10cSrcweir 279