summaryrefslogtreecommitdiffstats
path: root/unix/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'unix/configure.in')
-rw-r--r--unix/configure.in74
1 files changed, 46 insertions, 28 deletions
diff --git a/unix/configure.in b/unix/configure.in
index a9a804c..8182d93 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tk installation
dnl to configure the system for the local environment.
#
-# RCS: @(#) $Id: configure.in,v 1.119 2006/05/04 14:11:50 dgp Exp $
+# RCS: @(#) $Id: configure.in,v 1.120 2006/07/20 06:25:20 das Exp $
AC_INIT([tk],[8.5])
AC_PREREQ(2.59)
@@ -177,14 +177,14 @@ fi
# special flag.
#--------------------------------------------------------------------
-AC_CACHE_CHECK([for fd_set in sys/types], tcl_cv_type_fd_set,
+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))
+ 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,
+ AC_CACHE_CHECK([for fd_mask in sys/select], tcl_cv_grep_fd_mask, [
AC_EGREP_HEADER(fd_mask, sys/select.h,
- tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing))
+ tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing)])
if test $tcl_cv_grep_fd_mask = present; then
AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Should we include <sys/select.h>?])
tk_ok=yes
@@ -224,10 +224,10 @@ AC_TYPE_UID_T
# In OS/390 struct pwd has no pw_gecos field
#-------------------------------------------
-AC_CACHE_CHECK([pw_gecos in struct pwd], tcl_cv_pwd_pw_gecos,
+AC_CACHE_CHECK([pw_gecos in struct pwd], tcl_cv_pwd_pw_gecos, [
AC_TRY_COMPILE([#include <pwd.h>],
[struct passwd pwd; pwd.pw_gecos;],
- tcl_cv_pwd_pw_gecos=yes, tcl_cv_pwd_pw_gecos=no))
+ 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
@@ -237,24 +237,40 @@ fi
#--------------------------------------------------------------------
if test "`uname -s`" = "Darwin" ; then
+ AC_MSG_CHECKING([whether to use Aqua])
AC_ARG_ENABLE(aqua,
- AC_HELP_STRING([--enable-aqua],
- [enable Aqua windowingsystem on Mac OS X (default: off)]),
- [tk_aqua=$enableval], [tk_aqua=no])
+ AC_HELP_STRING([--enable-aqua],
+ [use Aqua windowingsystem on Mac OS X (default: off)]),
+ [tk_aqua=$enableval], [tk_aqua=no])
if test $tk_aqua = yes; then
- if test $tcl_corefoundation = no; then
- AC_MSG_WARN([Aqua can only be used when CoreFoundation is available])
- tk_aqua=no
- elif test ! -d /System/Library/Frameworks/Carbon.framework; then
- AC_MSG_WARN([Aqua can only be used when Carbon is available])
- tk_aqua=no
- fi
+ if test $tcl_corefoundation = no; then
+ AC_MSG_WARN([Aqua can only be used when CoreFoundation is available])
+ tk_aqua=no
+ fi
+ if test ! -d /System/Library/Frameworks/Carbon.framework; then
+ AC_MSG_WARN([Aqua can only be used when Carbon is available])
+ tk_aqua=no
+ fi
+ if test "`uname -r | awk -F. '{print [$]1}'`" -lt 6; then
+ AC_MSG_WARN([Aqua requires Mac OS X 10.2 or later])
+ tk_aqua=no
+ fi
fi
+ AC_MSG_RESULT([$tk_aqua])
if test $do64bit_ok = no ; then
# remove -arch ppc64 from CFLAGS for fat builds as neither Aqua nor X11
# can be built for 64bit at present (no 64bit GUI libraries).
CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/g'`"
fi
+ if test $tk_aqua = no; then
+ # check if weak linking whole libraries is possible.
+ 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)
+ LDFLAGS=$hold_ldflags])
+ fi
else
tk_aqua=no
fi
@@ -368,7 +384,6 @@ fi
#--------------------------------------------------------------------
if test $tk_aqua = no; then
-
tk_oldCFlags=$CFLAGS
CFLAGS="$CFLAGS $XINCLUDES"
tk_oldLibs=$LIBS
@@ -384,7 +399,13 @@ if test $tk_aqua = no; then
xss_lib_found=yes
], [
AC_CHECK_LIB(Xss,XScreenSaverQueryInfo, [
- XLIBSW="$XLIBSW -lXss -lXext"
+ if test "$tcl_cv_ld_weak_l" = yes; then
+ # On Darwin, weak link libXss if possible,
+ # as it is only available on Tiger or later.
+ XLIBSW="$XLIBSW -weak-lXss -lXext"
+ else
+ XLIBSW="$XLIBSW -lXss -lXext"
+ fi
xss_lib_found=yes
],, -lXext)
])
@@ -401,15 +422,14 @@ 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: off)]),
- [enable_xft=$enableval],
- [enable_xft="no"])
-
+ AC_HELP_STRING([--enable-xft],
+ [use freetype/fontconfig/xft (default: off)]),
+ [enable_xft=$enableval], [enable_xft="no"])
XFT_CFLAGS=""
XFT_LIBS=""
if test "$enable_xft" = "yes" ; then
- AC_MSG_CHECKING([for xft configuration])
XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || enable_xft="no"
XFT_LIBS=`xft-config --libs 2>/dev/null` || enable_xft="no"
if test "$enable_xft" = "no" ; then
@@ -417,19 +437,17 @@ if test $tk_aqua = no; then
XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || enable_xft="no"
XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || enable_xft="no"
fi
- if test "$enable_xft" = "yes" ; then
- AC_MSG_RESULT([ok])
- else
+ if test "$enable_xft" == "no" ; then
AC_MSG_WARN([Can't find xft configuration])
fi
fi
+ AC_MSG_RESULT([$enable_xft])
if test $enable_xft = "yes" ; then
UNIX_FONT_OBJS=tkUnixRFont.o
AC_DEFINE(HAVE_XFT, 1, [Have we turned on XFT (antialiased fonts)?])
else
UNIX_FONT_OBJS=tkUnixFont.o
fi
-
AC_SUBST(XFT_CFLAGS)
AC_SUBST(XFT_LIBS)
AC_SUBST(UNIX_FONT_OBJS)