Skip to content

Commit

Permalink
Clean up platform.sh
Browse files Browse the repository at this point in the history
Remove TCL_VER, which was not being set properly due to a syntax error
and which is a duplicate definition of TCL_SUFFIX anyway.  And include
the suffix on the macOS lib flag, just to ensure that the right library
is being linked.
  • Loading branch information
quark17 committed May 28, 2024
1 parent 353eeb2 commit e9e4ac6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,9 @@ else
fi

if [ "$1" = "tcllibs" ] ; then
TCL_VER=`echo 'catch { puts [info tclversion]; exit 0}; exit 1' | ${TCLSH}`

# Avoid Homebrew's install of Tcl on Mac
if [ ${OSTYPE} = "Darwin" ] ; then
echo -ltcl$(TCL_VER)
echo -ltcl${TCL_SUFFIX}
exit 0
fi

Expand All @@ -165,7 +163,7 @@ if [ "$1" = "tcllibs" ] ; then

# If pkg-config doesn't work, try some well-known locations
for L in /usr/lib /usr/lib64 /usr/local/lib ; do
for V in ${TCL_VER} ${TCL_SUFFIX} ${TCL_ALT_SUFFIX} ; do
for V in ${TCL_SUFFIX} ${TCL_ALT_SUFFIX} ; do
if [ -f "${L}/libtcl${V}.${LIB_SUFFIX}" ] ; then
echo -L${L} -ltcl${V}
exit 0
Expand All @@ -174,7 +172,7 @@ if [ "$1" = "tcllibs" ] ; then
done
# If we're Linux, look for multiarch things
if [ "${OSTYPE}" = "Linux" ] ; then
for V in ${TCL_VER} ${TCL_SUFFIX} ${TCL_ALT_SUFFIX} ; do
for V in ${TCL_SUFFIX} ${TCL_ALT_SUFFIX} ; do
if [ -f "/usr/lib/${MACHTYPE}-linux-gnu/libtcl${V}.${LIB_SUFFIX}" ] ; then
echo -ltcl${V}
exit 0
Expand Down

0 comments on commit e9e4ac6

Please sign in to comment.