summaryrefslogtreecommitdiffstats
path: root/unix/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'unix/configure.ac')
-rw-r--r--unix/configure.ac92
1 files changed, 34 insertions, 58 deletions
diff --git a/unix/configure.ac b/unix/configure.ac
index d861aa1..aa30233 100644
--- a/unix/configure.ac
+++ b/unix/configure.ac
@@ -4,7 +4,7 @@ dnl generate the file "configure", which is run during Tk installation
dnl to configure the system for the local environment.
AC_INIT([tk],[8.7])
-AC_PREREQ(2.69)
+AC_PREREQ([2.70])
dnl This is only used when included from macosx/configure.ac
m4_ifdef([SC_USE_CONFIG_HEADERS], [
@@ -92,7 +92,7 @@ if test -z "$no_pipe" && test -n "$GCC"; then
AC_CACHE_CHECK([if the compiler understands -pipe],
tcl_cv_cc_pipe, [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
- AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_pipe=yes],[tcl_cv_cc_pipe=no])
CFLAGS=$hold_cflags])
if test $tcl_cv_cc_pipe = yes; then
CFLAGS="$CFLAGS -pipe"
@@ -159,8 +159,7 @@ fi
#--------------------------------------------------------------------
AC_CACHE_CHECK([for fd_set in sys/types], tcl_cv_type_fd_set, [
- AC_TRY_COMPILE([#include <sys/types.h>],[fd_set readMask, writeMask;],
- tcl_cv_type_fd_set=yes, tcl_cv_type_fd_set=no)])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], [[fd_set readMask, writeMask;]])],[tcl_cv_type_fd_set=yes],[tcl_cv_type_fd_set=no])])
tk_ok=$tcl_cv_type_fd_set
if test $tk_ok = no; then
AC_CACHE_CHECK([for fd_mask in sys/select], tcl_cv_grep_fd_mask, [
@@ -180,7 +179,20 @@ fi
#------------------------------------------------------------------------------
AC_CHECK_HEADERS(sys/time.h)
-AC_HEADER_TIME
+m4_warn([obsolete],
+[Update your code to rely only on HAVE_SYS_TIME_H,
+then remove this warning and the obsolete code below it.
+All current systems provide time.h; it need not be checked for.
+Not all systems provide sys/time.h, but those that do, all allow
+you to include it and time.h simultaneously.])dnl
+AC_CHECK_HEADERS_ONCE([sys/time.h])
+# Obsolete code to be removed.
+if test $ac_cv_header_sys_time_h = yes; then
+ AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both <sys/time.h>
+ and <time.h>. This macro is obsolete.])
+fi
+# End of obsolete code.
+
#--------------------------------------------------------------------
# Check for various typedefs and provide substitutes if
@@ -192,46 +204,16 @@ AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UID_T
-AC_CHECK_TYPE([intptr_t], [
- AC_DEFINE([HAVE_INTPTR_T], 1, [Do we have the intptr_t type?])], [
- AC_CACHE_CHECK([for pointer-size signed integer type], tcl_cv_intptr_t, [
- for tcl_cv_intptr_t in "int" "long" "long long" none; do
- if test "$tcl_cv_intptr_t" != none; then
- AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT],
- [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])],
- [tcl_ok=yes], [tcl_ok=no])
- test "$tcl_ok" = yes && break; fi
- done])
- if test "$tcl_cv_intptr_t" != none; then
- AC_DEFINE_UNQUOTED([intptr_t], [$tcl_cv_intptr_t], [Signed integer
- type wide enough to hold a pointer.])
- fi
-])
-AC_CHECK_TYPE([uintptr_t], [
- AC_DEFINE([HAVE_UINTPTR_T], 1, [Do we have the uintptr_t type?])], [
- AC_CACHE_CHECK([for pointer-size unsigned integer type], tcl_cv_uintptr_t, [
- for tcl_cv_uintptr_t in "unsigned int" "unsigned long" "unsigned long long" \
- none; do
- if test "$tcl_cv_uintptr_t" != none; then
- AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT],
- [[sizeof (void *) <= sizeof ($tcl_cv_uintptr_t)]])],
- [tcl_ok=yes], [tcl_ok=no])
- test "$tcl_ok" = yes && break; fi
- done])
- if test "$tcl_cv_uintptr_t" != none; then
- AC_DEFINE_UNQUOTED([uintptr_t], [$tcl_cv_uintptr_t], [Unsigned integer
- type wide enough to hold a pointer.])
- fi
-])
+AC_CHECK_TYPES([intptr_t, uintptr_t],,,[[
+#include <stdint.h>
+]])
#-------------------------------------------
# In OS/390 struct pwd has no pw_gecos field
#-------------------------------------------
AC_CACHE_CHECK([pw_gecos in struct pwd], tcl_cv_pwd_pw_gecos, [
- AC_TRY_COMPILE([#include <pwd.h>],
- [struct passwd pwd; (void)pwd.pw_gecos;],
- tcl_cv_pwd_pw_gecos=yes, tcl_cv_pwd_pw_gecos=no)])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pwd.h>]], [[struct passwd pwd; (void)pwd.pw_gecos;]])],[tcl_cv_pwd_pw_gecos=yes],[tcl_cv_pwd_pw_gecos=no])])
if test $tcl_cv_pwd_pw_gecos = yes; then
AC_DEFINE(HAVE_PW_GECOS, 1, [Does struct password have a pw_gecos field?])
fi
@@ -243,8 +225,7 @@ fi
if test "`uname -s`" = "Darwin" ; then
AC_MSG_CHECKING([whether to use Aqua])
AC_ARG_ENABLE(aqua,
- AC_HELP_STRING([--enable-aqua=yes|no],
- [use Aqua windowingsystem on Mac OS X (default: no)]),
+ AS_HELP_STRING([--enable-aqua=yes|no],[use Aqua windowingsystem on Mac OS X (default: no)]),
[tk_aqua=$enableval], [tk_aqua=no])
if test $tk_aqua = yes -o $tk_aqua = cocoa; then
tk_aqua=yes
@@ -270,8 +251,7 @@ if test "`uname -s`" = "Darwin" ; then
done
CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
- AC_TRY_LINK([#include <X11/Xlib.h>], [XrmInitialize();],
- tcl_cv_lib_x11_64=yes, tcl_cv_lib_x11_64=no)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]], [[XrmInitialize();]])],[tcl_cv_lib_x11_64=yes],[tcl_cv_lib_x11_64=no])
for v in CFLAGS CPPFLAGS LDFLAGS; do
eval $v'="$hold_'$v'"'
done])
@@ -290,15 +270,14 @@ if test "`uname -s`" = "Darwin" ; then
AC_CACHE_CHECK([if ld accepts -weak-l flag], tcl_cv_ld_weak_l, [
hold_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-weak-lm"
- AC_TRY_LINK([#include <math.h>], [double f = sin(1.0);],
- tcl_cv_ld_weak_l=yes, tcl_cv_ld_weak_l=no)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[double f = sin(1.0);]])],[tcl_cv_ld_weak_l=yes],[tcl_cv_ld_weak_l=no])
LDFLAGS=$hold_ldflags])
fi
AC_CHECK_HEADERS(AvailabilityMacros.h)
if test "$ac_cv_header_AvailabilityMacros_h" = yes; then
AC_CACHE_CHECK([if weak import is available], tcl_cv_cc_weak_import, [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
#error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
@@ -307,8 +286,7 @@ if test "`uname -s`" = "Darwin" ; then
#error MAC_OS_X_VERSION_MIN_REQUIRED < 1020
#endif
int rand(void) __attribute__((weak_import));
- ], [rand();],
- tcl_cv_cc_weak_import=yes, tcl_cv_cc_weak_import=no)
+ ]], [[rand();]])],[tcl_cv_cc_weak_import=yes],[tcl_cv_cc_weak_import=no])
CFLAGS=$hold_cflags])
if test $tcl_cv_cc_weak_import = yes; then
AC_DEFINE(HAVE_WEAK_IMPORT, 1, [Is weak import available?])
@@ -316,7 +294,7 @@ if test "`uname -s`" = "Darwin" ; then
AC_CACHE_CHECK([if Darwin SUSv3 extensions are available],
tcl_cv_cc_darwin_c_source, [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
#error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
@@ -326,7 +304,7 @@ if test "`uname -s`" = "Darwin" ; then
#endif
#define _DARWIN_C_SOURCE 1
#include <sys/cdefs.h>
- ],,tcl_cv_cc_darwin_c_source=yes, tcl_cv_cc_darwin_c_source=no)
+ ]], [[]])],[tcl_cv_cc_darwin_c_source=yes],[tcl_cv_cc_darwin_c_source=no])
CFLAGS=$hold_cflags])
if test $tcl_cv_cc_darwin_c_source = yes; then
AC_DEFINE(_DARWIN_C_SOURCE, 1,
@@ -424,15 +402,15 @@ if test -d /usr/include/mit -a $tk_aqua = no; then
CFLAGS="$CFLAGS -I/usr/include/mit"
tk_oldLibs=$LIBS
LIBS="$LIBS -lX11-mit"
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <X11/Xlib.h>
- ], [
+ ]], [[
XOpenDisplay(0);
- ], [
+ ]])],[
AC_MSG_RESULT([yes])
XLIBSW="-lX11-mit"
XINCLUDES="-I/usr/include/mit"
- ], AC_MSG_RESULT([no]))
+ ],[AC_MSG_RESULT(no)])
CFLAGS=$tk_oldCFlags
LIBS=$tk_oldLibs
fi
@@ -444,8 +422,7 @@ fi
if test $tk_aqua = no; then
AC_MSG_CHECKING([whether to use xft])
AC_ARG_ENABLE(xft,
- AC_HELP_STRING([--enable-xft],
- [use freetype/fontconfig/xft (default: on)]),
+ AS_HELP_STRING([--enable-xft],[use freetype/fontconfig/xft (default: on)]),
[enable_xft=$enableval], [enable_xft="default"])
XFT_CFLAGS=""
XFT_LIBS=""
@@ -540,8 +517,7 @@ if test $tk_aqua = no; then
xss_lib_found=no
AC_MSG_CHECKING([whether to try to use XScreenSaver])
AC_ARG_ENABLE(xss,
- AC_HELP_STRING([--enable-xss],
- [use XScreenSaver for activity timer (default: on)]),
+ AS_HELP_STRING([--enable-xss],[use XScreenSaver for activity timer (default: on)]),
[enable_xss=$enableval], [enable_xss=yes])
if test "$enable_xss" = "no" ; then
AC_MSG_RESULT([$enable_xss])