Initial import (#787878).

This commit is contained in:
Paweł Forysiuk 2012-02-08 18:14:00 +01:00
parent 4b7a29aa37
commit 2af1470714
5 changed files with 397 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/icu4c-4_8_1_1-src.tgz

View File

@ -0,0 +1,216 @@
--- a/source/common/unicode/platform.h.in
+++ b/source/common/unicode/platform.h.in
@@ -248,6 +248,12 @@
#ifndef U_GNUC_UTF16_STRING
#define U_GNUC_UTF16_STRING @U_CHECK_GNUC_UTF16_STRING@
#endif
+
+/**
+ * Never define U_DECLARE_UTF16 for MinGW, as that will cause
+ * bogus UNICODE_STRING and U_STRING_DECL definitions.
+ */
+#ifndef __MINGW32__
#if @U_CHECK_UTF16_STRING@ || defined(U_CHECK_UTF16_STRING)
#if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
|| (defined(__HP_aCC) && __HP_aCC >= 035000) \
@@ -263,6 +269,7 @@
#define U_DECLARE_UTF16(string) L ## string
#endif
#endif
+#endif
/** @} */
--- a/source/config/icu.pc.in
+++ b/source/config/icu.pc.in
@@ -1,27 +1,27 @@
# Copyright (C) 2010, International Business Machines Corporation. All Rights Reserved.
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-#bindir = @bindir@
-libdir = @libdir@
-includedir = @includedir@
-baselibs = @LIBS@
-#datarootdir = @datarootdir@
-#datadir = @datadir@
-#sbindir = @sbindir@
-#mandir = @mandir@
-#sysconfdir = @sysconfdir@
-CFLAGS = @CFLAGS@
-#CXXFLAGS = @CXXFLAGS@
-DEFS = @DEFS@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+#bindir=@bindir@
+libdir=@libdir@
+includedir=@includedir@
+baselibs=@LIBS@
+#datarootdir=@datarootdir@
+#datadir=@datadir@
+#sbindir=@sbindir@
+#mandir=@mandir@
+#sysconfdir=@sysconfdir@
+CFLAGS=@CFLAGS@
+#CXXFLAGS=@CXXFLAGS@
+DEFS=@DEFS@
UNICODE_VERSION=@UNICODE_VERSION@
ICUPREFIX=icu
ICULIBSUFFIX=@ICULIBSUFFIX@
-LIBICU=lib${ICUPREFIX}
+LIBICU=${ICUPREFIX}
#SHAREDLIBCFLAGS=-fPIC
pkglibdir=${libdir}/@PACKAGE@${ICULIBSUFFIX}/@VERSION@
#pkgdatadir=${datadir}/@PACKAGE@${ICULIBSUFFIX}/@VERSION@
-ICUDATA_NAME = icudt@LIB_VERSION_MAJOR@@ICUDATA_CHAR@
+ICUDATA_NAME=icudt@LIB_VERSION_MAJOR@@ICUDATA_CHAR@
#ICUPKGDATA_DIR=@libdir@
#ICUDATA_DIR=${pkgdatadir}
ICUDESC=International Components for Unicode
--- a/source/config/Makefile.inc.in
+++ b/source/config/Makefile.inc.in
@@ -41,7 +41,7 @@
# The prefix for ICU libraries, normally 'icu'
ICUPREFIX = icu
PACKAGE = @PACKAGE@
-LIBICU = lib$(ICUPREFIX)
+LIBICU = $(ICUPREFIX)
# Static library prefix and file extension
STATIC_PREFIX = s
@@ -113,6 +113,7 @@
ICULIBS_BASE = $(LIBS) -L$(libdir)
# for icu-config to test with
+SO = lib
ICULIBS_COMMON_LIB_NAME = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO}
ICULIBS_COMMON_LIB_NAME_A = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}
--- a/source/config/mh-mingw
+++ b/source/config/mh-mingw
@@ -38,8 +38,10 @@
#LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
## Commands to make a shared library
-SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared
-SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared
+# $(subst) won't work in shell script. #M# at the end omits these
+# lines from the shell script (Make only)
+SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,--enable-auto-import -Wl,--out-implib=$(subst $(SO_TARGET_VERSION_MAJOR),,$(subst $(ICUPREFIX),$(LIBPREFIX)$(ICUPREFIX),$@)).$(A)#M#
+SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -Wl,--enable-auto-import -Wl,--out-implib=$(subst $(SO_TARGET_VERSION_MAJOR),,$(subst $(ICUPREFIX),$(LIBPREFIX)$(ICUPREFIX),$@)).$(A)#M#
## Compiler switch to embed a runtime search path
LD_RPATH=
@@ -52,22 +54,20 @@
SO = dll
## Non-shared intermediate object suffix
STATIC_O = ao
-SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
-
-# Static library prefix and file extension
-LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX)
-A = lib
-
-## An import library is needed for z/OS and MSVC
-#IMPORT_LIB_EXT = .lib
-
-LIBPREFIX=
-
-# Change the stubnames so that poorly working FAT disks and installation programs can work.
-# This is also for backwards compatibility.
-DATA_STUBNAME = dt
-I18N_STUBNAME = in
-LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)
+LIBICU = $(ICUPREFIX)
+LIBSICU = $(LIBPREFIX)$(ICUPREFIX)
+## To have an import library is better on Windows
+IMPORT_LIB_EXT = .dll.a
+
+LIBICU = $(ICUPREFIX)
+ICULIBS_DT = -l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
+ICULIBS_UC = -l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)
+ICULIBS_I18N = -l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)
+ICULIBS_LE = -l$(ICUPREFIX)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX)
+ICULIBS_LX = -l$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)
+ICULIBS_IO = -l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)
+ICULIBS_CTESTFW = -l$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)
+ICULIBS_TOOLUTIL = -l$(ICUPREFIX)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX)
# The #M# is used to delete lines for icu-config
# Current full path directory.
@@ -103,21 +103,32 @@
## Versioned target for a shared library.
## Since symbolic links don't work the same way on Windows,
## we only use the version major number.
-#FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
+SHARED_OBJECT = $(FINAL_SO_TARGET)
+
+IMPORT_LIB = $(subst $(ICUPREFIX),$(LIBPREFIX)$(ICUPREFIX),$(basename $(SO_TARGET))).$(SO).$(A)#M#
+MIDDLE_IMPORT_LIB = $(IMPORT_LIB)#M#
+FINAL_IMPORT_LIB = $(IMPORT_LIB)#M#
-## Special pkgdata information that is needed
-PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
-#ICUPKGDATA_INSTALL_DIR = $(shell cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M#
-#ICUPKGDATA_INSTALL_LIBDIR = $(shell cygpath -dma $(DESTDIR)$(libdir))#M#
+# The following is for Makefile.inc's use.
+ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
## Versioned libraries rules
-#%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
-# $(RM) $@ && cp ${<F} $@
%.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
@echo -n
+## Install libraries as executable
+INSTALL-L=$(INSTALL_PROGRAM)
+
+## Bind internal references
+
+# LDflags that pkgdata will use
+BIR_LDFLAGS= -Wl,-Bsymbolic
+
+# Dependencies [i.e. map files] for the final library
+BIR_DEPS=
+
# Environment variable to set a runtime search path
LDLIBRARYPATH_ENVVAR = PATH
--- a/source/tools/toolutil/pkg_genc.c
+++ b/source/tools/toolutil/pkg_genc.c
@@ -145,6 +145,22 @@
".long ","",HEX_0X
},
+ {"gcc-mingw-x86",
+ ".globl _%s\n"
+ "\t.section .rdata,\"dr\"\n"
+ "\t.align 4\n"
+ "_%s:\n\n",
+
+ ".long ","",HEX_0X
+ },
+ {"gcc-mingw-x64",
+ ".globl %s\n"
+ "\t.section .rdata,\"dr\"\n"
+ "\t.align 16\n" /* Either align 8 bytes or 2^8 (256) bytes. 8 bytes is needed. */
+ "%s:\n\n",
+
+ ".long ","",HEX_0X
+ },
{"sun",
"\t.section \".rodata\"\n"
"\t.align 8\n"
--- a/source/config/icu-config-bottom
+++ b/source/config/icu-config-bottom
@@ -3,7 +3,7 @@
## Copyright (c) 2002-2010, International Business Machines Corporation and
## others. All Rights Reserved.
-ICUUC_FILE="${libdir}/${ICULIBS_COMMON_LIB_NAME}"
+ICUUC_FILE="${bindir}/${ICULIBS_COMMON_LIB_NAME}"
ICUUC_FILE_A="${libdir}/${ICULIBS_COMMON_LIB_NAME_A}"
# echo ENABLE RPATH $ENABLE_RPATH and RPATHLDFLAGS=${RPATH_LDFLAGS}

11
icu4c-4_6_1-win32.patch Normal file
View File

@ -0,0 +1,11 @@
--- icu/source/config/mh-mingw 2011-05-25 02:59:51.523815290 +0200
+++ icu/source/config/mh-mingw 2011-05-25 02:57:58.715695508 +0200
@@ -133,7 +133,7 @@
LDLIBRARYPATH_ENVVAR = PATH
# The type of assembly to write for generating an object file
-GENCCODE_ASSEMBLY=-a gcc-cygwin
+GENCCODE_ASSEMBLY=-a gcc-mingw-x86
# These are needed to allow the pkgdata GNU make files to work
PKGDATA_DEFS = -DU_MAKE=\"$(MAKE)\"

168
mingw-icu.spec Normal file
View File

@ -0,0 +1,168 @@
%global __strip %{_mingw32_strip}
%global __objdump %{_mingw32_objdump}
%define __debug_install_post %{_mingw32_debug_install_post}
%define underscore_version %(echo %{version} | sed 's/\\./_/g')
Name: mingw-icu
Version: 4.8.1.1
Release: 2%{?dist}
Summary: MinGW compilation of International Components for Unicode Tools
License: MIT and UCD and Public Domain
Group: Development/Libraries
URL: http://icu-project.org
Source0: http://download.icu-project.org/files/icu4c/%{version}/icu4c-%{underscore_version}-src.tgz
BuildArch: noarch
Patch0: icu4c-4_6_1-crossbuild.patch
Patch1: icu4c-4_6_1-win32.patch
#Patch2: icu4c-4_6_1-mingw-w64.patch
BuildRequires: mingw32-filesystem >= 68
BuildRequires: mingw32-gcc
BuildRequires: mingw32-gcc-c++
BuildRequires: mingw32-binutils
#BuildRequires: mingw32-pkg-config
%description
ICU is a set of C and C++ libraries that provides robust and
full-featured Unicode and locale support. The library provides calendar
support, conversions for many character sets, language sensitive
collation, date and time formatting, support for many locales, message
catalogs and resources, message formatting, normalization, number and
currency formatting, time zone support, transliteration, and word,
line, and sentence breaking, etc.
%package -n mingw32-icu
Summary: MinGW compilation of International Components for Unicode Tools
Group: Development/Libraries
%description -n mingw32-icu
ICU is a set of C and C++ libraries that provides robust and
full-featured Unicode and locale support. The library provides calendar
support, conversions for many character sets, language sensitive
collation, date and time formatting, support for many locales, message
catalogs and resources, message formatting, normalization, number and
currency formatting, time zone support, transliteration, and word,
line, and sentence breaking, etc.
%{_mingw32_debug_package}
%prep
%setup -q -n icu
%patch0 -p1 -b .crossbuild
%patch1 -p1 -b .win32
%build
pushd source
mkdir -p nativebuild
pushd nativebuild
../configure --enable-static --disable-shared
make %{?_smp_mflags} || make
popd
%{_mingw32_configure} \
--enable-shared --disable-static \
--with-cross-build=$(pwd)/nativebuild \
--with-data-packaging=library
make %{?_smp_mflags}
popd
%install
pushd source
make DESTDIR=$RPM_BUILD_ROOT install
popd
# UGLY HACKS RESTARTING
find $RPM_BUILD_ROOT%{_mingw32_libdir} -name "*.dll" -type l -delete
rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/icudata48.dll
mv $RPM_BUILD_ROOT%{_mingw32_libdir}/libicudata48.1.1.dll \
$RPM_BUILD_ROOT%{_mingw32_libdir}/icudata48.dll
for i in $RPM_BUILD_ROOT%{_mingw32_libdir}/*.dll; \
do mv $i $RPM_BUILD_ROOT%{_mingw32_bindir}/; done
sed -i -e 's,default_ENABLE_RPATH=.*,default_ENABLE_RPATH="N",' -e 's,^SO=.*$,SO="dll",' $RPM_BUILD_ROOT%{_mingw32_bindir}/icu-config
# UGLY HACKS ENDING AGAIN
rm -fr $RPM_BUILD_ROOT%{_mingw32_mandir}
# remove dangling pointers
rm -fr $RPM_BUILD_ROOT%{_mingw32_libdir}/icu/Makefile.inc
rm -fr $RPM_BUILD_ROOT%{_mingw32_libdir}/icu/pkgdata.inc
%files -n mingw32-icu
%doc license.html unicode-license.txt
%{_mingw32_bindir}/genrb.exe
%{_mingw32_bindir}/gencnval.exe
%{_mingw32_bindir}/uconv.exe
%{_mingw32_bindir}/gencmn.exe
%{_mingw32_bindir}/makeconv.exe
%{_mingw32_bindir}/genbrk.exe
%{_mingw32_bindir}/gensprep.exe
%{_mingw32_bindir}/pkgdata.exe
%{_mingw32_bindir}/icupkg.exe
%{_mingw32_bindir}/derb.exe
%{_mingw32_bindir}/genccode.exe
%{_mingw32_bindir}/genctd.exe
%{_mingw32_bindir}/gencfu.exe
%{_mingw32_bindir}/gennorm2.exe
%{_mingw32_bindir}/icuinfo.exe
%{_mingw32_bindir}/icuio48.dll
%{_mingw32_bindir}/icuuc48.dll
%{_mingw32_bindir}/icule48.dll
%{_mingw32_bindir}/icui18n48.dll
%{_mingw32_bindir}/icutu48.dll
%{_mingw32_bindir}/icudata48.dll
%{_mingw32_bindir}/iculx48.dll
%{_mingw32_bindir}/icutest48.dll
%{_mingw32_bindir}/icu-config
%{_mingw32_libdir}/libicule.dll.a
%{_mingw32_libdir}/libicudata.dll.a
%{_mingw32_libdir}/libicui18n.dll.a
%{_mingw32_libdir}/libicuuc.dll.a
%{_mingw32_libdir}/libiculx.dll.a
%{_mingw32_libdir}/libicuio.dll.a
%{_mingw32_libdir}/libicutest.dll.a
%{_mingw32_libdir}/libicutu.dll.a
%{_mingw32_libdir}/pkgconfig/icu-i18n.pc
%{_mingw32_libdir}/pkgconfig/icu-io.pc
%{_mingw32_libdir}/pkgconfig/icu-le.pc
%{_mingw32_libdir}/pkgconfig/icu-lx.pc
%{_mingw32_libdir}/pkgconfig/icu-uc.pc
%{_mingw32_includedir}/layout
%{_mingw32_includedir}/unicode
%{_mingw32_libdir}/icu
%{_mingw32_datadir}/icu
%changelog
* Tue Feb 07 2012 Forysiuk Paweł <tuxator@o2.pl> - 4.8.1.1-2
- Fix icu4c-4_6_1-crossbuild.patch to compile cleanly
- Minor packaging cleanup
* Tue Feb 07 2012 Forysiuk Paweł <tuxator@o2.pl> - 4.8.1.1-1
- Initial release based on openSUSE mingw32-icu package

View File

@ -0,0 +1 @@
ea93970a0275be6b42f56953cd332c17 icu4c-4_8_1_1-src.tgz