- Timestamp:
- 2010-07-25T10:11:13Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 377cce8
- Parents:
- 24a2517 (diff), a2da43c (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:
-
- 6 added
- 8 edited
-
autotool.py (added)
-
checkers/clang.py (added)
-
checkers/howto.txt (added)
-
checkers/stanse.py (modified) (2 diffs)
-
checkers/vcc.h (added)
-
checkers/vcc.py (modified) (9 diffs)
-
config.py (modified) (9 diffs)
-
jobfile.py (modified) (1 diff)
-
mkfat.py (modified) (1 diff)
-
mkhord.py (modified) (1 diff)
-
mktmpfs.py (modified) (1 diff)
-
mkuimage.py (added)
-
pack.py (added)
-
toolchain.sh (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tools/checkers/stanse.py
r24a2517 rc621f4aa 74 74 srcfname = arg[0] 75 75 tgtfname = arg[1] 76 tool = arg[2] 77 category = arg[3] 76 78 base = arg[4] 77 79 options = arg[5] … … 83 85 84 86 # Only C files are interesting for us 85 if ( arg[2]!= "cc"):87 if (tool != "cc"): 86 88 continue 87 89 -
tools/checkers/vcc.py
r24a2517 rc621f4aa 36 36 import subprocess 37 37 import jobfile 38 import re 38 39 39 40 jobs = [ 40 "kernel/kernel.job", 41 "uspace/srv/clip/clip.job" 41 "kernel/kernel.job" 42 42 ] 43 44 re_attribute = re.compile("__attribute__\s*\(\(.*\)\)") 45 re_va_list = re.compile("__builtin_va_list") 46 47 specification = "" 43 48 44 49 def usage(prname): 45 50 "Print usage syntax" 46 print prname + " <ROOT> "51 print prname + " <ROOT> [VCC_PATH]" 47 52 48 53 def cygpath(upath): … … 54 59 "Preprocess source using GCC preprocessor and compatibility tweaks" 55 60 61 global specification 62 56 63 args = ['gcc', '-E'] 57 64 args.extend(options.split()) 58 args. append(srcfname)65 args.extend(['-DCONFIG_VERIFY_VCC=1', srcfname]) 59 66 60 67 # Change working directory … … 66 73 67 74 tmpf = file(tmpfname, "w") 75 tmpf.write(specification) 68 76 69 77 for line in preproc.splitlines(): 78 70 79 # Ignore preprocessor directives 80 71 81 if (line.startswith('#')): 72 continue 82 continue 83 84 # Remove __attribute__((.*)) GCC extension 85 86 line = re.sub(re_attribute, "", line) 87 88 # Ignore unsupported __builtin_va_list type 89 # (a better solution replacing __builrin_va_list with 90 # an emulated implementation is needed) 91 92 line = re.sub(re_va_list, "void *", line) 73 93 74 94 tmpf.write("%s\n" % line) … … 80 100 return True 81 101 82 def vcc( root, job):102 def vcc(vcc_path, root, job): 83 103 "Run Vcc on a jobfile" 84 104 … … 107 127 srcfname = arg[0] 108 128 tgtfname = arg[1] 129 tool = arg[2] 130 category = arg[3] 109 131 base = arg[4] 110 132 options = arg[5] … … 118 140 tmpfqname = os.path.join(base, tmpfname) 119 141 142 vccfname = "%s.i" % srcfname 143 vccfqname = os.path.join(base, vccfname); 144 120 145 # Only C files are interesting for us 121 if ( arg[2]!= "cc"):146 if (tool != "cc"): 122 147 continue 123 148 … … 128 153 129 154 # Run Vcc 130 131 retval = subprocess.Popen(['vcc', cygpath(tmpfqname)]).wait() 132 133 # Cleanup 155 print " -- %s --" % srcfname 156 retval = subprocess.Popen([vcc_path, '/pointersize:32', '/newsyntax', cygpath(tmpfqname)]).wait() 157 158 if (retval != 0): 159 return False 160 161 # Cleanup, but only if verification was successful 162 # (to be able to examine the preprocessed file) 134 163 135 164 if (os.path.isfile(tmpfqname)): 136 165 os.remove(tmpfqname) 137 138 if (retval != 0): 139 return False 166 os.remove(vccfqname) 140 167 141 168 return True 142 169 143 170 def main(): 171 global specification 172 144 173 if (len(sys.argv) < 2): 145 174 usage(sys.argv[0]) … … 147 176 148 177 rootdir = os.path.abspath(sys.argv[1]) 178 if (len(sys.argv) > 2): 179 vcc_path = sys.argv[2] 180 else: 181 vcc_path = "/cygdrive/c/Program Files (x86)/Microsoft Research/Vcc/Binaries/vcc" 182 183 if (not os.path.isfile(vcc_path)): 184 print "%s is not a binary." % vcc_path 185 print "Please supply the full Cygwin path to Vcc as the second argument." 186 return 187 149 188 config = os.path.join(rootdir, "HelenOS.config") 150 189 … … 154 193 return 155 194 195 specpath = os.path.join(rootdir, "tools/checkers/vcc.h") 196 if (not os.path.isfile(specpath)): 197 print "%s not found." % config 198 return 199 200 specfile = file(specpath, "r") 201 specification = specfile.read() 202 specfile.close() 203 156 204 for job in jobs: 157 if (not vcc( rootdir, job)):205 if (not vcc(vcc_path, rootdir, job)): 158 206 print 159 207 print "Failed job: %s" % job -
tools/config.py
r24a2517 rc621f4aa 28 28 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 29 # 30 30 31 """ 31 32 HelenOS configuration system 32 33 """ 34 33 35 import sys 34 36 import os … … 41 43 MAKEFILE = 'Makefile.config' 42 44 MACROS = 'config.h' 43 DEFS = 'config.defs'44 45 PRECONF = 'defaults' 45 46 … … 223 224 return True 224 225 225 def create_output(mkname, mcname, d fname, defaults, ask_names):226 def create_output(mkname, mcname, defaults, ask_names): 226 227 "Create output configuration" 227 228 … … 229 230 230 231 sys.stderr.write("Fetching current revision identifier ... ") 231 version = subprocess.Popen(['bzr', 'version-info', '--custom', '--template={clean}:{revno}:{revision_id}'], stdout = subprocess.PIPE).communicate()[0].split(':') 232 sys.stderr.write("OK\n") 232 233 try: 234 version = subprocess.Popen(['bzr', 'version-info', '--custom', '--template={clean}:{revno}:{revision_id}'], stdout = subprocess.PIPE).communicate()[0].split(':') 235 sys.stderr.write("ok\n") 236 except: 237 version = [1, "unknown", "unknown"] 238 sys.stderr.write("failed\n") 233 239 234 240 if (len(version) == 3): … … 242 248 outmk = file(mkname, 'w') 243 249 outmc = file(mcname, 'w') 244 outdf = file(dfname, 'w')245 250 246 251 outmk.write('#########################################\n') … … 252 257 outmc.write(' ***************************************/\n\n') 253 258 254 outdf.write('#########################################\n') 255 outdf.write('## AUTO-GENERATED FILE, DO NOT EDIT!!! ##\n') 256 outdf.write('#########################################\n\n') 257 outdf.write('CONFIG_DEFS =') 259 defs = 'CONFIG_DEFS =' 258 260 259 261 for varname, vartype, name, choices, cond in ask_names: … … 273 275 if (default == "y"): 274 276 outmc.write('/* %s */\n#define %s\n\n' % (name, varname)) 275 outdf.write(' -D%s' % varname)277 defs += ' -D%s' % varname 276 278 else: 277 279 outmc.write('/* %s */\n#define %s %s\n#define %s_%s\n\n' % (name, varname, default, varname, default)) 278 outdf.write(' -D%s=%s -D%s_%s' % (varname, default, varname, default))280 defs += ' -D%s=%s -D%s_%s' % (varname, default, varname, default) 279 281 280 282 if (revision is not None): 281 283 outmk.write('REVISION = %s\n' % revision) 282 284 outmc.write('#define REVISION %s\n' % revision) 283 outdf.write(' "-DREVISION=%s"' % revision)285 defs += ' "-DREVISION=%s"' % revision 284 286 285 287 outmk.write('TIMESTAMP = %s\n' % timestamp) 286 288 outmc.write('#define TIMESTAMP %s\n' % timestamp) 287 outdf.write(' "-DTIMESTAMP=%s"\n' % timestamp) 289 defs += ' "-DTIMESTAMP=%s"\n' % timestamp 290 291 outmk.write(defs) 288 292 289 293 outmk.close() 290 294 outmc.close() 291 outdf.close()292 295 293 296 def sorted_dir(root): … … 348 351 if ((len(sys.argv) >= 3) and (sys.argv[2] == 'default')): 349 352 if (check_choices(defaults, ask_names)): 350 create_output(MAKEFILE, MACROS, DEFS,defaults, ask_names)353 create_output(MAKEFILE, MACROS, defaults, ask_names) 351 354 return 0 352 355 … … 466 469 xtui.screen_done(screen) 467 470 468 create_output(MAKEFILE, MACROS, DEFS,defaults, ask_names)471 create_output(MAKEFILE, MACROS, defaults, ask_names) 469 472 return 0 470 473 -
tools/jobfile.py
r24a2517 rc621f4aa 27 27 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 # 29 29 30 """ 30 31 Add a source/object file pair to a checker jobfile -
tools/mkfat.py
r24a2517 rc621f4aa 27 27 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 # 29 29 30 """ 30 31 FAT creator -
tools/mkhord.py
r24a2517 rc621f4aa 27 27 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 # 29 29 30 """ 30 31 HORD encapsulator -
tools/mktmpfs.py
r24a2517 rc621f4aa 27 27 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 # 29 29 30 """ 30 31 TMPFS creator -
tools/toolchain.sh
r24a2517 rc621f4aa 142 142 143 143 BINUTILS_VERSION="2.20" 144 GCC_VERSION="4. 4.3"144 GCC_VERSION="4.5.0" 145 145 146 146 BINUTILS="binutils-${BINUTILS_VERSION}.tar.bz2" … … 165 165 echo ">>> Downloading tarballs" 166 166 download_check "${BINUTILS_SOURCE}" "${BINUTILS}" "ee2d3e996e9a2d669808713360fa96f8" 167 download_check "${GCC_SOURCE}" "${GCC_CORE}" " 054b66f315b3d04ad06544ce26e72365"168 download_check "${GCC_SOURCE}" "${GCC_OBJC}" " 34711c4de46eaf79aa018206dbec4389"169 download_check "${GCC_SOURCE}" "${GCC_CPP}" " cd179ec4f05ee17ce76464da25a2674c"167 download_check "${GCC_SOURCE}" "${GCC_CORE}" "58eda33c3184303628f91c42a7ab15b5" 168 download_check "${GCC_SOURCE}" "${GCC_OBJC}" "8d8c01b6631b020cc6c167860fde2398" 169 download_check "${GCC_SOURCE}" "${GCC_CPP}" "5ab93605af40def4844eda09ca769c2d" 170 170 171 171 echo ">>> Removing previous content" … … 196 196 cd "${OBJDIR}" 197 197 check_error $? "Change directory failed." 198 "${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 198 "${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 199 199 check_error $? "Error configuring GCC." 200 200 PATH="${PATH}:${PREFIX}/bin" make all-gcc install-gcc
Note:
See TracChangeset
for help on using the changeset viewer.
