[llvm-commits] [hlvm] r38095 - in /hlvm/trunk/build: configure.py hlvm.py
Reid Spencer
reid at x10sys.com
Sat Jul 7 16:59:47 PDT 2007
Author: reid
Date: Sat Jul 7 18:59:47 2007
New Revision: 38095
URL: http://llvm.org/viewvc/llvm-project?rev=38095&view=rev
Log:
Provide command line options for specifying the install prefix and various
"with" options to specify where to look for packages we depend on. Also,
rearrange configure.py a little bit.
Modified:
hlvm/trunk/build/configure.py
hlvm/trunk/build/hlvm.py
Modified: hlvm/trunk/build/configure.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/build/configure.py?rev=38095&r1=38094&r2=38095&view=diff
==============================================================================
--- hlvm/trunk/build/configure.py (original)
+++ hlvm/trunk/build/configure.py Sat Jul 7 18:59:47 2007
@@ -6,16 +6,14 @@
from os.path import exists as exists
from os import environ as environ
-def CheckProgram(context,progname,varname,moredirs=[]):
- context.Message("Checking for " + progname + "...")
- fname = context.env.WhereIs(progname,environ['PATH'])
- ret = fname != None
- if ret:
- context.env[varname] = fname
- context.Result(ret)
- return ret
-
+def _getline(env,msg):
+ response = raw_input(msg)
+ if response == 'quit' or response == "exit":
+ print "Configuration terminated by user"
+ env.Exit(1)
+ return response
+
def AskForDirs(context,pkgname,hdr,libs):
hdrdir = _getline(context.env,
'Enter directory containing %(name)s headers: ' % {'name':pkgname }
@@ -112,32 +110,34 @@
context.Result( 'Not Found' )
return AskForDirs(context,pkgname,hdr,libs)
-def _getline(env,msg):
- response = raw_input(msg)
- if response == 'quit' or response == "exit":
- print "Configuration terminated by user"
- env.Exit(1)
- return response
-
def FindLLVM(conf,env):
code = 'new llvm::Module("Name");'
return conf.FindPackage('LLVM','llvm/Module.h',['LLVMSupport','LLVMSystem'],
- code,['/proj/install/llvm'],['LLVMCore','LLVMbzip2'])
+ code,[env['with_llvm'],'/proj/install/llvm'],['LLVMCore','LLVMbzip2'])
def FindAPR(conf,env):
code = 'apr_initialize();'
return conf.FindPackage('APR',pjoin('apr-1','apr_general.h'),['apr-1'],code,
- ['/usr/local/apr'])
+ [env['with_apr']])
def FindAPRU(conf,env):
code = 'apu_version_string();'
return conf.FindPackage('APRU',pjoin('apr-1','apu_version.h'),['aprutil-1'],
- code,['/usr/local/apr'])
+ code,[env['with_apru']])
def FindLibXML2(conf,env):
code = 'xmlNewParserCtxt();'
return conf.FindPackage('LIBXML2',pjoin('libxml','parser.h'),['xml2'],code,
- [],[],'libxml2')
+ [env['with_xml2']],[],'libxml2')
+
+def CheckProgram(context,progname,varname,moredirs=[]):
+ context.Message("Checking for " + progname + "...")
+ fname = context.env.WhereIs(progname,environ['PATH'])
+ ret = fname != None
+ if ret:
+ context.env[varname] = fname
+ context.Result(ret)
+ return ret
def CheckForHeaders(conf,env):
if not conf.CheckCXXHeader('algorithm'):
Modified: hlvm/trunk/build/hlvm.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/build/hlvm.py?rev=38095&r1=38094&r2=38095&view=diff
==============================================================================
--- hlvm/trunk/build/hlvm.py (original)
+++ hlvm/trunk/build/hlvm.py Sat Jul 7 18:59:47 2007
@@ -70,12 +70,12 @@
BoolOption('optimize','Build object files with optimization',0),
BoolOption('profile','Generate profiling aware code',0),
BoolOption('small','Generate smaller code rather than faster',0),
- PackageOption('llvm','Specify where LLVM is located','search'),
- PackageOption('apr','Specify where apr is located','search'),
- PackageOption('apru','Specify where apr-utils is located','search'),
- PackageOption('xml2','Specify where LibXml2 is located','search'),
)
opts.Add('prefix','Specify where to install HLVM','/usr/local')
+ opts.Add('with_llvm','Specify where LLVM is located','/usr/local'),
+ opts.Add('with_apr','Specify where apr is located','/usr/local/apr'),
+ opts.Add('with_apru','Specify where apr-utils is located','/usr/local/apr'),
+ opts.Add('with_xml2','Specify where LibXml2 is located','/usr/local'),
opts.Update(env)
opts.Save('.options_cache',env)
env['HLVM_Copyright'] = 'Copyright (c) 2006 Reid Spencer'
More information about the llvm-commits
mailing list