The build of npth-1.3 fails on NetBSD with:
- t-mutex --- libtool: link: gcc -O2 -g -fPIC -D_FORTIFY_SOURCE=2 -Wl,-z
-Wl,relro -Wl,-z -Wl,now -Wl,-rpath -Wl,/usr/pkg/lib -o .libs/t-mutex t-mutex.o
-L../src/.libs -lnpth -Wl,-rpath,/usr/pkg/lib
../src/.libs/libnpth.so:
undefined reference to `sem_wait'
../src/.libs/libnpth.so: undefined reference to `sem_init'
../src/.libs/libnpth.so: undefined reference to `pthread_create' ../src/.libs/libnpth.so: undefined reference to
`sem_open'
../src/.libs/libnpth.so:
undefined reference to `sem_post'
- t-fork
- ../src/.libs/libnpth.so: undefined reference to sem_wait' ../src/.libs/libnpth.so: undefined reference to sem_init' ../src/.libs/libnpth.so: undefined reference
to `pthread_create'
../src/.libs/libnpth.so: undefined reference to `sem_open'
../src/.libs/libnpth.so: undefined reference to `sem_post'
and
- t-thread ---
libtool: link: gcc -O2 -g -fPIC -D_FORTIFY_SOURCE=2 -Wl,-z -Wl,relro -Wl,-z
-Wl,now -Wl,-rpath -Wl,/usr/pkg/lib -o .libs/t-thread t-thread.o -L../src/.libs
-lnpth -Wl,-rpath,
/usr/pkg/lib
t-thread.o: In function `main':
/scratch/devel/npth/work/npth-1.3/tests/t-thread.c:127: undefined reference to
`pthread_attr_init'
/scratch/devel/npth/work/npth-1.3/tests/t-thread.c:129: undefined reference to
`pthread_attr_getdetachstate'
/scratch/devel/npth/work/npth-1.3/tests/t-thread.c:144: undefined reference to
`pthread_attr_destroy'
../src/.libs/libnpth.so: undefined reference to `sem_wait'
../src/.libs/libnpth.so: undefined reference to `sem_init'
../src/.libs/libnpth.so: undefined reference to `pthread_create'
../src/.libs/libnpth.so: undefined reference to `sem_open'
../src/.libs/libnpth.so: undefined reference to `sem_post'
- [t-thread] Error code 1
Adding "-pthread" to the CFLAGS fixes it. It would be great if this could be
automatically detected and added.