Permalink
Browse files

Use waf-light instead of waf

This way there won't be strange tools/.waf-12343 directories hanging about.
All that waf needs to run is inside the tools/wafadmin directory.
  • Loading branch information...
1 parent 763137e commit 84d2966377a757fca9760d3b8c57d5f2d74975e5 @ry ry committed Oct 2, 2009
Showing with 15,737 additions and 1 deletion.
  1. +1 −1 configure
  2. BIN tools/waf
  3. +150 −0 tools/waf-light
  4. +963 −0 tools/wafadmin/Build.py
  5. +336 −0 tools/wafadmin/Configure.py
  6. +76 −0 tools/wafadmin/Constants.py
  7. +205 −0 tools/wafadmin/Environment.py
  8. +128 −0 tools/wafadmin/Logs.py
  9. +660 −0 tools/wafadmin/Node.py
  10. +273 −0 tools/wafadmin/Options.py
  11. +219 −0 tools/wafadmin/Runner.py
  12. +561 −0 tools/wafadmin/Scripting.py
  13. +1,078 −0 tools/wafadmin/Task.py
  14. +576 −0 tools/wafadmin/TaskGen.py
  15. +266 −0 tools/wafadmin/Tools/UnitTest.py
  16. +4 −0 tools/wafadmin/Tools/__init__.py
  17. +36 −0 tools/wafadmin/Tools/ar.py
  18. +42 −0 tools/wafadmin/Tools/bison.py
  19. +335 −0 tools/wafadmin/Tools/boost.py
  20. +102 −0 tools/wafadmin/Tools/cc.py
  21. +613 −0 tools/wafadmin/Tools/ccroot.py
  22. +67 −0 tools/wafadmin/Tools/compiler_cc.py
  23. +61 −0 tools/wafadmin/Tools/compiler_cxx.py
  24. +33 −0 tools/wafadmin/Tools/compiler_d.py
  25. +680 −0 tools/wafadmin/Tools/config_c.py
  26. +69 −0 tools/wafadmin/Tools/cs.py
  27. +106 −0 tools/wafadmin/Tools/cxx.py
  28. +532 −0 tools/wafadmin/Tools/d.py
  29. +37 −0 tools/wafadmin/Tools/dbus.py
  30. +64 −0 tools/wafadmin/Tools/dmd.py
  31. +26 −0 tools/wafadmin/Tools/flex.py
  32. +40 −0 tools/wafadmin/Tools/gas.py
  33. +121 −0 tools/wafadmin/Tools/gcc.py
  34. +52 −0 tools/wafadmin/Tools/gdc.py
  35. +165 −0 tools/wafadmin/Tools/glib2.py
  36. +214 −0 tools/wafadmin/Tools/gnome.py
  37. +111 −0 tools/wafadmin/Tools/gnu_dirs.py
  38. +18 −0 tools/wafadmin/Tools/gob2.py
  39. +125 −0 tools/wafadmin/Tools/gxx.py
  40. +36 −0 tools/wafadmin/Tools/icc.py
  41. +34 −0 tools/wafadmin/Tools/icpc.py
  42. +143 −0 tools/wafadmin/Tools/intltool.py
  43. +255 −0 tools/wafadmin/Tools/javaw.py
  44. +76 −0 tools/wafadmin/Tools/kde4.py
  45. +333 −0 tools/wafadmin/Tools/libtool.py
  46. +25 −0 tools/wafadmin/Tools/lua.py
  47. +433 −0 tools/wafadmin/Tools/misc.py
  48. +775 −0 tools/wafadmin/Tools/msvc.py
  49. +52 −0 tools/wafadmin/Tools/nasm.py
  50. +313 −0 tools/wafadmin/Tools/ocaml.py
  51. +185 −0 tools/wafadmin/Tools/osx.py
  52. +120 −0 tools/wafadmin/Tools/perl.py
  53. +809 −0 tools/wafadmin/Tools/preproc.py
  54. +401 −0 tools/wafadmin/Tools/python.py
  55. +531 −0 tools/wafadmin/Tools/qt4.py
  56. +75 −0 tools/wafadmin/Tools/suncc.py
  57. +69 −0 tools/wafadmin/Tools/suncxx.py
  58. +235 −0 tools/wafadmin/Tools/tex.py
  59. +273 −0 tools/wafadmin/Tools/vala.py
  60. +49 −0 tools/wafadmin/Tools/winres.py
  61. +652 −0 tools/wafadmin/Utils.py
  62. +3 −0 tools/wafadmin/__init__.py
  63. +620 −0 tools/wafadmin/pproc.py
  64. +95 −0 tools/wafadmin/py3kfixes.py
