[Python-Dev] Need some configure eyeballs and testing

Skip Montanaro skip@pobox.com
Tue, 19 Nov 2002 13:02:10 -0600


Awhile ago I volunteered to fix the use of OPT within configure.  The
problem is that OPT is overloaded with two different kinds of things,
optimization/debug flags and other flags which are required to get code to
compile.  The problem is that if there are any flags which need to be set to
simply get Python to compile, if you override OPT when running configure or
make, you may wipe out compiler flags necessary to simply compile the
interpreter.

I finally got a round to finishing that off this morning.  I split OPT into
two variables, OPT and BASECFLAGS.  OPT can be modified, while BASECFLAGS
should be left alone.  You can pass BASECFLAGS to configure.  If it decides
you need some other flags they just get tacked on.  On the other hand, if
you pass OPT to configure, it generally will prevent the configure script
from doing anything else to it.  (There is one bit of code I didn't
understand too well which does set OPT unconditionally on BeOS.  I left that
alone, but I think it probably needs to be changed.

As they say, "it works for me", however all I've tested it on is MacOSX, and
only a Unix build (I still don't know how to do the fancy schmansy Mac
builds).  The following issues remain:

    * For some reason the flags which wind up in BASECFLAGS are getting
      duplicated on the gcc command line.  I'm not sure where this is
      happening, but Makefile.pre and Makefile both wind up with these
      definitions: 

        OPT=             -Wno-long-double -no-cpp-precomp -g -Wall -Wstrict-prototypes
        BASECFLAGS=      -Wno-long-double -no-cpp-precomp

      I don't merge BASECFLAGS into OPT anywhere, and the echo statements in
      configure report:

        Base CFLAGS: < -Wno-long-double -no-cpp-precomp>
        OPT: <-g -Wall -Wstrict-prototypes>

    * There are three XXX comments in configure.in which could use some
      investigation.  Two are related to condensing two bits of code which
      seem to overlap a bit.  The third is related to Monterey.  This small
      block of code:

        # The current (beta) Monterey compiler dies with optimizations
        case $ac_sys_system in
            Monterey*)
                OPT=""
                ;;
        esac

      unconditionally wipes out OPT, but doesn't say what Monterey is or
      give any indication that this setting needs to be revisited.  Is
      "Monterey" still in beta test?  "cvs annotate" indicates that Trent
      Mick added this in August 2000, so I assume it's something to do with
      Win64 (the OS?  MSVC?), but it would be nice to know if this is still
      needed.

I can use some extra eyeballs if you have a few moments to spare.  To save
bandwidth on the group, I opened a patch at

    http://python.org/sf/640843

The uploaded file includes diffs for Makefile.pre.in, configure.in and
configure, so you don't need to have a recent version of autoconf to try it
out.

I uploaded the context diffs using Internet Explorer on my Mac.  I just
downloaded it to my Linux laptop using Opera and noticed a bit of corruption
(NULs at the start and the end).  The file is fine on my Mac.  Downloading
on the Mac with IE generates an okay file, but Mac+Opera also results in
corruption.  If you can't get a clean file, let me know and I'll be happy to
mail it to you.

I have no idea what caused this but would appreciate some feedback on
efforts to download it, even if you don't have time to test it more
extensively.

Skip