Commits

bi...@4525493e-7705-40b1-a816-d608a930855b  committed 9d8e82d

'fix relocation of pkgbuilds + fix cross-compilation of pkgbuilds'

  • Participants
  • Parent commits fcd09b1
  • Tags PyCmt-00-00-28

Comments (0)

Files changed (3)

+2012-04-05  Sebastien Binet  <binet@cern.ch>
+
+	* tagging PyCmt-00-00-28
+	* fix relocation of pkgbuilds
+	* fix cross-compilation of pkgbuilds
+	* M python/pkgbuild/__init__.py
+	* M python/pkgbuild/cmmi.py
+
 2012-02-21  Sebastien Binet  <binet@voatlas51.cern.ch>
 
 	* tagging PyCmt-00-00-27

File python/pkgbuild/__init__.py

     cfg_env['CFLAGS']  += " -fno-strict-aliasing"
     cfg_env['FCFLAGS'] += " -fno-strict-aliasing"
     cfg_env['CXXFLAGS']+= " -fno-strict-aliasing"
+
     
+    host_arch = 'x86_64' if 'x86_64' in os.environ['CMTCONFIG'] else 'i686'
+    host_plat = 'none'
+    if 'linux' in sys.platform:
+        host_plat = 'linux'
+    elif 'darwin' in sys.platform:
+        host_plat = 'darwin'
+    else:
+        pass
+    host = '%s-unknown-%s-%s' % (host_arch, host_plat, 'gnu')
+    cfg_env['pkg_host_triple'] = host
+
+    if 'darwin' in sys.platform:
+        for k in ('CFLAGS', 'CXXFLAGS'):
+            cfg_env[k] = cfg_env[k].replace(' -bundle ', ' ')
+            
     # FIXME: HACK !!
     cfg_env['LDFLAGS'] = cfg_env['LDFLAGS'].replace(
         "-Wl,--as-needed", "").replace(
             verbose(" delta:      [%s]", delta_dir)
             verbose("    dest:    [%s]", dest)
             with _dir_restore(osp.dirname(dest)):
+                try:
+                    os.remove(dest)
+                except OSError:
+                    pass
                 os.symlink(rel_src,
                            osp.basename(dest))
             if dest.endswith('.la'):

File python/pkgbuild/cmmi.py

     cmd = [
         "./configure",
         "--prefix=%(pkg_install_dir)s" % env,
+        "--host=%(pkg_host_triple)s" % env
         ]
     self.run(cmd)