Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Dec 2006 06:12:29 +0100 (CET)
From:      Karel Miklav <karel@lovetemple.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Karel Miklav <karel@lovetemple.net>
Subject:   ports/106655: Problem bootstrapping the gnat-gcc34 solved.
Message-ID:  <200612130512.kBD5CTEj020976@tp.unitedpeople.info>
Resent-Message-ID: <200612130520.kBD5K8mp068757@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         106655
>Category:       ports
>Synopsis:       Problem bootstrapping the gnat-gcc34 solved.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 13 05:20:03 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Karel Miklav
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD tp.unitedpeople.info 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Thu Oct 12 00:18:05 CEST 2006 lino@tp.unitedpeople.info:/usr/obj/usr/src/sys/TPX40 i386
	
>Description:
Bootstrapping the compiler with a custom compiler doesn't work.   
	
>How-To-Repeat:
Install lang/gnat then try to build this one.
	
>Fix:
Require the binary compiler specified in the port for bootstrapping. Summary of
changes:

 - require specified binary compiler for bootstrapping
 - some aesthetic changes in the Makefile
 - bump PORTVERSION

The patch follows.

diff -urN /usr/ports/lang/gnat-gcc34/Makefile gnat-gcc34/Makefile
--- /usr/ports/lang/gnat-gcc34/Makefile	Wed Nov  1 00:11:32 2006
+++ gnat-gcc34/Makefile	Wed Dec 13 05:37:55 2006
@@ -8,12 +8,15 @@
 
 PORTNAME=		gnat-gcc
 PORTVERSION=	3.4.6
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=		lang
-MASTER_SITES=	${MASTER_SITE_GCC}
-MASTER_SITE_SUBDIR=	releases/gcc-${PORTVERSION}
+MASTER_SITES=	${MASTER_SITE_GCC} \
+				${MASTER_SITE_LOCAL}:boot
+MASTER_SITE_SUBDIR=	releases/gcc-${PORTVERSION} \
+				deischen/gcc/:boot
 DISTFILES=		gcc-core-${PORTVERSION}.tar.gz \
-				gcc-ada-${PORTVERSION}.tar.gz
+				gcc-ada-${PORTVERSION}.tar.gz \
+				gnat-3.15p-boot.tar.gz:boot
 
 MAINTAINER=		karel@lovetemple.net
 COMMENT=		The GNU Ada Compiler system
@@ -21,7 +24,7 @@
 ONLY_FOR_ARCHS=	i386
 
 USE_GMAKE=	yes
-USE_PERL5=	yes
+USE_PERL5=	yes # Needed? Builds on 6.1 and bootstrapps the 4.1 without Perl.
 USE_BISON=	yes
 
 CONFLICTS=	gcc-3.4.*
@@ -31,7 +34,7 @@
 			gcc${gcc_suffix}.1 \
  			gcov${gcc_suffix}.1
 MAN7=		${fsf_mans:S/$/${fsf_suffix}.7/}
-NOMANCOMPRESS=	yes	# too hard to deal with differences on 5-cur and releng4
+NOMANCOMPRESS=	yes	# Too hard to deal with differences on 5-cur and releng4?
 INFO=		gcc${gcc_suffix}/cpp \
 			gcc${gcc_suffix}/cppinternals \
 			gcc${gcc_suffix}/gcc \
@@ -75,74 +78,37 @@
 
 USE_LDCONFIG=	${targlib}
 
-# You need a compiler who calls an existing GNAT compiler (3.15 or greater).
-# By default, we'll look for one in the path.  If we can't find one, we'll
-# fetch a distfile containing a minimum (still pretty large) compiler toolset
-# and use that to build.
-gnat_gcc!=	if ${WHICH} adagcc > /dev/null 2>&1; then \
-				${ECHO_CMD} "`${WHICH} adagcc`"; \
-			else \
-				${ECHO_CMD} ""; \
-			fi
-gnat_bind!=	if ${WHICH} gnatbind > /dev/null 2>&1; then \
-				${ECHO_CMD} "`${WHICH} gnatbind`"; \
-			else \
-				${ECHO_CMD} ""; \
-			fi
-.if empty(gnat_gcc)
-gnat_gcc!=	if ${WHICH} gnatgcc > /dev/null 2>&1; then \
-				${ECHO_CMD} "`${WHICH} gnatgcc`"; \
-			else \
-				${ECHO_CMD} ""; \
-			fi
-.endif
-
-.if !empty(gnat_gcc) && !empty(gnat_bind)
-build_path!=	if [ -x ${gnat_gcc} -a -x ${gnat_bind} ]; then \
-				${ECHO_CMD} "$$PATH"; \
-			else \
-				${ECHO_CMD} ""; \
-			fi
-.else
-build_path=
-.endif
-
-.if empty(build_path)
-DISTFILES+=		gnat-3.15p-boot.tar.gz:boot
-MASTER_SITES+=	${MASTER_SITE_LOCAL}:boot
-MASTER_SITE_SUBDIR+=	deischen/gcc/:boot
+# An ancient binary distribution of GNAT is used for bootstrapping.
 .if ${OSVERSION} >= 500000
 BUILD_DEPENDS+=	${LOCALBASE}/lib/compat/libc.so.4:${PORTSDIR}/misc/compat4x
 .endif
 # Warning! You need the trailing slash on GCC_EXEC_PREFIX.
