[llvm-commits] [hlvm] r38219 - in /hlvm/trunk: build/configure.py build/hlvm.py docs/SConscript
Reid Spencer
reid at x10sys.com
Sat Jul 7 17:01:16 PDT 2007
Author: reid
Date: Sat Jul 7 19:01:16 2007
New Revision: 38219
URL: http://llvm.org/viewvc/llvm-project?rev=38219&view=rev
Log:
Fix the install target to be repeatable.
Modified:
hlvm/trunk/build/configure.py
hlvm/trunk/build/hlvm.py
hlvm/trunk/docs/SConscript
Modified: hlvm/trunk/build/configure.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/build/configure.py?rev=38219&r1=38218&r2=38219&view=diff
==============================================================================
--- hlvm/trunk/build/configure.py (original)
+++ hlvm/trunk/build/configure.py Sat Jul 7 19:01:16 2007
@@ -267,7 +267,7 @@
if p != '' and exists(p) and exists(pjoin(p,'bin')):
rlist = [p] + rlist
for p in rlist:
- env['ENV']['PATH'] = pjoin(p,'bin') + ':' + env['ENV']['PATH']
+ env.PrependENVPath('PATH', pjoin(p,'bin'))
env['LIBS'] = ''
Modified: hlvm/trunk/build/hlvm.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/build/hlvm.py?rev=38219&r1=38218&r2=38219&view=diff
==============================================================================
--- hlvm/trunk/build/hlvm.py (original)
+++ hlvm/trunk/build/hlvm.py Sat Jul 7 19:01:16 2007
@@ -5,6 +5,7 @@
from SCons.Script.SConscript import SConsEnvironment as SConsEnvironment
from SCons.Script import COMMAND_LINE_TARGETS as COMMAND_LINE_TARGETS
from SCons.Environment import Environment as Environment
+from SCons.Defaults import Mkdir as Mkdir
from configure import ConfigureHLVM as ConfigureHLVM
from os.path import join as pjoin
from os.path import exists as exists
@@ -67,32 +68,40 @@
sconsfile = pjoin(dir,d,'SConscript')
env.SConscript(sconsfile)
-def InstallProgram(env,prog):
+def InstallProgram(env,progs):
if 'install' in COMMAND_LINE_TARGETS:
dir = pjoin(env['prefix'],'bin')
- env.Install(dir,prog)
+ if not exists(dir):
+ env.Execute(Mkdir(dir))
+ env.Install(dir=env.Dir(dir),source=progs)
if 'check' in COMMAND_LINE_TARGETS:
- env.Depends('check',prog[0].path)
+ env.Depends('check',progs)
return 1
-def InstallLibrary(env,lib):
+def InstallLibrary(env,libs):
env.AppendUnique(LIBPATH=[env.Dir('.')])
if 'install' in COMMAND_LINE_TARGETS:
libdir = pjoin(env['prefix'],'lib')
- env.Install(libdir,lib.path)
+ if not exists(libdir):
+ env.Execute(Mkdir(libdir))
+ env.Install(dir=env.Dir(libdir),source=libs)
return 1
def InstallHeader(env,hdrs):
if 'install' in COMMAND_LINE_TARGETS:
moddir = strrepl(env.Dir('.').path,pjoin(env['BuildDir'],''),'',1)
dir = pjoin(env['prefix'],'include',moddir)
- env.Install(dir,hdrs)
+ if not exists(dir):
+ env.Execute(Mkdir(dir))
+ env.Install(dir=env.Dir(dir),source=hdrs)
return 1
-def InstallDoc(env,docs):
+def InstallDocs(env,docs):
if 'install' in COMMAND_LINE_TARGETS:
dir = pjoin(env['prefix'],'docs')
- env.install(dir,docs)
+ if not exists(dir):
+ env.Execute(Mkdir(dir))
+ env.Install(dir=dir,source=docs)
def GetBuildEnvironment(targets,arguments):
env = Environment();
@@ -232,10 +241,13 @@
env.BuildDir(BuildDir,'#',duplicate=0)
env.SConsignFile(pjoin(BuildDir,'sconsign'))
if 'install' in COMMAND_LINE_TARGETS:
- env.Alias('install',pjoin(env['prefix'],'bin'))
- env.Alias('install',pjoin(env['prefix'],'lib'))
- env.Alias('install',pjoin(env['prefix'],'include'))
- env.Alias('install',pjoin(env['prefix'],'docs'))
+ env.Alias('install',[
+ env.Dir(pjoin(env['prefix'],'bin')),
+ env.Dir(pjoin(env['prefix'],'lib')),
+ env.Dir(pjoin(env['prefix'],'include')),
+ env.Dir(pjoin(env['prefix'],'docs'))
+ ])
+
env.Help("""
HLVM Build Environment
Modified: hlvm/trunk/docs/SConscript
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/docs/SConscript?rev=38219&r1=38218&r2=38219&view=diff
==============================================================================
--- hlvm/trunk/docs/SConscript (original)
+++ hlvm/trunk/docs/SConscript Sat Jul 7 19:01:16 2007
@@ -41,4 +41,4 @@
env.Alias('doxy-install',installtgt)
if 'install' in COMMAND_LINE_TARGETS:
- hlvm.InstallDocs(env,hlvm.GetFiles('*.html')+['hlvm.css'])
+ hlvm.InstallDocs(env,hlvm.GetFiles(env,'*.html')+['hlvm.css'])
More information about the llvm-commits
mailing list