Skip to content

Commit be0607e

Browse files
committed
updated for version 7.3.1167
Problem: Python configure check doesn't reject Python 2 when requesting Python 3. Some systems need -pthreads instead of -pthread. Solution: Adjust configure accordingly. (Andrei Olsen)
1 parent 7d406c3 commit be0607e

File tree

3 files changed

+278
-244
lines changed

3 files changed

+278
-244
lines changed

src/auto/configure

Lines changed: 118 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -5431,6 +5431,9 @@ $as_echo_n "checking if -pthread should be used... " >&6; }
54315431
threadsafe_flag="-D_THREAD_SAFE"
54325432
thread_lib="-pthread"
54335433
fi
5434+
if test "`(uname) 2>/dev/null`" = SunOS; then
5435+
threadsafe_flag="-pthreads"
5436+
fi
54345437
fi
54355438
libs_save_old=$LIBS
54365439
if test -n "$threadsafe_flag"; then
@@ -5502,7 +5505,6 @@ rm -f core conftest.err conftest.$ac_objext \
55025505
PYTHON_LIBS=
55035506
PYTHON_CFLAGS=
55045507
fi
5505-
55065508
fi
55075509
else
55085510
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: too old" >&5
@@ -5594,55 +5596,63 @@ fi
55945596
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_version" >&5
55955597
$as_echo "$vi_cv_var_python3_version" >&6; }
55965598

5597-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's abiflags" >&5
5599+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python is 3.0 or better" >&5
5600+
$as_echo_n "checking Python is 3.0 or better... " >&6; }
5601+
if ${vi_cv_path_python3} -c \
5602+
"import sys; sys.exit(${vi_cv_var_python3_version} < 3.0)"
5603+
then
5604+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yep" >&5
5605+
$as_echo "yep" >&6; }
5606+
5607+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's abiflags" >&5
55985608
$as_echo_n "checking Python's abiflags... " >&6; }
55995609
if test "${vi_cv_var_python3_abiflags+set}" = set; then :
56005610
$as_echo_n "(cached) " >&6
56015611
else
56025612

5603-
vi_cv_var_python3_abiflags=
5604-
if ${vi_cv_path_python3} -c \
5605-
"import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)"
5606-
then
5607-
vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \
5608-
"import sys; print(sys.abiflags)"`
5609-
fi
5613+
vi_cv_var_python3_abiflags=
5614+
if ${vi_cv_path_python3} -c \
5615+
"import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)"
5616+
then
5617+
vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \
5618+
"import sys; print(sys.abiflags)"`
5619+
fi
56105620
fi
56115621
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_abiflags" >&5
56125622
$as_echo "$vi_cv_var_python3_abiflags" >&6; }
56135623

5614-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's install prefix" >&5
5624+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's install prefix" >&5
56155625
$as_echo_n "checking Python's install prefix... " >&6; }
56165626
if test "${vi_cv_path_python3_pfx+set}" = set; then :
56175627
$as_echo_n "(cached) " >&6
56185628
else
56195629
vi_cv_path_python3_pfx=`
5620-
${vi_cv_path_python3} -c \
5621-
"import sys; print(sys.prefix)"`
5630+
${vi_cv_path_python3} -c \
5631+
"import sys; print(sys.prefix)"`
56225632
fi
56235633
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_pfx" >&5
56245634
$as_echo "$vi_cv_path_python3_pfx" >&6; }
56255635

5626-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's execution prefix" >&5
5636+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's execution prefix" >&5
56275637
$as_echo_n "checking Python's execution prefix... " >&6; }
56285638
if test "${vi_cv_path_python3_epfx+set}" = set; then :
56295639
$as_echo_n "(cached) " >&6
56305640
else
56315641
vi_cv_path_python3_epfx=`
5632-
${vi_cv_path_python3} -c \
5633-
"import sys; print(sys.exec_prefix)"`
5642+
${vi_cv_path_python3} -c \
5643+
"import sys; print(sys.exec_prefix)"`
56345644
fi
56355645
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_epfx" >&5
56365646
$as_echo "$vi_cv_path_python3_epfx" >&6; }
56375647

56385648

