Jim Meyering <[EMAIL PROTECTED]> wrote:
> Ralf Wildenhues <[EMAIL PROTECTED]> wrote:
>> Hi David,
> ...
>>> + err = __argz_append (&dst, &dst_len, src, (arg - src));
>>
>> Shouldn't this be argz_append? How come you don't get a link error
>> with this?
>>
>>> + delayed_copy = 0;
>>> + }
>>> + if (! err)
>>> + err = __argz_add (&dst, &dst_len, to);
>>
>> Likewise, argz_add.
>
> These are compelling arguments for automatic derivation of
> the file from the glibc sources.
Wow. There are many differences between libtool's argz.c and glibc's.
I suppose it's been a long time since things have been synced. Here's a
script to generate argz.c from glibc's sources (this also appends the
few missing functions):
cat <<\EOF > argz-gen
#!/bin/sh
glibc_dir=/mirror/d/glibc
f='
append
addsep
ctsep
insert
next
stringify
count
extract
create
delete
replace
'
for i in $f; do
perl -pe 's/__(argz_|st|mem)/$1/g' $glibc_dir/string/argz-$i.c \
| perl -0x0 -pe 's,/\*(.|\n)+?\*/\n,,' \
| grep -vE '^(#include|INTDEF|weak_alias|libc_hidden_def)'
done
EOF
Run it like this:
sh argz-gen > argz.c
For now, I haven't considered what headers to include
at the top, nor have I tried to emit a copyright comment
in the result, but the existing ones should work fine.
This is just to let us evaluate the differences.
>From the looks of the commit logs for libtool/libltdl/argz.c,
there have been no changes, other than regarding included headers,
so there should be no need to push libtool-specific bug fixes
back to glibc.