AIX下编译python

++ AIX下编译python

AIX 5.3: To build a 64-bit version with IBM’s compiler, I used the following:

    export PATH=/usr/bin:/usr/vacpp/bin
    ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64"  --disable-ipv6 AR="ar -X64"
    make

报错 “Include/token.h”, line 42.9: 1506-213 (S) Macro name TILDE cannot be redefined

vim Include/token.h

用/* */注释42行 或者修改为: #if defined(_SYS_IOCTL_H_) #undef TILDE #define TILDE 32 #endif 或者是 #if defined(aix) #undef TILDE #define TILDE 32 #endif

再次出现语法错误的报错

+++网上提供的编译命令 CONFIG_SHELL=/usr/bin/bash CC=xlc_r CFLAGS=”-q64 -qlanglvl=extc99” CXX=xlC_r CXXFLAGS=”-q64 -qlanglvl=extended” AR="ar -X64” LDFLAGS=”-L$HOME/libreadline/lib -L$HOME/libz/lib -L$HOME/libbz2/lib” ./configure –prefix=/usr/local/python26 –with-gcc="xlc_r -q64 -qlanglvl=extc99” –with-cxx="xlC_r -q64 -qlanglvl=extended” –disable-ipv6

make +++还是不行 后来看到这一句: Monterey (64-bit AIX): The current Monterey C compiler (Visual Age) uses the OBJECT_MODE={32|64} environment variable to set the compilation mode to either 32-bit or 64-bit (32-bit mode is the default). Presumably you want 64-bit compilation mode for this 64-bit OS. As a result you must first set OBJECT_MODE=64 in your environment before configuring (./configure) or building (make) Python on Monterey.

OBJECT_MODE=64 export OBJECT_MODE=64

AIX 5.3: To build a 64-bit version with IBM’s compiler, I used the following:

    export PATH=/usr/bin:/usr/vacpp/bin
    ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" \
                --disable-ipv6 AR="ar -X64"
    make