Subject: RE: pkgsrc math/gap and pkgtools/bootstrap-mk-files
To: 'oliver gould' <cjep@netbsd.org>
From: Chris Pinnock <cjep@fawlty.net>
List: pkgsrc-users
Date: 11/01/2006 19:52:11
Can someone on the list with bootstrap kit knowledge and a Darwin setup look
at this please to see if this is a general error? Oliver: please would you
file a PR at http://www.netbsd.org/Misc/send-pr.html


> -----Original Message-----
> From: oliver gould [mailto:ogould@cs.stevens.edu]
> Sent: 01 November 2006 17:55
> To: cjep@netbsd.org
> Cc: pkgsrc-users@netbsd.org
> Subject: pkgsrc math/gap and pkgtools/bootstrap-mk-files
> 
> 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 = 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
> 	/Volumes/absolute-pkgsrc/pkgsrc/math/gap/work/gap4r3/bin/i386-apple-
> darwin8-gcc -pipe/gap
> 	/usr/pkg/lib/gap4.3/bin/i386-apple-darwin8-gcc -pipe
> 	install:
> 	/Volumes/absolute-pkgsrc/pkgsrc/math/gap/work/gap4r3/bin/i386-apple-
> darwin8-gcc:
> 	Inappropriate file type or format
> 	*** Error code 71
> 
> The culprit is this part of the Makefile:
> 
>     31  GAP_PLATFORM=   ${MACHINE_GNU_PLATFORM}-${CC}
>     32
>     33  PLIST_SUBST+=   GAP_PLATFORM=${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?=	${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
> 
> 	 .if exists(/usr/bin/gcc)
> 	-CC?=		gcc -pipe
> 	+CC?=		gcc
> 	+CFLAGS+=	-pipe
> 	 .else
> 	-CC?=		cc -pipe
> 	+CC?=		cc
> 	+CFLAGS+=	-pipe
> 	 .endif
> 	 DBG?=		-O2
> 	 CFLAGS?=	${DBG}
> 
> Or should the Makefile strip spaces out of CC before appending it to
> GAP_PLATFORM?
> 
> --
>   .oliver