summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-01-07 18:10:24 (GMT)
committerGeorg Brandl <georg@python.org>2008-01-07 18:10:24 (GMT)
commit52d168a9950cc0933b6f650e5fdebfad13347e88 (patch)
tree513a176653aeddee22e0d0b3571360b7d4cc21a4 /configure.in
parent22ec03c286094298227b2068fa02bcafedf76860 (diff)
downloadcpython-52d168a9950cc0933b6f650e5fdebfad13347e88.zip
cpython-52d168a9950cc0933b6f650e5fdebfad13347e88.tar.gz
cpython-52d168a9950cc0933b6f650e5fdebfad13347e88.tar.bz2
Remove traces of Py_USING_UNICODE and Unicode-specific conditionals in configure.
Rename --enable-unicode to --with-wide-unicode; the default is still not wide.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in89
1 files changed, 36 insertions, 53 deletions
diff --git a/configure.in b/configure.in
index a92705c..fe52c4b 100644
--- a/configure.in
+++ b/configure.in
@@ -3003,72 +3003,55 @@ then
ac_cv_wchar_t_signed=yes)])
AC_MSG_RESULT($ac_cv_wchar_t_signed)
fi
-
-AC_MSG_CHECKING(what type to use for unicode)
-dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
-AC_ARG_ENABLE(unicode,
- AC_HELP_STRING(--enable-unicode@<:@=ucs@<:@24@:>@@:>@, Enable Unicode strings (default is yes)),
- [],
- [enable_unicode=yes])
-if test $enable_unicode = yes
-then
- # Without any arguments, Py_UNICODE defaults to two-byte mode
- case "$have_ucs4_tcl" in
- yes) enable_unicode="ucs4"
- ;;
- *) enable_unicode="ucs2"
- ;;
- esac
+AC_MSG_CHECKING(what type to use for str)
+AC_ARG_WITH(wide-unicode,
+ AC_HELP_STRING(--with-wide-unicode, Use 4-byte Unicode characters (default is 2 bytes)),
+[
+if test "$withval" != no
+then unicode_size="4"
+else unicode_size="2"
fi
+],
+[
+case "$have_ucs4_tcl" in
+ yes) unicode_size="4" ;;
+ *) unicode_size="2" ;;
+esac
+])
AH_TEMPLATE(Py_UNICODE_SIZE,
[Define as the size of the unicode type.])
-case "$enable_unicode" in
-ucs2) unicode_size="2"
- AC_DEFINE(Py_UNICODE_SIZE,2)
- ;;
-ucs4) unicode_size="4"
- AC_DEFINE(Py_UNICODE_SIZE,4)
- ;;
+case "$unicode_size" in
+ 4) AC_DEFINE(Py_UNICODE_SIZE, 4) ;;
+ *) AC_DEFINE(Py_UNICODE_SIZE, 2) ;;
esac
AH_TEMPLATE(PY_UNICODE_TYPE,
[Define as the integral type used for Unicode representation.])
-AC_SUBST(UNICODE_OBJS)
-if test "$enable_unicode" = "no"
+# wchar_t is only usable if it maps to an unsigned type
+if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" \
+ -a "$ac_cv_wchar_t_signed" = "no"
then
- UNICODE_OBJS=""
- AC_MSG_RESULT(not used)
+ PY_UNICODE_TYPE="wchar_t"
+ AC_DEFINE(HAVE_USABLE_WCHAR_T, 1,
+ [Define if you have a useable wchar_t type defined in wchar.h; useable
+ means wchar_t must be an unsigned type with at least 16 bits. (see
+ Include/unicodeobject.h).])
+ AC_DEFINE(PY_UNICODE_TYPE,wchar_t)
+elif test "$ac_cv_sizeof_short" = "$unicode_size"
+then
+ PY_UNICODE_TYPE="unsigned short"
+ AC_DEFINE(PY_UNICODE_TYPE,unsigned short)
+elif test "$ac_cv_sizeof_long" = "$unicode_size"
+then
+ PY_UNICODE_TYPE="unsigned long"
+ AC_DEFINE(PY_UNICODE_TYPE,unsigned long)
else
- UNICODE_OBJS="Objects/unicodeobject.o Objects/unicodectype.o"
- AC_DEFINE(Py_USING_UNICODE, 1,
- [Define if you want to have a Unicode type.])
-
- # wchar_t is only usable if it maps to an unsigned type
- if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" \
- -a "$ac_cv_wchar_t_signed" = "no"
- then
- PY_UNICODE_TYPE="wchar_t"
- AC_DEFINE(HAVE_USABLE_WCHAR_T, 1,
- [Define if you have a useable wchar_t type defined in wchar.h; useable
- means wchar_t must be an unsigned type with at least 16 bits. (see
- Include/unicodeobject.h).])
- AC_DEFINE(PY_UNICODE_TYPE,wchar_t)
- elif test "$ac_cv_sizeof_short" = "$unicode_size"
- then
- PY_UNICODE_TYPE="unsigned short"
- AC_DEFINE(PY_UNICODE_TYPE,unsigned short)
- elif test "$ac_cv_sizeof_long" = "$unicode_size"
- then
- PY_UNICODE_TYPE="unsigned long"
- AC_DEFINE(PY_UNICODE_TYPE,unsigned long)
- else
- PY_UNICODE_TYPE="no type found"
- fi
- AC_MSG_RESULT($PY_UNICODE_TYPE)
+ PY_UNICODE_TYPE="no type found"
fi
+AC_MSG_RESULT($PY_UNICODE_TYPE)
# check for endianness
AC_C_BIGENDIAN