from distutils.core import setup, Extension from distutils import sysconfig from os import getenv, walk, path import subprocess # Remove the "-Wstrict-prototypes" compiler option, which isn't valid for C++. cfg_vars = sysconfig.get_config_vars() opt = cfg_vars["OPT"] cfg_vars["OPT"] = " ".join( flag for flag in opt.split() if flag != '-Wstrict-prototypes' ) sources = list() depends = list() for dirname, dirnames, filenames in walk('/home/benland100/snoing/install/xrootd-4.3.0-source/bindings/python/src'): for filename in filenames: if filename.endswith('.cc'): sources.append(path.join(dirname, filename)) elif filename.endswith('.hh'): depends.append(path.join(dirname, filename)) xrdcllibdir = "/home/benland100/snoing/install/xrootd-4.3.0/src/XrdCl" xrdlibdir = "/home/benland100/snoing/install/xrootd-4.3.0/src" xrdsrcincdir = "/home/benland100/snoing/install/xrootd-4.3.0-source/src" xrdbinincdir = "/home/benland100/snoing/install/xrootd-4.3.0/src" version = "v4.3.0" print 'XRootD library dir: ', xrdlibdir print 'XRootD src include dir:', xrdsrcincdir print 'XRootD bin include dir:', xrdbinincdir print 'Version: ', version setup( name = 'pyxrootd', version = version, author = 'XRootD Developers', author_email = 'xrootd-dev@slac.stanford.edu', url = 'http://xrootd.org', license = 'LGPLv3+', description = "XRootD Python bindings", long_description = "XRootD Python bindings", packages = ['pyxrootd', 'XRootD', 'XRootD.client'], package_dir = {'pyxrootd' : '/home/benland100/snoing/install/xrootd-4.3.0-source/bindings/python/src', 'XRootD' : '/home/benland100/snoing/install/xrootd-4.3.0-source/bindings/python/libs', 'XRootD.client': '/home/benland100/snoing/install/xrootd-4.3.0-source/bindings/python/libs/client'}, ext_modules = [ Extension( 'pyxrootd.client', sources = sources, depends = depends, libraries = ['XrdCl', 'XrdUtils', 'dl'], extra_compile_args = ['-g'], include_dirs = [xrdsrcincdir, xrdbinincdir], library_dirs = [xrdlibdir, xrdcllibdir] ) ] )