- Timestamp:
- 2019-08-18T19:06:02Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1c39d33b
- Parents:
- fa70134 (diff), 6c2fac18 (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:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-08-18 19:06:02)
- git-committer:
- GitHub <noreply@…> (2019-08-18 19:06:02)
- Location:
- tools
- Files:
-
- 3 added
- 5 deleted
- 8 edited
- 3 moved
-
README (added)
-
autotool.py (deleted)
-
build_all.sh (added)
-
cc.sh (modified) (1 diff)
-
config.py (modified) (7 diffs)
-
dest_build.py (deleted)
-
ew.py (modified) (4 diffs)
-
export.sh (moved) (moved from uspace/app/vlaunch/Makefile ) (2 diffs, 1 prop)
-
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)
-
travis.sh (modified) (2 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/cc.sh
rfa70134 r32b4302 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/config.py
rfa70134 r32b4302 43 43 44 44 ARGPOS_RULES = 1 45 ARGPOS_CHOICE = 2 46 ARGPOS_PRESET = 3 45 ARGPOS_PRESETS_DIR = 2 46 ARGPOS_CHOICE = 3 47 ARGPOS_PRESET = 4 48 ARGPOS_MASK_PLATFORM = 3 47 49 48 50 RULES_FILE = sys.argv[ARGPOS_RULES] 49 51 MAKEFILE = 'Makefile.config' 50 52 MACROS = 'config.h' 51 PRESETS_DIR = 'defaults'53 PRESETS_DIR = sys.argv[ARGPOS_PRESETS_DIR] 52 54 53 55 class BinaryOp: … … 536 538 537 539 try: 538 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() 539 541 sys.stderr.write("ok\n") 540 542 except: … … 689 691 else: 690 692 preset = None 693 694 mask_platform = (len(sys.argv) > ARGPOS_MASK_PLATFORM and sys.argv[ARGPOS_MASK_PLATFORM] == "--mask-platform") 691 695 692 696 # Input configuration file can be specified on command line … … 755 759 options = [] 756 760 opt2row = {} 757 cnt = 1 758 759 options.append(" --- Load preconfigured defaults ... ") 761 cnt = 0 762 763 if not mask_platform: 764 cnt += 1 765 options.append(" --- Load preconfigured defaults ... ") 760 766 761 767 for rule in rules: … … 764 770 if cond and not cond.evaluate(config): 765 771 continue 772 773 if mask_platform and (varname == "PLATFORM" or varname == "MACHINE" or varname == "COMPILER"): 774 rule = varname, vartype, "(locked) " + name, choices, cond 766 775 767 776 if varname == selname: … … 811 820 continue 812 821 813 if value == 0 :822 if value == 0 and not mask_platform: 814 823 profile = choose_profile(PRESETS_DIR, MAKEFILE, screen, config) 815 824 if profile != None: … … 828 837 else: 829 838 value = config[selname] 839 840 if mask_platform and (selname == "PLATFORM" or selname == "MACHINE" or selname == "COMPILER"): 841 continue 830 842 831 843 if seltype == 'choice': -
tools/ew.py
rfa70134 r32b4302 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): … … 164 183 def hdisk_mk(): 165 184 if not os.path.exists('hdisk.img'): 166 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) 167 186 168 187 def qemu_bd_options(): … … 298 317 299 318 def ski_run(platform, machine, processor): 300 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') 301 320 302 321 def msim_run(platform, machine, processor): 303 322 hdisk_mk() 304 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') 305 324 306 325 def spike_run(platform, machine, processor): … … 495 514 exit() 496 515 497 config = {} 498 autotool.read_config(autotool.CONFIG, config) 516 config = read_config() 499 517 500 518 if 'PLATFORM' in config.keys(): -
tools/export.sh
-
Property mode
changed from
100644to100755
rfa70134 r32b4302 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/mkarray_for_meson.sh
-
Property mode
changed from
100644to100755
rfa70134 r32b4302 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
rfa70134 r32b4302 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
rfa70134 r32b4302 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/travis.sh
rfa70134 r32b4302 87 87 echo "Will try to run C style check." 88 88 echo 89 make ccheck || exit 1 89 cd tools 90 ./build-ccheck.sh || exit 1 91 cd .. 92 tools/ccheck.sh || exit 1 90 93 echo "C style check passed." 91 94 exit 0 … … 154 157 fi 155 158 156 157 159 # Build it 158 make "PROFILE=$H_ARCH" HANDS_OFF=y || exit 1 159 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 160 172 161 173 echo -
tools/xcw/bin/helenos-cc
rfa70134 r32b4302 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
rfa70134 r32b4302 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
rfa70134 r32b4302 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.
