Hi,

I'm trying to package a python module that has a C extension that has a
special preprocessor that turns protocol definition files into C.

Currently, I have a makefile that calls the rxgen program[*]:

        ./rxgen/rxgen.pl rpc-api/*

which produces four C files (afs_xg.[ch] and afs_py.[ch]) that then get
compiled and linked together with some other sources into an extension module:

        from distutils.core import setup, Extension

        setup(name = "kafs",
              version = "0.1",
              description = "AFS filesystem management scripting and commands",
              author = "David Howells",
              author_email = "dhowe...@redhat.com",
              license = "GPLv2",
              ext_modules = [Extension("kafs",
                                       sources = [ "afs_xg.c",
                                                   "kafs.c",
                                                   "afs_py.c",
                                                   "py_passwd.c",
                                                   "py_rxgen.c",
                                                   "py_rxconn.c",
                                                   "py_rxsplit.c",
                                                   "af_rxrpc.c"
                                               ],
                                     extra_compile_args = [
                                         "-O0",
                                         "-Wp,-U_FORTIFY_SOURCE",
                                     ],
                                     libraries = [
                                         "k5crypto",
                                         "krb5"
                                     ]
                                 )])

Is there any way of making the Extension module do the rxgen step?  It would
be possible to convert the rxgen perl scripts into python and call it
directly - it's just that I find it easier to write a file parser in perl, at
least initially.

David

[*] yes, I know, it's written in perl
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

Reply via email to