summaryrefslogtreecommitdiffstats
path: root/win/tcl.m4
diff options
context:
space:
mode:
Diffstat (limited to 'win/tcl.m4')
-rw-r--r--win/tcl.m4124
1 files changed, 67 insertions, 57 deletions
diff --git a/win/tcl.m4 b/win/tcl.m4
index 3211d1a..dd9110b 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -28,9 +28,9 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
# we reset no_tcl in case something fails here
no_tcl=true
AC_ARG_WITH(tcl,
- AC_HELP_STRING([--with-tcl],
+ AS_HELP_STRING([--with-tcl],
[directory containing tcl configuration (tclConfig.sh)]),
- with_tclconfig="${withval}")
+ [with_tclconfig="${withval}"])
AC_MSG_CHECKING([for Tcl configuration])
AC_CACHE_VAL(ac_cv_c_tclconfig,[
@@ -146,9 +146,9 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
# we reset no_tk in case something fails here
no_tk=true
AC_ARG_WITH(tk,
- AC_HELP_STRING([--with-tk],
+ AS_HELP_STRING([--with-tk],
[directory containing tk configuration (tkConfig.sh)]),
- with_tkconfig="${withval}")
+ [with_tkconfig="${withval}"])
AC_MSG_CHECKING([for Tk configuration])
AC_CACHE_VAL(ac_cv_c_tkconfig,[
@@ -251,7 +251,6 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
# TCL_BIN_DIR
# TCL_SRC_DIR
# TCL_LIB_FILE
-# TCL_ZIP_FILE
#
#------------------------------------------------------------------------
@@ -288,7 +287,6 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
AC_SUBST(TCL_BIN_DIR)
AC_SUBST(TCL_SRC_DIR)
- AC_SUBST(TCL_ZIP_FILE)
AC_SUBST(TCL_LIB_FILE)
AC_SUBST(TCL_LIB_FLAG)
AC_SUBST(TCL_LIB_SPEC)
@@ -358,14 +356,6 @@ AC_DEFUN([SC_ENABLE_SHARED], [
AC_ARG_ENABLE(shared,
[ --enable-shared build and link with shared libraries (default: on)],
[tcl_ok=$enableval], [tcl_ok=yes])
-
- if test "${enable_shared+set}" = set; then
- enableval="$enable_shared"
- tcl_ok=$enableval
- else
- tcl_ok=yes
- fi
-
if test "$tcl_ok" = "yes" ; then
AC_MSG_RESULT([shared])
SHARED_BUILD=1
@@ -463,6 +453,7 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [
# CFLAGS_DEBUG
# CFLAGS_OPTIMIZE
# CFLAGS_WARNING
+# CFLAGS_NOLTO
# LDFLAGS_DEBUG
# LDFLAGS_OPTIMIZE
# LDFLAGS_CONSOLE
@@ -517,13 +508,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK(for cross-compile version of gcc,
ac_cv_cross,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifndef _WIN32
#error cross-compiler
#endif
- ], [],
- ac_cv_cross=no,
- ac_cv_cross=yes)
+ ]], [[]])],
+ [ac_cv_cross=no],
+ [ac_cv_cross=yes])
)
if test "$ac_cv_cross" = "yes"; then
@@ -584,13 +575,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
extra_ldflags="-pipe -static-libgcc"
AC_CACHE_CHECK(for mingw32 version of gcc,
ac_cv_win32,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef _WIN32
#error win32
#endif
- ], [],
- ac_cv_win32=no,
- ac_cv_win32=yes)
+ ]], [[]])],
+ [ac_cv_win32=no],
+ [ac_cv_win32=yes])
)
if test "$ac_cv_win32" != "yes"; then
AC_MSG_ERROR([${CC} cannot produce win32 executables.])
@@ -599,13 +590,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain"
AC_CACHE_CHECK(for working -municode linker flag,
ac_cv_municode,
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <windows.h>
int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;}
- ],
- [],
- ac_cv_municode=yes,
- ac_cv_municode=no)
+ ]], [[]])],
+ [ac_cv_municode=yes],
+ [ac_cv_municode=no])
)
CFLAGS=$hold_cflags
if test "$ac_cv_municode" = "yes" ; then
@@ -613,6 +603,26 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
else
extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS"
fi
+ 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
+ extra_cflags="$extra_cflags -finput-charset=UTF-8"
+ fi
fi
AC_MSG_CHECKING([compiler flags])
@@ -661,7 +671,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_LD='${CC} -shared'
SHLIB_LD_LIBS='${LIBS}'
MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -o \[$]@ ${extra_ldflags} \
- -Wl,--out-implib,\$(patsubst %.dll,lib%.a,\[$]@)"
+ -Wl,--out-implib,\$(patsubst %.dll,lib%.dll.a,\[$]@)"
# DLLSUFFIX is separate because it is the building block for
# users of tclConfig.sh that may build shared or static.
DLLSUFFIX=".dll"
@@ -682,7 +692,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format"
;;
*)
- CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -Wdeclaration-after-statement"
+ CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -fextended-identifiers"
;;
esac
@@ -717,18 +727,18 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_MSG_RESULT([ Using 64-bit $MACHINE mode])
;;
*)
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifndef _WIN64
#error 32-bit
#endif
- ], [],
- tcl_win_64bit=yes,
- tcl_win_64bit=no
+ ]], [[]])],
+ [tcl_win_64bit=yes],
+ [tcl_win_64bit=no]
)
if test "$tcl_win_64bit" = "yes" ; then
- do64bit=amd64
- MACHINE="AMD64"
- AC_MSG_RESULT([ Using 64-bit $MACHINE mode])
+ do64bit=amd64
+ MACHINE="AMD64"
+ AC_MSG_RESULT([ Using 64-bit $MACHINE mode])
fi
;;
esac
@@ -851,7 +861,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
if test "${GCC}" = "yes" ; then
AC_CACHE_CHECK(for SEH support in compiler,
tcl_cv_seh,
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
@@ -866,10 +876,10 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
}
return 1;
}
- ],
- tcl_cv_seh=yes,
- tcl_cv_seh=no,
- tcl_cv_seh=no)
+ ]])],
+ [tcl_cv_seh=yes],
+ [tcl_cv_seh=no],
+ [tcl_cv_seh=no])
)
if test "$tcl_cv_seh" = "no" ; then
AC_DEFINE(HAVE_NO_SEH, 1,
@@ -884,15 +894,15 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
#
AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
tcl_cv_eh_disposition,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# undef WIN32_LEAN_AND_MEAN
- ],[
+ ]], [[
EXCEPTION_DISPOSITION x;
- ],
- tcl_cv_eh_disposition=yes,
- tcl_cv_eh_disposition=no)
+ ]])],
+ [tcl_cv_eh_disposition=yes],
+ [tcl_cv_eh_disposition=no])
)
if test "$tcl_cv_eh_disposition" = "no" ; then
AC_DEFINE(EXCEPTION_DISPOSITION, int,
@@ -905,18 +915,18 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK(for winnt.h that ignores VOID define,
tcl_cv_winnt_ignore_void,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define VOID void
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
- ], [
+ ]], [[
CHAR c;
SHORT s;
LONG l;
- ],
- tcl_cv_winnt_ignore_void=yes,
- tcl_cv_winnt_ignore_void=no)
+ ]])],
+ [tcl_cv_winnt_ignore_void=yes],
+ [tcl_cv_winnt_ignore_void=no])
)
if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1,
@@ -931,13 +941,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK(for cast to union support,
tcl_cv_cast_to_union,
- AC_TRY_COMPILE([],
- [
+ 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)
+ ]])],
+ [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,
@@ -950,6 +959,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_SUBST(CFLAGS_DEBUG)
AC_SUBST(CFLAGS_OPTIMIZE)
AC_SUBST(CFLAGS_WARNING)
+ AC_SUBST(CFLAGS_NOLTO)
])
#------------------------------------------------------------------------
@@ -1107,7 +1117,7 @@ AC_DEFUN([SC_TCL_CFG_ENCODING], [
AC_DEFUN([SC_EMBED_MANIFEST], [
AC_MSG_CHECKING(whether to embed manifest)
AC_ARG_ENABLE(embedded-manifest,
- AC_HELP_STRING([--enable-embedded-manifest],
+ AS_HELP_STRING([--enable-embedded-manifest],
[embed manifest if possible (default: yes)]),
[embed_ok=$enableval], [embed_ok=yes])