From owner-freebsd-ports@FreeBSD.ORG Fri Jul 25 17:13:12 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C39361065677 for ; Fri, 25 Jul 2008 17:13:12 +0000 (UTC) (envelope-from chukharev@mail.ru) Received: from mx2.mail.ru (mx2-2.mail.ru [194.67.23.122]) by mx1.freebsd.org (Postfix) with ESMTP id 91EAF8FC3D for ; Fri, 25 Jul 2008 17:13:12 +0000 (UTC) (envelope-from chukharev@mail.ru) Received: from [91.155.183.162] (port=60932 helo=localhost) by mx2.mail.ru with asmtp id 1KMQqs-0006k6-00; Fri, 25 Jul 2008 21:13:10 +0400 Date: Fri, 25 Jul 2008 20:14:41 +0300 To: "Dirk Meyer" , freebsd-ports@freebsd.org From: "V.Chukharev" Content-Type: text/plain; charset=koi8-r MIME-Version: 1.0 References: <08GlBzRclM@dmeyer.dinoex.sub.org> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: User-Agent: Opera Mail/9.51 (FreeBSD) X-Spam: Not detected X-Mras: OK Cc: Subject: Re: Mk/bsd.openssl.mk optimization X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jul 2008 17:13:12 -0000 On Fri, 25 Jul 2008 16:09:10 +0300, V.Chukharev wrote: > On Fri, 25 Jul 2008 07:30:18 +0300, Dirk Meyer wrote: > >> So you are right that make index could be otimized, >> but it will take much more work. > > Totally agree on this. I tryed to make caching in bsd.subdir.mk as Kris > proposed, and I got also considerable speedup, but not as good as > with the first patch. The grep on all packages is done once per port > category. I miss how to pass the results to a child make... > > Anyway, I attach the new (better, but still not fully working) patch JFYI. Well, I've found how to pass params to a child make. So the next version of the patch comes at the end of this post. This patch should work well for index builds, but I have big doubts about all the rest. Please review and test if possible. With the patch Mk/bsd.port.sudir.mk .include's Mk/bsd.openssl.mk, hence everywhere when the former is used the latter is inderectly included. This is because I did not want to split the openssl staff into two parts. I put some protection. >> kind regards Dirk >> >> - Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany >> - [dirk.meyer@dinoex.sub.org],[dirk.meyer@guug.de],[dinoex@FreeBSD.org] >> http://people.freebsd.org/~dinoex/errorlogs/ >> > > > Best regards, -- V. Chukharev $ cat ~/Mk_bsd.openssl.mk_2.patch --- /usr/ports/Mk/bsd.openssl.mk.orig 2008-07-23 09:14:29.000000000 +0300 +++ /usr/ports/Mk/bsd.openssl.mk 2008-07-25 16:06:16.000000000 +0300 @@ -33,6 +33,9 @@ # BUILD_DEPENDS - are added if needed # RUN_DEPENDS - are added if needed +.if !defined(BSD_OPENSSL_MK) +BSD_OPENSSL_MK=yes + OpenSSL_Include_MAINTAINER= dinoex@FreeBSD.org # honor obsolete options for a bit @@ -121,13 +124,19 @@ exists(${DESTDIR}/${LOCALBASE}/lib/libcrypto.so) # find installed port and use it for dependency PKG_DBDIR?= ${DESTDIR}/var/db/pkg +.if !defined(OPENSSL_INSTALLED) OPENSSL_INSTALLED!= grep -l -r "^lib/libssl.so." "${PKG_DBDIR}" | \ while read contents; do \ sslprefix=`grep "^@cwd " "$${contents}" | ${HEAD} -n 1`; \ if test "$${sslprefix}" = "@cwd ${LOCALBASE}" ; then \ echo "$${contents}"; break; fi; done +.endif +.if !defined(OPENSSL_PORT) OPENSSL_PORT!= grep "^@comment ORIGIN:" "${OPENSSL_INSTALLED}" | ${CUT} -d : -f 2 +.endif +.if !defined(OPENSSL_SHLIBFILE) OPENSSL_SHLIBFILE!= grep "^lib/libssl.so." "${OPENSSL_INSTALLED}" +.endif OPENSSL_SHLIBVER?= ${OPENSSL_SHLIBFILE:E} .endif OPENSSL_PORT?= security/openssl @@ -168,3 +177,4 @@ ### crypto #RESTRICTED= "Contains cryptography." +.endif --- /usr/ports/Mk/bsd.port.subdir.mk.orig 2008-07-21 16:00:36.000000000 +0300 +++ /usr/ports/Mk/bsd.port.subdir.mk 2008-07-25 16:06:16.000000000 +0300 @@ -56,6 +56,10 @@ DESCR?= ${PKGDIR}/pkg-descr .include "${PORTSDIR}/Mk/bsd.commands.mk" +#cache variables from bsd.openssl.mk +.if !defined(BSD_OPENSSL_MK) +.include "${PORTSDIR}/Mk/bsd.openssl.mk" +.endif .MAIN: all @@ -374,6 +378,9 @@ PKGINSTALLVER="${PKGINSTALLVER:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \ HAVE_COMPAT_IA32_KERN="${HAVE_COMPAT_IA32_KERN}" \ CONFIGURE_MAX_CMD_LEN="${CONFIGURE_MAX_CMD_LEN}" \ + OPENSSL_INSTALLED="${OPENSSL_INSTALLED}" \ + OPENSSL_PORT="${OPENSSL_PORT}" \ + OPENSSL_SHLIBFILE="${OPENSSL_SHLIBFILE}" \ PYTHON_DEFAULT_VERSION="${PYTHON_DEFAULT_VERSION}" \ PYTHON_DEFAULT_PORTVERSION="${PYTHON_DEFAULT_PORTVERSION}" \ PYTHONBASE="${PYTHONBASE}" \