-compiler_data=	GCC_EXEC_PREFIX=${WRKDIR}/adaboot/lib/gcc-lib/ \
+compiler_defs=	GCC_EXEC_PREFIX=${WRKDIR}/adaboot/lib/gcc-lib/ \
 				ADA_INCLUDE_PATH=${WRKDIR}/adaboot/lib/gcc-lib/adainclude \
 				ADA_OBJECTS_PATH=${WRKDIR}/adaboot/lib/gcc-lib/adalib
 bootstrap_path=	${WRKDIR}/adaboot/bin
 build_path=		${bootstrap_path}:${PATH}
-gnat_gcc=		adagcc
-.endif
 
 # Make sure we use the Ada-aware gcc compiler.
-CC=				${gnat_gcc}
+CC=				adagcc
 # C compiler from GNAT 3.15 doesn't understand modern flags.
 CFLAGS=
-CONFIGURE_ENV+=	${compiler_data} PATH=${build_path}
-MAKE_ENV+=		${compiler_data} PATH=${build_path} PTHREAD_LIBS=${PTHREAD_LIBS} CC=${CC}
+CONFIGURE_ENV+=	${compiler_defs} PATH=${build_path} CC=${CC}
+MAKE_ENV+=		${compiler_defs} PATH=${build_path} CC=${CC} PTHREAD_LIBS=${PTHREAD_LIBS}
 
 pre-everything::
 	@${ECHO_MSG} "Making GCC ${DISTNAME:S/^gcc-//} for ${OPSYS} ${OSREL} target=${CONFIGURE_TARGET}"
 
 # Append ' [FreeBSD]' to gcc version string.
 post-patch:
-	@${REINPLACE_CMD} -e 's|\(const char version_string.*\)";|\1 [FreeBSD]";|' \
+	${REINPLACE_CMD} -e 's|\(const char version_string.*\)";|\1 [FreeBSD]";|' \
 	    ${WRKSRC}/gcc/version.c
 
 pre-configure:
 	cd ${WRKSRC}; contrib/gcc_update --touch
-	@${RM} -f ${WRKSRC}/gcc/*/*.info*
-	@${MKDIR} ${CONFIGURE_WRKSRC}
-	# Ada and C compilers should be the same.
+	${RM} -f ${WRKSRC}/gcc/*/*.info*
+	${MKDIR} ${CONFIGURE_WRKSRC}
+	@# Ada and C compilers should be the same.
 	if [ -d ${bootstrap_path} ]; then \
 		${LN} -s ${bootstrap_path}/adagcc ${bootstrap_path}/cc; \
 	fi
@@ -158,16 +124,16 @@
 post-install:
 	${LN} -s ${PREFIX}/bin/gcc${gcc_suffix}/gcc${gcc_suffix} \
 		${PREFIX}/bin/gcc${gcc_suffix}/gcc
-	# Man pages can only be generated if Perl >= 5.6 is installed; fake them otherwise.
+	@# Man pages can only be generated if Perl >= 5.6 is installed; fake them otherwise.
 	for mp in ${_MANPAGES}; do \
 		${TEST} -e $${mp} || ${TOUCH} ${TOUCH_FLAGS} $${mp}; \
 	done
-	# Version FSF funding and licensing manuals.
+	@# Version FSF funding and licensing manuals.
 	for mp in ${fsf_mans}; do \
 		${MV} -f ${PREFIX}/man/man7/$${mp}.7 \
 			${PREFIX}/man/man7/$${mp}${fsf_suffix}.7; \
 	done
-	# Prepare a temporary list of installed libraries and include files.
+	@# Prepare a temporary list of installed libraries and include files.
 	${RM} -f ${WRKDIR}/PLIST.lib
 	for d in ${targlib:S/^${PREFIX}\///} ${targlib:S/^${PREFIX}\///:S/lib/libexec/}; do \
 		cd ${PREFIX}; \
@@ -176,12 +142,12 @@
 			${FIND} $${d} -type d | ${SORT} -r | ${SED} -e 's/^/@dirrm /g' >>${WRKDIR}/PLIST.lib; \
 		fi; \
 	done
-	# Following directories should be removed on deinstal if empty. Add them to the temporary list.
+	@# Following directories should be removed on deinstal if empty. Add them to the temporary list.
 	${ECHO_CMD} "@unexec ${RMDIR} %D/lib/gcc/${CONFIGURE_TARGET} 2>/dev/null || true" >> ${WRKDIR}/PLIST.lib
 	${ECHO_CMD} "@unexec ${RMDIR} %D/lib/gcc 2>/dev/null || true" >> ${WRKDIR}/PLIST.lib
 	${ECHO_CMD} "@unexec ${RMDIR} %D/libexec/gcc/${CONFIGURE_TARGET} 2>/dev/null || true" >> ${WRKDIR}/PLIST.lib
 	${ECHO_CMD} "@unexec ${RMDIR} %D/libexec/gcc 2>/dev/null || true" >> ${WRKDIR}/PLIST.lib
-	# Insert the temporary list in the packing list.
+	@# Insert the temporary list in the packing list.
 	cd ${WRKDIR}; ${SED} -i -e "/PLIST.lib/ r PLIST.lib" ${TMPPLIST}
 
 .include <bsd.port.post.mk>
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612130512.kBD5CTEj020976>