On Mon, 6 Aug 2012, Ian Lance Taylor wrote:

On Mon, Aug 6, 2012 at 9:34 PM, Dimitrios Apostolou <ji...@gmx.net> wrote:
As an addendum to my previous patch, I made an attempt to properly add
strnlen() to libiberty, with the code copied from gnulib. Unfortunately it
seems I've messed it up somewhere since defining HAVE_STRNLEN to 0 doesn't
seem to build strnlen.o for me. Any ideas?

What do you mean by "defining HAVE_STRNLEN to 0"?  The thing that will
control building strnlen.o is having AC_REPLACE_FUNCS in
libiberty/configure.in fail to find strlen.  One way you can test this
is by adding this to libiberty/config.cache:

ac_cv_func_strnlen=${ac_cv_func_strnlen=yes}

before invoking configure.

Thanks Ian, that helped a lot. I changed ac_cv_func_strnlen=no and reconfigured with -C, and strnlen.o was built. :-)

What else is missing to make this patch appropriate for libiberty? Should I change the prolog in strnlen.c, since I only copied it intact from gnulib?


Thanks,
Dimitris

Reply via email to