Subject: pkgsrc math/gap and pkgtools/bootstrap-mk-files
To: None <cjep@netbsd.org>
From: oliver gould <ogould@cs.stevens.edu>
List: pkgsrc-users
Date: 11/01/2006 12:55:28
--zCKi3GIZzVBPywwA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello-

While installing GAP on i386 Darwin, the ${CC} variable is set in a way
that breaks GAP's installation.

	$ bmake -dvx install
	...
	Global:CC =3D gcc -pipe
	...
	/usr/bin/install -d -o root -g wheel -m 755
	/usr/pkg/lib/gap4.3/bin/i386-apple-darwin8-gcc -pipe
	/usr/bin/install -c -s -o root -g wheel -m 555=20
	/Volumes/absolute-pkgsrc/pkgsrc/math/gap/work/gap4r3/bin/i386-apple-darwin=
8-gcc -pipe/gap=20
	/usr/pkg/lib/gap4.3/bin/i386-apple-darwin8-gcc -pipe
	install:
	/Volumes/absolute-pkgsrc/pkgsrc/math/gap/work/gap4r3/bin/i386-apple-darwin=
8-gcc:
	Inappropriate file type or format
	*** Error code 71

The culprit is this part of the Makefile:

    31  GAP_PLATFORM=3D   ${MACHINE_GNU_PLATFORM}-${CC}
    32
    33  PLIST_SUBST+=3D   GAP_PLATFORM=3D${GAP_PLATFORM:Q}

A space in CC, and therefore GAP_PLATFORM, inserts a space in the
install command line, which attempts to install into a bogus directory,
and creates an empty directory math/gap/-pipe

'-pipe' is appended to CC by pkgtools/bootstrap-mk-files in
/usr/pkg/share/mk/sys.mk.  Should '-pipe' be added to CFLAGS instead to
avoid this sort of error?  Something like...

	--- share/mk/sys.mk	2006-10-18 17:17:20.000000000 -0400
	+++ /tmp/sys.mk		2006-11-01 12:34:57.000000000 -0500
	@@ -21,9 +21,11 @@
	 LINK.S?=3D	${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
	=20
	 .if exists(/usr/bin/gcc)
	-CC?=3D		gcc -pipe
	+CC?=3D		gcc
	+CFLAGS+=3D	-pipe
	 .else
	-CC?=3D		cc -pipe
	+CC?=3D		cc
	+CFLAGS+=3D	-pipe
	 .endif
	 DBG?=3D		-O2
	 CFLAGS?=3D	${DBG}

Or should the Makefile strip spaces out of CC before appending it to
GAP_PLATFORM?

--=20
  .oliver

--zCKi3GIZzVBPywwA
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (NetBSD)

iD8DBQFFSN+QNtBooygWxWcRAp29AKCTugNqGu8nocYGCNZPV/roUJND7gCg8ZbC
pzXgwahei/xtf2W19O+dT+U=
=R13A
-----END PGP SIGNATURE-----

--zCKi3GIZzVBPywwA--