Missing stpcpy on Solaris 8

Boban Acimovic acim@mbl.is
Fri, 26 Apr 2002 13:44:01 +0200


> Hmmm, put this into jnlib/stringhelp.c
>
> #ifndef HAVE_STPCPY
> char *
> stpcpy(char *a,const char *b)
> {
>     while( *b )
> *a++ = *b++;
>     *a = 0;
>
>     return (char*)a;
> }
> #endif

This definition is already in stringhelp.c

bin/sh ../libtool --mode=compile
 -DHAVE_CONFIG_H -I. -I. -I.. -I../src    -Os -Wall -c -o stringhelp.lo
`test -f stringhelp.c || echo './'`stringhelp.c
rm -f .libs/stringhelp.lo
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../src -Os -Wall -c
stringhelp.c -Wp,-MD,.deps/stringhelp.TPlo  -fPIC -DPIC -o
.libs/stringhelp.lo
stringhelp.c:358: redefinition of `stpcpy'
stringhelp.c:33: `stpcpy' previously defined here
make[2]: *** [stringhelp.lo] Error 1
make[2]: Leaving directory `/usr/local/src/libgcrypt-1.1.6/jnlib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/libgcrypt-1.1.6'
make: *** [all] Error 2

This look to me just like a problem in configuration script. If I do

gcc -Os -Wall -o .libs/testapi testapi.o ../jnlib/stringhelp.o
./.libs/libgcrypt.so -ldl -lnsl -lsocket -Wl,--rpath -Wl,/usr/local/lib

(../jnlib/stringhelp.o addes to original line)

then I get rid of stpcpy error. However, I still get other errors:

./.libs/libgcrypt.so: undefined reference to `_gcry_rndunix_constructor'
./.libs/libgcrypt.so: undefined reference to `__udiv_qrnnd'
./.libs/libgcrypt.so: undefined reference to
`register_internal_cipher_extension'
collect2: ld returned 1 exit status

Regards,
Boban Acimovic