From owner-freebsd-current@FreeBSD.ORG Sun Nov 26 02:53:16 2006 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3B70D16A40F; Sun, 26 Nov 2006 02:53:16 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from sakura.ninth-nine.com (sakura.ninth-nine.com [219.127.74.120]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE60E43D62; Sun, 26 Nov 2006 02:52:22 +0000 (GMT) (envelope-from nork@FreeBSD.org) Received: from nadesico.ninth-nine.com (nadesico.ninth-nine.com [219.127.74.122]) by sakura.ninth-nine.com (8.13.8/8.13.8/NinthNine) with SMTP id kAQ2rB6f076354; Sun, 26 Nov 2006 11:53:12 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Sun, 26 Nov 2006 11:53:11 +0900 From: Norikatsu Shigemura To: Ruslan Ermilov Message-Id: <20061126115311.37d0aa08.nork@FreeBSD.org> In-Reply-To: <20061110173526.GA22441@rambler-co.ru> References: <20061110151247.GA64530@zone3000.net> <20061110173526.GA22441@rambler-co.ru> X-Mailer: Sylpheed version 2.3.0beta5 (GTK+ 2.10.6; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (sakura.ninth-nine.com [219.127.74.121]); Sun, 26 Nov 2006 11:53:12 +0900 (JST) Cc: David Xu , Norikatsu Shigemura , current@FreeBSD.org Subject: PTHREAD_CFLAGS/PTHREAD_LIBS clean test (Re: libpthread vs libthr.) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Nov 2006 02:53:16 -0000 On Fri, 10 Nov 2006 20:35:26 +0300 Ruslan Ermilov 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.*.