# This is so far just tested on Windows... # Seems to work fine with ActiveState Python2.3 and Linux # Note you need to link p4api to whereever you put Perforce API # See notes in P4API documentation for building with API on different # platforms: # http://www.perforce.com/perforce/doc.042/manuals/p4api/02_clientprog.html from distutils.core import setup, Extension import os NAME = "P4Python" VERSION = "0.5" PY_MODULES = ["p4"] DESCRIPTION="Python interface to Perforce" AUTHOR="Robert Cowham" AUTHOR_EMAIL="robert@vaccaperna.co.uk" URL="http://public.perforce.com/guest/robert_cowham/perforce/API/python/index.html" def do_setup(): if os.name == "nt": setup(name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, py_modules=PY_MODULES, ext_modules=[Extension("P4Client", ["P4Clientmodule.cc"], include_dirs=["p4api"], library_dirs=["p4api"], libraries=["oldnames", "wsock32", "advapi32", # MSVC libs "libclient", "librpc", "libsupp"], # P4API libs extra_compile_args=["/DOS_NT", "/DMT", "/DCASE_INSENSITIVE"], extra_link_args=["/NODEFAULTLIB:libcmt"], )]) else: # Assume Linux setup(name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, py_modules=PY_MODULES, ext_modules=[Extension("P4Client", ["P4Clientmodule.cc"], include_dirs=["p4api"], library_dirs=["p4api"], libraries=["client", "rpc", "supp"], # P4API libs extra_compile_args=["-DOS_LINUX"], )]) if __name__ == "__main__": do_setup()