config.c, Makefile, Configure.py, etc. ( was: problem ... on AIX )

Steven D. Majewski (sdm7g@elvis.med.virginia.edu)
Tue, 7 Sep 1993 15:00:12 -0400

On Sep 7, 18:40, Sjoerd Mullender wrote:
>
> Apparently USE_POSIX didn't get defined in config.c. You can have a
> look there to see under which circumstances USE_POSIX is defined. My
> guess is that "unix" is not defined. I suppose that the ifdefs in
> config.c should be improved, but for the time being you can try
> defining "unix" yourself, or change config.c to check for another
> value.
>

Thanks. That was the problem.
But the other problem is that defining unix (globally) makes timemodule.c
unable to compile. So (one more kludge!) I defined it in the makefile
here:

>config.o: config.c Makefile libpython.a
> $(COMPILE) $(CONFIGDEFS) $(CONFIGINCLS) -Dunix $*.c

and "import posix" works and:

>make test
> PYTHONPATH=../lib ./python -c 'import autotest'
>All tests OK.

Note: unix is not automatically defined for AIX, so I didn't
undef it for timemodule.c

Is there anyone else out there building/using python on AIX ?
( I know there are someother UVA folks on this list. )

Is anyone else running into problems with make or ./Configure.py
for 0.9.9 ?

Most of the problems I've run into are minor, but I'ld like to
help Guido sort them out before he gets to the 1.0 release.

The other glitch I ran into ( besides posix and the timemodule )
was that, when I did NOT select X11 support in ./Configure.py,
the Makefile did not comment out those lines properly, i.e. :

>#XT_OBJ= Xtmodule.o Xttypes.o GCobject.o Fontobject.o \
> widgetobject.o wclassobject.o
>
>#XT_SRC= Xtmodule.c Xttypes.c GCobject.c Fontobject.c \
> widgetobject.c wclassobject.c

which 'make' didn't much care for, instead of:

>#XT_OBJ= Xtmodule.o Xttypes.o GCobject.o Fontobject.o \
># widgetobject.o wclassobject.o
>
>#XT_SRC= Xtmodule.c Xttypes.c GCobject.c Fontobject.c \
># widgetobject.c wclassobject.c

FY( Guido's mostly )I:

A long time ago, Guido asked me (and the list, I think) what
symbols were automatically defined in AIX. I didn't answer at
the time, because I wasn't sure myself. It turns out that
most of the "automatic" definitions are defined by a configure
file ( /etc/xlc.cfg ), and are different according to which
compiler 'alias' is used ( xlc, cc, c89, bsdcc ). This file
is user configurable ( UVA has added 'bsdcc' to the standard
file - it is in the xlc manual, but not in the standard cfg file.)
"_AIX" appears to be the "standard" predefined symbol.
My 'gcc' also appears to define "_AIX" , but I don't know
if this is standard, or has been modified here at UVA.
( And the RT C compiler predefines "AIX" and "unix" , but
not "_AIX" ! )

I have seen a lot of portable Makefile's set ARCH via `uname` -
( which seems to be more standard than SunOS `arch' ) and then
use that to define it explicitly in CFLAGS. ( Which is how I've
gotten into the habit of often using "#ifdef aix" instead of
the "standard" "#ifdef _AIX" .

( If you want to know why something compiles under 'cc', but not c89 )
Here is my /etc/xlc.cfg which is (I think) the same as the standard
AIX 3.2.2 distribution except for the addition of 'bsdcc'. language
level causes some other defines ( e.g. "-qlanglevl=extended" causes
__EXTENDED__ to be defined. ) and also changes the language accepted
by the compiler.

* @(#) xlc.cfg 1.2 12/19/91 19:30:55
*
* COMPONENT_NAME: (CC) AIX XL C Compiler/6000
*
* FUNCTIONS: C Configuration file
*
* ORIGINS: 27
*
* (C) COPYRIGHT International Business Machines Corp. 1989, 1990, 1991
* All Rights Reserved
* Licensed Materials - Property of IBM
*
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*

* standard c compiler
xlc: use = DEFLT
crt = /lib/crt0.o
mcrt = /lib/mcrt0.o
gcrt = /lib/gcrt0.o
libraries = -lc
proflibs = -L/lib/profiled,-L/usr/lib/profiled
options = -H512,-T512,-D_ANSI_C_SOURCE,-qansialias

* standard c compiler aliased as cc
cc: use = DEFLT
crt = /lib/crt0.o
mcrt = /lib/mcrt0.o
gcrt = /lib/gcrt0.o
libraries = -lc
proflibs = -L/lib/profiled,-L/usr/lib/profiled
options = -H512,-T512,-qlanglvl=extended,-qnoro


* standard c compiler aliased as c89
c89: use = DEFLT
crt = /lib/crt0.o
mcrt = /lib/mcrt0.o
gcrt = /lib/gcrt0.o
libraries = -lc
proflibs = -L/lib/profiled,-L/usr/lib/profiled
options = -H512,-T512,-D_ANSI_C_SOURCE,-qansialias


* common definitions
DEFLT: xlc = /usr/lpp/xlc/bin/xlcentry
as = /bin/as
ld = /bin/ld
options = -D_IBMR2,-D_AIX,-bhalt:4
ldopt = "b:o:e:u:R:H:Y:Z:L:T:A:V:k:j:"

* bsdcc setup from the porting guide
bsdcc: use = DEFLT
crt =/lib/crt0.o
mcrt =/lib/mcrt0.o
gcrt =/lib/gcrt0.o
libraries = -lbsd, -lc
proflibs = -L/lib/profiled,-L/usr/lib/profiled
options = -H512,-T512,-qlanglvl=extended,-qnoro,-D_BSD,-D_NONSTD_TYPES,-D_NO_PROTO,-D_BSD_INCLUDES,-bnodelcsect,-U__STR__,-U__MATH__

-Steve Majewski (804-982-0831) <sdm7g@Virginia.EDU>
-Univ. of Virginia Department of Molecular Physiology and Biological Physics