aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pygrub/setup.py
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-10-19 16:07:11 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-10-19 16:07:11 +0100
commit4308423bdd9722a590c7de096ef3a11124de1e1d (patch)
tree15c2365cb5c790de65c2754aeb47853a5ff25a27 /tools/pygrub/setup.py
parent7c2cea666f3ce71b22906ad19b301b63e5138c3d (diff)
downloadxen-4308423bdd9722a590c7de096ef3a11124de1e1d.tar.gz
xen-4308423bdd9722a590c7de096ef3a11124de1e1d.tar.bz2
xen-4308423bdd9722a590c7de096ef3a11124de1e1d.zip
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@mulix.org>
Diffstat (limited to 'tools/pygrub/setup.py')
-rw-r--r--tools/pygrub/setup.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/pygrub/setup.py b/tools/pygrub/setup.py
index 680535d6cb..43e46762a8 100644
--- a/tools/pygrub/setup.py
+++ b/tools/pygrub/setup.py
@@ -12,11 +12,14 @@ if os.path.exists("/usr/include/ext2fs/ext2_fs.h"):
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,