5639-
if test "${vi_cv_path_python3path+set}" = set; then :
5649+
if test "${vi_cv_path_python3path+set}" = set; then :
56405650
$as_echo_n "(cached) " >&6
56415651
else
56425652
vi_cv_path_python3path=`
5643-
unset PYTHONPATH;
5644-
${vi_cv_path_python3} -c \
5645-
"import sys, string; print(':'.join(sys.path))"`
5653+
unset PYTHONPATH;
5654+
${vi_cv_path_python3} -c \
5655+
"import sys, string; print(':'.join(sys.path))"`
56465656
fi
56475657

56485658

@@ -5654,95 +5664,98 @@ if test "${with_python3_config_dir+set}" = set; then :
56545664
fi
56555665

56565666

5657-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's configuration directory" >&5
5667+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's configuration directory" >&5
56585668
$as_echo_n "checking Python's configuration directory... " >&6; }
56595669
if test "${vi_cv_path_python3_conf+set}" = set; then :
56605670
$as_echo_n "(cached) " >&6
56615671
else
56625672

5663-
vi_cv_path_python3_conf=
5664-
config_dir="config"
5665-
if test "${vi_cv_var_python3_abiflags}" != ""; then
5666-
config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
5667-
fi
5668-
d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"`
5669-
if test -d "$d" && test -f "$d/config.c"; then
5670-
vi_cv_path_python3_conf="$d"
5671-
else
5672-
for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do
5673-
for subdir in lib64 lib share; do
5674-
d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}"
5675-
if test -d "$d" && test -f "$d/config.c"; then
5676-
vi_cv_path_python3_conf="$d"
5677-
fi
5678-
done
5679-
done
5680-
fi
5673+
vi_cv_path_python3_conf=
5674+
config_dir="config"
5675+
if test "${vi_cv_var_python3_abiflags}" != ""; then
5676+
config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
5677+
fi
5678+
d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"`
5679+
if test -d "$d" && test -f "$d/config.c"; then
5680+
vi_cv_path_python3_conf="$d"
5681+
else
5682+
for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do
5683+
for subdir in lib64 lib share; do
5684+
d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}"
5685+
if test -d "$d" && test -f "$d/config.c"; then
5686+
vi_cv_path_python3_conf="$d"
5687+
fi
5688+
done
5689+
done
5690+
fi
56815691

56825692
fi
56835693
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_conf" >&5
56845694
$as_echo "$vi_cv_path_python3_conf" >&6; }
56855695

5686-
PYTHON3_CONFDIR="${vi_cv_path_python3_conf}"
5696+
PYTHON3_CONFDIR="${vi_cv_path_python3_conf}"
56875697

5688-
if test "X$PYTHON3_CONFDIR" = "X"; then
5689-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: can't find it!" >&5
5698+
if test "X$PYTHON3_CONFDIR" = "X"; then
5699+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: can't find it!" >&5
56905700
$as_echo "can't find it!" >&6; }
5691-
else
5701+
else
56925702

5693-
if test "${vi_cv_path_python3_plibs+set}" = set; then :
5703+
if test "${vi_cv_path_python3_plibs+set}" = set; then :
56945704
$as_echo_n "(cached) " >&6
56955705
else
56965706

5697-
pwd=`pwd`
5698-
tmp_mkf="$pwd/config-PyMake$$"
5699-
cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}"
5707+
pwd=`pwd`
5708+
tmp_mkf="$pwd/config-PyMake$$"
5709+
cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}"
57005710
__:
57015711
@echo "python3_BASEMODLIBS='$(BASEMODLIBS)'"
57025712
@echo "python3_LIBS='$(LIBS)'"
57035713
@echo "python3_SYSLIBS='$(SYSLIBS)'"
57045714
@echo "python3_DLLLIBRARY='$(DLLLIBRARY)'"
57055715
@echo "python3_INSTSONAME='$(INSTSONAME)'"
57065716
eof
5707-
eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
5708-
rm -f -- "${tmp_mkf}"
5709-
vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
5710-
vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
5711-
vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
5712-
vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
5717+
eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
5718+
rm -f -- "${tmp_mkf}"
5719+
vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
5720+
vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
5721+
vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
5722+
vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
57135723

57145724
fi
57155725

57165726

5717-
if test "X$python3_DLLLIBRARY" != "X"; then
5718-
python3_INSTSONAME="$python3_DLLLIBRARY"
5719-
fi
5720-
PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
5721-
if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
5722-
PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
5723-
else
5724-
PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
5725-
fi
5726-
PYTHON3_SRC="if_python3.c"
5727-
PYTHON3_OBJ="objects/if_python3.o"
5727+
if test "X$python3_DLLLIBRARY" != "X"; then
5728+
python3_INSTSONAME="$python3_DLLLIBRARY"
5729+
fi
5730+
PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
5731+
if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
5732+
PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
5733+
else
5734+
PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
5735+
fi
5736+
PYTHON3_SRC="if_python3.c"
5737+
PYTHON3_OBJ="objects/if_python3.o"
57285738

