From owner-freebsd-ports Wed Aug 18 9: 1:19 1999 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 7F76E14C27 for ; Wed, 18 Aug 1999 09:01:17 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id JAA28899; Wed, 18 Aug 1999 09:00:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Wed, 18 Aug 1999 09:00:02 -0700 (PDT) Message-Id: <199908181600.JAA28899@freefall.freebsd.org> To: freebsd-ports@FreeBSD.org Cc: From: Motoyuki Konno Subject: Re: ports/13224: bug of gcc-2.95? (-D__FreeBSD__=3=4) Reply-To: Motoyuki Konno Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR ports/13224; it has been noted by GNATS. From: Motoyuki Konno To: imura@cs.titech.ac.jp Cc: freebsd-gnats-submit@freebsd.org Subject: Re: ports/13224: bug of gcc-2.95? (-D__FreeBSD__=3=4) Date: Thu, 19 Aug 1999 00:20:45 +0900 Hi, imura@cs.titech.ac.jp wrote: > If a code have "__FreeBSD__" compile fails, because > $(LOCALBASE)/lib/gcc-lib/i386-portbld-freebsd3.2/2.95/specs says > "-D__FreeBSD__=3=4" which comes from $(WRKSRC)/gcc/specs, I'm not sure. > This may be $(WRKSRC)/gcc/stage1/specs or $(WRKSRC)/gcc/stage2/specs. > >How-To-Repeat: > Compile a code which have "__FreeBSD__". > >Fix: > Following patches may solve the problem. I think the problem caused by the followings. In the file ports/lang/egcs/files/freebsd.h, -------- #define CPP_FBSD_PREDEFINES " -Dunix -D__FreeBSD__=4 -Asystem(unix) -Asystem(FreeBSD) " -------- In the file ports/lang/egcs/Makefile -------- pre-configure: @(MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \ ${SED} -e "s:__FreeBSD__:__FreeBSD__=$${MAJ}:" ${FILESDIR}/freebsd.h \ >${WRKSRC}/gcc/config/freebsd.h ) -------- So, apply following patches to solve this problem. ========== --- ports/lang/egcs/files/freebsd.h.old Mon Aug 16 10:42:29 1999 +++ ports/lang/egcs/files/freebsd.h Thu Aug 19 00:19:48 1999 @@ -55,7 +55,7 @@ /* Place spaces around this string. We depend on string splicing to produce the final CPP_PREDEFINES value. */ -#define CPP_FBSD_PREDEFINES " -Dunix -D__FreeBSD__=4 -Asystem(unix) -Asystem(FreeBSD) " +#define CPP_FBSD_PREDEFINES " -Dunix -D__FreeBSD__ -Asystem(unix) -Asystem(FreeBSD) " /* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate libc, depending on whether we're doing profiling or need threads support. ========== -- ------------------------------------------------------------------------ Motoyuki Konno mkonno@res.yamanashi-med.ac.jp (Univ) motoyuki@snipe.rim.or.jp (Home) motoyuki@FreeBSD.ORG (FreeBSD Project) Yamanashi Medical University http://www.freebsd.org/~motoyuki/ (WWW) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message