From eb664a50b2c10137d776b695063aaa79ea6ee2a7 Mon Sep 17 00:00:00 2001 From: Robert McLay Date: Fri, 6 Sep 2024 13:24:47 -0500 Subject: [PATCH] Issue #722: Allowing for sites to specify TCL_INCLUDE and TCL_LIBS --- configure | 41 ++++++++++++++++++++++++++++------------- configure.ac | 1 - 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/configure b/configure index 1c94679ed..1d89591f3 100755 --- a/configure +++ b/configure @@ -4487,7 +4487,7 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_pkgConfig" && ac_cv_path_pkgConfig="""" + test -z "$ac_cv_path_pkgConfig" && ac_cv_path_pkgConfig=""UNKNOWN_PKG_CONFIG"" ;; esac fi @@ -4501,7 +4501,17 @@ printf "%s\n" "no" >&6; } fi - if test -n "$TCL_PKG_CONFIG_DIR" ; then + if test -n "$TCL_INCLUDE" -a -n "$TCL_LIBS"; then + echo "using TCL_INCLUDE: $TCL_INCLUDE" + echo "using TCL_LIBS: $TCL_LIBS" + elif test -n "$TCL_PKG_CONFIG_DIR" ; then + if test "$pkgConfig" = "UNKNOWN_PKG_CONFIG" ; then + echo + echo "You must have valid pkg-config in your path. Quitting!" + echo + rm -f makefile + exit 1 + fi export PKG_CONFIG_PATH=$TCL_PKG_CONFIG_DIR TCL_INCLUDE=`$pkgConfig --cflags-only-I tcl 2> /dev/null` TCL_LIBS=`$pkgConfig --libs tcl` @@ -4519,16 +4529,21 @@ fi 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 - if test $? = 0; then - TCL_INCLUDE=`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 $pkgConfig --cflags-only-I $i 2> /dev/null` - TCL_LIBS=`$pkgConfig --libs $i` - break - fi - done - fi + if test "$pkgConfig" = "UNKNOWN_PKG_CONFIG" ; then + echo + echo "You must have valid pkg-config in your path. Quitting!" + echo + rm -f makefile + exit 1 + fi + for i in tcl tcl8.8 tcl8.7 tcl8.6 tcl8.5; do + $pkgConfig --exists $i + if test $? = 0; then + TCL_INCLUDE=`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 $pkgConfig --cflags-only-I $i 2> /dev/null` + TCL_LIBS=`$pkgConfig --libs $i` + break + fi + done fi CPPFLAGS="$TCL_INCLUDE" @@ -4575,7 +4590,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. You can also provide your own tcl source. Please set TCL_PKG_CONFIG_DIR to point to the directory containing tcl.pc" + 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 Or specify TCL_INCLUDE and TCL_LIBS" ERR_MSG="$ERR_MSG||$MSG" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $MSG" >&5 printf "%s\n" "$as_me: $MSG" >&6;} diff --git a/configure.ac b/configure.ac index 1c01b11bf..4f4b2247e 100644 --- a/configure.ac +++ b/configure.ac @@ -746,7 +746,6 @@ if test "$FAST_TCL_INTERP" = yes ; then break fi done - fi fi CPPFLAGS="$TCL_INCLUDE"