[llvm-commits] [hlvm] r38133 - in /hlvm/trunk/build: configure.py hlvm.py

Reid Spencer reid at x10sys.com
Sat Jul 7 17:00:09 PDT 2007


Author: reid
Date: Sat Jul  7 19:00:09 2007
New Revision: 38133

URL: http://llvm.org/viewvc/llvm-project?rev=38133&view=rev
Log:
Finally figured out the scons fu for getting all the object files in the
build directory. Also tweaked the FindPackage to optimize cases where it
doesn't find the libraries. Finally, fixed the search for LLVM to not 
look for object files named LLVMCore.o and LLVMbzip2.o because LLVM doesn't
build them any more (as of yesterday).

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=38133&r1=38132&r2=38133&view=diff

==============================================================================
--- hlvm/trunk/build/configure.py (original)
+++ hlvm/trunk/build/configure.py Sat Jul  7 19:00:09 2007
@@ -83,6 +83,7 @@
     incdir = None
     bindir = None
     objects = []
+    foundlib = 0
     # Check various library directory names
     for ldir in ['lib','libs','LIBS','Lib','Libs','Library','Libraries']:
       libdir = pjoin(p,ldir)
@@ -104,24 +105,30 @@
       if count != len(libs):
         continue
 
-      # Check each of the required object files
-      count = 0
-      for o in objs:
-        obj =  pjoin(libdir,context.env['OBJPREFIX'])
-        obj += o + context.env['OBJSUFFIX']
-        if not isfile(obj):
-          continue
-        else:
-          count += 1
-          objects.append(obj)
+      # If we were given some object files to check
+      if len(objs) > 0:
+        count = 0
+        # Check each of the required object files
+        for o in objs:
+          obj =  pjoin(libdir,context.env['OBJPREFIX'])
+          obj += o + context.env['OBJSUFFIX']
+          if not isfile(obj):
+            break
+          else:
+            count += 1
+            objects.append(obj)
 
-      # If we didn't find them all, try the next library path
-      if count != len(objs):
-        continue
+        # If we didn't find them all, try the next library path
+        if count != len(objs):
+          continue
 
       # Otherwise we found the right library path
+      foundlib = 1
       break
     
+    if not foundlib:
+      continue
+
     # At this point we have a valid libdir. Now check the various include 
     # diretory names
     count = 0
@@ -140,6 +147,7 @@
         count += 1
         break
 
+    # Check that we found the header file
     if count != 1:
       continue
 
@@ -189,10 +197,9 @@
 
 def FindLLVM(conf,env):
   code = 'new llvm::Module("Name");'
-  conf.FindPackage('LLVM','llvm/Module.h',['LLVMSupport','LLVMSystem'],
-     code,[env['with_llvm'],'/proj/install/llvm'],['LLVMCore','LLVMbzip2'],
-     '', ['llvm2cpp','llvm-as','llc'] )
-
+  conf.FindPackage('LLVM','llvm/Module.h',['LLVMCore','LLVMSystem'],
+     code,[env['with_llvm'],'/proj/install/llvm'],[],'',
+     ['llvm2cpp','llvm-as','llc'] )
 
 def FindAPR(conf,env):
   code = 'apr_initialize();'

Modified: hlvm/trunk/build/hlvm.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/build/hlvm.py?rev=38133&r1=38132&r2=38133&view=diff

==============================================================================
--- hlvm/trunk/build/hlvm.py (original)
+++ hlvm/trunk/build/hlvm.py Sat Jul  7 19:00:09 2007
@@ -11,10 +11,14 @@
 from string import replace as strrepl
 import glob
 
-def GetFiles(env,pat,dir=''):
-  spec = pjoin(env.Dir('.').abspath,dir,pat)
-  spec = strrepl(spec,pjoin(env['BuildDir'],''),'',1)
-  return glob.glob(spec)
+def GetFiles(env,pat):
+  prefix = env.Dir('.').abspath
+  modprefix = strrepl(prefix,pjoin(env['BuildDir'],''),'',1)
+  files = glob.glob(pjoin(modprefix,pat))
+  result = []
+  for f in files:
+    result += [strrepl(f,modprefix,prefix,1)]
+  return result
 
 def GetAllCXXFiles(env):
   return GetFiles(env,'*.cpp')
@@ -168,7 +172,6 @@
   env['AbsSrcRoot'] = env.Dir('#').abspath
   env.Prepend(CPPPATH=[pjoin('#',BuildDir)])
   env.Prepend(CPPPATH=['#'])
-  env['OBJPREFIX'] = pjoin(BuildDir,'')
   env['LIBPATH'] = []
   env['BINPATH'] = []
   env.BuildDir(BuildDir,'#',duplicate=0)





More information about the llvm-commits mailing list