Files
xen/tools/pygrub/setup.py
T
kaf24@firebug.cl.cam.ac.uk 635fd50b51 Re-enable the pygrub build and fix the build with older
e2fsprogs (tested on RHEL4 with e2fsprogs-1.35 and rawhide
with e2fsprogs-1.38)

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2005-10-07 23:21:23 +01:00

50 lines
1.7 KiB
Python

from distutils.core import setup, Extension
from distutils.ccompiler import new_compiler
import os
import sys
extra_compile_args = [ "-fno-strict-aliasing", "-Wall", "-Werror" ]
fsys_mods = []
fsys_pkgs = []
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")
ext2 = Extension("grub.fsys.ext2._pyext2",
extra_compile_args = extra_compile_args,
libraries = ["ext2fs"],
define_macros = ext2defines,
sources = ["src/fsys/ext2/ext2module.c"])
fsys_mods.append(ext2)
fsys_pkgs.append("grub.fsys.ext2")
if os.path.exists("/usr/include/reiserfs/reiserfs.h"):
reiser = Extension("grub.fsys.reiser._pyreiser",
extra_compile_args = extra_compile_args,
libraries = ["reiserfs"],
sources = ["src/fsys/reiser/reisermodule.c"])
fsys_mods.append(reiser)
fsys_pkgs.append("grub.fsys.reiser")
setup(name='pygrub',
version='0.3',
description='Boot loader that looks a lot like grub for Xen',
author='Jeremy Katz',
author_email='katzj@redhat.com',
license='GPL',
package_dir={'grub': 'src'},
scripts = ["src/pygrub"],
packages=['grub',
'grub.fsys'].extend(fsys_pkgs),
ext_modules = fsys_mods
)