zsh-workers
 help / color / mirror / code / Atom feed
* Fwd: Re: zsh compilation problem with autoconf git
@ 2008-01-29 22:03 Ismail Dönmez
  2008-01-29 22:38 ` Clint Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Ismail Dönmez @ 2008-01-29 22:03 UTC (permalink / raw)
  To: zsh-workers; +Cc: Ralf Wildenhues, bug-autoconf

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

Hi Ralf,

I am forwarding your message to zsh-workers list. To summarise the issue zsh 
modules are not compiled with upcoming autoconf 2.62 and Ralf successfully 
identified that zsh/Src/mkmakemod.sh does some unportable stuff :

    # check 2.13, 2.50, and 2.60 syntaxes
    if grep '%@D@%D%' config.status >/dev/null ||
       grep ',@D@,D,' config.status >/dev/null ||
       grep ',@D@,|#_!!_#|D,' config.status >/dev/null; then
        is_dynamic=true
    else
        is_dynamic=false
    fi

So the question is, is this thing needed at all, if yes why?

-- 
Never learn by your mistakes, if you do you may never dare to try again.

[-- Attachment #2: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>: Re: zsh compilation problem with autoconf git --]
[-- Type: message/rfc822, Size: 5231 bytes --]

From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: "Ismail Dönmez" <ismail@pardus.org.tr>
Cc: bug-autoconf@gnu.org
Subject: Re: zsh compilation problem with autoconf git
Date: Tue, 29 Jan 2008 22:58:41 +0100
Message-ID: <20080129215840.GA11536@ins.uni-bonn.de>

* Ismail Dönmez wrote on Tue, Jan 29, 2008 at 09:38:33PM CET:
> 
> Sure, just grab zsh.git and create two copies of it, and do
[...]
> now if you compare zsh & zsh2 you will see that zsh directory have bunch of 
> shared objects in Src/Modules where as zsh2 have none.

Confirmed.  But with Autoconf 2.59 vs mainline, not 2.61a.
zsh/Src/mkmakemod.sh does ugly and nonsupported things such as
grepping config.status for values:

    # check 2.13, 2.50, and 2.60 syntaxes
    if grep '%@D@%D%' config.status >/dev/null ||
       grep ',@D@,D,' config.status >/dev/null ||
       grep ',@D@,|#_!!_#|D,' config.status >/dev/null; then
        is_dynamic=true
    else
        is_dynamic=false
    fi

That looks dubious, and should be fixed.  Further, I don't know why it
should be needed.  When config.status' documented interfaces are used,
there is no need to grep it.  grepping it is explicitly not supported.
Autoconf 2.62's config.status will internally work differently again as
2.61a (more efficiently), and we won't hesitate to change it in again in
every future version if changes help do things better in some way.

If zsh authors can explain why the above should be needed, we may be
able to see whether there is (or was) a bug in Autoconf to be worked
around, and then we can add that to the Autoconf test suite to ensure
that we don't regress.

I can get things to work fine with a hack as below.

Cheers,
Ralf


diff --git a/Src/mkmakemod.sh b/Src/mkmakemod.sh
index d275038..8e9cee5 100644
--- a/Src/mkmakemod.sh
+++ b/Src/mkmakemod.sh
@@ -114,7 +114,8 @@ if $first_stage; then
     # check 2.13, 2.50, and 2.60 syntaxes
     if grep '%@D@%D%' config.status >/dev/null ||
        grep ',@D@,D,' config.status >/dev/null ||
-       grep ',@D@,|#_!!_#|D,' config.status >/dev/null; then
+       grep ',@D@,|#_!!_#|D,' config.status >/dev/null ||
+       :; then
 	is_dynamic=true
     else
 	is_dynamic=false



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fwd: Re: zsh compilation problem with autoconf git
  2008-01-29 22:03 Fwd: Re: zsh compilation problem with autoconf git Ismail Dönmez
@ 2008-01-29 22:38 ` Clint Adams
  2008-01-30  4:42   ` Ismail Dönmez
  2008-01-30 13:03   ` Eric Blake
  0 siblings, 2 replies; 6+ messages in thread
