Thread: mega-patch

mega-patch

From
Bruce Momjian
Date:
I have just made a change to allow configure to properly find tcl/tk.
The old code never found tk.h if it existed in /usr/include, and their
were other problems.

I also removed the version-specific stuff from tcl/tk searching, so they
will have to be called tcl.h/tcl.[a/so] and tk.h/tk.[a/so] without the
version numbers. You will also have to specify the search location for
those directories when prompted by configure.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

Re: [HACKERS] mega-patch--tcl/tk configuration

From
Brook Milligan
Date:
   I also removed the version-specific stuff from tcl/tk searching, so they
   will have to be called tcl.h/tcl.[a/so] and tk.h/tk.[a/so] without the
   version numbers. You will also have to specify the search location for
   those directories when prompted by configure.

This seems to defeat the purpose of the configure script.  Isn't it
supposed to find whatever is needed, whereever it is, and let the rest
of the software do the right thing?

In that case, it seems to me that configure should be checking all the
relevant version-specific locations without requiring any prompts.
After a few iterations, the list of appropriate directories will be
more-or-less all inclusive, so all will be well.  The --use-tcl or
whatever config option can also give an explicit location in case the
current ones are not appropriate.

But removing the other directories and requiring either a special
installation or response to a prompt seems to go against the nature
(and usefulness) of the configure system.

Cheers,
Brook

Re: [HACKERS] mega-patch--tcl/tk configuration

