diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2011-08-06 19:26:39 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2011-08-17 17:34:23 +0200 |
commit | 2674376ddff9370988fe1fcad0ec519d1e68e869 (patch) | |
tree | 042a9581e042b88006b4e8cbb2372b98da0b6da0 /i18npool/source/breakiterator | |
parent | 3aeeb8fb5d5342b73f1b2f8dde9f270b46bd94c2 (diff) |
convert i18npool to gbuild
Diffstat (limited to 'i18npool/source/breakiterator')
-rw-r--r-- | i18npool/source/breakiterator/Makefile | 85 | ||||
-rw-r--r-- | i18npool/source/breakiterator/data/dict.map | 12 | ||||
-rw-r--r-- | i18npool/source/breakiterator/data/makefile.mk | 80 | ||||
-rw-r--r-- | i18npool/source/breakiterator/makefile.mk | 113 |
4 files changed, 85 insertions, 205 deletions
diff --git a/i18npool/source/breakiterator/Makefile b/i18npool/source/breakiterator/Makefile new file mode 100644 index 000000000000..c8e5d08fd05b --- /dev/null +++ b/i18npool/source/breakiterator/Makefile @@ -0,0 +1,85 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Matúš Kukan <matus.kukan@gmail.com> +# Portions created by the Initial Developer are Copyright (C) 2011 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +all : OpenOffice_dat.c data/dict_ja.cxx data/dict_zh.cxx + +include $(GBUILDDIR)/gbuild_simple.mk + +data: + mkdir data + +data/dict_%.cxx : data/dict_%_invis.cxx + sed 's/\tconst/\tSAL_DLLPUBLIC_EXPORT const/' $< > $@ + +data/dict_%_invis.cxx : $(realpath $(SRC_ROOT)/i18npool/source/breakiterator/data)/%.dic data + $(gb_Helper_execute)gendict $< $@ + + +ifeq ($(SYSTEM_ICU),YES) +GENBRK := $(SYSTEM_GENBRK) +GENCCODE := $(SYSTEM_GENCCODE) +GENCMN := $(SYSTEM_GENCMN) +USE_SED := $(shell if test "$(ICU_MAJOR)" -ge "5" -o "$(ICU_MAJOR)" = "4" -a "$(ICU_MINOR)" -ge "4"; then echo "YES"; fi) +else +GENBRK := $(gb_Helper_execute)genbrk +GENCCODE := $(gb_Helper_execute)genccode +GENCMN := $(gb_Helper_execute)gencmn +USE_SED := YES +endif + +TEMPFILE := $(shell $(gb_MKTEMP)) +BRKFILES := $(notdir $(subst .txt,.brk,$(wildcard $(SRC_ROOT)/i18npool/source/breakiterator/data/*.txt))) + +# 'gencmn', 'genbrk' and 'genccode' are tools generated and delivered by icu project to process icu breakiterator rules. +# The output of gencmn generates warnings under Windows. We want to minimize the patches to external tools, +# so the output (OpenOffice_dat.c) is changed here to include a pragma to disable the warnings. +# Output of gencmn is redirected to OpenOffice_icu_tmp.c with the -t switch. +OpenOffice_dat.c : $(subst .brk,_brk.c,$(BRKFILES)) + $(foreach brkfile,$(BRKFILES),$(shell echo $(brkfile) >> $(TEMPFILE))) + $(GENCMN) -n OpenOffice -t tmp -S -d ./ 0 $(TEMPFILE) + echo '#ifdef _MSC_VER' > $@ + echo '#pragma warning( disable : 4229 4668 )' >> $@ + echo '#endif' >> $@ + cat $(subst _dat,_tmp,$@) >> $@ + +%_brk.c : %.brk + $(GENCCODE) -n OpenOffice -d ./ $< + +%.brk : %.txt.p + $(GENBRK) -r $< -o $@ + +# fdo#31271 ")" reclassified in more recent ICU/Unicode Standards +%.txt.p : $(realpath $(SRC_ROOT)/i18npool/source/breakiterator/data)/%.txt +ifeq ($(USE_SED),YES) + sed "s#\[:LineBreak = Close_Punctuation:\]#\[\[:LineBreak = Close_Punctuation:\] \[:LineBreak = Close_Parenthesis:\]\]#" $< > $@ +else + cp $< $@ +endif + +.PHONY: all +# vim: set noet sw=4 ts=4: diff --git a/i18npool/source/breakiterator/data/dict.map b/i18npool/source/breakiterator/data/dict.map deleted file mode 100644 index ebd4f9185d1f..000000000000 --- a/i18npool/source/breakiterator/data/dict.map +++ /dev/null @@ -1,12 +0,0 @@ -UDK_3_0_0 { -global: - GetVersionInfo; - getDataArea; - getExistMark; - getIndex1; - getIndex2; - getLenArray; - -local: - *; -}; diff --git a/i18npool/source/breakiterator/data/makefile.mk b/i18npool/source/breakiterator/data/makefile.mk deleted file mode 100644 index 572446a80e15..000000000000 --- a/i18npool/source/breakiterator/data/makefile.mk +++ /dev/null @@ -1,80 +0,0 @@ -#************************************************************************* -#* -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************ -PRJ=../../.. - -PRJNAME=i18npool -TARGET=dict -LIBTARGET=NO - -# --- Settings ----------------------------------------------------- -.INCLUDE : settings.mk - -# Fix heap limit problem on MSC -.IF "$(COM)" == "MSC" -.IF "$(COMEX)" != "8" -CDEFS+=-Zm300 -.ENDIF -.ENDIF - -# --- Files -------------------------------------------------------- -# Japanese dictionary -SHL1TARGET=dict_ja -SHL1IMPLIB=i$(SHL1TARGET) - -SHL1VERSIONMAP=$(TARGET).map -SHL1DEF=$(MISC)/$(SHL1TARGET).def -DEF1NAME=$(SHL1TARGET) - -SHL1OBJS= \ - $(SLO)/dict_ja.obj - -LIB1TARGET= $(SLB)/$(SHL1TARGET).lib -LIB1OBJFILES=$(SHL1OBJS) - -# Chinese dictionary -SHL2TARGET=dict_zh -SHL2IMPLIB=i$(SHL2TARGET) - -SHL2VERSIONMAP=$(TARGET).map -SHL2DEF=$(MISC)/$(SHL2TARGET).def -DEF2NAME=$(SHL2TARGET) - -SHL2OBJS= \ - $(SLO)/dict_zh.obj - -LIB2TARGET= $(SLB)/$(SHL2TARGET).lib -LIB2OBJFILES=$(SHL2OBJS) - -DEPOBJFILES= \ - $(SLO1FILES) \ - $(SLO2FILES) - -# --- Targets ------------------------------------------------------ -.INCLUDE : target.mk - -$(MISC)/dict_%.cxx : %.dic - $(AUGMENT_LIBRARY_PATH) $(OUT_FOR_BUILD)/bin/gendict $< $@ diff --git a/i18npool/source/breakiterator/makefile.mk b/i18npool/source/breakiterator/makefile.mk deleted file mode 100644 index 961d7aa1ac6e..000000000000 --- a/i18npool/source/breakiterator/makefile.mk +++ /dev/null @@ -1,113 +0,0 @@ -#************************************************************************* -#* -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************/ -PRJ=../.. -PRJNAME=i18npool -TARGET=breakiterator - -TARGETTYPE=CUI -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- - -# grab all .txt files under data directory, which are breakiterator rule files. -MY_BRK_TXTFILES:=$(shell @ls data/*.txt) - -# insert "OpenOffice" as icu package name in front of the name of each rule file for searching on application provided data -MY_BRK_BRKFILES:=$(subst,data/,$(MISC)/ $(MY_BRK_TXTFILES:s/.txt/.brk/)) - -# OpenOffice_dat.c is a generated file from the rule file list by gencmn -MY_MISC_CXXFILES := \ - $(MISC)/OpenOffice_dat.c \ - $(MY_BRK_BRKFILES:s/.brk/_brk.c/) - -SLOFILES= \ - $(SLO)/breakiteratorImpl.obj \ - $(SLO)/breakiterator_cjk.obj \ - $(SLO)/breakiterator_ctl.obj \ - $(SLO)/breakiterator_th.obj \ - $(SLO)/breakiterator_unicode.obj \ - $(SLO)/xdictionary.obj \ - $(subst,$(MISC)/,$(SLO)/ $(MY_MISC_CXXFILES:s/.c/.obj/)) - -.IF "$(CROSS_COMPILING)" != "YES" - -OBJFILES = $(OBJ)/gendict.obj - -APP1TARGET = gendict -APP1RPATH = NONE - -DEPOBJFILES = $(OBJ)/gendict.obj -APP1OBJS = $(DEPOBJFILES) - -APP1STDLIBS = $(SALLIB) - -.ENDIF - -# --- Targets ------------------------------------------------------ - -.IF "$(SYSTEM_ICU)" == "YES" -GENCMN:=$(SYSTEM_GENCMN) -GENBRK:=$(SYSTEM_GENBRK) -GENCCODE:=$(SYSTEM_GENCCODE) -.ELSE -GENCMN:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/gencmn -GENBRK:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/genbrk -GENCCODE:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/genccode -.ENDIF - -.INCLUDE .IGNORE : icuversion.mk - -.INCLUDE : target.mk - -$(MISC)/%.txt : data/%.txt -# fdo#31271 ")" reclassified in more recent ICU/Unicode Standards -.IF "$(ICU_MAJOR)" >= "5" || ("$(ICU_MAJOR)" == "4" && "$(ICU_MINOR)" >= "4") - $(SED) "s#\[:LineBreak = Close_Punctuation:\]#\[\[:LineBreak = Close_Punctuation:\] \[:LineBreak = Close_Parenthesis:\]\]#" $< > $@ -.ELSE - $(COPY) $< $@ -.ENDIF - -$(MISC)/%.brk : $(MISC)/%.txt - $(GENBRK) -r $< -o $(MISC)/$*.brk - -$(MISC)/%_brk.c : $(MISC)/%.brk - $(GENCCODE) -n OpenOffice -d $(MISC)$ $(MISC)/$*.brk - -# 'gencmn', 'genbrk' and 'genccode' are tools generated and delivered by icu project to process icu breakiterator rules. -# The output of gencmn generates warnings under Windows. We want to minimize the patches to external tools, -# so the output (OpenOffice_dat.c) is changed here to include a pragma to disable the warnings. -# Output of gencmn is redirected to OpenOffice_icu_tmp.c with the -t switch. -$(MISC)/OpenOffice_dat.c : $(MY_BRK_BRKFILES:s/.brk/_brk.c/) - $(GENCMN) -n OpenOffice -t tmp -S -d $(MISC) O $(mktmp $(subst,$(MISC)/, $(MY_BRK_BRKFILES:t"\n"))) - echo $(USQ)#ifdef _MSC_VER$(USQ) > $@ - echo $(USQ)#pragma warning( disable : 4229 4668 )$(USQ) >> $@ - echo $(USQ)#endif$(USQ) >> $@ - $(TYPE) $(@:s/_dat/_tmp/) >> $@ |