From f9e2925711ddf6f1acc994cb233cf91c8bdb11b2 Mon Sep 17 00:00:00 2001 From: das Date: Sun, 26 Nov 2006 06:05:11 +0000 Subject: * tcl.m4 (Linux): --enable-64bit support. [Patch 1597389], [Bug 1230558] * configure: autoconf-2.59 --- ChangeLog | 5 +++ unix/configure | 120 +++++++++++++++++++++++++++++++++++++++++++-------------- unix/tcl.m4 | 13 ++++++- 3 files changed, 109 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index e20b05d..704491b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-11-26 Daniel Steffen + + * tcl.m4 (Linux): --enable-64bit support. [Patch 1597389], [Bug 1230558] + * configure: autoconf-2.59 + 2006-11-24 Jeff Hobbs * macosx/tkMacOSXInit.c (TkpInit): only set tcl_interactive 1 if diff --git a/unix/configure b/unix/configure index 911751a..d7d57c5 100755 --- a/unix/configure +++ b/unix/configure @@ -5367,7 +5367,7 @@ echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" - SHLIB_LD="${CC} -shared" + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" @@ -5376,6 +5376,70 @@ echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi + if test $do64bit = yes; then + echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_m64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + 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_cc_m64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_m64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 +echo "${ECHO_T}$tcl_cv_cc_m64" >&6 + if test $tcl_cv_cc_m64 = yes; then + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + fi + fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The @@ -9376,20 +9440,20 @@ fi; XFT_CFLAGS="" XFT_LIBS="" if test "$enable_xft" = "no" ; then - echo "$as_me:$LINENO: result: $enable_xft" >&5 + echo "$as_me:$LINENO: result: $enable_xft" >&5 echo "${ECHO_T}$enable_xft" >&6 else - found_xft="yes" - XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no" - XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no" - if test "$found_xft" = "no" ; then - found_xft=yes - XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" - XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" - fi + found_xft="yes" + XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no" + XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no" + if test "$found_xft" = "no" ; then + found_xft=yes + XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" + XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" + fi echo "$as_me:$LINENO: result: $found_xft" >&5 echo "${ECHO_T}$found_xft" >&6 - if test "$found_xft" = "yes" ; then + if test "$found_xft" = "yes" ; then tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" tk_oldLibs=$LIBS @@ -9446,15 +9510,15 @@ if test $ac_cv_header_X11_Xft_Xft_h = yes; then : else - found_xft=no + found_xft=no fi - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs - fi - if test "$found_xft" = "yes" ; then + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs + fi + if test "$found_xft" = "yes" ; then tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" tk_oldLibs=$LIBS @@ -9533,30 +9597,30 @@ _ACEOF else - found_xft=no + found_xft=no fi - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs - fi - if test "$found_xft" = "no" ; then - if test "$enable_xft" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: Can't find xft configuration, or xft is unusable" >&5 + CFLAGS=$tk_oldCFlags + LIBS=$tk_oldLibs + fi + if test "$found_xft" = "no" ; then + if test "$enable_xft" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: Can't find xft configuration, or xft is unusable" >&5 echo "$as_me: WARNING: Can't find xft configuration, or xft is unusable" >&2;} - fi - enable_xft=no - fi + fi + enable_xft=no + fi fi if test $enable_xft = "yes" ; then - UNIX_FONT_OBJS=tkUnixRFont.o + UNIX_FONT_OBJS=tkUnixRFont.o cat >>confdefs.h <<\_ACEOF #define HAVE_XFT 1 _ACEOF else - UNIX_FONT_OBJS=tkUnixFont.o + UNIX_FONT_OBJS=tkUnixFont.o fi diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 8c900dd..ff09cd0 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1402,7 +1402,7 @@ dnl AC_CHECK_TOOL(AR, ar) # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" - SHLIB_LD="${CC} -shared" + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" @@ -1411,6 +1411,17 @@ dnl AC_CHECK_TOOL(AR, ar) if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi + if test $do64bit = yes; then + AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_m64 = yes; then + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + fi + fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The -- cgit v0.12