5729-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5
5739+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5
57305740
$as_echo_n "checking if -pthread should be used... " >&6; }
5731-
threadsafe_flag=
5732-
thread_lib=
5733-
if test "`(uname) 2>/dev/null`" != Darwin; then
5734-
test "$GCC" = yes && threadsafe_flag="-pthread"
5735-
if test "`(uname) 2>/dev/null`" = FreeBSD; then
5736-
threadsafe_flag="-D_THREAD_SAFE"
5737-
thread_lib="-pthread"
5741+
threadsafe_flag=
5742+
thread_lib=
5743+
if test "`(uname) 2>/dev/null`" != Darwin; then
5744+
test "$GCC" = yes && threadsafe_flag="-pthread"
5745+
if test "`(uname) 2>/dev/null`" = FreeBSD; then
5746+
threadsafe_flag="-D_THREAD_SAFE"
5747+
thread_lib="-pthread"
5748+
fi
5749+
if test "`(uname) 2>/dev/null`" = SunOS; then
5750+
threadsafe_flag="-pthreads"
5751+
fi
57385752
fi
5739-
fi
5740-
libs_save_old=$LIBS
5741-
if test -n "$threadsafe_flag"; then
5742-
cflags_save=$CFLAGS
5743-
CFLAGS="$CFLAGS $threadsafe_flag"
5744-
LIBS="$LIBS $thread_lib"
5745-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5753+
libs_save_old=$LIBS
5754+
if test -n "$threadsafe_flag"; then
5755+
cflags_save=$CFLAGS
5756+
CFLAGS="$CFLAGS $threadsafe_flag"
5757+
LIBS="$LIBS $thread_lib"
5758+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57465759
/* end confdefs.h. */
57475760
57485761
int
@@ -5763,19 +5776,19 @@ $as_echo "no" >&6; }; LIBS=$libs_save_old
57635776
fi
57645777
rm -f core conftest.err conftest.$ac_objext \
57655778
conftest$ac_exeext conftest.$ac_ext
5766-
CFLAGS=$cflags_save
5767-
else
5768-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5779+
CFLAGS=$cflags_save
5780+
else
5781+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
57695782
$as_echo "no" >&6; }
5770-
fi
5783+
fi
57715784

5772-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for Python 3 are sane" >&5
5785+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for Python 3 are sane" >&5
57735786
$as_echo_n "checking if compile and link flags for Python 3 are sane... " >&6; }
5774-
cflags_save=$CFLAGS
5775-
libs_save=$LIBS
5776-
CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
5777-
LIBS="$LIBS $PYTHON3_LIBS"
5778-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5787+
cflags_save=$CFLAGS
5788+
libs_save=$LIBS
5789+
CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
5790+
LIBS="$LIBS $PYTHON3_LIBS"
5791+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57795792
/* end confdefs.h. */
57805793
57815794
int
@@ -5795,18 +5808,22 @@ $as_echo "no: PYTHON3 DISABLED" >&6; }; python3_ok=no
57955808
fi
57965809
rm -f core conftest.err conftest.$ac_objext \
57975810
conftest$ac_exeext conftest.$ac_ext
5798-
CFLAGS=$cflags_save
5799-
LIBS=$libs_save
5800-
if test "$python3_ok" = yes; then
5801-
$as_echo "#define FEAT_PYTHON3 1" >>confdefs.h
5802-
5803-
else
5804-
LIBS=$libs_save_old
5805-
PYTHON3_SRC=
5806-
PYTHON3_OBJ=
5807-
PYTHON3_LIBS=
5808-
PYTHON3_CFLAGS=
5811+
CFLAGS=$cflags_save
5812+
LIBS=$libs_save
5813+
if test "$python3_ok" = yes; then
5814+
$as_echo "#define FEAT_PYTHON3 1" >>confdefs.h
5815+
5816+
else
5817+
LIBS=$libs_save_old
5818+
PYTHON3_SRC=
5819+
PYTHON3_OBJ=
5820+
PYTHON3_LIBS=
5821+
PYTHON3_CFLAGS=
5822+
fi
58095823
fi
5824+
else
5825+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: too old" >&5
5826+
$as_echo "too old" >&6; }
58105827
fi
58115828
fi
58125829
fi
@@ -8780,7 +8797,7 @@ if test -z "$SKIP_MOTIF"; then
87808797
xmheader="Xm/Xm.h"
87818798
else
87828799
xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h
8783-
Xm/UnhighlightT.h Xm/Notebook.h"
8800+
Xm/UnhighlightT.h Xm/Notebook.h"
87848801
fi
87858802
for ac_header in $xmheader
87868803
do :
@@ -11777,7 +11794,7 @@ int
1177711794
main ()
1177811795
{
1177911796
struct sysinfo sinfo;
11780-
sinfo.mem_unit = 1;
11797+
sinfo.mem_unit = 1;
1178111798
1178211799
;
1178311800
return 0;

0 commit comments

Comments
 (0)