Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa3bdea

Browse files
committed
Patch #798202: detect redhat9 Tcl/Tk in configure script.
Will backport to 2.2.
1 parent e81e9b1 commit fa3bdea

2 files changed

Lines changed: 77 additions & 3 deletions

File tree

configure

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# From configure.in Revision: 1.429 .
2+
# From configure.in Revision: 1.430 .
33
# Guess values for system-dependent variables and create Makefiles.
44
# Generated by GNU Autoconf 2.57 for python 2.4.
55
#
@@ -17520,6 +17520,58 @@ _ACEOF
1752017520

1752117521
fi
1752217522

17523+
echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5
17524+
echo $ECHO_N "checking for UCS-4 tcl... $ECHO_C" >&6
17525+
have_ucs4_tcl=no
17526+
cat >conftest.$ac_ext <<_ACEOF
17527+
#line $LINENO "configure"
17528+
/* confdefs.h. */
17529+
_ACEOF
17530+
cat confdefs.h >>conftest.$ac_ext
17531+
cat >>conftest.$ac_ext <<_ACEOF
17532+
/* end confdefs.h. */
17533+
17534+
#include <tcl.h>
17535+
#if TCL_UTF_MAX != 6
17536+
# error "NOT UCS4_TCL"
17537+
#endif
17538+
int
17539+
main ()
17540+
{
17541+
17542+
;
17543+
return 0;
17544+
}
17545+
_ACEOF
17546+
rm -f conftest.$ac_objext
17547+
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
17548+
(eval $ac_compile) 2>&5
17549+
ac_status=$?
17550+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
17551+
(exit $ac_status); } &&
17552+
{ ac_try='test -s conftest.$ac_objext'
17553+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
17554+
(eval $ac_try) 2>&5
17555+
ac_status=$?
17556+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
17557+
(exit $ac_status); }; }; then
17558+
17559+
17560+
cat >>confdefs.h <<\_ACEOF
17561+
#define HAVE_UCS4_TCL 1
17562+
_ACEOF
17563+
17564+
have_ucs4_tcl=yes
17565+
17566+
else
17567+
echo "$as_me: failed program was:" >&5
17568+
sed 's/^/| /' conftest.$ac_ext >&5
17569+
17570+
fi
17571+
rm -f conftest.$ac_objext conftest.$ac_ext
17572+
echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5
17573+
echo "${ECHO_T}$have_ucs4_tcl" >&6
17574+
1752317575
echo "$as_me:$LINENO: checking what type to use for unicode" >&5
1752417576
echo $ECHO_N "checking what type to use for unicode... $ECHO_C" >&6
1752517577
# Check whether --enable-unicode or --disable-unicode was given.
@@ -17533,7 +17585,12 @@ fi;
1753317585
if test $enable_unicode = yes
1753417586
then
1753517587
# Without any arguments, Py_UNICODE defaults to two-byte mode
17536-
enable_unicode="ucs2"
17588+
case "$have_ucs4_tcl" in
17589+
yes) enable_unicode="ucs4"
17590+
;;
17591+
*) enable_unicode="ucs2"
17592+
;;
17593+
esac
1753717594
fi
1753817595

1753917596

configure.in

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2647,6 +2647,18 @@ then
26472647
AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
26482648
fi
26492649

2650+
AC_MSG_CHECKING(for UCS-4 tcl)
2651+
have_ucs4_tcl=no
2652+
AC_TRY_COMPILE([
2653+
#include <tcl.h>
2654+
#if TCL_UTF_MAX != 6
2655+
# error "NOT UCS4_TCL"
2656+
#endif], [], [
2657+
AC_DEFINE(HAVE_UCS4_TCL, 1, [Define this if you have tcl and TCL_UTF_MAX==6])
2658+
have_ucs4_tcl=yes
2659+
])
2660+
AC_MSG_RESULT($have_ucs4_tcl)
2661+
26502662
AC_MSG_CHECKING(what type to use for unicode)
26512663
dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
26522664
AC_ARG_ENABLE(unicode,
@@ -2657,7 +2669,12 @@ AC_ARG_ENABLE(unicode,
26572669
if test $enable_unicode = yes
26582670
then
26592671
# Without any arguments, Py_UNICODE defaults to two-byte mode
2660-
enable_unicode="ucs2"
2672+
case "$have_ucs4_tcl" in
2673+
yes) enable_unicode="ucs4"
2674+
;;
2675+
*) enable_unicode="ucs2"
2676+
;;
2677+
esac
26612678
fi
26622679

26632680
AH_TEMPLATE(Py_UNICODE_SIZE,

0 commit comments

Comments
 (0)