- Timestamp:
- 2013-12-25T13:05:25Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bc54126c
- Parents:
- f4a47e52 (diff), 6946f23 (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. - Location:
- tools
- Files:
-
- 4 added
- 4 edited
-
autotool.py (modified) (13 diffs)
-
config.py (modified) (2 diffs)
-
ew.py (modified) (6 diffs)
-
toolchain-binutils-2.23.1.patch (added)
-
toolchain-gcc-4.8.1-headers.patch (added)
-
toolchain-gcc-4.8.1-targets.patch (added)
-
toolchain-gdb-7.6.1.patch (added)
-
toolchain.sh (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tools/autotool.py
rf4a47e52 r0773396 186 186 gnu_target = None 187 187 clang_target = None 188 helenos_target = None 188 189 cc_args = [] 189 190 … … 195 196 gnu_target = "arm-linux-gnueabi" 196 197 clang_target = "arm-unknown-linux" 198 helenos_target = "arm-helenos-gnueabi" 197 199 198 200 if (config['CROSS_TARGET'] == "ia32"): 199 201 gnu_target = "i686-pc-linux-gnu" 200 202 clang_target = "i386-unknown-linux" 203 helenos_target = "i686-pc-helenos" 201 204 202 205 if (config['CROSS_TARGET'] == "mips32"): 203 206 gnu_target = "mipsel-linux-gnu" 204 207 clang_target = "mipsel-unknown-linux" 208 helenos_target = "mipsel-helenos" 205 209 common['CC_ARGS'].append("-mabi=32") 206 210 … … 209 213 gnu_target = "amd64-linux-gnu" 210 214 clang_target = "x86_64-unknown-linux" 215 helenos_target = "amd64-helenos" 211 216 212 217 if (config['PLATFORM'] == "arm32"): … … 214 219 gnu_target = "arm-linux-gnueabi" 215 220 clang_target = "arm-unknown-linux" 221 helenos_target = "arm-helenos-gnueabi" 216 222 217 223 if (config['PLATFORM'] == "ia32"): … … 219 225 gnu_target = "i686-pc-linux-gnu" 220 226 clang_target = "i386-unknown-linux" 227 helenos_target = "i686-pc-helenos" 221 228 222 229 if (config['PLATFORM'] == "ia64"): 223 230 target = config['PLATFORM'] 224 231 gnu_target = "ia64-pc-linux-gnu" 232 helenos_target = "ia64-pc-helenos" 225 233 226 234 if (config['PLATFORM'] == "mips32"): … … 232 240 gnu_target = "mipsel-linux-gnu" 233 241 clang_target = "mipsel-unknown-linux" 242 helenos_target = "mipsel-helenos" 234 243 235 244 if ((config['MACHINE'] == "bmalta")): … … 237 246 gnu_target = "mips-linux-gnu" 238 247 clang_target = "mips-unknown-linux" 248 helenos_target = "mips-helenos" 239 249 240 250 if (config['PLATFORM'] == "mips64"): … … 246 256 gnu_target = "mips64el-linux-gnu" 247 257 clang_target = "mips64el-unknown-linux" 258 helenos_target = "mips64el-helenos" 248 259 249 260 if (config['PLATFORM'] == "ppc32"): … … 251 262 gnu_target = "ppc-linux-gnu" 252 263 clang_target = "powerpc-unknown-linux" 264 helenos_target = "ppc-helenos" 253 265 254 266 if (config['PLATFORM'] == "sparc64"): … … 256 268 gnu_target = "sparc64-linux-gnu" 257 269 clang_target = "sparc-unknown-linux" 258 259 return (target, cc_args, gnu_target, clang_target) 270 helenos_target = "sparc64-helenos" 271 272 return (target, cc_args, gnu_target, clang_target, helenos_target) 260 273 261 274 def check_app(args, name, details): … … 697 710 cross_prefix = "/usr/local/cross" 698 711 712 # HelenOS cross-compiler prefix 713 if ('CROSS_HELENOS_PREFIX' in os.environ): 714 cross_helenos_prefix = os.environ['CROSS_HELENOS_PREFIX'] 715 else: 716 cross_helenos_prefix = "/usr/local/cross-helenos" 717 699 718 # Prefix binutils tools on Solaris 700 719 if (os.uname()[0] == "SunOS"): … … 719 738 common['CC_ARGS'] = [] 720 739 if (config['COMPILER'] == "gcc_cross"): 721 target, cc_args, gnu_target, clang_target = get_target(config)740 target, cc_args, gnu_target, clang_target, helenos_target = get_target(config) 722 741 723 742 if (target is None) or (gnu_target is None): … … 727 746 path = "%s/%s/bin" % (cross_prefix, target) 728 747 prefix = "%s-" % gnu_target 748 749 check_gcc(path, prefix, common, PACKAGE_CROSS) 750 check_binutils(path, prefix, common, PACKAGE_CROSS) 751 752 check_common(common, "GCC") 753 common['CC'] = common['GCC'] 754 common['CC_ARGS'].extend(cc_args) 755 756 if (config['COMPILER'] == "gcc_helenos"): 757 target, cc_args, gnu_target, clang_target, helenos_target = get_target(config) 758 759 if (target is None) or (helenos_target is None): 760 print_error(["Unsupported compiler target for GNU GCC.", 761 "Please contact the developers of HelenOS."]) 762 763 path = "%s/%s/bin" % (cross_helenos_prefix, target) 764 prefix = "%s-" % helenos_target 729 765 730 766 check_gcc(path, prefix, common, PACKAGE_CROSS) -
tools/config.py
rf4a47e52 r0773396 363 363 def create_output(mkname, mcname, config, rules): 364 364 "Create output configuration" 365 366 timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) 365 366 timestamp_unix = int(time.time()) 367 timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(timestamp_unix)) 367 368 368 369 sys.stderr.write("Fetching current revision identifier ... ") … … 423 424 outmc.write('#define REVISION %s\n' % revision) 424 425 defs += ' "-DREVISION=%s"' % revision 426 427 outmk.write('TIMESTAMP_UNIX = %d\n' % timestamp_unix) 428 outmc.write('#define TIMESTAMP_UNIX %d\n' % timestamp_unix) 429 defs += ' "-DTIMESTAMP_UNIX=%d"\n' % timestamp_unix 425 430 426 431 outmk.write('TIMESTAMP = %s\n' % timestamp) -
tools/ew.py
rf4a47e52 r0773396 34 34 35 35 import os 36 import sys 36 37 import subprocess 37 38 import autotool 38 39 import platform 39 40 41 overrides = {} 42 43 def is_override(str): 44 if str in overrides.keys(): 45 return overrides[str] 46 return False 47 48 def cfg_get(platform, machine): 49 if machine == "": 50 return emulators[platform] 51 else: 52 return emulators[platform][machine] 53 40 54 def run_in_console(cmd, title): 41 55 cmdline = 'xterm -T ' + '"' + title + '"' + ' -e ' + cmd 42 56 print(cmdline) 43 subprocess.call(cmdline, shell = True); 57 if not is_override('dryrun'): 58 subprocess.call(cmdline, shell = True); 44 59 45 60 def get_host_native_width(): … … 52 67 # on 32 bits host 53 68 host_width = get_host_native_width() 54 if guest_width <= host_width :69 if guest_width <= host_width and not is_override('nokvm'): 55 70 opts = opts + ' -enable-kvm' 56 71 … … 79 94 80 95 def qemu_bd_options(): 96 if is_override('nohdd'): 97 return '' 98 81 99 if not os.path.exists('hdisk.img'): 82 100 subprocess.call('tools/mkfat.py 1048576 uspace/dist/data hdisk.img', shell = True) 101 83 102 return ' -hda hdisk.img' 84 103 … … 93 112 94 113 def qemu_net_options(): 95 nic_options = qemu_nic_e1k_options() 114 if is_override('nonet'): 115 return '' 116 117 nic_options = '' 118 if 'net' in overrides.keys(): 119 if 'e1k' in overrides['net'].keys(): 120 nic_options += qemu_nic_e1k_options() 121 if 'rtl8139' in overrides['net'].keys(): 122 nic_options += qemu_nic_rtl8139_options() 123 if 'ne2k' in overrides['net'].keys(): 124 nic_options += qemu_nic_ne2k_options() 125 else: 126 # Use the default NIC 127 nic_options += qemu_nic_e1k_options() 128 96 129 return nic_options + ' -net user -redir udp:8080::8080 -redir udp:8081::8081 -redir tcp:8080::8080 -redir tcp:8081::8081 -redir tcp:2223::2223' 97 130 98 131 def qemu_usb_options(): 99 return '' 100 101 def qemu_run(platform, machine, console, image, networking, storage, usb): 132 if is_override('nousb'): 133 return '' 134 return ' -usb' 135 136 def qemu_audio_options(): 137 if is_override('nosnd'): 138 return '' 139 return ' -soundhw sb16' 140 141 def qemu_run(platform, machine): 142 cfg = cfg_get(platform, machine) 102 143 suffix, options = platform_to_qemu_options(platform, machine) 103 144 cmd = 'qemu-' + suffix … … 107 148 cmdline += ' ' + options 108 149 109 if storage:110 cmdline += qemu_bd_options() 111 if networking:150 cmdline += qemu_bd_options() 151 152 if (not 'net' in cfg.keys()) or cfg['net']: 112 153 cmdline += qemu_net_options() 113 if usb:154 if (not 'usb' in cfg.keys()) or cfg['usb']: 114 155 cmdline += qemu_usb_options() 156 if (not 'audio' in cfg.keys()) or cfg['audio']: 157 cmdline += qemu_audio_options() 115 158 116 if image== 'image.iso':159 if cfg['image'] == 'image.iso': 117 160 cmdline += ' -boot d -cdrom image.iso' 118 elif image== 'image.boot':161 elif cfg['image'] == 'image.boot': 119 162 cmdline += ' -kernel image.boot' 120 163 121 if not console:164 if ('console' in cfg.keys()) and not cfg['console']: 122 165 cmdline += ' -nographic' 123 166 … … 128 171 else: 129 172 print(cmdline) 130 subprocess.call(cmdline, shell = True) 173 if not is_override('dryrun'): 174 subprocess.call(cmdline, shell = True) 131 175 132 def ski_run(platform, machine , console, image, networking, storage, usb):176 def ski_run(platform, machine): 133 177 run_in_console('ski -i contrib/conf/ski.conf', 'HelenOS/ia64 on ski') 134 178 135 def msim_run(platform, machine , console, image, networking, storage, usb):179 def msim_run(platform, machine): 136 180 run_in_console('msim -c contrib/conf/msim.conf', 'HelenOS/mips32 on msim') 137 181 138 emulators = {} 139 emulators['amd64'] = {} 140 emulators['arm32'] = {} 141 emulators['ia32'] = {} 142 emulators['ia64'] = {} 143 emulators['mips32'] = {} 144 emulators['ppc32'] = {} 145 emulators['sparc64'] = {} 146 147 emulators['amd64'][''] = qemu_run, True, 'image.iso', True, True, True 148 emulators['arm32']['integratorcp'] = qemu_run, True, 'image.boot', False, False, False 149 emulators['ia32'][''] = qemu_run, True, 'image.iso', True, True, True 150 emulators['ia64']['ski'] = ski_run, False, 'image.boot', False, False, False 151 emulators['mips32']['msim'] = msim_run, False, 'image.boot', False, False, False 152 emulators['mips32']['lmalta'] = qemu_run, False, 'image.boot', False, False, False 153 emulators['mips32']['bmalta'] = qemu_run, False, 'image.boot', False, False, False 154 emulators['ppc32'][''] = qemu_run, True, 'image.iso', True, True, True 155 emulators['sparc64']['generic'] = qemu_run, True, 'image.iso', True, True, True 182 183 emulators = { 184 'amd64' : { 185 'run' : qemu_run, 186 'image' : 'image.iso' 187 }, 188 'arm32' : { 189 'integratorcp' : { 190 'run' : qemu_run, 191 'image' : 'image.boot', 192 'net' : False, 193 'audio' : False 194 } 195 }, 196 'ia32' : { 197 'run' : qemu_run, 198 'image' : 'image.iso' 199 }, 200 'ia64' : { 201 'ski' : { 202 'run' : ski_run 203 } 204 }, 205 'mips32' : { 206 'msim' : { 207 'run' : msim_run 208 }, 209 'lmalta' : { 210 'run' : qemu_run, 211 'image' : 'image.boot', 212 'console' : False 213 }, 214 'bmalta' : { 215 'run' : qemu_run, 216 'image' : 'image.boot', 217 'console' : False 218 }, 219 }, 220 'ppc32' : { 221 'run' : qemu_run, 222 'image' : 'image.iso', 223 'audio' : False 224 }, 225 'sparc64' : { 226 'generic' : { 227 'run' : qemu_run, 228 'image' : 'image.iso', 229 'audio' : False 230 } 231 }, 232 } 233 234 def usage(): 235 print("%s - emulator wrapper for running HelenOS\n" % os.path.basename(sys.argv[0])) 236 print("%s [-d] [-h] [-net e1k|rtl8139|ne2k] [-nohdd] [-nokvm] [-nonet] [-nosnd] [-nousb]\n" % 237 os.path.basename(sys.argv[0])) 238 print("-d\tDry run: do not run the emulation, just print the command line.") 239 print("-h\tPrint the usage information and exit.") 240 print("-nohdd\tDisable hard disk, if applicable.") 241 print("-nokvm\tDisable KVM, if applicable.") 242 print("-nonet\tDisable networking support, if applicable.") 243 print("-nosnd\tDisable sound, if applicable.") 244 print("-nousb\tDisable USB support, if applicable.") 156 245 157 246 def run(): 247 expect_nic = False 248 249 for i in range(1, len(sys.argv)): 250 251 if expect_nic: 252 expect_nic = False 253 if not 'net' in overrides.keys(): 254 overrides['net'] = {} 255 if sys.argv[i] == 'e1k': 256 overrides['net']['e1k'] = True 257 elif sys.argv[i] == 'rtl8139': 258 overrides['net']['rtl8139'] = True 259 elif sys.argv[i] == 'ne2k': 260 overrides['net']['ne2k'] = True 261 else: 262 usage() 263 exit() 264 265 elif sys.argv[i] == '-h': 266 usage() 267 exit() 268 elif sys.argv[i] == '-d': 269 overrides['dryrun'] = True 270 elif sys.argv[i] == '-net' and i < len(sys.argv) - 1: 271 expect_nic = True 272 elif sys.argv[i] == '-nohdd': 273 overrides['nohdd'] = True 274 elif sys.argv[i] == '-nokvm': 275 overrides['nokvm'] = True 276 elif sys.argv[i] == '-nonet': 277 overrides['nonet'] = True 278 elif sys.argv[i] == '-nosnd': 279 overrides['nosnd'] = True 280 elif sys.argv[i] == '-nousb': 281 overrides['nousb'] = True 282 else: 283 usage() 284 exit() 285 158 286 config = {} 159 287 autotool.read_config(autotool.CONFIG, config) 160 288 289 if 'PLATFORM' in config.keys(): 290 platform = config['PLATFORM'] 291 else: 292 platform = '' 293 294 if 'MACHINE' in config.keys(): 295 mach = config['MACHINE'] 296 else: 297 mach = '' 298 161 299 try: 162 platform = config['PLATFORM']300 emu_run = cfg_get(platform, mach)['run'] 163 301 except: 164 platform = '' 165 166 try: 167 mach = config['MACHINE'] 168 except: 169 mach = '' 170 171 try: 172 emu_run, console, image, networking, storage, usb = emulators[platform][mach] 173 except: 174 print("Cannot start emulation for the chosen configuration.") 302 print("Cannot start emulation for the chosen configuration. (%s/%s)" % (platform, mach)) 175 303 return 176 304 177 emu_run(platform, mach , console, image, networking, storage, usb)305 emu_run(platform, mach) 178 306 179 307 run() -
tools/toolchain.sh
rf4a47e52 r0773396 36 36 GCC_GMP_VERSION_NUM(__GNU_MP_VERSION, __GNU_MP_VERSION_MINOR, __GNU_MP_VERSION_PATCHLEVEL) 37 37 38 #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4, 3,2)38 #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4, 3, 2) 39 39 choke me 40 40 #endif … … 55 55 BINUTILS_VERSION="2.23.1" 56 56 BINUTILS_RELEASE="" 57 BINUTILS_PATCHES="toolchain-binutils-2.23.1.patch" 57 58 GCC_VERSION="4.8.1" 58 GDB_VERSION="7.6" 59 GCC_PATCHES="toolchain-gcc-4.8.1-targets.patch toolchain-gcc-4.8.1-headers.patch" 60 GDB_VERSION="7.6.1" 61 GDB_PATCHES="toolchain-gdb-7.6.1.patch" 59 62 60 63 BASEDIR="`pwd`" 64 SRCDIR="$(readlink -f $(dirname "$0"))" 61 65 BINUTILS="binutils-${BINUTILS_VERSION}${BINUTILS_RELEASE}.tar.bz2" 62 66 GCC="gcc-${GCC_VERSION}.tar.bz2" 63 67 GDB="gdb-${GDB_VERSION}.tar.bz2" 68 69 REAL_INSTALL=true 70 USE_HELENOS_TARGET=false 71 INSTALL_DIR="${BASEDIR}/PKG" 64 72 65 73 # … … 135 143 echo 136 144 echo "Syntax:" 137 echo " $0 <platform>"145 echo " $0 [--no-install] [--helenos-target] <platform>" 138 146 echo 139 147 echo "Possible target platforms are:" … … 152 160 echo " 2-way same as 'all', but 2-way parallel" 153 161 echo 154 echo "The toolchain will be installed to the directory specified by" 155 echo "the CROSS_PREFIX environment variable. If the variable is not" 156 echo "defined, /usr/local/cross will be used by default." 162 echo "The toolchain is installed into directory specified by the" 163 echo "CROSS_PREFIX environment variable. If the variable is not" 164 echo "defined, /usr/local/cross/ is used as default." 165 echo 166 echo "If --no-install is present, the toolchain still uses the" 167 echo "CROSS_PREFIX as the target directory but the installation" 168 echo "copies the files into PKG/ subdirectory without affecting" 169 echo "the actual root file system. That is only useful if you do" 170 echo "not want to run the script under the super user." 171 echo 172 echo "The --helenos-target will build HelenOS-specific toolchain" 173 echo "(i.e. it will use *-helenos-* triplet instead of *-linux-*)." 174 echo "This toolchain is installed into /usr/local/cross-helenos by" 175 echo "default. The settings can be changed by setting environment" 176 echo "variable CROSS_HELENOS_PREFIX." 177 echo "Using the HelenOS-specific toolchain is still an experimental" 178 echo "feature that is not fully supported." 157 179 echo 158 180 … … 254 276 } 255 277 278 check_dirs() { 279 OUTSIDE="$1" 280 BASE="$2" 281 ORIGINAL="`pwd`" 282 283 cd "${OUTSIDE}" 284 check_error $? "Unable to change directory to ${OUTSIDE}." 285 ABS_OUTSIDE="`pwd`" 286 287 cd "${BASE}" 288 check_error $? "Unable to change directory to ${BASE}." 289 ABS_BASE="`pwd`" 290 291 cd "${ORIGINAL}" 292 check_error $? "Unable to change directory to ${ORIGINAL}." 293 294 BASE_LEN="${#ABS_BASE}" 295 OUTSIDE_TRIM="${ABS_OUTSIDE:0:${BASE_LEN}}" 296 297 if [ "${OUTSIDE_TRIM}" == "${ABS_BASE}" ] ; then 298 echo 299 echo "CROSS_PREFIX cannot reside within the working directory." 300 301 exit 5 302 fi 303 } 304 256 305 unpack_tarball() { 257 306 FILE="$1" … … 263 312 tar -xjf "${FILE}" 264 313 check_error $? "Error unpacking ${DESC}." 314 } 315 316 patch_sources() { 317 PATCH_FILE="$1" 318 PATCH_STRIP="$2" 319 DESC="$3" 320 321 change_title "Patching ${DESC}" 322 echo " >>> Patching ${DESC} with ${PATCH_FILE}" 323 324 patch -t "-p${PATCH_STRIP}" <"$PATCH_FILE" 325 check_error $? "Error patching ${DESC}." 265 326 } 266 327 … … 276 337 download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "33adb18c3048d057ac58d07a3f1adb38" 277 338 download_fetch "${GCC_SOURCE}" "${GCC}" "3b2386c114cd74185aa3754b58a79304" 278 download_fetch "${GDB_SOURCE}" "${GDB}" "fda57170e4d11cdde74259ca575412a8" 339 download_fetch "${GDB_SOURCE}" "${GDB}" "fbc4dab4181e6e9937075b43a4ce2732" 340 } 341 342 set_target_from_platform() { 343 case "$1" in 344 "amd64") 345 LINUX_TARGET="amd64-linux-gnu" 346 HELENOS_TARGET="amd64-helenos" 347 ;; 348 "arm32") 349 LINUX_TARGET="arm-linux-gnueabi" 350 HELENOS_TARGET="arm-helenos-gnueabi" 351 ;; 352 "ia32") 353 LINUX_TARGET="i686-pc-linux-gnu" 354 HELENOS_TARGET="i686-pc-helenos" 355 ;; 356 "ia64") 357 LINUX_TARGET="ia64-pc-linux-gnu" 358 HELENOS_TARGET="ia64-pc-helenos" 359 ;; 360 "mips32") 361 LINUX_TARGET="mipsel-linux-gnu" 362 HELENOS_TARGET="mipsel-helenos" 363 ;; 364 "mips32eb") 365 LINUX_TARGET="mips-linux-gnu" 366 HELENOS_TARGET="mips-helenos" 367 ;; 368 "mips64") 369 LINUX_TARGET="mips64el-linux-gnu" 370 HELENOS_TARGET="mips64el-helenos" 371 ;; 372 "ppc32") 373 LINUX_TARGET="ppc-linux-gnu" 374 HELENOS_TARGET="ppc-helenos" 375 ;; 376 "ppc64") 377 LINUX_TARGET="ppc64-linux-gnu" 378 HELENOS_TARGET="ppc64-helenos" 379 ;; 380 "sparc64") 381 LINUX_TARGET="sparc64-linux-gnu" 382 HELENOS_TARGET="sparc64-helenos" 383 ;; 384 *) 385 check_error 1 "No target known for $1." 386 ;; 387 esac 279 388 } 280 389 281 390 build_target() { 282 391 PLATFORM="$1" 283 TARGET="$2" 392 # This sets the *_TARGET variables 393 set_target_from_platform "$PLATFORM" 394 if $USE_HELENOS_TARGET; then 395 TARGET="$HELENOS_TARGET" 396 else 397 TARGET="$LINUX_TARGET" 398 fi 284 399 285 400 WORKDIR="${BASEDIR}/${PLATFORM}" … … 292 407 CROSS_PREFIX="/usr/local/cross" 293 408 fi 294 295 PREFIX="${CROSS_PREFIX}/${PLATFORM}" 409 if [ -z "${CROSS_HELENOS_PREFIX}" ] ; then 410 CROSS_HELENOS_PREFIX="/usr/local/cross-helenos" 411 fi 412 413 if $USE_HELENOS_TARGET; then 414 PREFIX="${CROSS_HELENOS_PREFIX}/${PLATFORM}" 415 else 416 PREFIX="${CROSS_PREFIX}/${PLATFORM}" 417 fi 296 418 297 419 echo ">>> Downloading tarballs" … … 301 423 302 424 echo ">>> Removing previous content" 303 cleanup_dir "${PREFIX}"425 $REAL_INSTALL && cleanup_dir "${PREFIX}" 304 426 cleanup_dir "${WORKDIR}" 305 427 306 create_dir "${PREFIX}" "destination directory"428 $REAL_INSTALL && create_dir "${PREFIX}" "destination directory" 307 429 create_dir "${OBJDIR}" "GCC object directory" 430 431 check_dirs "${PREFIX}" "${WORKDIR}" 308 432 309 433 echo ">>> Unpacking tarballs" … … 315 439 unpack_tarball "${BASEDIR}/${GDB}" "GDB" 316 440 441 echo ">>> Applying patches" 442 for p in $BINUTILS_PATCHES; do 443 patch_sources "${SRCDIR}/${p}" 0 "binutils" 444 done 445 for p in $GCC_PATCHES; do 446 patch_sources "${SRCDIR}/${p}" 0 "GCC" 447 done 448 for p in $GDB_PATCHES; do 449 patch_sources "${SRCDIR}/${p}" 0 "GDB" 450 done 451 317 452 echo ">>> Processing binutils (${PLATFORM})" 318 453 cd "${BINUTILSDIR}" … … 320 455 321 456 change_title "binutils: configure (${PLATFORM})" 322 CFLAGS=-Wno-error ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --disable-nls --disable-werror 457 CFLAGS=-Wno-error ./configure \ 458 "--target=${TARGET}" \ 459 "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" \ 460 --disable-nls --disable-werror 323 461 check_error $? "Error configuring binutils." 324 462 325 463 change_title "binutils: make (${PLATFORM})" 326 make all install 327 check_error $? "Error compiling/installing binutils." 464 make all 465 check_error $? "Error compiling binutils." 466 467 change_title "binutils: install (${PLATFORM})" 468 if $REAL_INSTALL; then 469 make install 470 else 471 make install "DESTDIR=${INSTALL_DIR}" 472 fi 473 check_error $? "Error installing binutils." 474 328 475 329 476 echo ">>> Processing GCC (${PLATFORM})" … … 332 479 333 480 change_title "GCC: configure (${PLATFORM})" 334 "${GCCDIR}/configure" "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --with-gnu-as --with-gnu-ld --disable-nls --disable-threads --enable-languages=c,objc,c++,obj-c++ --disable-multilib --disable-libgcj --without-headers --disable-shared --enable-lto --disable-werror 481 PATH="$PATH:${INSTALL_DIR}/${PREFIX}/bin" "${GCCDIR}/configure" \ 482 "--target=${TARGET}" \ 483 "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" \ 484 --with-gnu-as --with-gnu-ld --disable-nls --disable-threads \ 485 --enable-languages=c,objc,c++,obj-c++ \ 486 --disable-multilib --disable-libgcj --without-headers \ 487 --disable-shared --enable-lto --disable-werror 335 488 check_error $? "Error configuring GCC." 336 489 337 490 change_title "GCC: make (${PLATFORM})" 338 PATH="${PATH}:${PREFIX}/bin" make all-gcc install-gcc 339 check_error $? "Error compiling/installing GCC." 491 PATH="${PATH}:${PREFIX}/bin:${INSTALL_DIR}/${PREFIX}/bin" make all-gcc 492 check_error $? "Error compiling GCC." 493 494 change_title "GCC: install (${PLATFORM})" 495 if $REAL_INSTALL; then 496 PATH="${PATH}:${PREFIX}/bin" make install-gcc 497 else 498 PATH="${PATH}:${INSTALL_DIR}/${PREFIX}/bin" make install-gcc "DESTDIR=${INSTALL_DIR}" 499 fi 500 check_error $? "Error installing GCC." 501 340 502 341 503 echo ">>> Processing GDB (${PLATFORM})" … … 344 506 345 507 change_title "GDB: configure (${PLATFORM})" 346 ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" 508 PATH="$PATH:${INSTALL_DIR}/${PREFIX}/bin" ./configure \ 509 "--target=${TARGET}" \ 510 "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" 347 511 check_error $? "Error configuring GDB." 348 512 349 513 change_title "GDB: make (${PLATFORM})" 350 make all install 351 check_error $? "Error compiling/installing GDB." 514 PATH="${PATH}:${PREFIX}/bin:${INSTALL_DIR}/${PREFIX}/bin" make all 515 check_error $? "Error compiling GDB." 516 517 change_title "GDB: make (${PLATFORM})" 518 if $REAL_INSTALL; then 519 PATH="${PATH}:${PREFIX}/bin" make install 520 else 521 PATH="${PATH}:${INSTALL_DIR}/${PREFIX}/bin" make install "DESTDIR=${INSTALL_DIR}" 522 fi 523 check_error $? "Error installing GDB." 524 352 525 353 526 cd "${BASEDIR}" … … 360 533 echo ">>> Cross-compiler for ${TARGET} installed." 361 534 } 535 536 while [ "$#" -gt 1 ]; do 537 case "$1" in 538 --no-install) 539 REAL_INSTALL=false 540 shift 541 ;; 542 --helenos-target) 543 USE_HELENOS_TARGET=true 544 shift 545 ;; 546 *) 547 show_usage 548 ;; 549 esac 550 done 362 551 363 552 if [ "$#" -lt "1" ]; then … … 366 555 367 556 case "$1" in 368 "amd64")557 amd64|arm32|ia32|ia64|mips32|mips32eb|mips64|ppc32|ppc64|sparc64) 369 558 prepare 370 build_target "amd64" "amd64-linux-gnu" 371 ;; 372 "arm32") 373 prepare 374 build_target "arm32" "arm-linux-gnueabi" 375 ;; 376 "ia32") 377 prepare 378 build_target "ia32" "i686-pc-linux-gnu" 379 ;; 380 "ia64") 381 prepare 382 build_target "ia64" "ia64-pc-linux-gnu" 383 ;; 384 "mips32") 385 prepare 386 build_target "mips32" "mipsel-linux-gnu" 387 ;; 388 "mips32eb") 389 prepare 390 build_target "mips32eb" "mips-linux-gnu" 391 ;; 392 "mips64") 393 prepare 394 build_target "mips64" "mips64el-linux-gnu" 395 ;; 396 "ppc32") 397 prepare 398 build_target "ppc32" "ppc-linux-gnu" 399 ;; 400 "ppc64") 401 prepare 402 build_target "ppc64" "ppc64-linux-gnu" 403 ;; 404 "sparc64") 405 prepare 406 build_target "sparc64" "sparc64-linux-gnu" 559 build_target "$1" 407 560 ;; 408 561 "all") 409 562 prepare 410 build_target "amd64" "amd64-linux-gnu"411 build_target "arm32" "arm-linux-gnueabi"412 build_target "ia32" "i686-pc-linux-gnu"413 build_target "ia64" "ia64-pc-linux-gnu"414 build_target "mips32" "mipsel-linux-gnu"415 build_target "mips32eb" "mips-linux-gnu"416 build_target "mips64" "mips64el-linux-gnu"417 build_target "ppc32" "ppc-linux-gnu"418 build_target "ppc64" "ppc64-linux-gnu"419 build_target "sparc64" "sparc64-linux-gnu"563 build_target "amd64" 564 build_target "arm32" 565 build_target "ia32" 566 build_target "ia64" 567 build_target "mips32" 568 build_target "mips32eb" 569 build_target "mips64" 570 build_target "ppc32" 571 build_target "ppc64" 572 build_target "sparc64" 420 573 ;; 421 574 "parallel") 422 575 prepare 423 build_target "amd64" "amd64-linux-gnu"&424 build_target "arm32" "arm-linux-gnueabi"&425 build_target "ia32" "i686-pc-linux-gnu"&426 build_target "ia64" "ia64-pc-linux-gnu"&427 build_target "mips32" "mipsel-linux-gnu"&428 build_target "mips32eb" "mips-linux-gnu"&429 build_target "mips64" "mips64el-linux-gnu"&430 build_target "ppc32" "ppc-linux-gnu"&431 build_target "ppc64" "ppc64-linux-gnu"&432 build_target "sparc64" "sparc64-linux-gnu"&576 build_target "amd64" & 577 build_target "arm32" & 578 build_target "ia32" & 579 build_target "ia64" & 580 build_target "mips32" & 581 build_target "mips32eb" & 582 build_target "mips64" & 583 build_target "ppc32" & 584 build_target "ppc64" & 585 build_target "sparc64" & 433 586 wait 434 587 ;; 435 588 "2-way") 436 589 prepare 437 build_target "amd64" "amd64-linux-gnu"&438 build_target "arm32" "arm-linux-gnueabi"&590 build_target "amd64" & 591 build_target "arm32" & 439 592 wait 440 593 441 build_target "ia32" "i686-pc-linux-gnu"&442 build_target "ia64" "ia64-pc-linux-gnu"&594 build_target "ia32" & 595 build_target "ia64" & 443 596 wait 444 597 445 build_target "mips32" "mipsel-linux-gnu"&446 build_target "mips32eb" "mips-linux-gnu"&598 build_target "mips32" & 599 build_target "mips32eb" & 447 600 wait 448 601 449 build_target "mips64" "mips64el-linux-gnu"&450 build_target "ppc32" "ppc-linux-gnu"&602 build_target "mips64" & 603 build_target "ppc32" & 451 604 wait 452 605 453 build_target "ppc64" "ppc64-linux-gnu"&454 build_target "sparc64" "sparc64-linux-gnu"&606 build_target "ppc64" & 607 build_target "sparc64" & 455 608 wait 456 609 ;;
Note:
See TracChangeset
for help on using the changeset viewer.
