Re: Tk8.5: Tk_PhotoSetSize vs Tk_PhotoSetSize_Panic
- From: sbromle <sam@xxxxxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 09:26:02 -0800 (PST)
On Feb 29, 1:25 pm, sbromle <s...@xxxxxxxxxxxxxx> wrote:
On Feb 29, 1:04 pm, Donald G Porter <d...@xxxxxxxx> wrote:
sbromle wrote:
I'm getting a crash moving from Tk8.4 to Tk8.4 on the call
Tk_PhotoSetSize().
I assume that's a typo and you are migrating from Tk 8.4 to Tk 8.5.
See TIP 116 (http://tip.tcl.tk/116) and the Tk 8.5 documentation
for Tk_PhotoSetSize() (http://www.tcl.tk/man/tcl8.5/TkLib/FindPhoto.htm)
for details on how to use the -DUSE_PANIC_ON_PHOTO_ALLOC_FAILURE
directive as a migration tool when compiling your code.
--
| Don Porter Mathematical and Computational Sciences Division |
| donald.por...@xxxxxxxx Information Technology Laboratory |
|http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
Thank you kindly Don,
My problem was that I had a -I/usr/include/tcl8.4 line in my AM_CFLAGS
definition left over.
Now I'm faced with another issue. The tcl8.5.m4 macro allows automake
to
define TCL_LIBS, etc, but I don't see where TCL_INCLUDES (or similar)
would
be defined. Is there a way to do that with the standard tcl8.5.m4
autotools
macros? Or must I fully adopt TEA3 (or write my own m4 macro)?
Is there is an easy way to get the -I/usr/include/tcl8.5 in a variable
through the use of --with-tcl=/usr/lib/tcl8.5 flag (used to find
tclConfig.sh)?
The existing tcl8.5.m4 file contains a macro SC_LOAD_TCLCONFIG that
sets TCL_LIB_SPEC but not TCL_INCLUDE_SPEC. Is there a reason why
this is not done? I.e, is it safe / does it make sense/ for me to just
add
a bit to that to also define and AC_SUBST(TCL_INCLUDE_SPEC) ?
Thank you!
Sam
So I've created a very slightly modified version of SC_LOAD_TCLCONFIG
that sets up TCL_INCLUDE_SPEC in addition to TCL_LIB_SPEC, etc.
I put this in my acincludes.m4 and just use that instead. Now my
--with-tcl=/usr/lib/tcl8.5 config argument also sets up the include
directory.
Question: Is this a Bad Thing(TM)? I wonder simply because I can only
assume that most people will just start by using the shipped tcl8.5.m4
file
when compiling extenstions, without looking into TEA. So is there a
reason
why auto-exporting TCL_INCLUDE_SPEC is not done anywhere in tcl8.5.m4?
Below is my modification.
Cheers,
Sam
acinclude.m4:
#------------------------------------------------------------------------
# SC_LOAD_TCLCONFIG_WITH_INCLUDES --
#
# Like the standard SCL_LOAD_TCLCONFIG, that is:
# Load the tclConfig.sh file
# but in addition, set the TCL_INCLUDE_SPEC attribute as well.
#
# Arguments:
#
# Requires the following vars to be set:
# TCL_BIN_DIR
#
# Results:
#
# Subst the following vars:
# TCL_BIN_DIR
# TCL_SRC_DIR
# TCL_LIB_FILE
#
# and
#
# TCL_INCLUDE_SPEC
#
#------------------------------------------------------------------------
AC_DEFUN([SC_LOAD_TCLCONFIG_WITH_INCLUDES], [
AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
AC_MSG_RESULT([loading])
. "${TCL_BIN_DIR}/tclConfig.sh"
else
AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
fi
# eval is required to do the TCL_DBGX substitution
eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
# If the TCL_BIN_DIR is the build directory (not the install
directory),
# then set the common variable name to the value of the build
variables.
# For example, the variable TCL_LIB_SPEC will be set to the value
# of TCL_BUILD_LIB_SPEC. An extension should make use of
TCL_LIB_SPEC
# instead of TCL_BUILD_LIB_SPEC since it will work with both an
# installed and uninstalled version of Tcl.
if test -f "${TCL_BIN_DIR}/Makefile" ; then
TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
elif test "`uname -s`" = "Darwin"; then
# If Tcl was built as a framework, attempt to use the libraries
# from the framework at the given location so that linking works
# against Tcl.framework installed in an arbitary location.
case ${TCL_DEFS} in
*TCL_FRAMEWORK*)
if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
for i in "`cd ${TCL_BIN_DIR}; pwd`" \
"`cd ${TCL_BIN_DIR}/../..; pwd`"; do
if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}"
break
fi
done
fi
if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
fi
;;
esac
fi
# eval is required to do the TCL_DBGX substitution
eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
eval "TCL_INCLUDE_SPEC=\"${TCL_INCLUDE_SPEC}\""
eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_PATCH_LEVEL)
AC_SUBST(TCL_BIN_DIR)
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TCL_LIB_FILE)
AC_SUBST(TCL_LIB_FLAG)
AC_SUBST(TCL_LIB_SPEC)
AC_SUBST(TCL_INCLUDE_SPEC)
AC_SUBST(TCL_STUB_LIB_FILE)
AC_SUBST(TCL_STUB_LIB_FLAG)
AC_SUBST(TCL_STUB_LIB_SPEC)
])
.
- References:
- Tk8.5: Tk_PhotoSetSize vs Tk_PhotoSetSize_Panic
- From: sbromle
- Re: Tk8.5: Tk_PhotoSetSize vs Tk_PhotoSetSize_Panic
- From: Donald G Porter
- Re: Tk8.5: Tk_PhotoSetSize vs Tk_PhotoSetSize_Panic
- From: sbromle
- Tk8.5: Tk_PhotoSetSize vs Tk_PhotoSetSize_Panic
- Prev by Date: Re: New question on strings
- Next by Date: Re: Procedure for percent of a value
- Previous by thread: Re: Tk8.5: Tk_PhotoSetSize vs Tk_PhotoSetSize_Panic
- Next by thread: <treectrlWidget> item bbox doesn't work
- Index(es):
Relevant Pages
|