calling extension's autoconf/make from distutils

Discussion in 'Python' started by Gary Jefferson, Sep 21, 2007.

  1. I've got a python extension that comes with its own standard autoconf/
    automake system, and I can "python setup.py build" just fine with it
    as long as I have previously done "./configure" in that directory.

    However, 'python setup.py bdist_rpm' can't hope to have done './
    configure' first, as it untars and tries to build the extension there.

    Is there a hook for bdist_rpm (and friends) that will allow me to
    insert a './configure' in the build process, sometime before it tries
    to build the extension?

    Thanks,
    Gary
    Gary Jefferson, Sep 21, 2007
    #1
    1. Advertising

  2. On Sep 20, 10:43 pm, Gary Jefferson <>
    wrote:
    > I've got a python extension that comes with its own standard autoconf/
    > automake system, and I can "python setup.py build" just fine with it
    > as long as I have previously done "./configure" in that directory.
    >
    > However, 'python setup.py bdist_rpm' can't hope to have done './
    > configure' first, as it untars and tries to build the extension there.
    >
    > Is there a hook for bdist_rpm (and friends) that will allow me to
    > insert a './configure' in the build process, sometime before it tries
    > to build the extension?
    >
    > Thanks,
    > Gary



    I ended up simply subclassing 'Extension' and having it os.system('./
    configure') before proceeding.

    This isn't perfect, as it does the './configure' everytime, but it
    works.

    Gary
    Gary Jefferson, Sep 21, 2007
    #2
    1. Advertising

  3. Gary Jefferson

    Steve Holden Guest

    Gary Jefferson wrote:
    > On Sep 20, 10:43 pm, Gary Jefferson <>
    > wrote:
    >> I've got a python extension that comes with its own standard autoconf/
    >> automake system, and I can "python setup.py build" just fine with it
    >> as long as I have previously done "./configure" in that directory.
    >>
    >> However, 'python setup.py bdist_rpm' can't hope to have done './
    >> configure' first, as it untars and tries to build the extension there.
    >>
    >> Is there a hook for bdist_rpm (and friends) that will allow me to
    >> insert a './configure' in the build process, sometime before it tries
    >> to build the extension?
    >>
    >> Thanks,
    >> Gary

    >
    >
    > I ended up simply subclassing 'Extension' and having it os.system('./
    > configure') before proceeding.
    >
    > This isn't perfect, as it does the './configure' everytime, but it
    > works.
    >

    If it really is a one-off thing, you only need to ruin configure if
    config-status doesn't exist. That isn't a difficult check ...

    regards
    Steve
    --
    Steve Holden +1 571 484 6266 +1 800 494 3119
    Holden Web LLC/Ltd http://www.holdenweb.com
    Skype: holdenweb http://del.icio.us/steve.holden

    Sorry, the dog ate my .sigline
    Steve Holden, Sep 21, 2007
    #3
  4. Gary Jefferson

    Steve Holden Guest

    Gary Jefferson wrote:
    > On Sep 20, 10:43 pm, Gary Jefferson <>
    > wrote:
    >> I've got a python extension that comes with its own standard autoconf/
    >> automake system, and I can "python setup.py build" just fine with it
    >> as long as I have previously done "./configure" in that directory.
    >>
    >> However, 'python setup.py bdist_rpm' can't hope to have done './
    >> configure' first, as it untars and tries to build the extension there.
    >>
    >> Is there a hook for bdist_rpm (and friends) that will allow me to
    >> insert a './configure' in the build process, sometime before it tries
    >> to build the extension?
    >>
    >> Thanks,
    >> Gary

    >
    >
    > I ended up simply subclassing 'Extension' and having it os.system('./
    > configure') before proceeding.
    >
    > This isn't perfect, as it does the './configure' everytime, but it
    > works.
    >

    [Sorry: it's config.status you shoudl check for, not config-status].

    regards
    Steve
    --
    Steve Holden +1 571 484 6266 +1 800 494 3119
    Holden Web LLC/Ltd http://www.holdenweb.com
    Skype: holdenweb http://del.icio.us/steve.holden

    Sorry, the dog ate my .sigline
    Steve Holden, Sep 21, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?Michael_Str=F6der?=

    autoconf-style checking for installed libs with DistUtils

    =?ISO-8859-1?Q?Michael_Str=F6der?=, Jul 26, 2003, in forum: Python
    Replies:
    2
    Views:
    314
    Hartmut Goebel
    Jul 28, 2003
  2. Mark Asbach

    autoconf macros and distutils

    Mark Asbach, Mar 1, 2004, in forum: Python
    Replies:
    0
    Views:
    423
    Mark Asbach
    Mar 1, 2004
  3. timw.google
    Replies:
    1
    Views:
    527
    Serge Orlov
    May 11, 2006
  4. Daniel Nogradi
    Replies:
    1
    Views:
    447
    Lawrence D'Oliveiro
    Oct 4, 2007
  5. Luis Alberto Zarrabeitia Gomez

    distutils, No module named numpy.distutils.fcompiler.conv_template

    Luis Alberto Zarrabeitia Gomez, Mar 30, 2009, in forum: Python
    Replies:
    0
    Views:
    1,298
    Luis Alberto Zarrabeitia Gomez
    Mar 30, 2009
Loading...

Share This Page