Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(WIP) Update tcl.m4 #1616

Closed
wants to merge 7 commits into from
2 changes: 1 addition & 1 deletion aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ AC_DEFUN([EGG_TCL_TCLCONFIG],
if test "x$TCLLIBFN" = x; then
AC_MSG_NOTICE([Autoconfiguring Tcl with tclConfig.sh])
egg_tcl_changed="yes"
TEA_INIT("3.10")
TEA_INIT("3.13")
TEA_PATH_TCLCONFIG
TEA_LOAD_TCLCONFIG
TEA_TCL_LINK_LIBS
Expand Down
128 changes: 95 additions & 33 deletions m4/tcl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,11 @@

AC_PREREQ([2.71])

dnl TEA extensions pass us the version of TEA they think they
dnl are compatible with (must be set in TEA_INIT below)
dnl TEA_VERSION="3.10"

# Possible values for key variables defined:
#
# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem')
# PRACTCL_WINDOWINGSYSTEM - windows cocoa hitheme x11 sdl
# TEA_PLATFORM - windows unix
# TEA_TK_EXTENSION - True if this is a Tk extension
# TEACUP_OS - windows macosx linux generic
# TEACUP_TOOLSET - Toolset in use (gcc,mingw,msvc,llvm)
# TEACUP_PROFILE - win32
#

#------------------------------------------------------------------------
Expand Down Expand Up @@ -98,8 +90,9 @@ AC_DEFUN([TEA_PATH_TCLCONFIG], [
# we reset no_tcl in case something fails here
no_tcl=true
AC_ARG_WITH(tcl,
AS_HELP_STRING([--with-tcl],[directory containing tcl configuration (tclConfig.sh)]),
with_tclconfig="${withval}")
AS_HELP_STRING([--with-tcl],
[directory containing tcl configuration (tclConfig.sh)]),
[with_tclconfig="${withval}"])
AC_MSG_CHECKING([for Tcl configuration])
AC_CACHE_VAL(ac_cv_c_tclconfig,[

Expand Down Expand Up @@ -183,9 +176,9 @@ AC_DEFUN([TEA_PATH_TCLCONFIG], [
`ls -d /usr/pkg/lib 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
`ls -d /usr/lib/tcl[[8-9]].[[0-9]] 2>/dev/null` \
`ls -d /usr/local/lib/tcl[[8-9]].[[0-9]] 2>/dev/null` \
`ls -d /usr/local/lib/tcl/tcl[[8-9]].[[0-9]] 2>/dev/null` \
`ls -d /usr/lib/tcl[[8-9]].[[0-9]] 2>/dev/null` \
`ls -d /usr/local/lib/tcl[[8-9]].[[0-9]] 2>/dev/null` \
`ls -d /usr/local/lib/tcl/tcl[[8-9]].[[0-9]] 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig="`(cd $i; pwd)`"
Expand Down Expand Up @@ -225,6 +218,42 @@ AC_DEFUN([TEA_PATH_TCLCONFIG], [
fi
])

#--------------------------------------------------------------------
# TEA_CONFIG_SYSTEM
#
# Determine what the system is (some things cannot be easily checked
# on a feature-driven basis, alas). This can usually be done via the
# "uname" command.
#
# Arguments:
# none
#
# Results:
# Defines the following var:
#
# system - System/platform/version identification code.
#--------------------------------------------------------------------

AC_DEFUN([TEA_CONFIG_SYSTEM], [
AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
# TEA specific:
if test "${TEA_PLATFORM}" = "windows" ; then
tcl_cv_sys_version=windows
else
tcl_cv_sys_version=`uname -s`-`uname -r`
if test "$?" -ne 0 ; then
AC_MSG_WARN([can't find uname command])
tcl_cv_sys_version=unknown
else
if test "`uname -s`" = "AIX" ; then
tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
fi
fi
fi
])
system=$tcl_cv_sys_version
])

##
## Here ends the standard Tcl configuration bits and starts the
## TEA specific functions
Expand Down Expand Up @@ -260,32 +289,23 @@ AC_DEFUN([TEA_PATH_TCLCONFIG], [
#------------------------------------------------------------------------

AC_DEFUN([TEA_INIT], [
# TEA extensions pass this us the version of TEA they think they
# are compatible with.
TEA_VERSION="3.10"
AC_MSG_CHECKING([for correct TEA configuration])
TEA_VERSION="3.13"

AC_MSG_CHECKING([TEA configuration])
if test x"${PACKAGE_NAME}" = x ; then
AC_MSG_ERROR([
The PACKAGE_NAME variable must be defined by your TEA configure.ac])
fi
if test x"$1" = x ; then
AC_MSG_ERROR([
TEA version not specified.])
elif test "$1" != "${TEA_VERSION}" ; then
AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"])
else
AC_MSG_RESULT([ok (TEA ${TEA_VERSION})])
fi
AC_MSG_RESULT([ok (TEA ${TEA_VERSION})])

# If the user did not set CFLAGS, set it now to keep macros
# like AC_PROG_CC and AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) from adding "-g -O2".
# like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2".
if test "${CFLAGS+set}" != "set" ; then
CFLAGS=""
fi
TEA_TK_EXTENSION=0
AC_SUBST(TEA_TK_EXTENSION)

case "`uname -s`" in
*win32*|*WIN32*|*MINGW32_*)
*win32*|*WIN32*|*MINGW32_*|*MINGW64_*)
AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo)
EXEEXT=".exe"
TEA_PLATFORM="windows"
Expand Down Expand Up @@ -338,6 +358,9 @@ TEA version not specified.])
AC_SUBST(PKG_INCLUDES)
AC_SUBST(PKG_LIBS)
AC_SUBST(PKG_CFLAGS)

# Configure the installer.
TEA_INSTALLER
])

#------------------------------------------------------------------------
Expand All @@ -356,8 +379,8 @@ TEA version not specified.])
# TCL_BIN_DIR
# TCL_SRC_DIR
# TCL_LIB_FILE
# TCL_ZIP_FILE
# TCL_ZIPFS_SUPPORT
# TCL_ZIP_FILE
# TCL_ZIPFS_SUPPORT
#------------------------------------------------------------------------

AC_DEFUN([TEA_LOAD_TCLCONFIG], [
Expand Down Expand Up @@ -437,8 +460,8 @@ AC_DEFUN([TEA_LOAD_TCLCONFIG], [
CYGPATH=echo
],[
TEA_PLATFORM="windows"
AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo)
])
AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo) ]
)
CC=$hold_cc
AC_MSG_RESULT($TEA_PLATFORM)

