- Timestamp:
- 2019-09-23T12:49:29Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9be2358
- Parents:
- 9259d20 (diff), 1a4ec93f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - git-author:
- Jiri Svoboda <jiri@…> (2019-09-22 12:49:07)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-09-23 12:49:29)
- Location:
- tools
- Files:
-
- 3 added
- 5 deleted
- 14 edited
- 3 moved
-
README (added)
-
autocheck.awk (modified) (4 diffs)
-
autotool.py (deleted)
-
build-ccheck.sh (modified) (1 diff)
-
build_all.sh (added)
-
cc.sh (modified) (2 diffs)
-
ccheck.sh (modified) (4 diffs)
-
config.py (modified) (16 diffs)
-
dest_build.py (deleted)
-
ew.py (modified) (12 diffs)
-
export.sh (moved) (moved from uspace/app/vlaunch/Makefile ) (2 diffs, 1 prop)
-
grub/grub-update.sh (modified) (3 diffs)
-
grub/mkimage.sh (modified) (1 diff)
-
list_profiles.sh (added)
-
mkarray_for_meson.sh (moved) (moved from boot/Makefile.uboot ) (2 diffs, 1 prop)
-
release.sh (moved) (moved from tools/check.sh ) (2 diffs)
-
srepl (modified) (1 diff)
-
toolchain.sh (modified) (16 diffs)
-
travis.sh (modified) (4 diffs)
-
xcw/bin/helenos-bld-config (deleted)
-
xcw/bin/helenos-cc (modified) (1 diff)
-
xcw/bin/helenos-ld (deleted)
-
xcw/bin/helenos-pkg-config (modified) (1 diff)
-
xcw/demo/Makefile (modified) (1 diff)
-
xcw/include/helenos (deleted)
Legend:
- Unmodified
- Added
- Removed
-
tools/autocheck.awk
r9259d20 r3e828ea 33 33 BEGIN { 34 34 filename = ARGV[1] 35 output_lines = 0 35 36 print "// Generated file. Fix the included header if static assert fails." 36 print "#include \"" filename "\"" 37 print "// Inlined \"" filename "\"" 38 } 39 40 { 41 print $0 37 42 } 38 43 … … 44 49 } 45 50 macro_name = toupper(struct_name) "_SIZE" 46 print"_Static_assert(" macro_name " == sizeof(struct " struct_name "), \"\");"51 output[output_lines++] = "_Static_assert(" macro_name " == sizeof(struct " struct_name "), \"\");" 47 52 struct_name = "" 48 53 } … … 55 60 56 61 macro_name = toupper(struct_name) "_OFFSET_" toupper(member) 57 print"_Static_assert(" macro_name " == __builtin_offsetof(struct " struct_name ", " member "), \"\");"62 output[output_lines++] = "_Static_assert(" macro_name " == __builtin_offsetof(struct " struct_name ", " member "), \"\");" 58 63 59 64 macro_name = toupper(struct_name) "_SIZE_" toupper(member) 60 print"#ifdef " macro_name61 print"_Static_assert(" macro_name " == sizeof(((struct " struct_name "){ })." member "), \"\");"62 print"#endif"65 output[output_lines++] = "#ifdef " macro_name 66 output[output_lines++] = "_Static_assert(" macro_name " == sizeof(((struct " struct_name "){ })." member "), \"\");" 67 output[output_lines++] = "#endif" 63 68 } 64 69 } … … 67 72 struct_name = $3 68 73 } 74 75 END { 76 for ( i = 0; i < output_lines; i++ ) { 77 print output[i] 78 } 79 } -
tools/build-ccheck.sh
r9259d20 r3e828ea 1 #!/bin/ bash1 #!/bin/sh 2 2 # 3 3 # Copyright (c) 2019 Jiri Svoboda -
tools/cc.sh
r9259d20 r3e828ea 1 #! /bin/bash1 #!/bin/sh 2 2 3 3 # … … 36 36 EOF 37 37 38 # Find out the path to the script. 39 SOURCE_DIR=`which -- "$0" 2>/dev/null` 40 # Maybe we are running bash. 41 [ -z "$SOURCE_DIR" ] && SOURCE_DIR=`which -- "$BASH_SOURCE"` 42 [ -z "$SOURCE_DIR" ] && exit 1 43 SOURCE_DIR=`dirname -- "$SOURCE_DIR"` 44 SOURCE_DIR=`cd $SOURCE_DIR && cd .. && echo $PWD` 45 38 46 echo "" 39 47 40 git grep 'Copyright ([cC])' | \48 git -C "$SOURCE_DIR" grep 'Copyright ([cC])' | \ 41 49 sed -E -n 's/^.*(Copyright \([cC]\) (20[0-9][0-9]-)?20[0-9][0-9],? [-a-zA-Z., ]*[-a-zA-Z.]$)/\1/p' | \ 42 50 sed -E 's/ ( )+/ /' | \ -
tools/ccheck.sh
r9259d20 r3e828ea 1 #!/bin/ bash1 #!/bin/sh 2 2 # 3 3 # Copyright (c) 2018 Jiri Svoboda … … 33 33 fi 34 34 35 if [ ."$1" = = .--fix ]; then35 if [ ."$1" = .--fix ]; then 36 36 opt=--fix 37 37 else … … 49 49 outfile="$(mktemp)" 50 50 "$ccheck" $opt $fname >"$outfile" 2>&1 51 rc=$? 52 if [ .$rc == .0 ]; then 51 if [ $? -eq 0 ]; then 53 52 if [ -s "$outfile" ] ; then 54 53 srepcnt=$((srepcnt + 1)) … … 65 64 done 66 65 67 if [ $srepcnt == 0 -a $fcnt == 0 ]; then66 if [ $srepcnt -eq 0 ] && [ $fcnt -eq 0 ]; then 68 67 echo "Ccheck passed." 69 68 else -
tools/config.py
r9259d20 r3e828ea 42 42 import random 43 43 44 RULES_FILE = sys.argv[1] 44 ARGPOS_RULES = 1 45 ARGPOS_PRESETS_DIR = 2 46 ARGPOS_CHOICE = 3 47 ARGPOS_PRESET = 4 48 ARGPOS_MASK_PLATFORM = 3 49 50 RULES_FILE = sys.argv[ARGPOS_RULES] 45 51 MAKEFILE = 'Makefile.config' 46 52 MACROS = 'config.h' 47 PRESETS_DIR = 'defaults' 53 PRESETS_DIR = sys.argv[ARGPOS_PRESETS_DIR] 54 55 class BinaryOp: 56 def __init__(self, operator, left, right): 57 assert operator in ('&', '|', '=', '!=') 58 59 self._operator = operator 60 self._left = left 61 self._right = right 62 63 def evaluate(self, config): 64 if self._operator == '&': 65 return self._left.evaluate(config) and \ 66 self._right.evaluate(config) 67 if self._operator == '|': 68 return self._left.evaluate(config) or \ 69 self._right.evaluate(config) 70 71 # '=' or '!=' 72 if not self._left in config: 73 config_val = '' 74 else: 75 config_val = config[self._left] 76 if config_val == '*': 77 config_val = 'y' 78 79 if self._operator == '=': 80 return self._right == config_val 81 return self._right != config_val 82 83 # Expression parser 84 class CondParser: 85 TOKEN_EOE = 0 86 TOKEN_SPECIAL = 1 87 TOKEN_STRING = 2 88 89 def __init__(self, text): 90 self._text = text 91 92 def parse(self): 93 self._position = -1 94 self._next_char() 95 self._next_token() 96 97 res = self._parse_expr() 98 if self._token_type != self.TOKEN_EOE: 99 self._error("Expected end of expression") 100 return res 101 102 def _next_char(self): 103 self._position += 1 104 if self._position >= len(self._text): 105 self._char = None 106 else: 107 self._char = self._text[self._position] 108 self._is_special_char = self._char in \ 109 ('&', '|', '=', '!', '(', ')') 110 111 def _error(self, msg): 112 raise RuntimeError("Error parsing expression: %s:\n%s\n%s^" % 113 (msg, self._text, " " * self._token_position)) 114 115 def _next_token(self): 116 self._token_position = self._position 117 118 # End of expression 119 if self._char == None: 120 self._token = None 121 self._token_type = self.TOKEN_EOE 122 return 123 124 # '&', '|', '=', '!=', '(', ')' 125 if self._is_special_char: 126 self._token = self._char 127 self._next_char() 128 if self._token == '!': 129 if self._char != '=': 130 self._error("Expected '='") 131 self._token += self._char 132 self._next_char() 133 self._token_type = self.TOKEN_SPECIAL 134 return 135 136 # <var> or <val> 137 self._token = '' 138 self._token_type = self.TOKEN_STRING 139 while True: 140 self._token += self._char 141 self._next_char() 142 if self._is_special_char or self._char == None: 143 break 144 145 def _parse_expr(self): 146 """ <expr> ::= <or_expr> ('&' <or_expr>)* """ 147 148 left = self._parse_or_expr() 149 while self._token == '&': 150 self._next_token() 151 left = BinaryOp('&', left, self._parse_or_expr()) 152 return left 153 154 def _parse_or_expr(self): 155 """ <or_expr> ::= <factor> ('|' <factor>)* """ 156 157 left = self._parse_factor() 158 while self._token == '|': 159 self._next_token() 160 left = BinaryOp('|', left, self._parse_factor()) 161 return left 162 163 def _parse_factor(self): 164 """ <factor> ::= <var> <cond> | '(' <expr> ')' """ 165 166 if self._token == '(': 167 self._next_token() 168 res = self._parse_expr() 169 if self._token != ')': 170 self._error("Expected ')'") 171 self._next_token() 172 return res 173 174 if self._token_type == self.TOKEN_STRING: 175 var = self._token 176 self._next_token() 177 return self._parse_cond(var) 178 179 self._error("Expected '(' or <var>") 180 181 def _parse_cond(self, var): 182 """ <cond> ::= '=' <val> | '!=' <val> """ 183 184 if self._token not in ('=', '!='): 185 self._error("Expected '=' or '!='") 186 187 oper = self._token 188 self._next_token() 189 190 if self._token_type != self.TOKEN_STRING: 191 self._error("Expected <val>") 192 193 val = self._token 194 self._next_token() 195 196 return BinaryOp(oper, var, val) 48 197 49 198 def read_config(fname, config): … … 59 208 inf.close() 60 209 61 def check_condition(text, config, rules):62 "Check that the condition specified on input line is True (only CNF and DNF is supported)"63 64 ctype = 'cnf'65 66 if (')|' in text) or ('|(' in text):67 ctype = 'dnf'68 69 if ctype == 'cnf':70 conds = text.split('&')71 else:72 conds = text.split('|')73 74 for cond in conds:75 if cond.startswith('(') and cond.endswith(')'):76 cond = cond[1:-1]77 78 inside = check_inside(cond, config, ctype)79 80 if (ctype == 'cnf') and (not inside):81 return False82 83 if (ctype == 'dnf') and inside:84 return True85 86 if ctype == 'cnf':87 return True88 89 return False90 91 def check_inside(text, config, ctype):92 "Check for condition"93 94 if ctype == 'cnf':95 conds = text.split('|')96 else:97 conds = text.split('&')98 99 for cond in conds:100 res = re.match(r'^(.*?)(!?=)(.*)$', cond)101 if not res:102 raise RuntimeError("Invalid condition: %s" % cond)103 104 condname = res.group(1)105 oper = res.group(2)106 condval = res.group(3)107 108 if not condname in config:109 varval = ''110 else:111 varval = config[condname]112 if (varval == '*'):113 varval = 'y'114 115 if ctype == 'cnf':116 if (oper == '=') and (condval == varval):117 return True118 119 if (oper == '!=') and (condval != varval):120 return True121 else:122 if (oper == '=') and (condval != varval):123 return False124 125 if (oper == '!=') and (condval == varval):126 return False127 128 if ctype == 'cnf':129 return False130 131 return True132 133 210 def parse_rules(fname, rules): 134 211 "Parse rules file" … … 149 226 150 227 cond = res.group(1) 228 if cond: 229 cond = CondParser(cond).parse() 151 230 varname = res.group(2) 152 231 vartype = res.group(3) … … 232 311 varname, vartype, name, choices, cond = rule 233 312 234 if cond and (not check_condition(cond, config, rules)):313 if cond and not cond.evaluate(config): 235 314 continue 236 315 … … 279 358 280 359 # First check that this rule would make sense 281 if cond: 282 if not check_condition(cond, config, rules): 283 return random_choices(config, rules, start_index + 1) 360 if cond and not cond.evaluate(config): 361 return random_choices(config, rules, start_index + 1) 284 362 285 363 # Remember previous choices for backtracking … … 460 538 461 539 try: 462 version = subprocess.Popen(['git', ' log', '-1', '--pretty=%h'], stdout = subprocess.PIPE).communicate()[0].decode().strip()540 version = subprocess.Popen(['git', '-C', os.path.dirname(RULES_FILE), 'log', '-1', '--pretty=%h'], stdout = subprocess.PIPE).communicate()[0].decode().strip() 463 541 sys.stderr.write("ok\n") 464 542 except: … … 487 565 488 566 for varname, vartype, name, choices, cond in rules: 489 if cond and (not check_condition(cond, config, rules)):567 if cond and not cond.evaluate(config): 490 568 continue 491 569 … … 514 592 outmk.write('TIMESTAMP_UNIX = %d\n' % timestamp_unix) 515 593 outmc.write('#define TIMESTAMP_UNIX %d\n' % timestamp_unix) 516 defs += ' "-DTIMESTAMP_UNIX=%d" \n' % timestamp_unix594 defs += ' "-DTIMESTAMP_UNIX=%d"' % timestamp_unix 517 595 518 596 outmk.write('TIMESTAMP = %s\n' % timestamp) 519 597 outmc.write('#define TIMESTAMP %s\n' % timestamp) 520 defs += ' "-DTIMESTAMP=%s" \n' % timestamp521 522 outmk.write( defs)598 defs += ' "-DTIMESTAMP=%s"' % timestamp 599 600 outmk.write('%s\n' % defs) 523 601 524 602 outmk.close() … … 604 682 parse_rules(RULES_FILE, rules) 605 683 684 if len(sys.argv) > ARGPOS_CHOICE: 685 choice = sys.argv[ARGPOS_CHOICE] 686 else: 687 choice = None 688 689 if len(sys.argv) > ARGPOS_PRESET: 690 preset = sys.argv[ARGPOS_PRESET] 691 else: 692 preset = None 693 694 mask_platform = (len(sys.argv) > ARGPOS_MASK_PLATFORM and sys.argv[ARGPOS_MASK_PLATFORM] == "--mask-platform") 695 606 696 # Input configuration file can be specified on command line 607 697 # otherwise configuration from previous run is used. 608 if len(sys.argv) >= 4:609 profile = parse_profile_name( sys.argv[3])698 if preset is not None: 699 profile = parse_profile_name(preset) 610 700 read_presets(profile, config) 611 701 elif os.path.exists(MAKEFILE): … … 613 703 614 704 # Default mode: check values and regenerate configuration files 615 if (len(sys.argv) >= 3) and (sys.argv[2] == 'default'):705 if choice == 'default': 616 706 if (infer_verify_choices(config, rules)): 617 707 preprocess_config(config, rules) … … 621 711 # Hands-off mode: check values and regenerate configuration files, 622 712 # but no interactive fallback 623 if (len(sys.argv) >= 3) and (sys.argv[2] == 'hands-off'):624 # We deliberately test sys.argv >= 4because we do not want713 if choice == 'hands-off': 714 # We deliberately test this because we do not want 625 715 # to read implicitly any possible previous run configuration 626 if len(sys.argv) < 4:716 if preset is None: 627 717 sys.stderr.write("Configuration error: No presets specified\n") 628 718 return 2 … … 637 727 638 728 # Check mode: only check configuration 639 if (len(sys.argv) >= 3) and (sys.argv[2] == 'check'):729 if choice == 'check': 640 730 if infer_verify_choices(config, rules): 641 731 return 0 … … 643 733 644 734 # Random mode 645 if (len(sys.argv) == 3) and (sys.argv[2] == 'random'):735 if choice == 'random': 646 736 ok = random_choices(config, rules, 0) 647 737 if not ok: … … 669 759 options = [] 670 760 opt2row = {} 671 cnt = 1 672 673 options.append(" --- Load preconfigured defaults ... ") 761 cnt = 0 762 763 if not mask_platform: 764 cnt += 1 765 options.append(" --- Load preconfigured defaults ... ") 674 766 675 767 for rule in rules: 676 768 varname, vartype, name, choices, cond = rule 677 769 678 if cond and (not check_condition(cond, config, rules)):770 if cond and not cond.evaluate(config): 679 771 continue 772 773 if mask_platform and (varname == "PLATFORM" or varname == "MACHINE" or varname == "COMPILER"): 774 rule = varname, vartype, "(locked) " + name, choices, cond 680 775 681 776 if varname == selname: … … 725 820 continue 726 821 727 if value == 0 :822 if value == 0 and not mask_platform: 728 823 profile = choose_profile(PRESETS_DIR, MAKEFILE, screen, config) 729 824 if profile != None: … … 742 837 else: 743 838 value = config[selname] 839 840 if mask_platform and (selname == "PLATFORM" or selname == "MACHINE" or selname == "COMPILER"): 841 continue 744 842 745 843 if seltype == 'choice': -
tools/ew.py
r9259d20 r3e828ea 33 33 """ 34 34 35 import inspect 35 36 import os 37 import platform 38 import re 39 import subprocess 36 40 import sys 37 import subprocess38 import autotool39 import platform40 41 import thread 41 42 import time 42 43 43 44 overrides = {} 45 46 CONFIG = 'Makefile.config' 47 48 TOOLS_DIR = os.path.dirname(inspect.getabsfile(inspect.currentframe())) 49 50 def read_config(): 51 "Read HelenOS build configuration" 52 53 inf = open(CONFIG, 'r') 54 config = {} 55 56 for line in inf: 57 res = re.match(r'^(?:#!# )?([^#]\w*)\s*=\s*(.*?)\s*$', line) 58 if (res): 59 config[res.group(1)] = res.group(2) 60 61 inf.close() 62 return config 44 63 45 64 def is_override(str): … … 57 76 58 77 def termemu_detect(): 59 for termemu in ['xfce4-terminal', 'xterm']: 78 emus = ['gnome-terminal', 'xfce4-terminal', 'xterm'] 79 for termemu in emus: 60 80 try: 61 81 subprocess.check_output('which ' + termemu, shell = True) … … 64 84 pass 65 85 86 print('Could not find any of the terminal emulators %s.'%(emus)) 87 sys.exit(1) 88 66 89 def run_in_console(cmd, title): 67 ecmd = cmd.replace('"', '\\"') 68 cmdline = termemu_detect() + ' -T ' + '"' + title + '"' + ' -e "' + ecmd + '"' 90 temu = termemu_detect() 91 if temu == 'gnome-terminal': 92 cmdline = temu + ' -- ' + cmd 93 else: 94 ecmd = cmd.replace('"', '\\"') 95 cmdline = temu + ' -T ' + '"' + title + '"' + ' -e "' + ecmd + '"' 96 69 97 print(cmdline) 70 98 if not is_override('dryrun'): … … 87 115 88 116 def malta_options(): 89 return '-cpu 4Kc' 117 return '-cpu 4Kc -append "console=devices/\\hw\\pci0\\00:0a.0\\com1\\a"' 118 119 def find_firmware(name, environ_var, default_paths, extra_info=None): 120 """Find firmware image(s).""" 121 122 if environ_var in os.environ: 123 return os.environ[environ_var] 124 125 for path in default_paths: 126 if os.path.exists(path): 127 return path 128 129 sys.stderr.write("Cannot find %s binary image(s)!\n" % name) 130 sys.stderr.write( 131 "Either set %s environment variable accordingly or place the image(s) in one of the default locations: %s.\n" % 132 (environ_var, ", ".join(default_paths))) 133 if extra_info is not None: 134 sys.stderr.write(extra_info) 135 return None 90 136 91 137 def platform_to_qemu_options(platform, machine, processor): … … 94 140 elif platform == 'arm32': 95 141 return 'system-arm', '-M integratorcp' 142 elif platform == 'arm64': 143 # Search for the EDK2 firmware image 144 default_paths = ( 145 '/usr/local/qemu-efi-aarch64/QEMU_EFI.fd', # Custom 146 '/usr/share/edk2/aarch64/QEMU_EFI.fd', # Fedora 147 '/usr/share/qemu-efi-aarch64/QEMU_EFI.fd', # Ubuntu 148 ) 149 extra_info = ("Pre-compiled binary can be obtained from " 150 "http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-AARCH64/RELEASE_GCC49/QEMU_EFI.fd.\n") 151 efi_path = find_firmware( 152 "EDK2", 'EW_QEMU_EFI_AARCH64', default_paths, extra_info) 153 if efi_path is None: 154 raise Exception 155 156 return 'system-aarch64', \ 157 '-M virt -cpu cortex-a57 -m 1024 -bios %s' % efi_path 96 158 elif platform == 'ia32': 97 159 return 'system-i386', pc_options(32) … … 108 170 if processor == 'us': 109 171 return 'system-sparc64', '-M sun4u --prom-env boot-args="console=devices/\\hw\\pci0\\01:01.0\\com1\\a"' 110 elif processor == 'sun4v': 111 default_path = '/usr/local/opensparc/image/' 112 try: 113 if os.path.exists(default_path): 114 opensparc_bins = default_path 115 elif os.path.exists(os.environ['OPENSPARC_BINARIES']): 116 opensparc_bins = os.environ['OPENSPARC_BINARIES'] 117 else: 118 raise Exception 119 except: 120 print("Cannot find OpenSPARC binary images!") 121 print("Either set OPENSPARC_BINARIES environment variable accordingly or place the images in %s." % (default_path)) 172 173 # processor = 'sun4v' 174 opensparc_bins = find_firmware( 175 "OpenSPARC", 'OPENSPARC_BINARIES', 176 ('/usr/local/opensparc/image/', )) 177 if opensparc_bins is None: 122 178 raise Exception 123 179 … … 127 183 def hdisk_mk(): 128 184 if not os.path.exists('hdisk.img'): 129 subprocess.call( 'tools/mkfat.py 1048576 uspace/dist/data hdisk.img', shell = True)185 subprocess.call(TOOLS_DIR + '/mkfat.py 1048576 dist/data hdisk.img', shell = True) 130 186 131 187 def qemu_bd_options(): … … 208 264 cmdline += ' ' + options 209 265 210 cmdline += qemu_bd_options()211 266 if (not 'hdd' in cfg.keys() or cfg['hdd']): 267 cmdline += qemu_bd_options() 212 268 if (not 'net' in cfg.keys()) or cfg['net']: 213 269 cmdline += qemu_net_options() … … 234 290 if cfg['image'] == 'image.iso': 235 291 cmdline += ' -boot d -cdrom image.iso' 292 elif cfg['image'] == 'image.iso@arm64': 293 # Define image.iso cdrom backend. 294 cmdline += ' -drive if=none,file=image.iso,id=cdrom,media=cdrom' 295 # Define scsi bus. 296 cmdline += ' -device virtio-scsi-device' 297 # Define cdrom frontend connected to this scsi bus. 298 cmdline += ' -device scsi-cd,drive=cdrom' 236 299 elif cfg['image'] == 'image.boot': 237 300 cmdline += ' -kernel image.boot' … … 254 317 255 318 def ski_run(platform, machine, processor): 256 run_in_console('ski -i tools/conf/ski.conf', 'HelenOS/ia64 on ski')319 run_in_console('ski -i ' + TOOLS_DIR + '/conf/ski.conf', 'HelenOS/ia64 on ski') 257 320 258 321 def msim_run(platform, machine, processor): 259 322 hdisk_mk() 260 run_in_console('msim -c tools/conf/msim.conf', 'HelenOS/mips32 on msim')323 run_in_console('msim -c ' + TOOLS_DIR + '/conf/msim.conf', 'HelenOS/mips32 on msim') 261 324 262 325 def spike_run(platform, machine, processor): … … 276 339 'xhci' : False, 277 340 'tablet' : False 341 } 342 }, 343 'arm64' : { 344 'virt' : { 345 'run' : qemu_run, 346 'image' : 'image.iso@arm64', 347 'audio' : False, 348 'console' : True, 349 'hdd' : False, 350 'net' : False, 351 'tablet' : False, 352 'usb' : False, 353 'xhci' : False 278 354 } 279 355 }, … … 438 514 exit() 439 515 440 config = {} 441 autotool.read_config(autotool.CONFIG, config) 516 config = read_config() 442 517 443 518 if 'PLATFORM' in config.keys(): -
tools/export.sh
-
Property mode
changed from
100644to100755
r9259d20 r3e828ea 1 #!/bin/sh 2 1 3 # 2 # Copyright (c) 201 2 Petr Koupy4 # Copyright (c) 2019 Jiří Zárevúcky 3 5 # All rights reserved. 4 6 # … … 27 29 # 28 30 29 USPACE_PREFIX = ../.. 31 if [ "$#" -ne 1 ]; then 32 echo "Must define export directory." 33 exit 1 34 fi 30 35 31 # TODO: Should be just "gui", rest is transitive dependencies. 32 LIBS = gui draw softrend compress math 36 EXPORT_DIR="$1" 33 37 34 BINARY = vlaunch 38 # Only (re)build files we actually want to export. 35 39 36 IMG = image 37 IMGS = $(IMG)s 40 EXPORT_LIBS=" \ 41 uspace/lib/libmath.a \ 42 uspace/lib/libclui.a \ 43 uspace/lib/libgui.a \ 44 uspace/lib/libdraw.a \ 45 uspace/lib/libsoftrend.a \ 46 uspace/lib/libhound.a \ 47 uspace/lib/libpcm.a \ 48 uspace/lib/libcpp.a \ 49 uspace/lib/libc.a \ 50 uspace/lib/c/libstartfiles.a \ 51 uspace/lib/libposix.a \ 52 " 38 53 39 SOURCES =\40 vlaunch.c\41 $(IMGS).s\42 $(IMGS)_desc.c 54 EXPORT_CONFIGS=" \ 55 meson/part/exports/config.mk \ 56 meson/part/exports/config.sh \ 57 " 43 58 44 IMAGES = \ 45 gfx/helenos.tga 59 ninja $EXPORT_LIBS $EXPORT_CONFIGS 60 ninja devel-headers 46 61 47 PRE_DEPEND = $(IMGS).s $(IMGS).h $(IMGS)_desc.c 48 EXTRA_CLEAN = $(IMGS).s $(IMGS).h $(IMGS)_desc.c $(IMGS).zip 49 50 include $(USPACE_PREFIX)/Makefile.common 51 52 $(IMGS).s: $(IMGS).zip 53 unzip -p $< $@ > $@ 54 55 $(IMGS).h: $(IMGS).zip 56 unzip -p $< $@ > $@ 57 58 $(IMGS)_desc.c: $(IMGS).zip 59 unzip -p $< $@ > $@ 60 61 $(IMGS).zip: $(IMAGES) 62 $(ROOT_PATH)/tools/mkarray.py $(IMGS) $(IMG) "$(AS_PROLOG)" .data $^ 62 mkdir -p "$EXPORT_DIR/lib" 63 cp -t "$EXPORT_DIR/lib" $EXPORT_LIBS 64 rm -rf "$EXPORT_DIR/include" 65 cp -R dist/include "$EXPORT_DIR/include" 66 cp -t "$EXPORT_DIR" $EXPORT_CONFIGS -
Property mode
changed from
-
tools/grub/grub-update.sh
r9259d20 r3e828ea 40 40 grub_rev="bc220962e366b1b46769ed6f9fa5be603ba58ab5" 41 41 42 build_ia32amd64_pc=false 43 build_ia32amd64_efi=false 44 build_arm64_efi=false 45 42 46 function grub_build() 43 47 { 44 target="$1" 45 platform="$2" 48 platform="$1" 49 conf_target="$2" 50 conf_platform="$3" 46 51 47 ./configure --prefix="$builddir/$ target-$platform" --target="$target" --with-platform="$platform" --disable-werror || exit 152 ./configure --prefix="$builddir/$platform" --target="$conf_target" --with-platform="$conf_platform" --disable-werror || exit 1 48 53 make clean || exit 1 49 54 make install || exit 1 … … 55 60 platform="$2" 56 61 57 rm -rf "$helenosdir"/boot/"$gdir"/"$platform" || exit 1 58 cp -R "$builddir"/"$platform"/lib64/grub/"$platform" "$helenosdir"/boot/"$gdir" || exit 1 59 rm -f "$helenosdir"/boot/"$gdir"/"$platform"/*.image || exit 1 60 rm -f "$helenosdir"/boot/"$gdir"/"$platform"/*.module || exit 1 61 git add "$helenosdir"/boot/"$gdir"/"$platform" || exit 1 62 echo "$grub_rev" > "$helenosdir"/boot/grub/"$gdir"/REVISION || exit 1 63 rm -rf "$helenosdir"/boot/grub/"$gdir"/"$platform" || exit 1 64 cp -R "$builddir"/"$platform"/lib*/grub/"$platform" "$helenosdir"/boot/grub/"$gdir" || exit 1 65 rm -f "$helenosdir"/boot/grub/"$gdir"/"$platform"/*.image || exit 1 66 rm -f "$helenosdir"/boot/grub/"$gdir"/"$platform"/*.module || exit 1 67 git add "$helenosdir"/boot/grub/"$gdir"/"$platform" || exit 1 62 68 } 69 70 function show_usage() 71 { 72 echo "Script to generate/update prebuild Grub2 in HelenOS source tree" 73 echo 74 echo "Syntax:" 75 echo " $0 <target>" 76 echo 77 echo "Possible targets are:" 78 echo " ia32+amd64-pc" 79 echo " ia32+amd64-efi" 80 echo " arm64-efi" 81 echo " all build all targets" 82 echo 83 84 exit 3 85 } 86 87 if [ "$#" -ne "1" ] ; then 88 show_usage 89 fi 90 91 case "$1" in 92 ia32+amd64-pc) 93 build_ia32amd64_pc=true 94 ;; 95 ia32+amd64-efi) 96 build_ia32amd64_efi=true 97 ;; 98 arm64-efi) 99 build_arm64_efi=true 100 ;; 101 all) 102 build_ia32amd64_pc=true 103 build_ia32amd64_efi=true 104 build_arm64_efi=true 105 ;; 106 *) 107 show_usage 108 ;; 109 esac 63 110 64 111 # Prepare a clone of Grub2 repo … … 72 119 git reset --hard "$grub_rev" || exit 1 73 120 74 echo "$grub_rev" >"$helenosdir"/boot/grub.pc/REVISION || exit 1 75 echo "$grub_rev" > "$helenosdir"/boot/grub.efi/REVISION || exit 1 121 ./autogen.sh || exit 1 76 122 77 # Build each platform to a different directory 78 ./autogen.sh || exit 1 79 grub_build i386 pc 80 grub_build i386 efi 81 grub_build x86_64 efi 123 if $build_ia32amd64_pc ; then 124 cd "$workdir" || exit 1 125 grub_build i386-pc i386 pc 82 126 83 # Extract El Torrito boot image for i386-pc84 cd "$helenosdir"/boot/grub.pc || exit 185 rm -f pc.img || exit 186 "$builddir"/i386-pc/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1127 # Extract El Torrito boot image for i386-pc 128 cd "$helenosdir"/boot/grub/ia32-pc || exit 1 129 rm -f pc.img || exit 1 130 "$builddir"/i386-pc/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1 87 131 88 # Extract El Torrito boot image for i386-efi 89 cd "$helenosdir"/boot/grub.efi || exit 1 90 rm -f efi.img.gz || exit 1 91 "$builddir"/i386-efi/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1 92 mv efi.img i386-efi.img 132 grub_files_update ia32-pc i386-pc 133 fi 93 134 94 # Extract El Torrito boot image for x86_64-efi 95 cd "$helenosdir"/boot/grub.efi || exit 1 96 rm -f efi.img.gz || exit 1 97 "$builddir"/x86_64-efi/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1 135 if $build_ia32amd64_efi ; then 136 cd "$workdir" || exit 1 98 137 99 # Combine El Torrito boot images for x86_64-efi and i386-efi 100 mkdir tmp || exit 1 101 mcopy -ns -i i386-efi.img ::efi tmp || exit 1 102 mcopy -s -i efi.img tmp/* :: || exit 1 103 gzip efi.img || exit 1 104 rm -rf tmp || exit 1 105 rm -f i386-efi.img || exit 1 138 # Build each platform to a different directory 139 grub_build i386-efi i386 efi 140 grub_build x86_64-efi x86_64 efi 106 141 107 # Update Grub files for all platforms 108 grub_files_update grub.pc i386-pc 109 grub_files_update grub.efi i386-efi 110 grub_files_update grub.efi x86_64-efi 142 # Extract El Torrito boot image for i386-efi 143 cd "$helenosdir"/boot/grub/ia32-efi || exit 1 144 rm -f efi.img.gz || exit 1 145 "$builddir"/i386-efi/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1 146 mv efi.img i386-efi.img 147 148 # Extract El Torrito boot image for x86_64-efi 149 cd "$helenosdir"/boot/grub/ia32-efi || exit 1 150 rm -f efi.img.gz || exit 1 151 "$builddir"/x86_64-efi/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1 152 153 # Combine El Torrito boot images for x86_64-efi and i386-efi 154 mkdir tmp || exit 1 155 mcopy -ns -i i386-efi.img ::efi tmp || exit 1 156 mcopy -s -i efi.img tmp/* :: || exit 1 157 gzip efi.img || exit 1 158 rm -rf tmp || exit 1 159 rm -f i386-efi.img || exit 1 160 161 # Update Grub files for all platforms 162 grub_files_update ia32-efi i386-efi 163 grub_files_update ia32-efi x86_64-efi 164 fi 165 166 if $build_arm64_efi ; then 167 cd "$workdir" || exit 1 168 169 # Check that the expected compiler is present on PATH 170 if ! [ -x "$(command -v aarch64-linux-gnu-gcc)" ] ; then 171 echo "Error: aarch64-linux-gnu-gcc is missing" >&2 172 exit 1 173 fi 174 175 grub_build arm64-efi aarch64-linux-gnu efi 176 177 # Extract El Torrito boot image for arm64-efi 178 cd "$helenosdir"/boot/grub/arm64-efi || exit 1 179 rm -f efi.img.gz || exit 1 180 "$builddir"/arm64-efi/bin/grub-mkrescue -o phony --xorriso="$origdir/getimage.sh" || exit 1 181 gzip efi.img || exit 1 182 183 grub_files_update arm64-efi arm64-efi 184 fi 111 185 112 186 echo "GRUB update successful." -
tools/grub/mkimage.sh
r9259d20 r3e828ea 39 39 orig_dir="$(cd "$(dirname "$0")" && pwd)" 40 40 grub_tools_dir="$orig_dir/grub-build/i386-pc/bin" 41 grub_mod_dir="$orig_dir/../../boot/grub .pc/i386-pc"41 grub_mod_dir="$orig_dir/../../boot/grub/ia32-pc/i386-pc" 42 42 43 43 "$grub_tools_dir"/grub-mkimage --directory "$grub_mod_dir" \ -
tools/mkarray_for_meson.sh
-
Property mode
changed from
100644to100755
r9259d20 r3e828ea 1 #!/bin/sh 2 1 3 # 2 # Copyright (c) 201 0 Jiri Svoboda4 # Copyright (c) 2019 Jiří Zárevúcky 3 5 # All rights reserved. 4 6 # … … 27 29 # 28 30 29 .PHONY: all clean 31 TOOLS_DIR=`which -- "$0" 2>/dev/null` 32 if [ -z "$TOOLS_DIR" ]; then 33 TOOLS_DIR=`which -- "$BASH_SOURCE" 2>/dev/null` 34 fi 35 TOOLS_DIR=`dirname $TOOLS_DIR` 36 TOOLS_DIR=`cd $TOOLS_DIR && echo $PWD` 30 37 31 include Makefile.common32 38 33 IMAGE_NAME = HelenOS-$(RELEASE) 34 BIN_OUTPUT = image.bin 39 _outdir="$1" 40 _arg1="$2" 41 _arg2="$3" 42 _arg3="$4" 43 _arg4="$5" 44 _inputs="" 35 45 36 all: $(POST_OUTPUT) 46 shift 5 37 47 38 $(BIN_OUTPUT): $(BOOT_OUTPUT) 39 $(OBJCOPY) -O binary $< $@ 48 for file in "$@"; do 49 _inputs="$_inputs $PWD/${file}" 50 done 40 51 41 $(POST_OUTPUT): $(BIN_OUTPUT) 42 $(MKUIMAGE) -name "$(IMAGE_NAME)" -laddr $(LADDR) -saddr $(SADDR) -ostype $(UIMAGE_OS) $< $@ 43 44 clean: 45 rm -f $(BIN_OUTPUT) 52 cd $_outdir 53 $TOOLS_DIR/mkarray.py "$_arg1" "$_arg2" "$_arg3" "$_arg4" $_inputs > /dev/null -
Property mode
changed from
-
tools/release.sh
r9259d20 r3e828ea 1 #! /bin/bash1 #!/bin/sh 2 2 3 3 # 4 # Copyright (c) 201 0 Jakub Jermar4 # Copyright (c) 2019 Jiří Zárevúcky 5 5 # All rights reserved. 6 6 # … … 29 29 # 30 30 31 if [ $1" " == "-h " ]; 32 then 33 echo "Perform pre-integration hands-off build of all profiles." 34 echo 35 echo "Syntax:" 36 echo " $0 [-h] [args...]" 37 echo 38 echo " -h Print this help." 39 echo " args... All other args are passed to make (e.g. -j 6)" 40 echo 31 # Find out the path to the script. 32 SOURCE_DIR=`which -- "$0" 2>/dev/null` 33 # Maybe we are running bash. 34 [ -z "$SOURCE_DIR" ] && SOURCE_DIR=`which -- "$BASH_SOURCE"` 35 [ -z "$SOURCE_DIR" ] && exit 1 36 SOURCE_DIR=`dirname -- "$SOURCE_DIR"` 37 SOURCE_DIR=`cd $SOURCE_DIR && cd .. && echo $PWD` 41 38 42 exit43 fi44 39 45 FAILED="" 46 PASSED="" 47 PROFILES="" 48 DIRS=`find defaults/ -name Makefile.config | sed 's/^defaults\/\(.*\)\/Makefile.config/\1/' | sort` 40 echo "Running tools/build_all.sh" 49 41 50 for D in $DIRS; 51 do 52 for H in $DIRS; 53 do 54 if [ `echo $H | grep "^$D\/.*"`x != "x" ]; 55 then 56 continue 2 57 fi 58 done 59 PROFILES="$PROFILES $D" 60 done 42 mkdir -p build_all 43 cd build_all 44 sh "${SOURCE_DIR}/tools/build_all.sh" 45 cd .. 61 46 62 echo ">>> Going to build the following profiles:" 63 echo $PROFILES 64 65 for P in $PROFILES; 66 do 67 echo -n ">>>> Building $P... " 68 ( make distclean && make PROFILE=$P HANDS_OFF=y "$@" ) >>/dev/null 2>>/dev/null 69 if [ $? -ne 0 ]; 70 then 71 FAILED="$FAILED $P" 72 echo "failed." 73 else 74 PASSED="$PASSED $P" 75 echo "ok." 76 fi 77 done 78 79 echo ">>> Done." 47 echo 80 48 echo 81 49 82 echo ">>> The following profiles passed:" 83 echo $PASSED 84 echo 50 PROFILES=`sh ${SOURCE_DIR}/tools/list_profiles.sh` 51 RELEASE=`sed -n 's:^HELENOS_RELEASE \?= \?\(.*\)$:\1:p' "${SOURCE_DIR}/version"` 52 SRC_ARCHIVE="HelenOS-${RELEASE}-src.tar" 85 53 86 echo ">>> The following profiles failed:"87 echo $FAILED 88 echo 54 git -C "${SOURCE_DIR}" archive master -o "${PWD}/${SRC_ARCHIVE}" 55 bzip2 -f "${SRC_ARCHIVE}" 56 echo "Created ${SRC_ARCHIVE}.bz2" 89 57 58 for profile in $PROFILES; do 59 image_name=`cat build_all/$profile/image_path` 60 if [ -z "$image_name" ]; then 61 continue 62 fi 63 64 image_path="build_all/$profile/`cat build_all/$profile/image_path`" 65 image_suffix=`echo "$image_name" | sed 's:.*\.::'` 66 67 release_name="HelenOS-${RELEASE}-`echo $profile | tr '/' '-'`.$image_suffix" 68 cp "$image_path" "$release_name" 69 70 echo "Created $release_name" 71 done -
tools/srepl
r9259d20 r3e828ea 1 1 #!/bin/sh 2 3 # 4 # Copyright (c) 2019 Jiří Zárevúcky 5 # All rights reserved. 6 # 7 # Redistribution and use in source and binary forms, with or without 8 # modification, are permitted provided that the following conditions 9 # are met: 10 # 11 # - Redistributions of source code must retain the above copyright 12 # notice, this list of conditions and the following disclaimer. 13 # - Redistributions in binary form must reproduce the above copyright 14 # notice, this list of conditions and the following disclaimer in the 15 # documentation and/or other materials provided with the distribution. 16 # - The name of the author may not be used to endorse or promote products 17 # derived from this software without specific prior written permission. 18 # 19 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 # 2 30 3 31 usage() -
tools/toolchain.sh
r9259d20 r3e828ea 1 #! /bin/bash1 #!/bin/sh 2 2 3 3 # … … 66 66 echo " amd64 AMD64 (x86-64, x64)" 67 67 echo " arm32 ARM 32b" 68 echo " arm64 AArch64" 68 69 echo " ia32 IA-32 (x86, i386)" 69 70 echo " ia64 IA-64 (Itanium)" … … 102 103 echo 103 104 104 if [ -z "$1" ] || [ "$1" = ="all" ] ; then105 PLATFORMS= ("amd64" "arm32" "ia32" "ia64" "mips32" "mips32eb" "ppc32" "riscv64" "sparc64")105 if [ -z "$1" ] || [ "$1" = "all" ] ; then 106 PLATFORMS='amd64 arm32 arm64 ia32 ia64 mips32 mips32eb ppc32 riscv64 sparc64' 106 107 else 107 PLATFORMS= ("$1")108 PLATFORMS="$1" 108 109 fi 109 110 … … 113 114 fi 114 115 115 for i in "${PLATFORMS[@]}"116 for i in $PLATFORMS 116 117 do 117 118 PLATFORM="$i" … … 120 121 121 122 echo "== $PLATFORM ==" 122 test_app_version "Binutils" "ld" "GNU \ ld\ \(GNU\ Binutils\)\ ((\.|[0-9])+)" "$BINUTILS_VERSION"123 test_app_version "GCC" "gcc" "gcc \ version\ ((\.|[0-9])+)" "$GCC_VERSION"124 test_app_version "GDB" "gdb" "GNU \ gdb\ \(GDB\)\s+((\.|[0-9])+)" "$GDB_VERSION"123 test_app_version "Binutils" "ld" "GNU ld (.*) \([.0-9]*\)" "$BINUTILS_VERSION" 124 test_app_version "GCC" "gcc" "gcc version \([.0-9]*\)" "$GCC_VERSION" 125 test_app_version "GDB" "gdb" "GNU gdb (.*)[[:space:]]\+\([.0-9]*\)" "$GDB_VERSION" 125 126 done 126 127 … … 139 140 echo "- $PKGNAME is missing" 140 141 else 141 { 142 OUT=$(${APP} -v 2>&1) 143 } &> /dev/null 144 145 if [[ "$OUT" =~ $REGEX ]]; then 146 VERSION="${BASH_REMATCH[1]}" 147 if [ "$INS_VERSION" = "$VERSION" ]; then 148 echo "+ $PKGNAME is uptodate ($INS_VERSION)" 149 else 150 echo "- $PKGNAME ($VERSION) is outdated ($INS_VERSION)" 151 fi 152 else 153 echo "- $PKGNAME Unexpected output" 154 fi 142 VERSION=`${APP} -v 2>&1 | sed -n "s:^${REGEX}.*:\1:p"` 143 144 if [ -z "$VERSION" ]; then 145 echo "- $PKGNAME Unexpected output" 146 return 1 147 fi 148 149 if [ "$INS_VERSION" = "$VERSION" ]; then 150 echo "+ $PKGNAME is uptodate ($INS_VERSION)" 151 else 152 echo "- $PKGNAME ($VERSION) is outdated ($INS_VERSION)" 153 fi 155 154 fi 156 155 } … … 159 158 160 159 change_title() { 161 echo -en"\e]0;$1\a"160 printf "\e]0;$1\a" 162 161 } 163 162 … … 170 169 fi 171 170 172 echo -n"${TM} "171 printf "${TM} " 173 172 change_title "${TM}" 174 173 sleep 1 … … 221 220 OUTSIDE="$1" 222 221 BASE="$2" 223 ORIGINAL="`pwd`" 222 ORIGINAL="$PWD" 223 224 cd "${BASE}" 225 check_error $? "Unable to change directory to ${BASE}." 226 ABS_BASE="$PWD" 227 cd "${ORIGINAL}" 228 check_error $? "Unable to change directory to ${ORIGINAL}." 224 229 225 230 mkdir -p "${OUTSIDE}" 226 227 231 cd "${OUTSIDE}" 228 232 check_error $? "Unable to change directory to ${OUTSIDE}." 229 ABS_OUTSIDE="`pwd`" 230 231 cd "${BASE}" 232 check_error $? "Unable to change directory to ${BASE}." 233 ABS_BASE="`pwd`" 233 234 while [ "${#PWD}" -gt "${#ABS_BASE}" ]; do 235 cd .. 236 done 237 238 if [ "$PWD" = "$ABS_BASE" ]; then 239 echo 240 echo "CROSS_PREFIX cannot reside within the working directory." 241 242 exit 5 243 fi 234 244 235 245 cd "${ORIGINAL}" 236 246 check_error $? "Unable to change directory to ${ORIGINAL}." 237 238 BASE_LEN="${#ABS_BASE}"239 OUTSIDE_TRIM="${ABS_OUTSIDE:0:${BASE_LEN}}"240 241 if [ "${OUTSIDE_TRIM}" == "${ABS_BASE}" ] ; then242 echo243 echo "CROSS_PREFIX cannot reside within the working directory."244 245 exit 5246 fi247 247 } 248 248 … … 275 275 "arm32") 276 276 GNU_ARCH="arm" 277 ;; 278 "arm64") 279 GNU_ARCH="aarch64" 277 280 ;; 278 281 "ia32") … … 341 344 mkdir -p "${WORKDIR}/sysroot/include" 342 345 mkdir "${WORKDIR}/sysroot/lib" 346 ARCH="$PLATFORM" 347 if [ "$ARCH" = "mips32eb" ]; then 348 ARCH=mips32 349 fi 350 343 351 cp -r -L -t "${WORKDIR}/sysroot/include" \ 344 352 ${SRCDIR}/../abi/include/* \ 345 ${SRCDIR}/../uspace/lib/c/arch/${ PLATFORM}/include/* \353 ${SRCDIR}/../uspace/lib/c/arch/${ARCH}/include/* \ 346 354 ${SRCDIR}/../uspace/lib/c/include/* 347 355 check_error $? "Failed to create build sysroot." … … 497 505 test_version 498 506 ;; 499 amd64|arm32| ia32|ia64|mips32|mips32eb|ppc32|riscv64|sparc64)507 amd64|arm32|arm64|ia32|ia64|mips32|mips32eb|ppc32|riscv64|sparc64) 500 508 prepare 501 509 build_target "$1" … … 505 513 build_target "amd64" 506 514 build_target "arm32" 515 build_target "arm64" 507 516 build_target "ia32" 508 517 build_target "ia64" … … 517 526 build_target "amd64" 518 527 build_target "arm32" 528 build_target "arm64" 519 529 build_target "ia32" 520 530 build_target "ia64" … … 528 538 build_target "amd64" & 529 539 build_target "arm32" & 540 build_target "arm64" & 530 541 build_target "ia32" & 531 542 build_target "ia64" & … … 543 554 wait 544 555 556 build_target "arm64" & 545 557 build_target "ia32" & 558 wait 559 546 560 build_target "ia64" & 561 build_target "mips32" & 547 562 wait 548 563 549 build_target "mips32" &550 564 build_target "mips32eb" & 565 build_target "ppc32" & 551 566 wait 552 567 553 build_target "ppc32" &554 568 build_target "riscv64" & 555 wait556 557 569 build_target "sparc64" & 558 570 wait -
tools/travis.sh
r9259d20 r3e828ea 52 52 arm32/integratorcp:arm-helenos:image.boot 53 53 arm32/raspberrypi:arm-helenos:uImage.bin 54 arm64/virt:aarch64-helenos:image.iso 54 55 ia32:i686-helenos:image.iso 55 56 ia64/i460GX:ia64-helenos:image.boot … … 86 87 echo "Will try to run C style check." 87 88 echo 88 make ccheck || exit 1 89 cd tools 90 ./build-ccheck.sh || exit 1 91 cd .. 92 tools/ccheck.sh || exit 1 89 93 echo "C style check passed." 90 94 exit 0 … … 153 157 fi 154 158 155 156 159 # Build it 157 make "PROFILE=$H_ARCH" HANDS_OFF=y || exit 1 158 test -s "$H_OUTPUT_FILENAME" || exit 1 160 SRCDIR="$PWD" 161 162 mkdir -p build/$H_ARCH || exit 1 163 cd build/$H_ARCH 164 165 export PATH="/usr/local/cross/bin:$PATH" 166 167 $SRCDIR/configure.sh $H_ARCH || exit 1 168 ninja || exit 1 169 ninja image_path || exit 1 170 171 cd $SRCDIR 159 172 160 173 echo … … 185 198 ) >hsct.conf || exit 1 186 199 187 "$HOME/helenos-harbours/hsct.sh" init "$H_HELENOS_HOME" || exit 1200 "$HOME/helenos-harbours/hsct.sh" init "$H_HELENOS_HOME" $H_ARCH || exit 1 188 201 189 202 # We cannot flood the output as Travis has limit of maximum output size -
tools/xcw/bin/helenos-cc
r9259d20 r3e828ea 32 32 # 33 33 34 35 34 36 XCW="$(dirname "$0")" 35 37 SRC_ROOT="$XCW/../../.." 36 38 if [ -z "$EXPORT_DIR" ]; then 37 EXPORT_DIR="$SRC_ROOT/ uspace/export"39 EXPORT_DIR="$SRC_ROOT/build/dist" 38 40 fi 39 UARCH="$("$XCW"/helenos-bld-config --uarch)"40 CC="$("$XCW"/helenos-bld-config --cc)"41 CFLAGS="$("$XCW"/helenos-bld-config --cflags)"42 ENDIAN="$("$XCW"/helenos-bld-config --endian)"43 41 44 echo helenos-cc "$@" 45 "$CC" \ 46 -O3 -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32LE -finput-charset=UTF-8 \ 47 $CFLAGS \ 48 -Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \ 49 -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings -ggdb \ 50 -fno-omit-frame-pointer \ 51 -D "$ENDIAN" \ 52 "$@" \ 53 -I"$XCW"/../include \ 54 -I"$EXPORT_DIR"/include/libc \ 55 -I"$EXPORT_DIR"/include 42 HELENOS_EXPORT_ROOT="$EXPORT_DIR" 43 44 source "${EXPORT_DIR}/config/config.sh" 45 46 # CC is a compilation driver, so we should check which stage of compilation 47 # is actually running and select which flags to provide. This makes no 48 # difference for GCC, but e.g. clang warns when a flag is provided that is 49 # unused 50 51 needs_cflags=true 52 needs_ldflags=true 53 54 for flag in "$@"; do 55 case "$flag" in 56 -E) 57 needs_cflags=false 58 needs_ldflags=false 59 break 60 ;; 61 -c|-S) 62 needs_ldflags=false 63 break 64 ;; 65 esac 66 done 67 68 flags="-fwide-exec-charset=UTF-32LE -finput-charset=UTF-8 -fexec-charset=UTF-8" 69 flags="$flags -isystem ${HELENOS_EXPORT_ROOT}/include/libc -idirafter ${HELENOS_EXPORT_ROOT}/include" 70 71 if $needs_cflags; then 72 flags="$flags -O3 \ 73 -Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \ 74 -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings -ggdb" 75 76 flags="$flags $HELENOS_CFLAGS" 77 fi 78 79 if $needs_ldflags; then 80 flags="$flags $HELENOS_LDFLAGS" 81 fi 82 83 flags="$flags $@" 84 85 if $needs_ldflags; then 86 flags="$flags $HELENOS_LDLIBS" 87 fi 88 89 echo "helenos-cc" "$@" 90 PATH="$HELENOS_CROSS_PATH:$PATH" "${HELENOS_TARGET}-gcc" $flags -
tools/xcw/bin/helenos-pkg-config
r9259d20 r3e828ea 34 34 XCW="$(dirname "$0")" 35 35 SRC_ROOT="$XCW/../../.." 36 UARCH="$("$XCW"/helenos-bld-config --uarch)"37 36 if [ -z "$EXPORT_DIR" ]; then 38 EXPORT_DIR="$SRC_ROOT/ uspace/export"37 EXPORT_DIR="$SRC_ROOT/build/dist" 39 38 fi 40 39 INCLUDE_DIR="$EXPORT_DIR/include" -
tools/xcw/demo/Makefile
r9259d20 r3e828ea 57 57 58 58 $(output): $(objects) 59 $( LD) -o $@ $^ $(LIBS)59 $(CC) -o $@ $^ $(LIBS) 60 60 61 61 %.o: %.c
Note:
See TracChangeset
for help on using the changeset viewer.
