classification
Title: environment variable MACHDEP and python build system
Type: behavior Stage: resolved
Components: Build Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, doko, loewis, python-dev, rpetrov
Priority: normal Keywords: patch

Created on 2008-08-28 22:18 by rpetrov, last changed 2013-01-26 18:02 by doko. This issue is now closed.

Files
File name Uploaded Description Edit
python-release25-MACHDEP.patch rpetrov, 2008-08-28 22:18
Messages (6)
msg72116 - (view) Author: Roumen Petrov (rpetrov) * Date: 2008-08-28 22:18
A) The reason to propose this patch following paragraph
from README:
--------------------
        2) To set sys.platform to something sensible, pass the
           following environment variable to the configure script:

             MACHDEP=unicosmk
--------------------
The sentence above is not true in all cases. It don't state how to pass
as example
1) MACHDEP=abcd
   export MACHDEP
   ./configure ....
2) MACHDEP=abcd ./configure ....
3) ./configure MACHDEP=abcd ....

The Makefile.pre.in contain dependency rule "Run the configure script": 
that create config.status if file "configure" is changed as run the script.
From above three samples for environment varaible passing only 3) will
save MACHDEP
into variable CONFIG_ARGS from generated Makefile.
The case 2) alwais lost it if config.status is created from makefile rule.
The case 1) will work only if developer don't remeber to set it every day.


B) The test case (note that MACHDEP isn't valid name!):
$ MACHDEP=linuxTEST ./configure --disable-ipv6
checking MACHDEP... linuxTEST
....
checking for build directories... done
configure: creating ./config.status
....
creating Makefile

Now lets see if "configure" script is changed:
$ touch configure; make
/bin/sh ./configure '--disable-ipv6'
checking MACHDEP... linux2                 <-- MACHDEP is lost
....
checking for build directories... done
configure: creating ./config.status
config.status: creating Makefile.pre
config.status: creating Modules/Setup.config
config.status: creating pyconfig.h
config.status: pyconfig.h is unchanged
creating Modules/Setup
creating Modules/Setup.local
creating Makefile
CONFIG_FILES=Makefile.pre CONFIG_HEADERS= /bin/sh config.status
config.status: creating Makefile.pre
make -f Makefile.pre Makefile
make[1]: Entering directory `..../python-release25-maint'
make[1]: `Makefile' is up to date.         <--- extra
make[1]: Leaving directory `..../python-release25-maint'
/bin/sh ./Modules/makesetup -c ./Modules/config.c.in \
....
The Makefile was updated, you may need to re-run make.
gcc -pthread -c ....
....

Note an extra attempt to create Makefile.


C) Next lets see after patch:
(the python configuration is the same as above):
$ touch configure; make
/bin/sh ./config.status --recheck
running CONFIG_SHELL=/bin/sh /bin/sh ./configure  --disable-ipv6
MACHDEP=linuxTEST  --no-create --no-recursion
checking MACHDEP... linuxTEST              <-- MACHDEP is same as at
configure time
....
checking for build directories... done
configure: creating ./config.status
creating Modules/Setup
creating Modules/Setup.local
creating Makefile
/bin/sh ./config.status Makefile.pre
config.status: creating Makefile.pre
/bin/sh ./Modules/makesetup -c ./Modules/config.c.in \
				-s Modules \
				Modules/Setup.config \
				Modules/Setup.local \
				Modules/Setup
The Makefile was updated, you may need to re-run make.
gcc -pthread -c - ....
(ignore failure here since MACHDEP=linuxTEST is used only to show problem)


D) Rerefence (from autoconf textinfo sections):
4.8.5 Automatic Remaking
7.2 Setting Output Variables (see macro AC_ARG_VAR)
16 config.status Invocation
msg112306 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-08-01 10:17
Can someone from the build team please review the patch, thanks.
msg180583 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-01-25 14:00
the change to the configure script looks ok. however you could change the README too.

It looks like the changes to the Makefile.pre.in are already applied.
msg180684 - (view) Author: Roumen Petrov (rpetrov) * Date: 2013-01-26 17:05
Matthias Klose wrote:
>
> Matthias Klose added the comment:
>
> the change to the configure script looks ok. however you could change the README too.

This is 5 years old issue.

README is not more in repository.  As result python lack documentation 
related to build process.

> It looks like the changes to the Makefile.pre.in are already applied.

No . But you could ignore this part of issue.

Roumen
msg180692 - (view) Author: Roundup Robot (python-dev) Date: 2013-01-26 18:00
New changeset 8c49dd8e4d22 by doko in branch '3.3':
- Issue #3718: Use AC_ARG_VAR to set MACHDEP in configure.ac.
http://hg.python.org/cpython/rev/8c49dd8e4d22

New changeset 6866384d9ccb by doko in branch 'default':
- Issue #3718: Use AC_ARG_VAR to set MACHDEP in configure.ac.
http://hg.python.org/cpython/rev/6866384d9ccb
msg180693 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-01-26 18:02
now checked in the configure change. I think that the cross-build documentation deserves an extra issue. Therefore now closing this issue.
History
Date User Action Args
2013-01-26 18:02:45dokosetstatus: open -> closed
resolution: fixed
messages: + msg180693

stage: patch review -> resolved
2013-01-26 18:00:34python-devsetnosy: + python-dev
messages: + msg180692
2013-01-26 17:23:14gregory.p.smithsetnosy: - gregory.p.smith
2013-01-26 17:05:16rpetrovsetmessages: + msg180684
2013-01-25 14:00:16dokosetnosy: + doko
messages: + msg180583
2011-03-15 16:22:55gregory.p.smithsetassignee: gregory.p.smith ->

nosy: + loewis
2010-08-01 10:17:55BreamoreBoysetversions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.5
nosy: + BreamoreBoy

messages: + msg112306

type: behavior
stage: patch review
2009-07-31 21:05:04gregory.p.smithsetpriority: normal
assignee: gregory.p.smith

nosy: + gregory.p.smith
2008-08-28 22:18:51rpetrovcreate