From
The Hermit Hacker
Date:
Its sad when, to save time, I only skim email that doesn't affect me
directly... :(

On Mon, 23 Mar 1998, Brook Milligan wrote:

>    I also removed the version-specific stuff from tcl/tk searching, so they
>    will have to be called tcl.h/tcl.[a/so] and tk.h/tk.[a/so] without the
>    version numbers. You will also have to specify the search location for
>    those directories when prompted by configure.
>
> This seems to defeat the purpose of the configure script.  Isn't it
> supposed to find whatever is needed, whereever it is, and let the rest
> of the software do the right thing?
>
> In that case, it seems to me that configure should be checking all the
> relevant version-specific locations without requiring any prompts.
> After a few iterations, the list of appropriate directories will be
> more-or-less all inclusive, so all will be well.  The --use-tcl or
> whatever config option can also give an explicit location in case the
> current ones are not appropriate.
>
> But removing the other directories and requiring either a special
> installation or response to a prompt seems to go against the nature
> (and usefulness) of the configure system.

I have to agree, in part, with this...

Under FreeBSD, because of how our ports collections work, it is possible
to have something installed using TCL8.0, but the next one to be installed
requires TCL8.1.  As such, we installed then as /usr/local/lib/tcl80 and
/usr/local/lib/tcl81, so they don't get confused...

Having it search several directories in order of preference, IMHO, is
proper behaviour for configure...it should remain as version search
instead of "just tcl.h"...



Re: [HACKERS] mega-patch--tcl/tk configuration

From
Bruce Momjian
Date:
> This seems to defeat the purpose of the configure script.  Isn't it
> supposed to find whatever is needed, whereever it is, and let the rest
> of the software do the right thing?
>
> In that case, it seems to me that configure should be checking all the
> relevant version-specific locations without requiring any prompts.
> After a few iterations, the list of appropriate directories will be
> more-or-less all inclusive, so all will be well.  The --use-tcl or
> whatever config option can also give an explicit location in case the
> current ones are not appropriate.
>
> But removing the other directories and requiring either a special
> installation or response to a prompt seems to go against the nature
> (and usefulness) of the configure system.

It seems tcl/tk uses directory names with version numbers, and I have
no intention of searching for every version they have ever released.


--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

Re: [HACKERS] mega-patch--tcl/tk configuration

From
Bruce Momjian
Date:
> I have to agree, in part, with this...
>
> Under FreeBSD, because of how our ports collections work, it is possible
> to have something installed using TCL8.0, but the next one to be installed
> requires TCL8.1.  As such, we installed then as /usr/local/lib/tcl80 and
> /usr/local/lib/tcl81, so they don't get confused...
>
> Having it search several directories in order of preference, IMHO, is
> proper behaviour for configure...it should remain as version search
> instead of "just tcl.h"...

OK, go ahead.  I did fix several problem with the tcl/tk stuff also.
For example, if it found /usr/include/tk.h, the flag would be -I with no
directory, causing any compile to fail.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

Re: [HACKERS] mega-patch--tcl/tk configuration

From
Brook Milligan
Date:
   It seems tcl/tk uses directory names with version numbers, and I have
   no intention of searching for every version they have ever released.

I agree that it seems like a pain to do so (and perhaps that argues
against the way tcl/tk is installed by the packaging systems), but
given that some common packaging systems do it that way, it seems like
we should handle the situation nicely.

Would it be possible to simply generate a list of directories to
search from a regular expression (e.g., tcl[0-9.]*), reverse sort them
so the later ones come first, then check for the right header file?
If too old a version was found we could flag it with a warning from
configure.

That might be a win over a fixed list, because we wouldn't have to
maintain the list, which I think was your objection (which I sort of
agree with, too, from the point of view of a maintainer).

Cheers,
Brook

Re: [HACKERS] mega-patch--tcl/tk configuration

From
The Hermit Hacker
Date:
On Mon, 23 Mar 1998, Bruce Momjian wrote:

> > This seems to defeat the purpose of the configure script.  Isn't it
> > supposed to find whatever is needed, whereever it is, and let the rest
> > of the software do the right thing?
> >
> > In that case, it seems to me that configure should be checking all the
> > relevant version-specific locations without requiring any prompts.
> > After a few iterations, the list of appropriate directories will be
> > more-or-less all inclusive, so all will be well.  The --use-tcl or
> > whatever config option can also give an explicit location in case the
> > current ones are not appropriate.
> >
> > But removing the other directories and requiring either a special
> > installation or response to a prompt seems to go against the nature
> > (and usefulness) of the configure system.
>
> It seems tcl/tk uses directory names with version numbers, and I have
> no intention of searching for every version they have ever released.

    Why not?  Or, rather, why not just do the ones that get reported
to us?  It does hurt to, and I think it hurts more not too...



Re: [HACKERS] mega-patch--tcl/tk configuration

From
Bruce Momjian
Date:
> > > But removing the other directories and requiring either a special
> > > installation or response to a prompt seems to go against the nature
> > > (and usefulness) of the configure system.
> >
> > It seems tcl/tk uses directory names with version numbers, and I have
> > no intention of searching for every version they have ever released.
>
>     Why not?  Or, rather, why not just do the ones that get reported
> to us?  It does hurt to, and I think it hurts more not too...

If someone wants to play with that, go ahead.  I see no reason the
installation person, if they want tcl/tk, should type in those directory
names.  However, if the actual library and include files have version
numbers in them, well, that is a pain.  Do they edit their source and
makefiles every time they upgrade versions?

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

Re: [HACKERS] mega-patch--tcl/tk configuration

From
Tom Ivar Helbekkmo
Date:
Marc wrote:

| Having it search several directories in order of preference, IMHO, is
| proper behaviour for configure...it should remain as version search
| instead of "just tcl.h"...

Bruce answered:

| OK, go ahead.  I did fix several problem with the tcl/tk stuff also.
| For example, if it found /usr/include/tk.h, the flag would be -I with no
| directory, causing any compile to fail.

While you guys are thinking about this, let me remind you of the
following patch for these problems that I sent you on March 2nd.  It
fixes the problem Bruce mentions, and extends the version checking to
include the last versions of TCL and TK prior to 8.0 -- since I can
observe here that they do work.

Marc's argument that version numbers have to stay where TCL/TK is
involved is very important: they are nearly always incompatible with
themselves in preceding and following versions, making it necessary
for a typical site to have one complete TCL/TK installation for each
and every application that uses the damn things.  (You may recall that
I expressed amazement at my discovery that I could use 7.6/4.2 with
both Scotty and PostgreSQL.)

Anyway, my take on the --with-tcl (and --with-perl) things, relative
to PostgreSQL 6.3:

*** configure.in.orig    Mon Mar  2 06:33:14 1998
--- configure.in    Mon Mar  2 21:42:59 1998
***************
*** 239,246 ****
  AC_ARG_WITH(
     tcl,
     [   --with-tcl              use tcl ],
!    USE_TCL=true AC_MSG_RESULT(enabled),
!    USE_TCL=false AC_MSG_RESULT(disabled)
  )
  export USE_TCL
  USE_X=$USE_TCL
--- 239,246 ----
  AC_ARG_WITH(
     tcl,
     [   --with-tcl              use tcl ],
!    USE_TCL=true; AC_MSG_RESULT(enabled),
!    USE_TCL=false; AC_MSG_RESULT(disabled)
  )
  export USE_TCL
  USE_X=$USE_TCL
***************
*** 250,257 ****
  AC_ARG_WITH(
     perl,
     [   --with-perl             use perl ],
!    USE_PERL=true AC_MSG_RESULT(enabled),
!    USE_PERL=false AC_MSG_RESULT(disabled)
  )
  export USE_PERL

--- 250,257 ----
  AC_ARG_WITH(
     perl,
     [   --with-perl             use perl ],
!    USE_PERL=true; AC_MSG_RESULT(enabled),
!    USE_PERL=false; AC_MSG_RESULT(disabled)
  )
  export USE_PERL

***************
*** 563,570 ****
  if test "$USE_TCL" = "true"
  then
  TCL_INCDIR=no
! AC_CHECK_HEADER(tcl.h, TCL_INCDIR=)
! for f in /usr/include /usr/include/tcl8.0 /usr/local/include /usr/local/include/tcl8.0; do
  if test "$TCL_INCDIR" = "no"; then
  AC_CHECK_HEADER($f/tcl.h, TCL_INCDIR=$f)
  fi
--- 563,569 ----
  if test "$USE_TCL" = "true"
  then
  TCL_INCDIR=no
! for f in /usr/include /usr/include/tcl8.0 /usr/include/tcl7.6 /usr/local/include /usr/local/include/tcl8.0
/usr/local/include/tcl7.6;do 
  if test "$TCL_INCDIR" = "no"; then
  AC_CHECK_HEADER($f/tcl.h, TCL_INCDIR=$f)
  fi
***************
*** 580,586 ****
  if test "$USE_TCL" = "true"
  then
  TCL_LIB=
! for f in tcl8.0 tcl80; do
  if test -z "$TCL_LIB"; then
  AC_CHECK_LIB($f, main, TCL_LIB=$f)
  fi
--- 579,585 ----
  if test "$USE_TCL" = "true"
  then
  TCL_LIB=
! for f in tcl8.0 tcl80 tcl7.6 tcl76; do
  if test -z "$TCL_LIB"; then
  AC_CHECK_LIB($f, main, TCL_LIB=$f)
  fi
***************
*** 606,616 ****
  ice_save_CPPFLAGS="$CPPFLAGS"
  ice_save_LDFLAGS="$LDFLAGS"

  CPPFLAGS="$CPPFLAGS $X_CFLAGS -I$TCL_INCDIR"

  TK_INCDIR=no
! AC_CHECK_HEADER(tk.h, TK_INCDIR=)
! for f in /usr/include /usr/include/tk8.0 /usr/local/include /usr/local/include/tk8.0; do
  if test "$TK_INCDIR" = "no"; then
  AC_CHECK_HEADER($f/tk.h, TK_INCDIR=$f)
  fi
--- 605,619 ----
  ice_save_CPPFLAGS="$CPPFLAGS"
  ice_save_LDFLAGS="$LDFLAGS"

+ if test "$TCL_INCDIR" = ""
+ then
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ else
  CPPFLAGS="$CPPFLAGS $X_CFLAGS -I$TCL_INCDIR"
+ fi

  TK_INCDIR=no
! for f in /usr/include /usr/include/tk8.0 /usr/include/tk4.2 /usr/local/include /usr/local/include/tk8.0
/usr/local/include/tk4.2;do 
  if test "$TK_INCDIR" = "no"; then
  AC_CHECK_HEADER($f/tk.h, TK_INCDIR=$f)
  fi
***************
*** 631,637 ****
  if test "$USE_TCL" = "true"
  then
  TK_LIB=
! for f in tk8.0 tk80; do
  if test -z "$TK_LIB"; then
  AC_CHECK_LIB($f, main, TK_LIB=$f)
  fi
--- 634,640 ----
  if test "$USE_TCL" = "true"
  then
  TK_LIB=
! for f in tk8.0 tk80 tk4.2 tk42; do
  if test -z "$TK_LIB"; then
  AC_CHECK_LIB($f, main, TK_LIB=$f)
  fi
*** configure.orig    Mon Mar  2 15:55:42 1998
--- configure    Mon Mar  2 21:43:39 1998
***************
*** 825,833 ****
  # Check whether --with-tcl or --without-tcl was given.
  if test "${with_tcl+set}" = set; then
    withval="$with_tcl"
!   USE_TCL=true echo "$ac_t""enabled" 1>&6
  else
!   USE_TCL=false echo "$ac_t""disabled" 1>&6

  fi

--- 825,833 ----
  # Check whether --with-tcl or --without-tcl was given.
  if test "${with_tcl+set}" = set; then
    withval="$with_tcl"
!   USE_TCL=true; echo "$ac_t""enabled" 1>&6
  else
!   USE_TCL=false; echo "$ac_t""disabled" 1>&6

  fi

***************
*** 839,847 ****
  # Check whether --with-perl or --without-perl was given.
  if test "${with_perl+set}" = set; then
    withval="$with_perl"
!   USE_PERL=true echo "$ac_t""enabled" 1>&6
  else
!   USE_PERL=false echo "$ac_t""disabled" 1>&6

  fi

--- 839,847 ----
  # Check whether --with-perl or --without-perl was given.
  if test "${with_perl+set}" = set; then
    withval="$with_perl"
!   USE_PERL=true; echo "$ac_t""enabled" 1>&6
  else
!   USE_PERL=false; echo "$ac_t""disabled" 1>&6

  fi

***************
*** 5393,5432 ****
  if test "$USE_TCL" = "true"
  then
  TCL_INCDIR=no
! ac_safe=`echo "tcl.h" | sed 'y%./+-%__p_%'`
! echo $ac_n "checking for tcl.h""... $ac_c" 1>&6
! echo "configure:5399: checking for tcl.h" >&5
! if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
!   echo $ac_n "(cached) $ac_c" 1>&6
! else
!   cat > conftest.$ac_ext <<EOF
! #line 5404 "configure"
! #include "confdefs.h"
! #include <tcl.h>
! EOF
! ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:5409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
! ac_err=`grep -v '^ *+' conftest.out`
! if test -z "$ac_err"; then
!   rm -rf conftest*
!   eval "ac_cv_header_$ac_safe=yes"
! else
!   echo "$ac_err" >&5
!   echo "configure: failed program was:" >&5
!   cat conftest.$ac_ext >&5
!   rm -rf conftest*
!   eval "ac_cv_header_$ac_safe=no"
! fi
! rm -f conftest*
! fi
! if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
!   echo "$ac_t""yes" 1>&6
!   TCL_INCDIR=
! else
!   echo "$ac_t""no" 1>&6
! fi
!
! for f in /usr/include /usr/include/tcl8.0 /usr/local/include /usr/local/include/tcl8.0; do
  if test "$TCL_INCDIR" = "no"; then
  ac_safe=`echo "$f/tcl.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $f/tcl.h""... $ac_c" 1>&6
--- 5393,5399 ----
  if test "$USE_TCL" = "true"
  then
  TCL_INCDIR=no
! for f in /usr/include /usr/include/tcl8.0 /usr/include/tcl7.6 /usr/local/include /usr/local/include/tcl8.0
/usr/local/include/tcl7.6;do 
  if test "$TCL_INCDIR" = "no"; then
  ac_safe=`echo "$f/tcl.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $f/tcl.h""... $ac_c" 1>&6
***************
*** 5473,5479 ****
  if test "$USE_TCL" = "true"
  then
  TCL_LIB=
! for f in tcl8.0 tcl80; do
  if test -z "$TCL_LIB"; then
  echo $ac_n "checking for main in -l$f""... $ac_c" 1>&6
  echo "configure:5480: checking for main in -l$f" >&5
--- 5440,5446 ----
  if test "$USE_TCL" = "true"
  then
  TCL_LIB=
! for f in tcl8.0 tcl80 tcl7.6 tcl76; do
  if test -z "$TCL_LIB"; then
  echo $ac_n "checking for main in -l$f""... $ac_c" 1>&6
  echo "configure:5480: checking for main in -l$f" >&5
***************
*** 5531,5573 ****
  ice_save_CPPFLAGS="$CPPFLAGS"
  ice_save_LDFLAGS="$LDFLAGS"

! CPPFLAGS="$CPPFLAGS $X_CFLAGS -I$TCL_INCDIR"
!
! TK_INCDIR=no
! ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
! echo $ac_n "checking for tk.h""... $ac_c" 1>&6
! echo "configure:5540: checking for tk.h" >&5
! if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
!   echo $ac_n "(cached) $ac_c" 1>&6
! else
!   cat > conftest.$ac_ext <<EOF
! #line 5545 "configure"
! #include "confdefs.h"
! #include <tk.h>
! EOF
! ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:5550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
! ac_err=`grep -v '^ *+' conftest.out`
! if test -z "$ac_err"; then
!   rm -rf conftest*
!   eval "ac_cv_header_$ac_safe=yes"
! else
!   echo "$ac_err" >&5
!   echo "configure: failed program was:" >&5
!   cat conftest.$ac_ext >&5
!   rm -rf conftest*
!   eval "ac_cv_header_$ac_safe=no"
! fi
! rm -f conftest*
! fi
! if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
!   echo "$ac_t""yes" 1>&6
!   TK_INCDIR=
  else
!   echo "$ac_t""no" 1>&6
  fi

! for f in /usr/include /usr/include/tk8.0 /usr/local/include /usr/local/include/tk8.0; do
  if test "$TK_INCDIR" = "no"; then
  ac_safe=`echo "$f/tk.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $f/tk.h""... $ac_c" 1>&6
--- 5498,5512 ----
  ice_save_CPPFLAGS="$CPPFLAGS"
  ice_save_LDFLAGS="$LDFLAGS"

! if test "$TCL_INCDIR" = ""
! then
! CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  else
! CPPFLAGS="$CPPFLAGS $X_CFLAGS -I$TCL_INCDIR"
  fi

! TK_INCDIR=no
! for f in /usr/include /usr/include/tk8.0 /usr/include/tk4.2 /usr/local/include /usr/local/include/tk8.0
/usr/local/include/tk4.2;do 
  if test "$TK_INCDIR" = "no"; then
  ac_safe=`echo "$f/tk.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $f/tk.h""... $ac_c" 1>&6
***************
*** 5619,5625 ****
  if test "$USE_TCL" = "true"
  then
  TK_LIB=
! for f in tk8.0 tk80; do
  if test -z "$TK_LIB"; then
  echo $ac_n "checking for main in -l$f""... $ac_c" 1>&6
  echo "configure:5626: checking for main in -l$f" >&5
--- 5558,5564 ----
  if test "$USE_TCL" = "true"
  then
  TK_LIB=
! for f in tk8.0 tk80 tk4.2 tk42; do
  if test -z "$TK_LIB"; then
  echo $ac_n "checking for main in -l$f""... $ac_c" 1>&6
  echo "configure:5626: checking for main in -l$f" >&5

-tih
--
Popularity is the hallmark of mediocrity.  --Niles Crane, "Frasier"

Re: [HACKERS] mega-patch--tcl/tk configuration

From
The Hermit Hacker
Date:
On 23 Mar 1998, Tom Ivar Helbekkmo wrote:

> Marc's argument that version numbers have to stay where TCL/TK is
> involved is very important: they are nearly always incompatible with
> themselves in preceding and following versions, making it necessary
> for a typical site to have one complete TCL/TK installation for each
> and every application that uses the damn things.  (You may recall that
> I expressed amazement at my discovery that I could use 7.6/4.2 with
> both Scotty and PostgreSQL.)
>
> Anyway, my take on the --with-tcl (and --with-perl) things, relative
> to PostgreSQL 6.3:

    Can you take a quick look at the way things are right now and
submit a new patch against the current version for the tcl stuff?  I think
this "multiple version" thing with tcl/tk is an inconvience, but a
necessary one based on the way they do do development :(

    Other then this, I don't think we have any outstanding issues we
wanted covered...is there?  If not, if this can be submitted before 4pm
today, I'll include it...if not, the patch/tar file is created and
*finally* released at that point :)

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org


Re: [HACKERS] mega-patch--tcl/tk configuration

From
Tom Ivar Helbekkmo
Date:
Marc wrote:

>     Can you take a quick look at the way things are right now and
> submit a new patch against the current version for the tcl stuff?  I
> think this "multiple version" thing with tcl/tk is an inconvience,
> but a necessary one based on the way they do do development :(

Sorry -- not enough time for that.  It would mean changing several
files (after finding out which files to change) in ways that I can't
test sufficiently well within the time frame.  I'll have to do it
eventually, of course, in order to get PostgreSQL 6.3.1 to work with
TCL/TK here, and I'll send you the changes it takes.  An alternative,
of course, is to get Bruce to identify and back out the changes that
he made in order to remove all version-specific TCL/TK stuff from
configure*, various makefiles and whatever.  Then, you could just slip
my patch right into configure.in, add support for tcl/tk 8.1 to match
the version 8.0 stuff, and generate a new configure...

I don't even like TCL!  It's just that pgaccess is _so_ _cute_!  :-)

[Meanwhile, I'm hacking on PL/Scheme -- I can already create and use
functions with "language 'scheme'", and I'm working on integrating
calls back into the backend into Scheme the way I want them.  Having a
great time with this stuff.  Don't hold your breath waiting for this,
though; it's strictly a spare time project, and will take a while.]

-tih
--
Popularity is the hallmark of mediocrity.  --Niles Crane, "Frasier"