Skip to content

Commit

Permalink
Issue #722: Support local TCL installs added with TCL_PKG_CONFIG_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Sep 5, 2024
1 parent fcf086e commit 302255a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 30 deletions.
39 changes: 22 additions & 17 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -4344,7 +4344,7 @@ fi
if test ${with_moduleAutoHandling+y}
then :
withval=$with_moduleAutoHandling; MODULE_AUTO_HANDLING="$withval"
MODULE_AUTO_HANDLING=`echo $FAST_TCL_INTERP | tr '[:upper:]' '[:lower:]'`
MODULE_AUTO_HANDLING=`echo $MODULE_AUTO_HANDLING | tr '[:upper:]' '[:lower:]'`
VALID_YN $MODULE_AUTO_HANDLING "--with-moduleAutoHandling=ans: ans must be yes or no"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: MODULE_AUTO_HANDLING=$with-moduleAutoHandling" >&5
printf "%s\n" "MODULE_AUTO_HANDLING=$with-moduleAutoHandling" >&6; }
Expand Down Expand Up @@ -4455,20 +4455,7 @@ fi
if test "$FAST_TCL_INTERP" = yes ; then
OS=$(uname -s)
if test "$OS" = Darwin ; then
DIR=$(xcrun --show-sdk-path)
TCL_INCLUDE="-I${DIR}/usr/include"
else
for i in "" tcl tcl8.8 tcl8.7 tcl8.6 tcl8.5; do
if test -f /usr/include/$i/tcl.h ; then
TCL_INCLUDE="-I/usr/include/$i"
break;
fi
done
fi
if test -z "$TCL_INCLUDE" ; then
# Extract the first word of "pkg-config", so it can be a program name with args.
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
Expand Down Expand Up @@ -4514,6 +4501,24 @@ printf "%s\n" "no" >&6; }
fi
if test -n "$TCL_PKG_CONFIG_DIR" ; then
export PKG_CONFIG_PATH=$TCL_PKG_CONFIG_DIR
TCL_INCLUDE=`$pkgConfig --cflags-only-I tcl 2> /dev/null`
TCL_LIBS=`$pkgConfig --libs tcl`
echo TCL_INCLUDE: $TCL_INCLUDE
elif test "$OS" = Darwin ; then
DIR=$(xcrun --show-sdk-path)
TCL_INCLUDE="-I${DIR}/usr/include"
else
for i in "" tcl tcl8.8 tcl8.7 tcl8.6 tcl8.5; do
if test -f /usr/include/$i/tcl.h ; then
TCL_INCLUDE="-I/usr/include/$i"
break;
fi
done
fi
if test -z "$TCL_INCLUDE" ; then
if ! test x$pkgConfig = "x"; then
for i in tcl tcl8.8 tcl8.7 tcl8.6 tcl8.5; do
$pkgConfig --exists $i
Expand Down Expand Up @@ -4570,7 +4575,7 @@ fi
if test "$ac_cv_header_tcl_h" != yes ; then
rm -f makefile
FOUND_ERROR=yes
MSG="Unable to build Lmod without tcl.h. Please install the tcl devel package or configure --with-fastTCLInterp=no to not require tcl.h"
MSG="Unable to build Lmod without tcl.h. Please install the tcl devel package or configure --with-fastTCLInterp=no to not require tcl.h. You can also provide your own tcl source. Please set TCL_PKG_CONFIG_DIR to point to the directory containing tcl.pc"
ERR_MSG="$ERR_MSG||$MSG"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: $MSG" >&5
printf "%s\n" "$as_me: $MSG" >&6;}
Expand Down Expand Up @@ -5480,7 +5485,7 @@ ORIG_LUA_PATH="$LUA_PATH"
export LUA_PATH="${SRCDIR}/src/?.lua;$LUA_PATH;;"
LuaV=$( $PATH_TO_LUA -e 'print(_VERSION)' | sed -e 's/Lua //' )
LmodV=$( $PATH_TO_LUA -e "v=require('Version'); s=v.name():gsub(' .*','');print(s)")
if test -n "$PATH_TO_GIT" -a -d $ac_confdir/.git ; then
if test -n "$PATH_TO_GIT" -a -e $ac_confdir/.git ; then
lmodV=$($PATH_TO_GIT describe)
else
lmodV=$($PATH_TO_LUA -e "v=require('Version'); s=v.git():gsub(' .*','');print(s)")
Expand Down
31 changes: 18 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ AC_SUBST(MODULE_AUTO_HANDLING)
AC_ARG_WITH(moduleAutoHandling,
AS_HELP_STRING([--with-moduleAutoHandling=ans],[Automatically replaces prereqs with depends_on. [[no]]]),
MODULE_AUTO_HANDLING="$withval"
MODULE_AUTO_HANDLING=`echo $FAST_TCL_INTERP | tr '@<:@:upper:@:>@' '@<:@:lower:@:>@'`
MODULE_AUTO_HANDLING=`echo $MODULE_AUTO_HANDLING | tr '@<:@:upper:@:>@' '@<:@:lower:@:>@'`
VALID_YN $MODULE_AUTO_HANDLING "--with-moduleAutoHandling=ans: ans must be yes or no"
AC_MSG_RESULT([MODULE_AUTO_HANDLING=$with-moduleAutoHandling])
AC_DEFINE_UNQUOTED(MODULE_AUTO_HANDLING, "$with-moduleAutoHandling")dnl
Expand Down Expand Up @@ -702,20 +702,25 @@ fi

if test "$FAST_TCL_INTERP" = yes ; then
OS=$(uname -s)
if test "$OS" = Darwin ; then
DIR=$(xcrun --show-sdk-path)
TCL_INCLUDE="-I${DIR}/usr/include"
AC_PATH_PROG(pkgConfig, pkg-config, "")
if test -n "$TCL_PKG_CONFIG_DIR" ; then
export PKG_CONFIG_PATH=$TCL_PKG_CONFIG_DIR
TCL_INCLUDE=`$pkgConfig --cflags-only-I tcl 2> /dev/null`
TCL_LIBS=`$pkgConfig --libs tcl`
echo TCL_INCLUDE: $TCL_INCLUDE
elif test "$OS" = Darwin ; then
DIR=$(xcrun --show-sdk-path)
TCL_INCLUDE="-I${DIR}/usr/include"
else
for i in "" tcl tcl8.8 tcl8.7 tcl8.6 tcl8.5; do
if test -f /usr/include/$i/tcl.h ; then
TCL_INCLUDE="-I/usr/include/$i"
break;
fi
done
for i in "" tcl tcl8.8 tcl8.7 tcl8.6 tcl8.5; do
if test -f /usr/include/$i/tcl.h ; then
TCL_INCLUDE="-I/usr/include/$i"
break;
fi
done
fi

if test -z "$TCL_INCLUDE" ; then
AC_PATH_PROG(pkgConfig, pkg-config, "")
if ! test x$pkgConfig = "x"; then
for i in tcl tcl8.8 tcl8.7 tcl8.6 tcl8.5; do
$pkgConfig --exists $i
Expand All @@ -736,7 +741,7 @@ if test "$FAST_TCL_INTERP" = yes ; then
if test "$ac_cv_header_tcl_h" != yes ; then
rm -f makefile
FOUND_ERROR=yes
MSG="Unable to build Lmod without tcl.h. Please install the tcl devel package or configure --with-fastTCLInterp=no to not require tcl.h"
MSG="Unable to build Lmod without tcl.h. Please install the tcl devel package or configure --with-fastTCLInterp=no to not require tcl.h. You can also provide your own tcl source. Please set TCL_PKG_CONFIG_DIR to point to the directory containing tcl.pc"
ERR_MSG="$ERR_MSG||$MSG"
AC_MSG_NOTICE([$MSG])
fi
Expand Down Expand Up @@ -921,7 +926,7 @@ ORIG_LUA_PATH="$LUA_PATH"
export LUA_PATH="${SRCDIR}/src/?.lua;$LUA_PATH;;"
LuaV=$( $PATH_TO_LUA -e 'print(_VERSION)' | sed -e 's/Lua //' )
LmodV=$( $PATH_TO_LUA -e "v=require('Version'); s=v.name():gsub(' .*','');print(s)")
if test -n "$PATH_TO_GIT" -a -d $ac_confdir/.git ; then
if test -n "$PATH_TO_GIT" -a -e $ac_confdir/.git ; then
lmodV=$($PATH_TO_GIT describe)
else
lmodV=$($PATH_TO_LUA -e "v=require('Version'); s=v.git():gsub(' .*','');print(s)")
Expand Down

0 comments on commit 302255a

Please sign in to comment.