@@ -290,6 +290,7 @@ def wrapper_func(self, args):
290
290
user_ndk_dir = self .ndk_dir ,
291
291
user_android_api = self .android_api ,
292
292
user_ndk_ver = self .ndk_version )
293
+ ctx .set_archs (self .archs )
293
294
dist = self ._dist
294
295
if dist .needs_build :
295
296
info_notify ('No dist exists that meets your requirements, '
@@ -1087,9 +1088,11 @@ def __init__(self):
1087
1088
# root of the toolchain
1088
1089
self .setup_dirs ()
1089
1090
1090
- # AND: Currently only the Android architecture is supported
1091
+ # this list should contain all Archs, it is pruned later
1091
1092
self .archs = (
1092
1093
ArchARM (self ),
1094
+ ArchARMv7_a (self ),
1095
+ Archx86 (self )
1093
1096
)
1094
1097
1095
1098
ensure_dir (join (self .build_dir , 'bootstrap_builds' ))
@@ -1104,6 +1107,22 @@ def __init__(self):
1104
1107
# set the state
1105
1108
self .state = JsonStore (join (self .dist_dir , "state.db" ))
1106
1109
1110
+ def set_archs (self , arch_names ):
1111
+ all_archs = self .archs
1112
+ new_archs = set ()
1113
+ for name in arch_names :
1114
+ matching = [arch for arch in all_archs if arch .arch == name ]
1115
+ for match in matching :
1116
+ new_archs .add (match )
1117
+ self .archs = list (new_archs )
1118
+ if not self .archs :
1119
+ warning ('Asked to compile for no Archs, so failing.' )
1120
+ exit (1 )
1121
+ info ('Will compile for the following archs: {}' .format (
1122
+ ', ' .join ([arch .arch for arch in self .archs ])))
1123
+ exit (1 )
1124
+
1125
+
1107
1126
def prepare_bootstrap (self , bs ):
1108
1127
bs .ctx = self
1109
1128
self .bootstrap = bs
@@ -2771,6 +2790,14 @@ def __init__(self):
2771
2790
help = ('The version of the Android NDK. This is optional, '
2772
2791
'we try to work it out automatically from the ndk_dir.' ))
2773
2792
2793
+
2794
+ # AND: This option doesn't really fit in the other categories, the
2795
+ # arg structure needs a rethink
2796
+ parser .add_argument (
2797
+ '--arch' ,
2798
+ help = 'The archs to build for, separated by commas.' ,
2799
+ default = 'armeabi' )
2800
+
2774
2801
# Options for specifying the Distribution
2775
2802
parser .add_argument (
2776
2803
'--dist_name' ,
@@ -2808,6 +2835,7 @@ def __init__(self):
2808
2835
description = ('Whether the dist recipes must perfectly match '
2809
2836
'those requested' ))
2810
2837
2838
+
2811
2839
self ._read_configuration ()
2812
2840
2813
2841
args , unknown = parser .parse_known_args (sys .argv [1 :])
@@ -2820,8 +2848,8 @@ def __init__(self):
2820
2848
self .android_api = args .android_api
2821
2849
self .ndk_version = args .ndk_version
2822
2850
2823
- # import ipdb
2824
- # ipdb.set_trace()
2851
+ self . archs = split_argument_list ( args . arch )
2852
+
2825
2853
# AND: Fail nicely if the args aren't handled yet
2826
2854
if args .extra_dist_dirs :
2827
2855
warning ('Received --extra_dist_dirs but this arg currently is not '
0 commit comments