PTHREAD_CFLAGS/PTHREAD_LIBS clean test (Re: libpthread vs libthr.)
Norikatsu Shigemura
nork at FreeBSD.org
Sat Nov 25 18:53:16 PST 2006
On Fri, 10 Nov 2006 20:35:26 +0300
Ruslan Ermilov <ru at freebsd.org> wrote:
> To make user's life easier, I suggest the following simple patch.
> Its effect on platforms where libpthread is available is to (sym)link
> libthr to libpthread if WITHOUT_LIBPTHREAD is set in /etc/src.conf.
> This would allow more people interested in libthr testing to more
> easily do it. (Of course already linked applications wouldn't
> magically start using libthr without also patching /etc/libmap.conf.)
> %%%
> Index: Makefile
> ===================================================================
> RCS file: /home/ncvs/src/lib/libthr/Makefile,v
> retrieving revision 1.20
> diff -u -p -r1.20 Makefile
> --- Makefile 22 Aug 2006 07:51:06 -0000 1.20
> +++ Makefile 10 Nov 2006 17:27:40 -0000
> @@ -42,7 +42,7 @@ PRECIOUSLIB=
> .include "${.CURDIR}/sys/Makefile.inc"
> .include "${.CURDIR}/thread/Makefile.inc"
>
> -.if ${MACHINE_ARCH} == "sparc64"
> +.if ${MACHINE_ARCH} == "sparc64" || ${MK_LIBPTHREAD} == "no"
> SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a
> .if !defined(NO_PIC)
> SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so
> %%%
In the case you said (echo WITHOUT_LIBPTHREAD=yes >> /etc/src.conf),
we cannot get libkse.*. Because lib/libpthread is omitted in
lib/Makefile:-(.
I'm trying to test PTHREAD_CFLAGS/PTHREAD_LIBS. So I prepared
following environment.
x libpthread.* (removed as passible as)
o libkse.*
o libthr.*
But WITHOUT_LIBPTHREAD (MK_LIBPTHREAD=no) option is too danger.
$ cd /usr/src
$ fgrep -r MK_LIBPTHREAD .
./lib/Makefile:.if ${MK_LIBPTHREAD} != "no"
./sbin/ggate/Makefile:.elif ${MK_LIBPTHREAD} != "no"
./share/man/man3/Makefile:.if ${MK_LIBPTHREAD} != "no" || ${MK_LIBTHR} != "no"
./tools/build/mk/OptionalObsoleteFiles.inc:#.if ${MK_LIBPTHREAD} == no
./usr.bin/Makefile:.elif ${MK_LIBPTHREAD} != "no"
./usr.sbin/Makefile:.if ${MK_LIBPTHREAD} != "no"
./usr.sbin/Makefile:.if ${MK_LIBPTHREAD} != "no"
./usr.sbin/Makefile:.if ${MK_LIBPTHREAD} != "no"
ok lib/Makefile has no problem.
ng In case of sbin/ggate/Makefile, ggatec and ggated will not be
installed.
ok share/man/man3/Makefile has no problem.
ok tools/build/mk/OptionalObsoleteFiles.inc has no problem.
ng In case of usr.bin/Makefile, csup will not be installed.
ng In case of usr.sbin/Makefile, pppctl will not be installed.
And usr.sbin/cached/Makefile and usr.sbin/ngctl/Makefile is not
good WITHOUT_LIBPTHREAD. I couldn't compile them. I think that
these should be omitted in usr.sbin/Makefile like pppctl case.
And FreeBSD src tree don't have PTHREAD_CFLAGS/PTHREAD_LIBS clean
mechanism. I think that there are some way to adopt PTHREAD_CFLAGS/
PTHREAD_LIBS to src tree, maybe. But I don't know how do I do
anyway.
1. force lib/libpthread install libkse.* to /usr/lib, and symlink
to /lib/libpthread.*. I don't know KEYWORD to symlink to /lib/
libpthread.* from libkse.*/libthr.*.
2. Fix like following in usr.bin/Makefile and usr.sbin/Makefile:
.if ${MK_LIBPTHREAD} != "no"
.....
:
to
.if ${MK_LIBPTHREAD} != "no" || ${MK_LIBTHR} != "no"
.....
:
And compile force lib/libpthread. And in case of
MK_LIBPTHREAD=no, symlink libthr.* to libpthread.*.
More information about the freebsd-current
mailing list