WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] pygrub's setup.py relies on distutils.UnixCCompiler.has_

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] pygrub's setup.py relies on distutils.UnixCCompiler.has_function(),
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 21 Oct 2005 18:54:15 +0000
Delivery-date: Fri, 21 Oct 2005 18:52:25 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID f7552b93adebb6628c9a2c49873c0d790c2b4fd9
# Parent  b3e6901f4cdbdfa9c649ac1eaae070011e4e3876
pygrub's setup.py relies on distutils.UnixCCompiler.has_function(),
which does not exist with python2.2, causing the following build
error:

make[2]: Entering directory `/home/muli/xen/x86.hg/tools/pygrub'
CFLAGS=" -m32 -march=i686" python setup.py build
Traceback (most recent call last):
  File "setup.py", line 15, in ?
    if cc.has_function("ext2fs_open2"):
AttributeError: UnixCCompiler instance has no attribute 'has_function'

The following patch gets it to build, but is pretty ugly. A proper fix
would be to do the check for ext2fs_open2() in a way that is backward
compatible with python2.2.

Signed-Off-By: Muli Ben-Yehuda <mulix@xxxxxxxxx>

diff -r b3e6901f4cdb -r f7552b93adeb tools/pygrub/setup.py
--- a/tools/pygrub/setup.py     Wed Oct 19 14:51:14 2005
+++ b/tools/pygrub/setup.py     Wed Oct 19 15:07:11 2005
@@ -12,11 +12,14 @@
     ext2defines = []
     cc = new_compiler()
     cc.add_library("ext2fs")
-    if cc.has_function("ext2fs_open2"):
-        ext2defines.append( ("HAVE_EXT2FS_OPEN2", None) )
-    else:
-        sys.stderr.write("WARNING: older version of e2fsprogs installed, not 
building full\n")
-        sys.stderr.write("         disk support for ext2.\n")
+    try:
+        if cc.has_function("ext2fs_open2"):
+            ext2defines.append( ("HAVE_EXT2FS_OPEN2", None) )
+        else:
+            sys.stderr.write("WARNING: older version of e2fsprogs installed, 
not building full\n")
+            sys.stderr.write("         disk support for ext2.\n")
+    except AttributeError:
+        pass
         
     ext2 = Extension("grub.fsys.ext2._pyext2",
                      extra_compile_args = extra_compile_args,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] pygrub's setup.py relies on distutils.UnixCCompiler.has_function(),, Xen patchbot -unstable <=