You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Farid Zaripov <Fa...@kyiv.vdiweb.com> on 2006/10/13 17:56:19 UTC

[PATCH] RE: svn commit: r454781 - /incubator/stdcxx/trunk/etc/config/windows/configure.wsf

 > -----Original Message-----
 > From: Martin Sebor [mailto:sebor@roguewave.com]
 > Sent: Wednesday, October 11, 2006 7:36 PM
 > To: stdcxx-dev@incubator.apache.org
 > Subject: Re: svn commit: r454781 -
 > /incubator/stdcxx/trunk/etc/config/windows/configure.wsf
 >
 > >   Sure. If someone will make changes to the libc_decl.sh I
 > will port
 > > the changes to configure.wsf. I'm not so familiar with sh
 > scripting to
 > > make useful format of file with functions.
 >
 > I was hoping we could automate it.

   I mean if someone will make changes to the libc_decl.sh to use
the external file with functions list, then I'll port the changes
to the configure.wsf. :)

   But I had read the bash-scripting guide and found nothing hard :)

   The proposed patch is attached.

Farid.

Re: [PATCH] RE: svn commit: r454781 - /incubator/stdcxx/trunk/etc/config/windows/configure.wsf

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
[...]
>   I mean if someone will make changes to the libc_decl.sh to use
> the external file with functions list, then I'll port the changes
> to the configure.wsf. :)
> 
>   But I had read the bash-scripting guide and found nothing hard :)
> 
>   The proposed patch is attached.
> 

Cool! This is exactly what I had in mind! This way we'll only have
one list of headers and functions to maintain.

[...]
> Index: config/src/libc_decl.sh
> ===================================================================
> --- config/src/libc_decl.sh	(revision 463143)
> +++ config/src/libc_decl.sh	(working copy)
> @@ -66,12 +66,12 @@
>      function="$3"
>  fi
>  
> +# include headers.inc file
> +inc="`echo $0 | sed 's/libc_decl.sh/headers.inc/'`"
> +. $inc

I assume the reason for the sed command is to include the file
from the same directory as where libc_decl.sh resides, correct?
If so, the dirname command might be a more appropriate choice:
http://www.opengroup.org/onlinepubs/009695399/utilities/dirname.html

But I'm not sure that using $0 for this is guaranteed to work
the way you expect. The first argument expands to the name of
the command, not necessarily its pathname.

I would suggest using the TOPDIR variable defined in the vars.sh
file included at the top of the script instead. Like so (untested):

. $TOPDIR/etc/config/src/headers.inc

Martin