summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-02-04 11:11:34 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-02-04 11:11:34 (GMT)
commit0d69fc832e95cff706d7bb039e2ff329b8c5d202 (patch)
tree5eb0d7e80af008f982cc729bb18b3c5b76d3f27c /unix
parent6e97fd01b017aa32b07924c1ed080c27941664fd (diff)
downloadtcl-0d69fc832e95cff706d7bb039e2ff329b8c5d202.zip
tcl-0d69fc832e95cff706d7bb039e2ff329b8c5d202.tar.gz
tcl-0d69fc832e95cff706d7bb039e2ff329b8c5d202.tar.bz2
Fix [03b70c8918]: core-8-branch : trying to build on macOS10.9 linked against XQuartz
Diffstat (limited to 'unix')
-rwxr-xr-xunix/configure65
-rw-r--r--unix/tcl.m470
2 files changed, 88 insertions, 47 deletions
diff --git a/unix/configure b/unix/configure
index 2943334..26de9a8 100755
--- a/unix/configure
+++ b/unix/configure
@@ -5581,7 +5581,7 @@ fi
then :
CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith -finput-charset=UTF-8"
+ CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith"
case "${CC}" in
*++|*++-*)
;;
@@ -7293,11 +7293,11 @@ then :
fi
- # See if the compiler supports casting to a union type.
- # This is used to stop gcc from printing a compiler
- # warning when initializing a union member.
+ # See if the compiler supports casting to a union type.
+ # This is used to stop gcc from printing a compiler
+ # warning when initializing a union member.
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5
printf %s "checking for cast to union support... " >&6; }
if test ${tcl_cv_cast_to_union+y}
then :
@@ -7310,8 +7310,8 @@ int
main (void)
{
- union foo { int i; double d; };
- union foo f = (union foo) (int) 0;
+ union foo { int i; double d; };
+ union foo f = (union foo) (int) 0;
;
return 0;
@@ -7328,13 +7328,13 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5
printf "%s\n" "$tcl_cv_cast_to_union" >&6; }
- if test "$tcl_cv_cast_to_union" = "yes"; then
+ if test "$tcl_cv_cast_to_union" = "yes"; then
printf "%s\n" "#define HAVE_CAST_TO_UNION 1" >>confdefs.h
- fi
- hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -fno-lto" >&5
+ fi
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working -fno-lto" >&5
printf %s "checking for working -fno-lto... " >&6; }
if test ${ac_cv_nolto+y}
then :
@@ -7362,12 +7362,45 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_nolto" >&5
printf "%s\n" "$ac_cv_nolto" >&6; }
+ CFLAGS=$hold_cflags
+ if test "$ac_cv_nolto" = "yes" ; then
+ CFLAGS_NOLTO="-fno-lto"
+ else
+ CFLAGS_NOLTO=""
+ fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -finput-charset" >&5
+printf %s "checking if the compiler understands -finput-charset... " >&6; }
+if test ${tcl_cv_cc_input_charset+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -finput-charset=UTF-8"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+ tcl_cv_cc_input_charset=yes
+else $as_nop
+ tcl_cv_cc_input_charset=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CFLAGS=$hold_cflags
- if test "$ac_cv_nolto" = "yes" ; then
- CFLAGS_NOLTO="-fno-lto"
- else
- CFLAGS_NOLTO=""
- fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_input_charset" >&5
+printf "%s\n" "$tcl_cv_cc_input_charset" >&6; }
+ if test $tcl_cv_cc_input_charset = yes; then
+ CFLAGS="$CFLAGS -finput-charset=UTF-8"
+ fi
ac_fn_c_check_header_compile "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default"
if test "x$ac_cv_header_stdbool_h" = xyes
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 08c1907..a8911f8 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -960,7 +960,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG=-g
AS_IF([test "$GCC" = yes], [
CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith -finput-charset=UTF-8"
+ CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith"
case "${CC}" in
*++|*++-*)
;;
@@ -1838,36 +1838,44 @@ dnl # preprocessing tests use only CPPFLAGS.
TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}"])
AC_SUBST(TCL_LIBS)
- # See if the compiler supports casting to a union type.
- # This is used to stop gcc from printing a compiler
- # warning when initializing a union member.
-
- AC_CACHE_CHECK(for cast to union support,
- tcl_cv_cast_to_union,
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
- union foo { int i; double d; };
- union foo f = (union foo) (int) 0;
- ]])],
- [tcl_cv_cast_to_union=yes],
- [tcl_cv_cast_to_union=no])
- )
- if test "$tcl_cv_cast_to_union" = "yes"; then
- AC_DEFINE(HAVE_CAST_TO_UNION, 1,
- [Defined when compiler supports casting to union type.])
- fi
- hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto"
- AC_CACHE_CHECK(for working -fno-lto,
- ac_cv_nolto,
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
- [ac_cv_nolto=yes],
- [ac_cv_nolto=no])
- )
- CFLAGS=$hold_cflags
- if test "$ac_cv_nolto" = "yes" ; then
- CFLAGS_NOLTO="-fno-lto"
- else
- CFLAGS_NOLTO=""
- fi
+ # See if the compiler supports casting to a union type.
+ # This is used to stop gcc from printing a compiler
+ # warning when initializing a union member.
+
+ AC_CACHE_CHECK(for cast to union support,
+ tcl_cv_cast_to_union,
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ union foo { int i; double d; };
+ union foo f = (union foo) (int) 0;
+ ]])],
+ [tcl_cv_cast_to_union=yes],
+ [tcl_cv_cast_to_union=no])
+ )
+ if test "$tcl_cv_cast_to_union" = "yes"; then
+ AC_DEFINE(HAVE_CAST_TO_UNION, 1,
+ [Defined when compiler supports casting to union type.])
+ fi
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto"
+ AC_CACHE_CHECK(for working -fno-lto,
+ ac_cv_nolto,
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+ [ac_cv_nolto=yes],
+ [ac_cv_nolto=no])
+ )
+ CFLAGS=$hold_cflags
+ if test "$ac_cv_nolto" = "yes" ; then
+ CFLAGS_NOLTO="-fno-lto"
+ else
+ CFLAGS_NOLTO=""
+ fi
+ AC_CACHE_CHECK([if the compiler understands -finput-charset],
+ tcl_cv_cc_input_charset, [
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -finput-charset=UTF-8"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_input_charset=yes],[tcl_cv_cc_input_charset=no])
+ CFLAGS=$hold_cflags])
+ if test $tcl_cv_cc_input_charset = yes; then
+ CFLAGS="$CFLAGS -finput-charset=UTF-8"
+ fi
AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have <stdbool.h>?])],)