View
@@ -24,7 +24,7 @@ cd $WORKINGDIR
WORKINGDIR=`pwd`
cd $CUR_DIR
-WAF="${WORKINGDIR}/tools/waf"
+WAF="${WORKINGDIR}/tools/waf-light"
# Checks for WAF. Honours $WAF if set. Stores path to 'waf' in $WAF.
# Requires that $PYTHON is set.
View
BIN tools/waf
Binary file not shown.
View
@@ -0,0 +1,150 @@
+#!/usr/bin/env python
+# encoding: utf-8
+# Thomas Nagy, 2005-2009
+
+"""
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+"""
+
+import os, sys
+if sys.hexversion<0x203000f: raise ImportError("Waf requires Python >= 2.3")
+
+if 'PSYCOWAF' in os.environ:
+ try:import psyco;psyco.full()
+ except:pass
+
+VERSION="1.5.9"
+REVISION="x"
+INSTALL="x"
+C1='x'
+C2='x'
+cwd = os.getcwd()
+join = os.path.join
+
+WAF='waf'
+def b(x):
+ return x
+
+if sys.hexversion>0x300000f:
+ WAF='waf3'
+ def b(x):
+ return x.encode()
+
+def err(m):
+ print(('\033[91mError: %s\033[0m' % m))
+ sys.exit(1)
+
+def unpack_wafdir(dir):
+ f = open(sys.argv[0],'rb')
+ c = "corrupted waf (%d)"
+ while 1:
+ line = f.readline()
+ if not line: err("run waf-light from a folder containing wafadmin")
+ if line == b('#==>\n'):
+ txt = f.readline()
+ if not txt: err(c % 1)
+ if f.readline()!=b('#<==\n'): err(c % 2)
+ break
+ if not txt: err(c % 3)
+ txt = txt[1:-1].replace(b(C1), b('\n')).replace(b(C2), b('\r'))
+
+ import shutil, tarfile
+ try: shutil.rmtree(dir)
+ except OSError: pass
+ try: os.makedirs(join(dir, 'wafadmin', 'Tools'))
+ except OSError: err("Cannot unpack waf lib into %s\nMove waf into a writeable directory" % dir)
+
+ os.chdir(dir)
+ tmp = 't.tbz2'
+ t = open(tmp,'wb')
+ t.write(txt)
+ t.close()
+
+ try:
+ t = tarfile.open(tmp)
+ for x in t: t.extract(x)
+ t.close()
+ except:
+ os.chdir(cwd)
+ try: shutil.rmtree(dir)
+ except OSError: pass
+ err("Waf cannot be unpacked, check that bzip2 support is present")
+
+ os.chmod(join('wafadmin','Tools'), 493)
+
+ os.unlink(tmp)
+
+ if sys.hexversion>0x300000f:
+ sys.path = [join(dir, 'wafadmin')] + sys.path
+ import py3kfixes
+ py3kfixes.fixdir(dir)
+
+ os.chdir(cwd)
+
+def test(dir):
+ try: os.stat(join(dir, 'wafadmin')); return os.path.abspath(dir)
+ except OSError: pass
+
+def find_lib():
+ name = sys.argv[0]
+ base = os.path.dirname(os.path.abspath(name))
+
+ #devs use $WAFDIR
+ w=test(os.environ.get('WAFDIR', ''))
+ if w: return w
+
+ #waf-light
+ if name.endswith('waf-light'):
+ w = test(base)
+ if w: return w
+ err("waf-light requires wafadmin -> export WAFDIR=/folder")
+
+ dir = "/lib/%s-%s-%s/" % (WAF, VERSION, REVISION)
+ for i in [INSTALL,'/usr','/usr/local','/opt']:
+ w = test(i+dir)
+ if w: return w
+
+ #waf-local
+ s = '.%s-%s-%s'
+ if sys.platform == 'win32': s = s[1:]
+ dir = join(base, s % (WAF, VERSION, REVISION))
+ w = test(dir)
+ if w: return w
+
+ #unpack
+ unpack_wafdir(dir)
+ return dir
+
+wafdir = find_lib()
+w = join(wafdir, 'wafadmin')
+t = join(w, 'Tools')
+sys.path = [w, t] + sys.path
+
+import Scripting
+Scripting.prepare(t, cwd, VERSION, wafdir)
+sys.exit(0)
+
Oops, something went wrong.

0 comments on commit 84d2966

Please sign in to comment.