diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-10-01 11:20:50 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-10-01 21:09:24 +0200 |
commit | 7f16cabf00daa30e9284d2fb2494bd341352c25e (patch) | |
tree | 99809a8a4bf094e43ab5247a3de06cfb1712ff23 /external | |
parent | 0b3ff97d7d5a1e8471e494f4141165364203c192 (diff) |
icu: fix Windows Cygwin cross build
This replaces the previous, broken Windows ARM64 solution with a
general fix for Cygwin cross-building. The main problem is the
PATH environment, because that is colon-seperated on Cygwin, like
on Unix, so won't work with any absolute "Windows" path, which is
needed for the --with-cross-build option.
One general change is the adoption of icucross.inc. I don't know,
why that should prefer the general CURR_FULL_DIR from icudefs.mk
over the specific one in @platform_make_fragment@. That breaks
here, because it returns a cygwin unix path, which is used as
an option to compiled tools, which these won't be able to handle.
Change-Id: Ic2cf15b48801ac57ea5a8a2876ce59f2a84edfb3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103759
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'external')
-rw-r--r-- | external/icu/ExternalProject_icu.mk | 2 | ||||
-rw-r--r-- | external/icu/UnpackedTarball_icu.mk | 4 | ||||
-rw-r--r-- | external/icu/icu4c-win-arm64.patch.1 | 76 | ||||
-rw-r--r-- | external/icu/icu4c-windows-cygwin-cross.patch.1 | 131 |
4 files changed, 133 insertions, 80 deletions
diff --git a/external/icu/ExternalProject_icu.mk b/external/icu/ExternalProject_icu.mk index 855534f0a405..3ded08562211 100644 --- a/external/icu/ExternalProject_icu.mk +++ b/external/icu/ExternalProject_icu.mk @@ -29,7 +29,6 @@ $(call gb_ExternalProject_get_state_target,icu,build) : $(if $(MSVC_USE_DEBUG_RUNTIME),--enable-debug --disable-release) \ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \ --with-cross-build=$(WORKDIR_FOR_BUILD)/UnpackedTarball/icu/source \ - $(if $(GNUMAKE_WIN_NATIVE),--enable-native-make) \ --disable-tools --disable-extras) \ && $(MAKE) $(if $(CROSS_COMPILING),DATASUBDIR=data) $(if $(verbose),VERBOSE=1) \ ,source) @@ -67,6 +66,7 @@ icu_LDFLAGS:=" \ $(call gb_ExternalProject_get_state_target,icu,build) : $(call gb_Trace_StartRange,icu,EXTERNAL) $(call gb_ExternalProject_run,build,\ + autoconf && \ CPPFLAGS=$(icu_CPPFLAGS) CFLAGS=$(icu_CFLAGS) \ CXXFLAGS=$(icu_CXXFLAGS) LDFLAGS=$(icu_LDFLAGS) \ PYTHONWARNINGS="default" \ diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk index 552c578ae6cf..002b7d28cab5 100644 --- a/external/icu/UnpackedTarball_icu.mk +++ b/external/icu/UnpackedTarball_icu.mk @@ -41,9 +41,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\ external/icu/icu4c-khmerbreakengine.patch.1 \ external/icu/strict_ansi.patch \ external/icu/icu4c-link-scrptrun.patch.2 \ - $(if $(CROSS_COMPILING),\ - $(if $(filter WNT_ARM64,$(OS)_$(CPUNAME)),external/icu/icu4c-win-arm64.patch.1) \ - )\ + external/icu/icu4c-windows-cygwin-cross.patch.1 \ )) $(eval $(call gb_UnpackedTarball_add_file,icu,source/data/brkitr/khmerdict.dict,external/icu/khmerdict.dict)) diff --git a/external/icu/icu4c-win-arm64.patch.1 b/external/icu/icu4c-win-arm64.patch.1 deleted file mode 100644 index 272310fed845..000000000000 --- a/external/icu/icu4c-win-arm64.patch.1 +++ /dev/null @@ -1,76 +0,0 @@ -diff -ur icu.org/source/acinclude.m4 icu/source/acinclude.m4 ---- icu.org/source/acinclude.m4 2020-04-10 16:22:16.000000000 +0200 -+++ icu/source/acinclude.m4 2020-04-21 22:14:09.940217733 +0200 -@@ -52,6 +52,12 @@ - else - icu_cv_host_frag=mh-cygwin-msvc - fi ;; -+aarch64-*-cygwin) -+ if test "$GCC" = yes; then -+ icu_cv_host_frag=mh-cygwin64 -+ else -+ icu_cv_host_frag=mh-cygwin-msvc -+ fi ;; - *-*-mingw*) - if test "$GCC" = yes; then - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -diff -ur icu.org/source/configure.ac icu/source/configure.ac ---- icu.org/source/configure.ac 2020-04-10 16:22:16.000000000 +0200 -+++ icu/source/configure.ac 2020-04-21 22:14:09.940217733 +0200 -@@ -252,6 +252,23 @@ - fi - fi - AC_SUBST(cross_buildroot) -+ -+native_make="no" -+ENABLE_RELEASE=1 -+AC_ARG_ENABLE(native-make, -+ [ --enable-native-make build with naive make (Cygwin only) [default=no]], -+ [ case "${enableval}" in -+ yes|"") native_make="yes" ;; -+ esac ], -+) -+ -+cross_path_buildroot="$cross_buildroot" -+if test "x$native_make" = "xyes"; then -+ case "${host}" in -+ *-*-cygwin*) cross_path_buildroot=$(cygpath -u "$cross_buildroot") ;; -+ esac -+fi -+AC_SUBST(cross_path_buildroot) - - # Check for doxygen to generate documentation - AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin) -diff -ur icu.org/source/icudefs.mk.in icu/source/icudefs.mk.in ---- icu.org/source/icudefs.mk.in 2020-04-10 16:22:16.000000000 +0200 -+++ icu/source/icudefs.mk.in 2020-04-21 22:14:09.940217733 +0200 -@@ -40,6 +40,7 @@ - # controls the include of $(top_builddir)/icucross.mk at bottom of file - cross_compiling = @cross_compiling@ - cross_buildroot = @cross_buildroot@ -+cross_path_buildroot = @cross_path_buildroot@ - - # Package information - -diff -ur icu.org/source/Makefile.in icu/source/Makefile.in ---- icu.org/source/Makefile.in 2020-04-10 16:22:16.000000000 +0200 -+++ icu/source/Makefile.in 2020-04-21 22:14:09.940217733 +0200 -@@ -90,15 +90,15 @@ - echo "TOOLEXEEXT=$(EXEEXT)" \ - ) > $@ - @(echo 'TOOLBINDIR=$$(cross_buildroot)/bin' ;\ -- echo 'TOOLLIBDIR=$$(cross_buildroot)/lib' ;\ -+ echo 'TOOLLIBDIR=$$(cross_path_buildroot)/lib' ;\ - echo "INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(TOOLLIBDIR):$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$$$'"$(LDLIBRARYPATH_ENVVAR)" ;\ - echo "PKGDATA_INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$(TOOLLIBDIR):$$$$'"$(LDLIBRARYPATH_ENVVAR) " ;\ - echo ) >> $@ - - config/icucross.inc: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile @platform_make_fragment@ - @echo rebuilding $@ -- @(grep '^CURR_FULL_DIR' $(top_builddir)/icudefs.mk ; \ -- grep '^CURR_FULL_DIR' @platform_make_fragment@ || echo ""; \ -+ @(grep '^CURR_FULL_DIR' @platform_make_fragment@ || echo ""; \ -+ grep '^CURR_FULL_DIR' $(top_builddir)/icudefs.mk ; \ - ) > $@ - - config/icu.pc: $(srcdir)/config/icu.pc.in diff --git a/external/icu/icu4c-windows-cygwin-cross.patch.1 b/external/icu/icu4c-windows-cygwin-cross.patch.1 new file mode 100644 index 000000000000..dd6b47c17211 --- /dev/null +++ b/external/icu/icu4c-windows-cygwin-cross.patch.1 @@ -0,0 +1,131 @@ +diff -ur icu.org/source/acinclude.m4 icu/source/acinclude.m4 +--- icu.org/source/acinclude.m4 2020-04-10 16:22:16.000000000 +0200 ++++ icu/source/acinclude.m4 2020-04-21 22:14:09.940217733 +0200 +@@ -52,6 +52,12 @@ + else + icu_cv_host_frag=mh-cygwin-msvc + fi ;; ++aarch64-*-cygwin) ++ if test "$GCC" = yes; then ++ icu_cv_host_frag=mh-cygwin64 ++ else ++ icu_cv_host_frag=mh-cygwin-msvc ++ fi ;; + *-*-mingw*) + if test "$GCC" = yes; then + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +--- icu/source/configure.ac.orig 2020-04-22 22:04:20.000000000 +0200 ++++ icu/source/configure.ac 2020-10-01 09:39:05.570900400 +0200 +@@ -213,23 +213,33 @@ + [cross_buildroot="${withval}"], + [cross_buildroot=""]) + ++cross_mixed_buildroot="$cross_buildroot" ++cross_unix_buildroot="$cross_buildroot" + if test "X$cross_buildroot" = "X"; then + if test "$cross_compiling" = "yes"; then + AC_MSG_ERROR([Error! Cross compiling but no --with-cross-build option specified - please supply the path to an executable ICU's build root]) + dnl ' + fi + else +- if test -f "${cross_buildroot}/config/icucross.mk"; then ++ case "${host}" in ++ *-*-cygwin*) ++ #M# -m isn't used because it doesn't work on Win98 ++ cross_mixed_buildroot=$(cygpath -ad "$cross_buildroot" | tr '\\' '/') ++ cross_unix_buildroot=$(cygpath -au "$cross_buildroot") ++ ;; ++ esac ++ if test -f "${cross_mixed_buildroot}/config/icucross.mk"; then + AC_MSG_RESULT([Using cross buildroot: $cross_buildroot]) + else +- if test -d "${cross_buildroot}"; then +- AC_MSG_ERROR([${cross_buildroot}/config/icucross.mk not found. Please build ICU in ${cross_buildroot} first.]) ++ if test -d "${cross_mixed_buildroot}"; then ++ AC_MSG_ERROR([${cross_mixed_buildroot}/config/icucross.mk not found. Please build ICU in ${cross_mixed_buildroot} first.]) + else +- AC_MSG_ERROR([No such directory ${cross_buildroot} supplied as the argument to --with-cross-build. Use an absolute path.]) ++ AC_MSG_ERROR([No such directory ${cross_mixed_buildroot} supplied as the argument to --with-cross-build. Use an absolute path.]) + fi + fi + fi +-AC_SUBST(cross_buildroot) ++AC_SUBST(cross_mixed_buildroot) ++AC_SUBST(cross_unix_buildroot) + + # Check for doxygen to generate documentation + AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin) +--- icu/source/test/testdata/Makefile.in.orig 2020-10-01 09:37:25.847888900 +0200 ++++ icu/source/test/testdata/Makefile.in 2020-10-01 09:36:41.859996500 +0200 +@@ -82,7 +82,7 @@ + # relative lib links from pkgdata are the same as for tmp + GENRBOPTS=-k + # use the cross root, in case we are cross compiling. Otherwise it is equal to top_builddir +-TOOLDIR=$(cross_buildroot)/tools ++TOOLDIR=$(cross_mixed_buildroot)/tools + SRCDATADIR=$(top_srcdir)/data + UNICODEDATADIR=$(SRCDATADIR)/unidata + OUTDIR=$(top_builddir)/data/out +--- icu/source/Makefile.in.orig 2020-04-22 22:04:20.000000000 +0200 ++++ icu/source/Makefile.in 2020-10-01 09:29:36.642364000 +0200 +@@ -255,16 +255,16 @@ + @(echo "CROSS_ICU_VERSION=$(VERSION)" ;\ + echo "TOOLEXEEXT=$(EXEEXT)" \ + ) > $@ +- @(echo 'TOOLBINDIR=$$(cross_buildroot)/bin' ;\ +- echo 'TOOLLIBDIR=$$(cross_buildroot)/lib' ;\ +- echo "INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(TOOLLIBDIR):$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$$$'"$(LDLIBRARYPATH_ENVVAR)" ;\ +- echo "PKGDATA_INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(cross_buildroot)/stubdata:$$(cross_buildroot)/tools/ctestfw:$$(TOOLLIBDIR):$$$$'"$(LDLIBRARYPATH_ENVVAR) " ;\ ++ @(echo 'TOOLBINDIR=$$(cross_mixed_buildroot)/bin' ;\ ++ echo 'TOOLLIBDIR=$$(cross_mixed_buildroot)/lib' ;\ ++ echo "INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(cross_unix_buildroot)/lib:$$(cross_unix_buildroot)/stubdata:$$(cross_unix_buildroot)/tools/ctestfw:$$$$'"$(LDLIBRARYPATH_ENVVAR)" ;\ ++ echo "PKGDATA_INVOKE=$(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)"'$$(cross_unix_buildroot)/stubdata:$$(cross_unix_buildroot)/tools/ctestfw:$$(cross_unix_buildroot)/lib:$$$$'"$(LDLIBRARYPATH_ENVVAR) " ;\ + echo ) >> $@ + + config/icucross.inc: $(top_builddir)/icudefs.mk $(top_builddir)/Makefile @platform_make_fragment@ + @echo rebuilding $@ +- @(grep '^CURR_FULL_DIR' $(top_builddir)/icudefs.mk ; \ +- grep '^CURR_FULL_DIR' @platform_make_fragment@ || echo ""; \ ++ @(grep '^CURR_FULL_DIR' @platform_make_fragment@ || echo ""; \ ++ grep '^CURR_FULL_DIR' $(top_builddir)/icudefs.mk ; \ + ) > $@ + + config/icu.pc: $(srcdir)/config/icu.pc.in +--- icu/source/icudefs.mk.in.orig 2020-04-22 22:04:20.000000000 +0200 ++++ icu/source/icudefs.mk.in 2020-10-01 09:35:54.418128800 +0200 +@@ -35,7 +35,8 @@ + sysconfdir = @sysconfdir@ + # controls the include of $(top_builddir)/icucross.mk at bottom of file + cross_compiling = @cross_compiling@ +-cross_buildroot = @cross_buildroot@ ++cross_mixed_buildroot = @cross_mixed_buildroot@ ++cross_unix_buildroot = @cross_unix_buildroot@ + + # Package information + +@@ -303,8 +304,8 @@ + INSTALLED_INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(libdir):$$$(LDLIBRARYPATH_ENVVAR) + + # Current full path directory for cross compilation +-ifneq ($(strip $(cross_buildroot)),) +-include $(cross_buildroot)/config/icucross.inc ++ifneq ($(strip $(cross_mixed_buildroot)),) ++include $(cross_mixed_buildroot)/config/icucross.inc + endif + + # Platform-specific setup +@@ -323,10 +324,11 @@ + + # some imported things from the cross env + TOOLEXEEXT = $(EXEEXT) +-ifneq ($(strip $(cross_buildroot)),) +-include $(cross_buildroot)/config/icucross.mk ++ifneq ($(strip $(cross_mixed_buildroot)),) ++include $(cross_mixed_buildroot)/config/icucross.mk + else +-cross_buildroot = $(top_builddir) ++cross_mixed_buildroot = $(top_builddir) ++cross_unix_buildroot = $(top_builddir) + endif + + # for tests |