From: Clint Adams @ 2008-01-29 22:38 UTC (permalink / raw)
  To: Ismail Dönmez; +Cc: zsh-workers, Ralf Wildenhues, bug-autoconf

On Wed, Jan 30, 2008 at 12:03:33AM +0200, Ismail Dönmez wrote:
> Hi Ralf,
> 
> I am forwarding your message to zsh-workers list. To summarise the issue zsh 
> modules are not compiled with upcoming autoconf 2.62 and Ralf successfully 
> identified that zsh/Src/mkmakemod.sh does some unportable stuff :
> 
>     # check 2.13, 2.50, and 2.60 syntaxes
>     if grep '%@D@%D%' config.status >/dev/null ||
>        grep ',@D@,D,' config.status >/dev/null ||
>        grep ',@D@,|#_!!_#|D,' config.status >/dev/null; then
>         is_dynamic=true
>     else
>         is_dynamic=false
>     fi
> 
> So the question is, is this thing needed at all, if yes why?

Presumably Src/mkmakemod.sh would need to be generated to check that
value in any supported manner.  I don't recall a reason that that
can't be done.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fwd: Re: zsh compilation problem with autoconf git
  2008-01-29 22:38 ` Clint Adams
@ 2008-01-30  4:42   ` Ismail Dönmez
  2008-01-30  6:48     ` Ralf Wildenhues
  2008-01-30  9:57     ` Peter Stephenson
  2008-01-30 13:03   ` Eric Blake
  1 sibling, 2 replies; 6+ messages in thread
From: Ismail Dönmez @ 2008-01-30  4:42 UTC (permalink / raw)
  To: Clint Adams; +Cc: zsh-workers, Ralf Wildenhues

[ Removed bug-autoconf from CC because this might be off topic for them ]

Wednesday 30 January 2008 00:38:19 tarihinde Clint Adams şunları yazmıştı:
> On Wed, Jan 30, 2008 at 12:03:33AM +0200, Ismail Dönmez wrote:
> > Hi Ralf,
> >
> > I am forwarding your message to zsh-workers list. To summarise the issue
> > zsh modules are not compiled with upcoming autoconf 2.62 and Ralf
> > successfully identified that zsh/Src/mkmakemod.sh does some unportable
> > stuff :
> >
> >     # check 2.13, 2.50, and 2.60 syntaxes
> >     if grep '%@D@%D%' config.status >/dev/null ||
> >        grep ',@D@,D,' config.status >/dev/null ||
> >        grep ',@D@,|#_!!_#|D,' config.status >/dev/null; then
> >         is_dynamic=true
> >     else
> >         is_dynamic=false
> >     fi
> >
> > So the question is, is this thing needed at all, if yes why?
>
> Presumably Src/mkmakemod.sh would need to be generated to check that
> value in any supported manner.  I don't recall a reason that that
> can't be done.

Why doesn't it parse config.h instead? I got 

#define DYNAMIC 1

in config.h so this could be grepped easily.

Regards,
ismail

-- 
Never learn by your mistakes, if you do you may never dare to try again.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fwd: Re: zsh compilation problem with autoconf git
  2008-01-30  4:42   ` Ismail Dönmez
@ 2008-01-30  6:48     ` Ralf Wildenhues
  2008-01-30  9:57     ` Peter Stephenson
  1 sibling, 0 replies; 6+ messages in thread
From: Ralf Wildenhues @ 2008-01-30  6:48 UTC (permalink / raw)
  To: Ismail Dönmez; +Cc: Clint Adams, zsh-workers

