Commits

Anonymous committed 31d40f8

'fix compilation on macs + fix re-compilation (conditioned on a .done file)'

  • Participants
  • Parent commits 3dc50e7
  • Tags PyCmt-00-00-29

Comments (0)

Files changed (3)

 2012-04-05  Sebastien Binet  <binet@cern.ch>
 
+	* tagging PyCmt-00-00-29
+	* fix compilation on macs
+	* fix re-compilation (conditioned on a .done file)
+	* M python/pkgbuild/distutils_support.py
+	* M python/pkgbuild/__init__.py
+
 	* tagging PyCmt-00-00-28
 	* fix relocation of pkgbuilds
 	* fix cross-compilation of pkgbuilds

File python/pkgbuild/__init__.py

                     os.remove(dest)
                 except OSError:
                     pass
-                os.symlink(rel_src,
-                           osp.basename(dest))
+                try:
+                    os.symlink(rel_src,
+                               osp.basename(dest))
+                except OSError, err:
+                    info("could not symlink [%s]:\n%s", dest, err)
+                    pass
             if dest.endswith('.la'):
                 pass
         return
         msg.debug('build-dir: [%s]', self.pkg_build_dir)
         msg.debug('install: [%s]', self.pkg_install_dir)
         
-        self.pre_build()
-        self.build()
-        self.post_build()
+        _build_done = osp.join(osp.dirname(self.pkg_build_dir),
+                               'pkg-build-%(pkg_name)s.done' % self.env)
+
+        if not osp.exists(_build_done):
+
+            import time
+            start = time.asctime()
+            self.pre_build()
+            self.build()
+            self.post_build()
+            end   = time.asctime()
+
+            with open(_build_done, 'w') as f:
+                f.write('start: %s\n' % start)
+                f.write('done:  %s\n' % end)
+                f.flush()
+                pass
 
         msg.debug('building [%s-%s]... (%s) [done]',
                   self.pkg_name,

File python/pkgbuild/distutils_support.py

 
 import sys
 python_config_version = "%i.%i" % sys.version_info[:2]
-del sys
 
 pkg_name = "<not there>"
 pkg_ver  = "0.0"
     env['LDFLAGS'] += " ".join([self.cmt(macro_value="Python_linkopts"),
                                "-shared"])
 
+    if 'darwin' in sys.platform:
+        env['LDFLAGS'] = env['LDFLAGS'].replace('-shared', '')
+
     # FIXME
     # setup.py does not honour the cross-compilation
     # correctly, at least at link time...