IOT-2793 Add introspection for simpleserver
[iotivity.git] / auto_build.py
1 #!/usr/bin/python
2
3 import os
4 import sys
5 import platform
6 import subprocess
7 import multiprocessing
8
9 # help message
10 def helpmsg(script):
11     helpstr = '''
12 Usage:
13     build:
14         python %s <targetbuild>
15         Allowed values for <target_build>: all, linux_unsecured, linux_secured, linux_full, linux_unsecured_with_rd, linux_secured_with_rd,
16         android, android_unsecured, android_secured, tizen, tizen_unsecured, tizen_secured, simulator, darwin, windows, msys
17         Note: \"linux\" will build \"linux_unsecured\", \"linux_secured\", \"linux_secured_with_rd\", \"linux_unsecured_with_mq\", \"linux_secured_with_tcp\" & \"linux_unsecured_with_tcp\" & \"linux_unsecured_with_rd\".
18         Any selection will build both debug and release versions of all available targets in the scope you've selected.
19         To choose any specific command, please use the SCons commandline directly. Please refer to [IOTIVITY_REPO]/Readme.scons.txt.
20     clean:
21         python %s -c
22     '''
23     print (helpstr % (script, script))
24     sys.exit(1)
25
26 def call_scons(build_options, extra_option_str):
27     """
28     This function formats and runs a scons command
29     Arguments:
30     build_options    -- {Dictionary} build flags (keys) associated with values;
31     extra_option_str -- {String} extra options to append to scons command
32     """
33     cmd_line = "scons VERBOSE=" + VERBOSE
34     for key in build_options:
35         cmd_line += " " + key + "=" + str(build_options[key])
36
37     cmd_line += " " + str(extra_option_str)
38
39     if not EXEC_MODE:
40         print ("Would run : " + cmd_line)
41     else:
42         print ("Running : " + cmd_line)
43         sys.stdout.flush()
44         exit_code = subprocess.Popen(cmd_line, shell=True).wait()
45         if exit_code != 0:
46             sys.exit(exit_code)
47
48 def build_all(flag, extra_option_str):
49     if platform.system() == "Linux":
50         build_linux_unsecured(flag, extra_option_str)
51         build_linux_secured(flag, extra_option_str)
52         build_linux_unsecured_with_rm(flag, extra_option_str)
53         build_linux_unsecured_with_rd(flag, extra_option_str)
54         build_linux_secured_with_rd(flag, extra_option_str)
55         build_linux_unsecured_with_mq(flag, extra_option_str)
56         build_linux_unsecured_with_tcp(flag, extra_option_str)
57         build_linux_secured_with_tcp(flag, extra_option_str)
58         build_linux_unsecured_with_java(flag, extra_option_str)
59         build_linux_secured_with_java(flag, extra_option_str)
60         build_simulator(flag, extra_option_str)
61
62         build_android_unsecured(flag, extra_option_str)
63         build_android_secured(flag, extra_option_str)
64         build_tizen(flag, extra_option_str)
65
66     if platform.system() == "Windows":
67         build_windows(flag, extra_option_str)
68
69     if platform.system() == "Darwin":
70         build_darwin(flag, extra_option_str)
71
72 def build_linux(flag, extra_option_str):
73     build_linux_unsecured(flag, extra_option_str)
74     build_linux_secured(flag, extra_option_str)
75
76 def build_linux_unsecured(flag, extra_option_str):
77     print ("*********** Build for linux ************")
78     build_options = {
79                         'RELEASE':flag,
80                         'SECURED':0,
81                     }
82     call_scons(build_options, extra_option_str)
83
84 def build_linux_secured_with_tcp(flag, extra_option_str):
85     print ("*********** Build for linux with Secured TCP ************")
86     build_options = {
87                         'RELEASE':flag,
88                         'WITH_TCP': 1,
89                         'WITH_CLOUD':1,
90                     }
91     call_scons(build_options, extra_option_str)
92
93 def build_linux_unsecured_with_java(flag, extra_option_str):
94     print ("*********** Build for linux with Java support ************")
95     build_options = {
96                         'RELEASE':flag,
97                         'BUILD_JAVA': 1,
98                         'TARGET_TRANSPORT': 'IP',
99                     }
100     call_scons(build_options, extra_option_str)
101
102 def build_linux_secured_with_java(flag, extra_option_str):
103     print ("*********** Build for linux with Java support and secured ************")
104     build_options = {
105                         'RELEASE':flag,
106                         'BUILD_JAVA': 1,
107                         'TARGET_TRANSPORT': 'IP',
108                         'SECURED': 1,
109                     }
110     call_scons(build_options, extra_option_str)
111
112 def build_linux_unsecured_with_tcp(flag, extra_option_str):
113     print ("*********** Build for linux with TCP ************")
114     build_options = {
115                         'RELEASE':flag,
116                         'WITH_TCP': 1,
117                         'TARGET_TRANSPORT': 'IP',
118                         'SECURED':0,
119                     }
120     call_scons(build_options, extra_option_str)
121
122 def build_linux_unsecured_with_rm(flag, extra_option_str):
123     print ("*********** Build for linux with RoutingManager************")
124     build_options = {
125                         'ROUTING':'GW',
126                         'RELEASE':flag,
127                         'SECURED':0,
128                     }
129     call_scons(build_options, extra_option_str)
130
131 def build_linux_secured(flag, extra_option_str):
132     print ("*********** Build for linux with Security *************")
133     build_options = {
134                         'RELEASE':flag,
135                     }
136     call_scons(build_options, extra_option_str)
137
138 def build_linux_full(flag, extra_option_str):
139     print ("*********** Build for linux with full features *************")
140     build_options = {
141                         'BUILD_JAVA':1,
142                         'MULTIPLE_OWNER':1,
143                         'RELEASE':flag,
144                         'SECURED':1,
145                         'WITH_CLOUD':1,
146                         'WITH_RA':1,
147                         'WITH_RA_IBB':1,
148                         'WITH_TCP':1,
149                     }
150     call_scons(build_options, extra_option_str)
151
152 def build_linux_unsecured_with_rd(flag, extra_option_str):
153     print ("*********** Build for linux With Resource Directory *************")
154     build_options = {
155                         'RELEASE':flag,
156                         'RD_MODE':'all',
157                         'SECURED':0,
158                     }
159     call_scons(build_options, extra_option_str)
160
161 def build_linux_secured_with_rd(flag, extra_option_str):
162     print ("*********** Build for linux With Resource Directory & Security ************")
163     build_options = {
164                         'RELEASE':flag,
165                         'RD_MODE':'all',
166                     }
167     call_scons(build_options, extra_option_str)
168
169 def build_linux_unsecured_with_mq(flag, extra_option_str):
170     print ("*********** Build for linux With Message Queue ************")
171     build_options = {
172                         'RELEASE':flag,
173                         'WITH_MQ':'PUB,SUB,BROKER',
174                         'SECURED':0,
175                     }
176     call_scons(build_options, extra_option_str)
177
178 def build_linux_unsecured_with_tcp(flag, extra_option_str):
179     print ("*********** Build for linux With tcp ************")
180     build_options = {
181                         'RELEASE':flag,
182                         'WITH_TCP':'1',
183                         'SECURED':0,
184                     }
185     call_scons(build_options, extra_option_str)
186
187 def build_android(flag, extra_option_str):
188     # Note: for android, as oic-resource uses C++11 feature stoi and to_string,
189     # it requires gcc-4.9, currently only android-ndk-r10(for linux)
190     # and windows android-ndk-r10(64bit target version) support these features.
191     print ("*********** Build for android armeabi *************")
192     build_options = {
193                         'TARGET_OS':'android',
194                         'TARGET_ARCH':'armeabi',
195                         'RELEASE':flag,
196                     }
197     call_scons(build_options, extra_option_str)
198
199 def build_android_universal(flag, extra_option_str):
200     print('''
201 *******************************************************************************
202     Starting Android Universal build
203     This Will take a very long time to complete. It will build the android
204     build for the following architectures.
205        - armeabi
206        - armeabi-v7a
207        - arm64-v8a
208        - x86
209        - x86_64
210     If you do not need to build a universal APK or you can target a specific
211     architecture we recommend you build android for that specific target. 
212 *******************************************************************************
213 ''')
214     print ("*********** Build for android armeabi *************")
215     build_options = {
216                         'TARGET_OS':'android',
217                         'TARGET_ARCH':'armeabi',
218                         'RELEASE':flag,
219                     }
220     call_scons(build_options, extra_option_str)
221     print ("*********** Build for android x86 *************")
222     build_options = {
223                         'TARGET_OS':'android',
224                         'TARGET_ARCH':'x86',
225                         'RELEASE':flag,
226                     }
227     call_scons(build_options, extra_option_str)
228     print ("*********** Build for android armeabi-v7a *************")
229     build_options = {
230                         'TARGET_OS':'android',
231                         'TARGET_ARCH':'armeabi-v7a',
232                         'RELEASE':flag,
233                     }
234     call_scons(build_options, extra_option_str)
235     print ("*********** Build for android x86_64 *************")
236     build_options = {
237                         'TARGET_OS':'android',
238                         'TARGET_ARCH':'x86_64',
239                         'RELEASE':flag,
240                     }
241     call_scons(build_options, extra_option_str)
242     print ("*********** Build for android arm64-v8a *************")
243     build_options = {
244                         'TARGET_OS':'android',
245                         'TARGET_ARCH':'arm64-v8a',
246                         'RELEASE':flag,
247                     }
248     call_scons(build_options, extra_option_str)
249     print ("*********** Finishing Android universal build *************")
250
251 def build_android_secured(flag, extra_option_str):
252     build_android(flag, extra_option_str + " SECURED=1")
253
254 def build_android_unsecured(flag, extra_option_str):
255     build_android(flag, extra_option_str + " SECURED=0")
256
257 def build_android_x86(flag, extra_option_str):
258     """ Build Android x86 Suite """
259     build_android_x86_with_ip(flag, extra_option_str)
260     build_android_x86_with_bt(flag, extra_option_str)
261     build_android_x86_with_ble(flag, extra_option_str)
262
263 def build_android_x86_with_ip(flag, extra_option_str):
264     print ("*********** Build for android x86 *************")
265     build_options = {
266                         'TARGET_OS':'android',
267                         'TARGET_ARCH':'x86',
268                         'RELEASE':flag,
269                         'TARGET_TRANSPORT':'IP',
270                     }
271     call_scons(build_options, extra_option_str)
272
273 def build_android_x86_with_bt(flag, extra_option_str):
274     print ("*********** Build for android x86 with Bluetooth *************")
275     build_options = {
276                         'TARGET_OS':'android',
277                         'TARGET_ARCH':'x86',
278                         'RELEASE':flag,
279                         'TARGET_TRANSPORT':'BT',
280                     }
281     call_scons(build_options, extra_option_str)
282
283 def build_android_x86_with_ble(flag, extra_option_str):
284     print ("*********** Build for android x86 with Bluetooth Low Energy *************")
285     build_options = {
286                         'TARGET_OS':'android',
287                         'TARGET_ARCH':'x86',
288                         'RELEASE':flag,
289                         'TARGET_TRANSPORT':'BLE',
290                     }
291     call_scons(build_options, extra_option_str)
292
293 def build_android_x86_with_rm(flag, extra_option_str):
294     """ Build Android x86 Routing Manager Suite """
295     build_android_x86_with_rm_and_ip(flag, extra_option_str)
296     build_android_x86_with_rm_and_bt(flag, extra_option_str)
297     build_android_x86_with_rm_and_ble(flag, extra_option_str)
298
299 def build_android_x86_with_rm_and_ip(flag, extra_option_str):
300     print ("*********** Build for android x86 with Routing Manager *************")
301     build_options = {
302                         'TARGET_OS':'android',
303                         'TARGET_ARCH':'x86',
304                         'ROUTING':'GW',
305                         'RELEASE':flag,
306                         'TARGET_TRANSPORT':'IP',
307                     }
308     call_scons(build_options, extra_option_str)
309
310 def build_android_x86_with_rm_and_bt(flag, extra_option_str):
311     print ("*********** Build for android x86 with Routing Manager and Bluetooth *************")
312     build_options = {
313                         'TARGET_OS':'android',
314                         'TARGET_ARCH':'x86',
315                         'ROUTING':'GW',
316                         'RELEASE':flag,
317                         'TARGET_TRANSPORT':'BT',
318                     }
319     call_scons(build_options, extra_option_str)
320
321 def build_android_x86_with_rm_and_ble(flag, extra_option_str):
322     print ("*********** Build for android x86 with Routing Manager and Bluetooth Low Energy *************")
323     build_options = {
324                         'TARGET_OS':'android',
325                         'TARGET_ARCH':'x86',
326                         'ROUTING':'GW',
327                         'RELEASE':flag,
328                         'TARGET_TRANSPORT':'BLE',
329                     }
330     call_scons(build_options, extra_option_str)
331
332 def build_android_armeabi(flag, extra_option_str):
333     """ Build Android Armeabi Suite """
334     build_android_armeabi_with_ip(flag, extra_option_str)
335     build_android_armeabi_with_bt(flag, extra_option_str)
336     build_android_armeabi_with_ble(flag, extra_option_str)
337
338 def build_android_armeabi_with_ip(flag, extra_option_str):
339     print ("*********** Build for android armeabi *************")
340     build_options = {
341                         'TARGET_OS':'android',
342                         'TARGET_ARCH':'armeabi',
343                         'RELEASE':flag,
344                         'TARGET_TRANSPORT':'IP',
345                     }
346     call_scons(build_options, extra_option_str)
347
348 def build_android_armeabi_with_bt(flag, extra_option_str):
349     print ("*********** Build for android armeabi with Bluetooth *************")
350     build_options = {
351                         'TARGET_OS':'android',
352                         'TARGET_ARCH':'armeabi',
353                         'RELEASE':flag,
354                         'TARGET_TRANSPORT':'BT',
355                     }
356     call_scons(build_options, extra_option_str)
357
358 def build_android_armeabi_with_ble(flag, extra_option_str):
359     print ("*********** Build for android armeabi with Bluetooth Low Energy *************")
360     build_options = {
361                         'TARGET_OS':'android',
362                         'TARGET_ARCH':'armeabi',
363                         'RELEASE':flag,
364                         'TARGET_TRANSPORT':'BLE',
365                     }
366     call_scons(build_options, extra_option_str)
367
368 def build_android_armeabi_with_rm(flag, extra_option_str):
369     """ Build Android Armeabi Routing Manager Suite """
370     build_android_armeabi_with_rm_and_ip(flag, extra_option_str)
371     build_android_armeabi_with_rm_and_bt(flag, extra_option_str)
372     build_android_armeabi_with_rm_and_ble(flag, extra_option_str)
373
374 def build_android_armeabi_with_rm_and_ip(flag, extra_option_str):
375     print ("*********** Build for android armeabi with Routing Manager *************")
376     build_options = {
377                         'TARGET_OS':'android',
378                         'TARGET_ARCH':'armeabi',
379                         'ROUTING':'GW',
380                         'RELEASE':flag,
381                         'TARGET_TRANSPORT':'IP',
382                     }
383     call_scons(build_options, extra_option_str)
384
385 def build_android_armeabi_with_rm_and_bt(flag, extra_option_str):
386     print ("*********** Build for android armeabi with Routing Manager and Bluetooth *************")
387     build_options = {
388                         'TARGET_OS':'android',
389                         'TARGET_ARCH':'armeabi',
390                         'ROUTING':'GW',
391                         'RELEASE':flag,
392                         'TARGET_TRANSPORT':'BT',
393                     }
394     call_scons(build_options, extra_option_str)
395
396 def build_android_armeabi_with_rm_and_ble(flag, extra_option_str):
397     print ("*********** Build for android armeabi with Routing Manager and Bluetooth Low Energy *************")
398     build_options = {
399                         'TARGET_OS':'android',
400                         'TARGET_ARCH':'armeabi',
401                         'ROUTING':'GW',
402                         'RELEASE':flag,
403                         'TARGET_TRANSPORT':'BLE',
404                     }
405     call_scons(build_options, extra_option_str)
406
407 def build_tizen(flag, extra_option_str):
408     print ("*********** Build for Tizen with options *************")
409     cmd_line = os.getcwd() + "/gbsbuild.sh" + " " + extra_option_str
410     if not EXEC_MODE:
411         print ("Would run : " + cmd_line)
412     else:
413         print ("Running : " + cmd_line)
414         exit_code = subprocess.Popen([cmd_line], shell=True).wait()
415         if exit_code != 0:
416             sys.exit(exit_code)
417
418     print ("*********** Build for Tizen octbstack lib and sample *************")
419     build_extra_options = "-f resource/csdk/stack/samples/tizen/build/SConscript " + extra_option_str
420     build_options = {
421                         'TARGET_OS':'tizen',
422                         'TARGET_TRANSPORT':'IP',
423                         'LOGGING':'true',
424                         'RELEASE':flag,
425                     }
426     call_scons(build_options, build_extra_options)
427
428     print ("*********** Build for Tizen octbstack lib and sample with Routing Manager*************")
429     build_options['ROUTING'] = 'GW'
430     call_scons(build_options, build_extra_options)
431
432     print ("*********** Build for Tizen Easy-Setup  sample *************")
433     build_options['ROUTING'] = 'EP'
434     build_options['ES_TARGET_ENROLLEE'] = 'tizen'
435     build_extra_options = "-f service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/tizen/SConscript " + extra_option_str
436     call_scons(build_options, build_extra_options)
437
438 def build_tizen_secured(flag, extra_option_str):
439     build_tizen(flag, extra_option_str + " SECURED=1")
440
441 def build_tizen_unsecured(flag, extra_option_str):
442     build_tizen(flag, extra_option_str + " SECURED=0")
443
444 # Mac OS and iOS
445 def build_darwin(flag, extra_option_str):
446     print ("*********** Build for OSX *************")
447     build_options = {
448                         'TARGET_OS':'darwin',
449                         'SYS_VERSION':'10.9',
450                         'RELEASE':flag,
451                     }
452     call_scons(build_options, extra_option_str)
453
454     print ("*********** Build for IOS i386 *************")
455     build_options = {
456                         'TARGET_OS':'ios',
457                         'TARGET_ARCH':'i386',
458                         'SYS_VERSION':'7.0',
459                         'RELEASE':flag,
460                     }
461     call_scons(build_options, extra_option_str)
462
463     print ("*********** Build for IOS x86_64 *************")
464     build_options['TARGET_ARCH'] = 'x86_64'
465     call_scons(build_options, extra_option_str)
466
467     print ("*********** Build for IOS armv7 *************")
468     build_options['TARGET_ARCH'] = 'armv7'
469     call_scons(build_options, extra_option_str)
470
471     print ("*********** Build for IOS armv7s *************")
472     build_options['TARGET_ARCH'] = 'armv7s'
473     call_scons(build_options, extra_option_str)
474
475     print ("*********** Build for IOS arm64 *************")
476     build_options['TARGET_ARCH'] = 'arm64'
477     call_scons(build_options, extra_option_str)
478
479 # Windows
480 def build_windows(flag, extra_option_str):
481     print ("*********** Build for Windows *************")
482     os.environ["SCONSFLAGS"] = ""
483     build_options = {
484                         'TARGET_OS':'windows',
485                         'TARGET_ARCH':'amd64',
486                         'RELEASE':flag,
487                         'TARGET_TRANSPORT':'IP',
488                         'WITH_TCP':0,
489                         'BUILD_SAMPLE':'ON',
490                         'LOGGING':'off',
491                         'TEST':1,
492                         'RD_MODE':'all',
493                     }
494     call_scons(build_options, extra_option_str)
495
496 # Windows msys
497 def build_msys(flag, extra_option_str):
498     print ("*********** Build for msys_nt *************")
499     os.environ["SCONSFLAGS"] = ""
500     build_options = {
501                         'TARGET_OS':'msys_nt',
502                         'TARGET_ARCH':'x86_64',
503                         'RELEASE':flag,
504                         'TARGET_TRANSPORT':'IP',
505                         'WITH_TCP':0,
506                         'BUILD_SAMPLE':'ON',
507                         'LOGGING':'off',
508                         'TEST':1,
509                         'RD_MODE':'all',
510                     }
511     call_scons(build_options, extra_option_str)
512
513 def build_simulator(flag, extra_option_str):
514     print ("*********** Build for simulator plugin *************")
515     build_options = {
516                         'SIMULATOR':1,
517                         'RELEASE':flag,
518                         'SECURED':0,
519                         'TARGET_TRANSPORT':'IP',
520                     }
521     call_scons(build_options, extra_option_str)
522
523 def unit_tests():
524     print ("*********** Unit test Start *************")
525     build_options = {
526                         'RELEASE':'false',
527                     }
528     extra_option_str = "-c ."
529     call_scons(build_options, extra_option_str)
530
531     build_options = {
532                         'TEST':1,
533                         'RELEASE':'false',
534                         'SECURED':0,
535                     }
536     extra_option_str = ""
537     call_scons(build_options, extra_option_str)
538
539     build_options = {
540                         'TEST':1,
541                         'SECURED':1,
542                         'RELEASE':'false',
543                     }
544     call_scons(build_options, extra_option_str)
545
546     print ("*********** Unit test Stop *************")
547
548 # Main module starts here
549 if os.getenv("SCONSFLAGS", "") == "":
550     os.environ["SCONSFLAGS"] = "-Q -j " + str(multiprocessing.cpu_count())
551
552 arg_num     = len(sys.argv)
553 script_name = sys.argv[0]
554
555 # May be overridden in user's shell
556 VERBOSE = os.getenv("VERBOSE", "1")
557 EXEC_MODE = os.getenv("EXEC_MODE", True)
558 if EXEC_MODE in ['false', 'False', '0']:
559     EXEC_MODE = False
560
561 if arg_num == 1:
562     build_all("true", "")
563     build_all("false", "")
564     unit_tests()
565
566 elif arg_num == 2:
567     if str(sys.argv[1]) == '-c':
568         build_all("true", "-c")
569         build_all("false", "-c")
570
571     elif str(sys.argv[1]) == "all":
572         build_all("true", "")
573         build_all("false", "")
574         unit_tests()
575
576     elif str(sys.argv[1]) == "linux":
577         build_linux("true", "")
578         build_linux("false", "")
579
580     elif str(sys.argv[1]) == "linux_unsecured":
581         build_linux_unsecured("true", "")
582         build_linux_unsecured("false", "")
583         build_linux_unsecured_with_rm("true", "")
584         build_linux_unsecured_with_rm("false", "")
585
586     elif str(sys.argv[1]) == "linux_secured":
587         build_linux_secured("true", "")
588         build_linux_secured("false", "")
589
590     elif str(sys.argv[1]) == "linux_full":
591         build_linux_full("true", "")
592         build_linux_full("false", "")
593
594     elif str(sys.argv[1]) == "linux_unsecured_with_rd":
595         build_linux_unsecured_with_rd("true", "")
596         build_linux_unsecured_with_rd("false", "")
597
598     elif str(sys.argv[1]) == "linux_secured_with_rd":
599         build_linux_secured_with_rd("true", "")
600         build_linux_secured_with_rd("false", "")
601
602     elif str(sys.argv[1]) == "linux_unsecured_with_mq":
603         build_linux_unsecured_with_mq("true", "")
604         build_linux_unsecured_with_mq("false", "")
605
606     elif str(sys.argv[1]) == "linux_unsecured_with_tcp":
607         build_linux_unsecured_with_tcp("true", "")
608         build_linux_unsecured_with_tcp("false", "")
609
610     elif str(sys.argv[1]) == "linux_secured_with_tcp":
611         build_linux_secured_with_tcp("false", "")
612         build_linux_secured_with_tcp("true", "")
613
614     elif str(sys.argv[1]) == "linux_unsecured_with_java":
615         build_linux_unsecured_with_java("false", "")
616         build_linux_unsecured_with_java("true", "")
617
618     elif str(sys.argv[1]) == "linux_secured_with_java":
619         build_linux_secured_with_java("false", "")
620         build_linux_secured_with_java("true", "")
621
622     elif str(sys.argv[1]) == "android":
623         build_android("true", "")
624         build_android("false", "")
625
626     elif str(sys.argv[1]) == "android_universal":
627         # only build the release version due to long amount of time to build.
628         build_android_universal("true", "")
629
630     elif str(sys.argv[1]) == "android_universal_unsecured":
631         # only build the release version due to long amount of time to build.
632         build_android_universal("true", "SECURED=0")
633
634     elif str(sys.argv[1]) == "android_unsecured":
635         build_android_unsecured("true", "")
636         build_android_unsecured("false", "")
637
638     elif str(sys.argv[1]) == "android_secured":
639         build_android_secured("true", "")
640         build_android_secured("false", "")
641
642     elif str(sys.argv[1]) == "android_x86":
643         build_android_x86("true", "")
644         build_android_x86("false", "")
645         build_android_x86_with_rm("true", "")
646         build_android_x86_with_rm("false", "")
647
648     elif str(sys.argv[1]) == "android_x86_with_ip":
649         build_android_x86_with_ip("true", "")
650         build_android_x86_with_ip("false", "")
651
652     elif str(sys.argv[1]) == "android_x86_with_bt":
653         build_android_x86_with_bt("true", "")
654         build_android_x86_with_bt("false", "")
655
656     elif str(sys.argv[1]) == "android_x86_with_ble":
657         build_android_x86_with_ble("true", "")
658         build_android_x86_with_ble("false", "")
659
660     elif str(sys.argv[1]) == "android_x86_with_rm_and_ip":
661         build_android_x86_with_rm_and_ip("true", "")
662         build_android_x86_with_rm_and_ip("false", "")
663
664     elif str(sys.argv[1]) == "android_x86_with_rm_and_bt":
665         build_android_x86_with_rm_and_bt("true", "")
666         build_android_x86_with_rm_and_bt("false", "")
667
668     elif str(sys.argv[1]) == "android_x86_with_rm_and_ble":
669         build_android_x86_with_rm_and_ble("true", "")
670         build_android_x86_with_rm_and_ble("false", "")
671
672     elif str(sys.argv[1]) == "android_armeabi":
673         build_android_armeabi("true", "")
674         build_android_armeabi("false", "")
675         build_android_armeabi_with_rm("true", "")
676         build_android_armeabi_with_rm("false", "")
677
678     elif str(sys.argv[1]) == "android_armeabi_with_ip":
679         build_android_armeabi_with_ip("true", "")
680         build_android_armeabi_with_ip("false", "")
681
682     elif str(sys.argv[1]) == "android_armeabi_with_bt":
683         build_android_armeabi_with_bt("true", "")
684         build_android_armeabi_with_bt("false", "")
685
686     elif str(sys.argv[1]) == "android_armeabi_with_ble":
687         build_android_armeabi_with_ble("true", "")
688         build_android_armeabi_with_ble("false", "")
689
690     elif str(sys.argv[1]) == "android_armeabi_with_rm_and_ip":
691         build_android_armeabi_with_rm_and_ip("true", "")
692         build_android_armeabi_with_rm_and_ip("false", "")
693
694     elif str(sys.argv[1]) == "android_armeabi_with_rm_and_bt":
695         build_android_armeabi_with_rm_and_bt("true", "")
696         build_android_armeabi_with_rm_and_bt("false", "")
697
698     elif str(sys.argv[1]) == "android_armeabi_with_rm_and_ble":
699         build_android_armeabi_with_rm_and_ble("true", "")
700         build_android_armeabi_with_rm_and_ble("false", "")
701
702     elif str(sys.argv[1]) == "windows":
703         build_windows("true", "")
704         build_windows("false", "")
705
706     elif str(sys.argv[1]) == "msys":
707         build_msys("true", "")
708         build_msys("false", "")
709
710     elif str(sys.argv[1]) == "tizen":
711         build_tizen("true", "")
712         build_tizen("false", "")
713
714     elif str(sys.argv[1]) == "tizen_unsecured":
715         build_tizen_unsecured("true", "")
716         build_tizen_unsecured("false", "")
717
718     elif str(sys.argv[1]) == "tizen_secured":
719         build_tizen_secured("true", "")
720         build_tizen_secured("false", "")
721
722     elif str(sys.argv[1]) == "simulator":
723         build_simulator("true", "")
724         build_simulator("false", "")
725
726     elif str(sys.argv[1]) == "darwin":
727         build_darwin("true", "")
728         build_darwin("false", "")
729
730     elif str(sys.argv[1]) == "unit_tests":
731         unit_tests()
732
733     else:
734         helpmsg(script_name)
735 else:
736         helpmsg(script_name)
737
738 print ("===================== done =====================")