Detecting proper bison version before make

Started by Greg Sabino Mullanealmost 23 years ago8 messagesbugs
Jump to latest
#1Greg Sabino Mullane
greg@turnstep.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I just installed Postgres on an older machine and was surprised
that configure did not throw an error about running an old version
of bison, but let me get a bit into the whole 'make' cycle before
a cryptic error was thrown. Can the configure script be made to check
for a proper version of bison?

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200306012154
-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE+2q7qvJuQZxSWSsgRAjmqAKDOWFXmckpYnvrIXSKVY7CQNWcn2gCbBb7b
il6Rrr+MmQ4fUrFNN4dRNyM=
=2Y3s
-----END PGP SIGNATURE-----

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Greg Sabino Mullane (#1)
Re: Detecting proper bison version before make

Greg Sabino Mullane writes:

Can the configure script be made to check for a proper version of bison?

Normally the parser files are prebuild and bison is never invoked. So it
seems wasteful to do a bunch of checking for this rare case.

--
Peter Eisentraut peter_e@gmx.net

#3Bruce Momjian
bruce@momjian.us
In reply to: Greg Sabino Mullane (#1)
Re: [BUGS] Detecting proper bison version before make

Here is an applied patch to check for bison version >= 1.875 and print a
warning. I piggybacks on the existing bison warning.

---------------------------------------------------------------------------

Greg Sabino Mullane wrote:
[ There is text before PGP section. ]

[ PGP not available, raw data follows ]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I just installed Postgres on an older machine and was surprised
that configure did not throw an error about running an old version
of bison, but let me get a bit into the whole 'make' cycle before
a cryptic error was thrown. Can the configure script be made to check
for a proper version of bison?

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200306012154
-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE+2q7qvJuQZxSWSsgRAjmqAKDOWFXmckpYnvrIXSKVY7CQNWcn2gCbBb7b
il6Rrr+MmQ4fUrFNN4dRNyM=
=2Y3s
-----END PGP SIGNATURE-----

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

[ Decrypting message... End of raw data. ]

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/bjm/difftext/plainDownload+23-0
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#3)
Re: [BUGS] Detecting proper bison version before make

Bruce Momjian <pgman@candle.pha.pa.us> writes:

AC_CHECK_PROGS(YACC, ['bison -y'])
+ 
+ if test "$YACC"; then
+   if bison --version | sed q | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'; then
+     AC_MSG_WARN([

Should this not be making at least some effort to use the particular
program found by the AC_CHECK_PROGS macro? ie, why not $YACC --version ...

regards, tom lane

#5Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#4)
Re: [BUGS] Detecting proper bison version before make

Sure, I will change it to $YACC, but I thought it had to be 'bison -y'
because that's what we fed to AC_CHECK_PROGS. I looked at the configure
output but I don't understand it, even though I know shell script.

---------------------------------------------------------------------------

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

AC_CHECK_PROGS(YACC, ['bison -y'])
+ 
+ if test "$YACC"; then
+   if bison --version | sed q | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'; then
+     AC_MSG_WARN([

Should this not be making at least some effort to use the particular
program found by the AC_CHECK_PROGS macro? ie, why not $YACC --version ...

regards, tom lane

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#6Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#3)
Re: [BUGS] Detecting proper bison version before make

Bruce Momjian writes:

Here is an applied patch to check for bison version >= 1.875 and print a
warning. I piggybacks on the existing bison warning.

Instead of 'bison --version' you need to check the executable that was
actually detected by configure.

--
Peter Eisentraut peter_e@gmx.net

#7Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#2)
Re: Detecting proper bison version before make

Peter Eisentraut wrote:

Greg Sabino Mullane writes:

Can the configure script be made to check for a proper version of bison?

Normally the parser files are prebuild and bison is never invoked. So it
seems wasteful to do a bunch of checking for this rare case.

Well, someone asked for it, and we already check for bison, so we might
as well check for a version that actually works. Now, if you are
suggesting we remove both bison checks, I could understand that. Are
you?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#8Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#6)
Re: [BUGS] Detecting proper bison version before make

Peter Eisentraut wrote:

Bruce Momjian writes:

Here is an applied patch to check for bison version >= 1.875 and print a
warning. I piggybacks on the existing bison warning.

Instead of 'bison --version' you need to check the executable that was
actually detected by configure.

I have since changed it to $YACC, per suggestion from Tom.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073