[Python-Dev] to the maintainer of python's configure script

McGreal, Martin P. Martin.McGreal at anheuser-busch.com
Mon Oct 20 15:34:35 EDT 2003


Hello,

I need to make these modifications to the configure script every time I compile
Python on AIX (both AIX 4.3.3 and 5.2 -- so I assume 5.1 as well), so I figured
I might as well submit them to you. Everything works fine without my changes
except for the readline detection. To get readline detection to work I must...

1. AIX doesn't have a termcap library, so any reference to -ltermcap must be
changed to -lcurses.
2. The prototype in the sample code at line 18237 is different from the
prototype in <readline/readline.h>, so it should simply be removed from the
sample code.
3. The sample code header doesn't include <readline/readline.h>, so both it and
<stdio.h> should be included.


34d33
< $as_unset ENV MAIL MAILPATH
18222c18221
< LIBS="-lreadline -ltermcap $LIBS"
---
> LIBS="-lreadline -lcurses $LIBS"
18225a18225,18226
> #include <stdio.h>
> #include <readline/readline.h>
18237d18237
< char rl_pre_input_hook ();
18286c18286
< LIBS="-lreadline -ltermcap $LIBS"
---
> LIBS="-lreadline -lcurses $LIBS"
18929d18928
< $as_unset ENV MAIL MAILPATH


My configure command is 

../configure -C --includedir=/usr/local/include --with-libs=-L/usr/local/lib
--disable-ipv6 --with-threads 

My readline is version 4.3, and is installed under /usr/local:

# find /usr/local/include -type f |egrep "readline|history"
/usr/local/include/readline/chardefs.h
/usr/local/include/readline/history.h
/usr/local/include/readline/keymaps.h
/usr/local/include/readline/readline.h
/usr/local/include/readline/rlconf.h
/usr/local/include/readline/rlstdc.h
/usr/local/include/readline/rltypedefs.h
/usr/local/include/readline/tilde.h
# find /usr/local/lib -type f |egrep "readline|history"    
/usr/local/lib/libhistory.a
/usr/local/lib/libreadline.a

If I do not make the changes in the configure script for the readline checks,
the following errors are produced:

[rl_pre_input_hook check before changing -ltermcap to -lcurses]:
configure:18215: checking for rl_pre_input_hook in -lreadline
configure:18246: cc_r -o conftest -g -I/usr/local/include  conftest.c -lreadline
-ltermcap -L/usr/local/lib -ldl  >&5
ld: 0706-006 Cannot find or open library file: -l termcap
        ld:open(): No such file or directory

[rl_completion_matches check before changing -ltermcap to -lcurses]
configure:18279: checking for rl_completion_matches in -lreadline
configure:18310: cc_r -o conftest -g -I/usr/local/include  conftest.c -lreadline
-ltermcap -L/usr/local/lib -ldl  >&5
ld: 0706-006 Cannot find or open library file: -l termcap
        ld:open(): No such file or directory
configure:18313: $? = 255

[rl_pre_input_hook check after changing -ltermcap to -lcurses]:
configure:18215: checking for rl_pre_input_hook in -lreadline
configure:18246: cc_r -o conftest -g -I/usr/local/include  conftest.c -lreadline
-lcurses -L/usr/loc
al/lib -ldl  >&5
ld: 0711-317 ERROR: Undefined symbol: .rl_pre_input_hook
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
configure:18249: $? = 8

[rl_completion_matches check is ok after changing -ltermcap to -lcurses]

[rl_pre_input_hook check after adding <stdio.h> and <readline/readline.h> to
example code]
configure:18215: checking for rl_pre_input_hook in -lreadline
configure:18249: cc_r -o conftest -g -I/usr/local/include  conftest.c -lreadline
-lcurses -L/usr/loc
al/lib -ldl  >&5
"configure", line 18233.9: 1506-236 (W) Macro name _ALL_SOURCE has been
redefined.
"configure", line 18233.9: 1506-358 (I) "_ALL_SOURCE" is defined on line 129 of
/usr/include/standar
ds.h.
"configure", line 18432.6: 1506-343 (S) Redeclaration of rl_pre_input_hook
differs from previous dec
laration on line 526 of "/usr/local/include/readline/readline.h".
"configure", line 18432.6: 1506-382 (I) The type "unsigned char()" of identifier
rl_pre_input_hook d
iffers from previous type "int(*)()".
configure:18252: $? = 1

[rl_pre_input_hook check is ok after deleting redeclaration of
rl_pre_input_hook]


This output was produced on an H50 running AIX 5.2 ML1. The same output can be
produced on AIX 4.3.3 ML11 (tested on an S7A), except that there is a
libtermcap, so -ltermcap doesn't have to be changed to -lcurses (and
consequently, the rl_completion_matches check goes right the first time). And on
4.3.3 for some reason the --includedir=/usr/local/include doesn't work so
instead I had to use

CPPFLAGS="-I/usr/local/include" ./configure -C --with-libs=-L/usr/local/lib
--disable-ipv6 --with-threads

Thanks!
Martin McGreal


PS: I also remove the unsetting of ENV from lines 34 and 18929 because on our
systems ENV is readonly, which makes the configure script choke.







More information about the Python-Dev mailing list