Subject: pkg/24345 fix
To: None <tech-pkg@netbsd.org>
From: Staffan Thomen <duck@multi.fi>
List: tech-pkg
Date: 02/08/2004 02:14:02
--Signature=_Sun__8_Feb_2004_02_14_02_+0200_y4Te.D7Yy1AOTSZp
Content-Type: multipart/mixed;
 boundary="Multipart=_Sun__8_Feb_2004_02_14_02_+0200_WVA9xYYunCgvb9jq"


--Multipart=_Sun__8_Feb_2004_02_14_02_+0200_WVA9xYYunCgvb9jq
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable


Hi, in a bored moment I wrote this, which should address the problem of
pkg/24345. It creates a new directory in ${WORKDIR}/.gcc, libexec and
links cc1/cc1plus/f771 there as appropriate, letting gcc find them in
../libexec.

Having not found any established way of contacting the appropriate
person, (aside from appending to the bug report? should I do this? I
found no clues on www.netbsd.org and this seems like a better place for
an untested patch anyway) I post it here.

Regards,

--=20
Staffan Thom=E9n
     GPG key: 1024D/7C7E2EF8
 Fingerprint: ADB3 455F 10D5 86D1 78D6  048D 11BB D66E 7C7E 2EF8


--Multipart=_Sun__8_Feb_2004_02_14_02_+0200_WVA9xYYunCgvb9jq
Content-Type: text/plain;
 name="gcc.mk.patch"
Content-Disposition: attachment;
 filename="gcc.mk.patch"
Content-Transfer-Encoding: quoted-printable

--- gcc.mk.orig	Sun Feb  8 01:42:07 2004
+++ gcc.mk	Sun Feb  8 01:43:25 2004
@@ -252,14 +252,20 @@
=20
 .  if !empty(_USE_PKGSRC_GCC:M[yY][eE][sS])
 _GCCBINDIR=3D	${_GCC_PREFIX}bin
+_GCCLIBEXECDIR=3D	${_GCC_PREFIX}libexec
 .  elif !empty(_IS_BUILTIN_GCC:M[yY][eE][sS])
 _GCCBINDIR=3D	${_CC:H}
+_GCCLIBEXECDIR=3D	${_CC:H}/../libexec
 .  endif
 .  if exists(${_GCCBINDIR}/gcc) && !empty(_LANGUAGES.gcc:Mc)
 _GCC_CC=3D	${_GCC_DIR}/bin/gcc
 _GCC_LINKS+=3D	_GCC_CC
 CC=3D		${_GCC_CC}
 .  endif
+.  if exists(${_GCCLIBEXECDIR}/cc1) && !empty(_LANGUAGES.gcc:Mc)
+_GCC_CC1=3D	${_GCC_DIR}/libexec/cc1
+_GCC_LINKS+=3D	_GCC_CC1
+.  endif
 .  if exists(${_GCCBINDIR}/cpp) && !empty(_LANGUAGES.gcc:Mc)
 _GCC_CPP=3D	${_GCC_DIR}/bin/cpp
 _GCC_LINKS+=3D	_GCC_CPP
@@ -270,16 +276,25 @@
 _GCC_LINKS+=3D	_GCC_CXX
 CXX=3D		${_GCC_CXX}
 .  endif
+.  if exists(${_GCCLIBEXECDIR}/cc1plus) && !empty(_LANGUAGES.gcc:Mc++)
+_GCC_CXX1=3D	${_GCC_DIR}/libexec/cc1plus
+_GCC_LINKS+=3D	_GCC_CXX1
+.  endif
 .  if exists(${_GCCBINDIR}/g77) && !empty(_LANGUAGES.gcc:Mfortran)
 _GCC_F77=3D	${_GCC_DIR}/bin/g77
 _GCC_LINKS+=3D	_GCC_F77
 F77=3D		${_GCC_F77}
 PKG_FC:=3D	${F77}
 .  endif
+.  if exists(${_GCCLIBEXECDIR}/f771) && !empty(_LANGUAGES.gcc:Mfortran)
+_GCC_F771=3D	${_GCC_DIR}/libexec/f771
+_GCC_LINKS+=3D	_GCC_F771
+.  endif
=20
 # GCC passes flags to the linker using "-Wl,".
 _COMPILER_LD_FLAG=3D	-Wl,
=20
+#
 # Pass the required flags to imake to tell it we're using gcc on Solaris.
 .  if ${OPSYS} =3D=3D "SunOS"
 IMAKEOPTS+=3D	-DHasGcc2=3DYES -DHasGcc2ForCplusplus=3DYES
@@ -340,8 +355,13 @@
 override-tools: ${${_target_}}       =20
 ${${_target_}}:
 	${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+.       ifdef ${${_target_}:M*libexec*}
+	${_PKG_SILENT}${_PKG_DEBUG}					\
+	${LN} -fs ${_GCCLIBEXECDIR}/${${_target_}:T} ${.TARGET}
+.       else
 	${_PKG_SILENT}${_PKG_DEBUG}					\
 	${LN} -fs ${_GCCBINDIR}/${${_target_}:T} ${.TARGET}
+.       endifdef
 .      endif
 .    endfor
 .  endif # COMPILER_GCC_MK

--Multipart=_Sun__8_Feb_2004_02_14_02_+0200_WVA9xYYunCgvb9jq--

--Signature=_Sun__8_Feb_2004_02_14_02_+0200_y4Te.D7Yy1AOTSZp
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (IRIX)

iD8DBQFAJX9NEbvWbnx+LvgRAh40AJ4jvbadNMgkCA9I44UkSx2CHwWZxQCfRr3S
Yh2H0PBoHT1ixewEqxiKZmE=
=85pU
-----END PGP SIGNATURE-----

--Signature=_Sun__8_Feb_2004_02_14_02_+0200_y4Te.D7Yy1AOTSZp--