incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: [PATCH] RE: svn commit: r454781 - /incubator/stdcxx/trunk/etc/config/windows/configure.wsf
Date Fri, 13 Oct 2006 20:35:45 GMT
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

Mime
View raw message