1
1
import sh
2
2
import os
3
+ import platform
3
4
from os .path import join , isdir , exists
4
5
from multiprocessing import cpu_count
5
6
from pythonforandroid .recipe import Recipe
@@ -64,7 +65,7 @@ def make_build_dest(dest):
64
65
return build_dest , True
65
66
66
67
icu_build = join (build_root , "icu_build" )
67
- build_linux , exists = make_build_dest ("build_icu_linux " )
68
+ build_host , exists = make_build_dest ("build_icu_host " )
68
69
69
70
host_env = os .environ .copy ()
70
71
# reduce the function set
@@ -75,12 +76,15 @@ def make_build_dest(dest):
75
76
"-DUCONFIG_NO_TRANSLITERATION=0 " )
76
77
77
78
if not exists :
79
+ icu4c_host_platform = platform .system ()
80
+ if icu4c_host_platform == "Darwin" :
81
+ icu4c_host_platform = "MacOSX"
78
82
configure = sh .Command (
79
83
join (build_root , "source" , "runConfigureICU" ))
80
- with current_directory (build_linux ):
84
+ with current_directory (build_host ):
81
85
shprint (
82
86
configure ,
83
- "Linux" ,
87
+ icu4c_host_platform ,
84
88
"--prefix=" + icu_build ,
85
89
"--enable-extras=no" ,
86
90
"--enable-strict=no" ,
@@ -93,18 +97,18 @@ def make_build_dest(dest):
93
97
94
98
build_android , exists = make_build_dest ("build_icu_android" )
95
99
if not exists :
96
-
97
100
configure = sh .Command (join (build_root , "source" , "configure" ))
98
101
99
102
with current_directory (build_android ):
100
103
shprint (
101
104
configure ,
102
- "--with-cross-build=" + build_linux ,
105
+ "--with-cross-build=" + build_host ,
103
106
"--enable-extras=no" ,
104
107
"--enable-strict=no" ,
105
108
"--enable-static=no" ,
106
109
"--enable-tests=no" ,
107
110
"--enable-samples=no" ,
111
+ "--host=" + arch .command_prefix ,
108
112
"--prefix=" + icu_build ,
109
113
_env = env )
110
114
shprint (sh .make , "-j" , str (cpu_count ()), _env = env )
0 commit comments