Subject: Re: Openssl build changes
To: None <tech-toolchain@NetBSD.org>
From: Martin Husemann <martin@duskware.de>
List: tech-toolchain
Date: 12/09/2005 13:09:26
--rJwd6BRFiFCcLxzm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Dec 09, 2005 at 11:24:29AM +0100, Martin Husemann wrote:
> Btw: a lot of regress/lib/libcrypto Makefiles need the same change, or so
> it seems. They silently use the host openssl/opensslconf.h file.

Ok, if we need this hack multiple times, we need a better generic solution.
I tried to create one in the attached patch, but it does not work.
When invoked explicitly, the dir/symlink creation works; cleanup works too.

But: for some reason beyound me "realall" does not cause building of
${BUILDDIRSYMLINKS.t}.

Any hints?

Martin

--rJwd6BRFiFCcLxzm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch.v2"

Index: bsd.README
===================================================================
RCS file: /cvsroot/src/share/mk/bsd.README,v
retrieving revision 1.170
diff -u -r1.170 bsd.README
--- bsd.README	27 Jun 2005 20:32:40 -0000	1.170
+++ bsd.README	9 Dec 2005 12:05:01 -0000
@@ -590,6 +590,13 @@
 		For each lnsrc item, create a symlink named lntgt.
 		The lntgt symlinks are removed by the cleandir target.
 
+BUILDDIRSYMLINKS	List of three word items:
+			lnsrc lndir lntgt
+		For each lnsrc item, create a symlink named lntgt in a
+		subdirectory called lndir.
+		The lntgt symlinks and lndir subdirectories are removed
+		by the cleandir target.
+
 UUDECODE_FILES	List of files which are stored as <file>.uue in the source
 		tree. Each one will be decoded with ${TOOL_UUDECODE}.
 		The source files have a `.uue' suffix, the generated files do 
Index: bsd.files.mk
===================================================================
RCS file: /cvsroot/src/share/mk/bsd.files.mk,v
retrieving revision 1.37
diff -u -r1.37 bsd.files.mk
--- bsd.files.mk	17 May 2004 12:58:17 -0000	1.37
+++ bsd.files.mk	9 Dec 2005 12:05:01 -0000
@@ -108,6 +108,30 @@
 .endif								# }
 
 #
+# BUILDDIRSYMLINKS
+#
+.if defined(BUILDDIRSYMLINKS)					# {
+
+.for _SL _DL _TL in ${BUILDDIRSYMLINKS}
+BUILDDIRSYMLINKS.d+=	${_DL}
+BUILDDIRSYMLINKS.s+=	${_SL}
+BUILDDIRSYMLINKS.t+=	${_DL}/${_TL}
+${_DL}/${_TL}: ${_SL}
+	${_MKTARGET_CREATE}
+	rm -f ${.TARGET}
+	mkdir -p ${_DL}
+	ln -s ${.ALLSRC} ${.TARGET}
+.endfor
+
+realall: ${BUILDDIRSYMLINKS.t}
+
+cleandir: cleanbuilddirsymlinks
+cleanbuilddirsymlinks: .PHONY
+	rm -rf ${BUILDDIRSYMLINKS.d}
+
+.endif								# }
+
+#
 # .uue -> "" handling (i.e. decode a given binary/object)
 #
 # UUDECODE_FILES -	List of files which are stored in the source tree
Index: Makefile
===================================================================
RCS file: /cvsroot/src/lib/libcrypto/Makefile,v
retrieving revision 1.43
diff -u -r1.43 Makefile
--- Makefile	25 Nov 2005 20:34:31 -0000	1.43
+++ Makefile	9 Dec 2005 12:05:23 -0000
@@ -36,6 +36,9 @@
 
 .include "srcs.inc"
 
+# The sources refer to opensslconf.h via <openssl/opensslconf.h>, so
+# create a suitable symlink to make it available via "-I ."
+BUILDDIRSYMLINKS +=  ${OPENSSLSRC}/crypto/opensslconf.h openssl opensslconf.h
 
 # XXX
 .if ${OBJECT_FMT} == "ELF"

--rJwd6BRFiFCcLxzm--