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. Fix: Following patches may solve the problem. How-To-Repeat: Compile a code which have "__FreeBSD__".
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)
Responsible Changed From-To: freebsd-ports->obrien Over to maintainer
State Changed From-To: open->closed problem fixed