Expand Down Expand Up @@ -546,3 +569,42 @@ AC_DEFUN([TEA_TCL_LINK_LIBS], [
AC_SUBST(TCL_LIBS)
AC_SUBST(MATH_LIBS)
])

#------------------------------------------------------------------------
# TEA_INSTALLER --
#
# Configure the installer.
#
# Arguments:
# none
#
# Results:
# Substitutes the following vars:
# INSTALL
# INSTALL_DATA_DIR
# INSTALL_DATA
# INSTALL_PROGRAM
# INSTALL_SCRIPT
# INSTALL_LIBRARY
#------------------------------------------------------------------------

AC_DEFUN([TEA_INSTALLER], [
INSTALL='$(SHELL) $(srcdir)/tclconfig/install-sh -c'
INSTALL_DATA_DIR='${INSTALL} -d -m 755'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL} -m 755'
INSTALL_SCRIPT='${INSTALL} -m 755'

TEA_CONFIG_SYSTEM
case $system in
HP-UX-*) INSTALL_LIBRARY='${INSTALL} -m 755' ;;
*) INSTALL_LIBRARY='${INSTALL} -m 644' ;;
esac

AC_SUBST(INSTALL)
AC_SUBST(INSTALL_DATA_DIR)
AC_SUBST(INSTALL_DATA)
AC_SUBST(INSTALL_PROGRAM)
AC_SUBST(INSTALL_SCRIPT)
AC_SUBST(INSTALL_LIBRARY)
])
Loading