Anonymous avatar Anonymous committed 9a66740

sync w/ atlasoff

Comments (0)

Files changed (3)

Binary file modified.

wafflelib/basepolicy.py

          '-D_GNU_SOURCE',
          '-DGAUDI_V20_COMPAT',
          '-DATLAS_GAUDI_V21',
+         # FIXME: only meaningful for slc6-gcc4x...
+         '-D__USE_XOPEN2K8'
          ]
         )
     if waffle_utils._is_opt(ctx):
         if waffle_utils._is_64b(ctx):
             ctx.env.append_unique(
                 'LIBPATH',
-                ['/usr/lib64',
+                [
+                    # no need: implicitly taken from ldconfig...
+                    #'/usr/lib64',
                  ]
                 )
         else:
     
     # rename the uselib variables from PYEMBED to python
     waffle_utils.copy_uselib_defs(ctx, 'python', 'PYEMBED')
-    ctx.env['LIBPATH_python'] = pylibdir[:]
 
+    # FIXME: hack for python-lcg.
+    # python-config --ldflags returns the wrong directory .../config...
+    if pylibdir and \
+           os.path.exists(os.path.join(pylibdir[0],
+                                       'libpython%s.so'%ctx.env['PYTHON_VERSION'])):
+        ctx.env['LIBPATH_python'] = pylibdir[:]
+    else:
+        # PYEMBED value should be ok.
+        pass
+    
     # disable fat/universal archives on darwin
     if waffle_utils._is_darwin(ctx):
         for n in ('CFLAGS', 'CXXFLAGS', 'LINKFLAGS'):

wafflelib/external_packages.py

     conf.load_packages()
 """
 import os
+import shlex
 
 from waflib import Logs
 from waflib import Utils
     install_cmd = None, # ex: 'make install DESTDIR=${BUILD_INSTALL_AREA}
     # --- build environment ---
     env = None,
+    shell = False,
     ):
     # set defaults
     if prefix is None:
         shutil.rmtree(path=unpack_dir.abspath(),
                       ignore_errors=True)
         unpack_stamp.write('')
+
+    def _get_cmd(cmd):
+        if isinstance(cmd, basestring):
+            cmd = shlex.split(cmd)
+        return [Utils.subst_vars(c, self.env) for c in cmd]
     
     ## real build...
     if patch_cmd:
-        cmd = Utils.subst_vars(patch_cmd, self.env)
+        cmd = _get_cmd(patch_cmd)
         if not os.path.exists(patch_stamp.abspath()):
             cwd=build_dir.abspath()
             Logs.info('[%s] patching...' % name)
 
     if not os.path.exists(configure_stamp.abspath()):
         Logs.info('[%s] configuring...' % name)
-        cmd = Utils.subst_vars(configure_cmd, self.env)
+        cmd = _get_cmd(configure_cmd)
         cwd=build_dir.abspath()
         fout = open(configure_log.abspath(), 'w')
         fout.write('++ cd %s\n' % cwd)
         fout.write('++ %s\n' % cmd)
         fout.flush()
+        if isinstance(cmd, basestring):
+            cmd = Utils.to_list(cmd)
+            pass
         Utils.subprocess.check_call(
-            Utils.to_list(cmd),
+            cmd,
             env=env,
             stdout=fout,
             stderr=fout,
 
     if not os.path.exists(make_stamp.abspath()):
         Logs.info('[%s] building...' % name)
-        cmd = Utils.subst_vars(build_cmd, self.env)
+        cmd = _get_cmd(build_cmd)
         cwd=build_dir.abspath()
         fout = open(make_log.abspath(), 'w')
         fout.write('++ cd %s\n' % cwd)
             env=env,
             stdout=fout,
             stderr=fout,
-            cwd=cwd
+            cwd=cwd,
+            shell=shell
             )
         make_stamp.write('')
 
     if not os.path.exists(make_install_stamp.abspath()):
         Logs.info('[%s] installing...' % name)
-        cmd = Utils.subst_vars(install_cmd, self.env)
+        cmd = _get_cmd(install_cmd)
         cwd=build_dir.abspath()
         fout = open(make_install_log.abspath(), 'w')
         fout.write('++ cd %s\n' % cwd)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.