summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2007-10-15 07:21:53 (GMT)
committerdas <das>2007-10-15 07:21:53 (GMT)
commit56d709fee2980dc323eb15baf1ef56e0dedd8d6a (patch)
tree28491d480f508696969973680f01a3b82d1531bf
parentc01f5d95fcb794f6efcc16569809ef24e6553cf5 (diff)
downloadtk-56d709fee2980dc323eb15baf1ef56e0dedd8d6a.zip
tk-56d709fee2980dc323eb15baf1ef56e0dedd8d6a.tar.gz
tk-56d709fee2980dc323eb15baf1ef56e0dedd8d6a.tar.bz2
* unix/configure.in (Darwin): add support for 64-bit X11.
* unix/configure: autoconf-2.59
-rwxr-xr-xunix/configure92
-rw-r--r--unix/configure.in29
2 files changed, 106 insertions, 15 deletions
diff --git a/unix/configure b/unix/configure
index 28f108d..1c51c1c 100755
--- a/unix/configure
+++ b/unix/configure
@@ -8589,10 +8589,82 @@ echo "$as_me: WARNING: Aqua requires Mac OS X 10.2 or later" >&2;}
fi
echo "$as_me:$LINENO: result: $tk_aqua" >&5
echo "${ECHO_T}$tk_aqua" >&6
- # remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit fat
- # builds, as neither TkAqua nor TkX11 can be built for 64-bit at present.
- test "$fat_32_64" = yes && for v in CFLAGS CPPFLAGS LDFLAGS; do
- eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done
+ if test "$fat_32_64" = yes; then
+ if test $tk_aqua = no; then
+ echo "$as_me:$LINENO: checking for 64-bit X11" >&5
+echo $ECHO_N "checking for 64-bit X11... $ECHO_C" >&6
+if test "${tcl_cv_lib_x11_64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
+ LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_lib_x11_64=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_lib_x11_64=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_lib_x11_64" >&5
+echo "${ECHO_T}$tcl_cv_lib_x11_64" >&6
+ fi
+ # remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit
+ # fat builds if configuration does not support 64-bit.
+ if test $tk_aqua = yes -o "$tcl_cv_lib_x11_64" = no; then
+ { echo "$as_me:$LINENO: Removing 64-bit architectures from compiler & linker flags" >&5
+echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;}
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
+ done
+ fi
+ fi
if test $tk_aqua = no; then
# check if weak linking whole libraries is possible.
echo "$as_me:$LINENO: checking if ld accepts -weak-l flag" >&5
@@ -8780,7 +8852,7 @@ ac_x_header_dirs='
/usr/openwin/share/include'
if test "$ac_x_includes" = no; then
- # Guess where to find include files, by looking for Xlib.h.
+ # Guess where to find include files, by looking for Intrinsic.h.
# First, try using that file with no special directory specified.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -8788,7 +8860,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -8815,7 +8887,7 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
for ac_dir in $ac_x_header_dirs; do
- if test -r "$ac_dir/X11/Xlib.h"; then
+ if test -r "$ac_dir/X11/Intrinsic.h"; then
ac_x_includes=$ac_dir
break
fi
@@ -8829,18 +8901,18 @@ if test "$ac_x_libraries" = no; then
# See if we find them without any special options.
# Don't add to $LIBS permanently.
ac_save_LIBS=$LIBS
- LIBS="-lX11 $LIBS"
+ LIBS="-lXt $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
int
main ()
{
-XrmInitialize ()
+XtMalloc (0)
;
return 0;
}
diff --git a/unix/configure.in b/unix/configure.in
index 1c94235..4b26a99 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.140 2007/10/02 18:28:15 dgp Exp $
+# RCS: @(#) $Id: configure.in,v 1.141 2007/10/15 07:21:53 das Exp $
AC_INIT([tk],[8.5])
AC_PREREQ(2.59)
@@ -256,10 +256,29 @@ if test "`uname -s`" = "Darwin" ; then
fi
fi
AC_MSG_RESULT([$tk_aqua])
- # remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit fat
- # builds, as neither TkAqua nor TkX11 can be built for 64-bit at present.
- test "$fat_32_64" = yes && for v in CFLAGS CPPFLAGS LDFLAGS; do
- eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done
+ if test "$fat_32_64" = yes; then
+ if test $tk_aqua = no; then
+ AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ 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)
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done])
+ fi
+ # remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit
+ # fat builds if configuration does not support 64-bit.
+ if test $tk_aqua = yes -o "$tcl_cv_lib_x11_64" = no; then
+ AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags])
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
+ done
+ fi
+ 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, [