* Ismail Dönmez wrote on Wed, Jan 30, 2008 at 05:42:40AM CET:
> Wednesday 30 January 2008 00:38:19 tarihinde Clint Adams şunları yazmıştı:
> > On Wed, Jan 30, 2008 at 12:03:33AM +0200, Ismail Dönmez wrote:
> > >
> > >     # check 2.13, 2.50, and 2.60 syntaxes
> > >     if grep '%@D@%D%' config.status >/dev/null ||
> > >        grep ',@D@,D,' config.status >/dev/null ||
> > >        grep ',@D@,|#_!!_#|D,' config.status >/dev/null; then
> > >         is_dynamic=true
> > >     else
> > >         is_dynamic=false
> > >     fi
> > >
> > > So the question is, is this thing needed at all, if yes why?
> >
> > Presumably Src/mkmakemod.sh would need to be generated to check that
> > value in any supported manner.  I don't recall a reason that that
> > can't be done.
> 
> Why doesn't it parse config.h instead? I got 

Clint is right.  The clean solution would be to have Src/mkmakemod.sh.in
(or a small helper file it sources) with
  D=@D@
  if test $D = D; then is_dynamic=true; else is_dynamic=false; fi

and of course in configure.ac you'd need
  AC_CONFIG_FILES([Src/mkmakemod.sh]).

Cheers,
Ralf


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fwd: Re: zsh compilation problem with autoconf git
  2008-01-30  4:42   ` Ismail Dönmez
  2008-01-30  6:48     ` Ralf Wildenhues
@ 2008-01-30  9:57     ` Peter Stephenson
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 2008-01-30  9:57 UTC (permalink / raw)
  To: zsh-workers

Ismail =?utf-8?q?D=C3=B6nmez?= wrote:
> Why doesn't it parse config.h instead? I got
> 
> #define DYNAMIC 1
> 
> in config.h so this could be grepped easily.

That's a nice easy and effective fix.  If anyone wants to be more
sophisticated they can.

Index: Src/mkmakemod.sh
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/mkmakemod.sh,v
retrieving revision 1.16
diff -u -r1.16 mkmakemod.sh
--- Src/mkmakemod.sh	28 May 2007 22:57:41 -0000	1.16
+++ Src/mkmakemod.sh	30 Jan 2008 09:42:16 -0000
@@ -111,10 +111,7 @@
     sed -e '/^#/d' -e 's/ .*/ /' -e 's/^name=/ /'`"
     module_list="${bin_mods}${dyn_mods}"
 
-    # check 2.13, 2.50, and 2.60 syntaxes
-    if grep '%@D@%D%' config.status >/dev/null ||
-       grep ',@D@,D,' config.status >/dev/null ||
-       grep ',@D@,|#_!!_#|D,' config.status >/dev/null; then
+    if grep '^#define DYNAMIC ' config.h >/dev/null; then
 	is_dynamic=true
     else
 	is_dynamic=false


-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fwd: Re: zsh compilation problem with autoconf git
  2008-01-29 22:38 ` Clint Adams
  2008-01-30  4:42   ` Ismail Dönmez
@ 2008-01-30 13:03   ` Eric Blake
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Blake @ 2008-01-30 13:03 UTC (permalink / raw)
  To: Ismail Dönmez, zsh-workers, Ralf Wildenhues, bug-autoconf

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

According to Clint Adams on 1/29/2008 3:38 PM:
|> So the question is, is this thing needed at all, if yes why?
|
| Presumably Src/mkmakemod.sh would need to be generated to check that
| value in any supported manner.  I don't recall a reason that that
| can't be done.

The point was: Why not just use documented interfaces (such as AC_SUBST)
and skip the grep altogether?  The underlying interface is intentionally
unstable, and attempts to grep it are bound to fail as new autoconf
releases use new means of achieving the same results.  Your code will be
easier to maintain if you don't have to add a new grep statement for every
new autoconf release.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHoHW784KuGfSFAYARAkEbAJwIpAFwnIJH/hnrDZGD1hZSXX3NewCeLNhg
b5aVFo5xmZr7J5B7FTJeuPQ=
=JCNc
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-01-30 13:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-29 22:03 Fwd: Re: zsh compilation problem with autoconf git Ismail Dönmez
2008-01-29 22:38 ` Clint Adams
2008-01-30  4:42   ` Ismail Dönmez
2008-01-30  6:48     ` Ralf Wildenhues
2008-01-30  9:57     ` Peter Stephenson
2008-01-30 13:03   ` Eric Blake

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).