Subject: pkg/5781: mysql doesnt build on alpha
To: None <gnats-bugs@gnats.netbsd.org>
From: Tim Rightnour <root@polaris.garbled.net>
List: netbsd-bugs
Date: 07/17/1998 06:24:10
>Number:         5781
>Category:       pkg
>Synopsis:       mysql doesnt build on alpha
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 17 06:20:01 1998
>Last-Modified:
>Originator:     Tim Rightnour
>Organization:
Tim Rightnour    -  root@garbled.net
http://www.zynetwc.com/~garbled/garbled.html
>Release:        6/10/98<NetBSD-current source date>
>Environment:
	
System: NetBSD polaris 1.3 NetBSD 1.3 (POLARIS) #0: Thu Mar 26 13:17:18 MST 1998 root@polaris:/usr/src/sys/arch/i386/compile/POLARIS i386


>Description:
mysql does not build on alpha.  Two problems: 
#1 -Bforcearchive breaks on alpha, --whole-archive is the answer to that
#2 you need -rpath for some binaries.
	
>How-To-Repeat:
try to build mysql on an alpha
	
>Fix:
two patches.. let me explain them..  This solution is a bit easier than 
libtool IMHO..  
First: the Makefile:
By setting it after the include, it brings the value of OBJECT_FMT into 
scope.  The WHOLEA and RPATH are then injected into the makefiles in the 
proper places.  This DTRT for both worlds, with a minimum of work.

in this case.. I simply added $(RPATH) to the LDADD= section of mysql's 
makefile.  the WHOLEA var was just as simple to do.  This sort of logic 
could even be added to the bsd.own.mk file and be kept out of the pkg's 
makefile


--- Makefile.orig	Thu Jul 16 04:19:10 1998
+++ Makefile	Fri Jul 17 05:31:55 1998
@@ -34 +34,9 @@
 .include "../../mk/bsd.pkg.mk"
+
+.if (${OBJECT_FMT} == "ELF") 
+WHOLEA=		--whole-archive
+RPATH=		-Wl,-rpath,${PREFIX}/lib
+.else
+WHOLEA=		-Bforcearchive
+.endif
+MAKE_ENV+=	WHOLEA=${WHOLEA} RPATH=${RPATH}


begin 644 patches/patch-ah
M+2TM(&-L:65N="]-86ME9FEL92YI;BYO<FEG"49R:2!*=6P@,3<@,#$Z,C$Z
M,3@@,3DY.`HK*RL@8VQI96YT+TUA:V5F:6QE+FEN"49R:2!*=6P@,3<@,#,Z
M-#0Z,S<@,3DY.`I`0"`M,3(T+#,@*S$R-"PS($!`"B!,24)3(#T)"0E`0TQ)
M14Y47TQ)0E-`"BU,1$%$1"`]"0D)+4PN("UL;7ES<6QC;&EE;G0**TQ$041$
M(#T)"0DD*%)0051(*2`M3"X@+6QM>7-Q;&-L:65N=`H@<&MG;&EB7TQ)0E)!
M4DE%4R`]"6QI8FUY<W%L8VQI96YT+F$*0$`@+34U-BPS("LU-38L,R!`0`H@
M;&EB;7ES<6QC;&EE;G0N<V\N)'M32%9%4E-)3TY].B!L:6)M>7-Q;&-L:65N
M=%]P:6,N80HM"20H3$0I("UX("U"<VAA<F5A8FQE("U"9F]R8V5A<F-H:79E
M(&QI8FUY<W%L8VQI96YT7W!I8RYA("UO("1`("0H3$E"4RD**PDD*$Q$*2`M
M>"`M0G-H87)E86)L92`D*%=(3TQ%02D@;&EB;7ES<6QC;&EE;G1?<&EC+F$@
0+6\@)$`@)"A,24)3*0H@"E=(
`
end


	
>Audit-Trail:
>Unformatted: