Thread: Another dead configure test

Another dead configure test

From
Tom Lane
Date:
I happened to notice that configure extracts TCL_SHLIB_LD_LIBS
from tclConfig.sh, and puts the value into Makefile.global,
but then we never use it anywhere.  AFAICT the only use went
away in cd75f94da, in 2003.  I propose the attached.

            regards, tom lane

diff --git a/configure b/configure
index b7fd6c5f4e..9e8ac510ac 100755
--- a/configure
+++ b/configure
@@ -634,7 +634,6 @@ DBTOEPUB
 FOP
 XSLTPROC
 XMLLINT
-TCL_SHLIB_LD_LIBS
 TCL_SHARED_BUILD
 TCL_LIB_SPEC
 TCL_LIBS
@@ -18818,7 +18817,7 @@ eval TCL_LIBS=\"$TCL_LIBS\"
 eval TCL_LIB_SPEC=\"$TCL_LIB_SPEC\"
 eval TCL_SHARED_BUILD=\"$TCL_SHARED_BUILD\"

-        if test "$TCL_SHARED_BUILD" != 1; then
+    if test "$TCL_SHARED_BUILD" != 1; then
       as_fn_error $? "cannot build PL/Tcl because Tcl is not a shared library
 Use --without-tcl to disable building PL/Tcl." "$LINENO" 5
     fi
diff --git a/configure.ac b/configure.ac
index e5740f4fb5..67cf317c3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2252,7 +2252,6 @@ if test "$with_tcl" = yes; then
     PGAC_PATH_TCLCONFIGSH([$with_tclconfig])
     PGAC_EVAL_TCLCONFIGSH([$TCL_CONFIG_SH],
                           [TCL_INCLUDE_SPEC,TCL_LIBS,TCL_LIB_SPEC,TCL_SHARED_BUILD])
-    AC_SUBST(TCL_SHLIB_LD_LIBS)dnl don't want to double-evaluate that one
     if test "$TCL_SHARED_BUILD" != 1; then
       AC_MSG_ERROR([cannot build PL/Tcl because Tcl is not a shared library
 Use --without-tcl to disable building PL/Tcl.])
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 0625b60c43..5664c645f8 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -221,7 +221,6 @@ TCL_LIBS        = @TCL_LIBS@
 TCL_LIB_SPEC        = @TCL_LIB_SPEC@
 TCL_INCLUDE_SPEC    = @TCL_INCLUDE_SPEC@
 TCL_SHARED_BUILD    = @TCL_SHARED_BUILD@
-TCL_SHLIB_LD_LIBS    = @TCL_SHLIB_LD_LIBS@

 PTHREAD_CFLAGS        = @PTHREAD_CFLAGS@
 PTHREAD_LIBS        = @PTHREAD_LIBS@

Re: Another dead configure test

From
Andres Freund
Date:
Hi,

On 2022-08-18 11:04:03 -0400, Tom Lane wrote:
> I happened to notice that configure extracts TCL_SHLIB_LD_LIBS
> from tclConfig.sh, and puts the value into Makefile.global,
> but then we never use it anywhere.  AFAICT the only use went
> away in cd75f94da, in 2003.  I propose the attached.

Looks good, except that it perhaps could go a tad further: TCL_SHARED_BUILD
isn't used either afaics?

Greetings,

Andres Freund



Re: Another dead configure test

From
Tom Lane
Date:
Andres Freund <andres@anarazel.de> writes:
> Looks good, except that it perhaps could go a tad further: TCL_SHARED_BUILD
> isn't used either afaics?

I wondered about that, but we do need TCL_SHARED_BUILD in configure
itself, and the PGAC_EVAL_TCLCONFIGSH macro is going to AC_SUBST it.
We could remove the line in Makefile.global but I don't think that
buys much, and it might be more confusing not less so.

            regards, tom lane



Re: Another dead configure test

From
Andres Freund
Date:
Hi,

On 2022-08-18 13:00:28 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > Looks good, except that it perhaps could go a tad further: TCL_SHARED_BUILD
> > isn't used either afaics?
> 
> I wondered about that, but we do need TCL_SHARED_BUILD in configure
> itself, and the PGAC_EVAL_TCLCONFIGSH macro is going to AC_SUBST it.
> We could remove the line in Makefile.global but I don't think that
> buys much, and it might be more confusing not less so.

From the meson-generates-Makefile.global angle I like fewer symbols that have
to be considered in Makefile.global.in :). But even leaving that aside, I
think it's clearer to not have things in Makefile.global if they're not used.

But it's obviously not important.

Greetings,

Andres Freund



Re: Another dead configure test

From
Tom Lane
Date:
Andres Freund <andres@anarazel.de> writes:
> On 2022-08-18 13:00:28 -0400, Tom Lane wrote:
>> I wondered about that, but we do need TCL_SHARED_BUILD in configure
>> itself, and the PGAC_EVAL_TCLCONFIGSH macro is going to AC_SUBST it.
>> We could remove the line in Makefile.global but I don't think that
>> buys much, and it might be more confusing not less so.

>> From the meson-generates-Makefile.global angle I like fewer symbols that have
> to be considered in Makefile.global.in :). But even leaving that aside, I
> think it's clearer to not have things in Makefile.global if they're not used.

> But it's obviously not important.

Yeah, I'm not excited about it either way --- feel free to change
if you'd rather.

            regards, tom lane