Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jul 2008 16:09:10 +0300
From:      "V.Chukharev" <chukharev@mail.ru>
To:        "Dirk Meyer" <dirk.meyer@dinoex.sub.org>, freebsd-ports@freebsd.org
Subject:   Re: Mk/bsd.openssl.mk optimization
Message-ID:  <op.ueumske80g54sc@localhost>
In-Reply-To: <08GlBzRclM@dmeyer.dinoex.sub.org>
References:  <op.ueqfl1xy0g54sc@localhost> <08GlBzRclM@dmeyer.dinoex.sub.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Fri, 25 Jul 2008 07:30:18 +0300, Dirk Meyer <dirk.meyer@dinoex.sub.org> wrote:

> V.Chukharev schrieb:,
>
>> I should confess I do not understand how my patch works. I expected to see a
>> file /usr/ports/.openssl_installed or /tmp/index_something/.openssl_installed
>> or similar, but could not see it... But I hope this patch will inspire you
>> to do something really working.
>
> This patch breaks the desired funtion.

Yes, it does break things. It was intended only to demonstrate how big 
can be the speedup. I have mentioned I know very little about make.

> To speedup index build you can add in in your /etc/make.conf
> WITH_OPENSSL_BASE=yes
> or
> WITH_OPENSSL_PORT=yes

That's great! And is it possible to set some default value on installation,
and make each corresponding port change it accordingly? I mean, is there a 
procedure to ensure ports do such changes?

> The linker will pull in the latests version of libssl.so,
> So this check is necessary to detect an installed port version,
> and record the correct dependency.

Yes. Only, the detection can be done once per an index build.

> The result can be cached only if no other ports or package is installed.

You mean, my patch did not delete the cache at the end of the index build?
That's true. The patch was not a real one...

> 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.

> 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
[-- Attachment #2 --]
--- /usr/ports/Mk/bsd.openssl.mk.orig	2008-07-23 09:14:29.000000000 +0300
+++ /usr/ports/Mk/bsd.openssl.mk	2008-07-25 12:02:01.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 12:02:01.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
 
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.ueumske80g54sc>