aboutsummaryrefslogtreecommitdiffstats
path: root/lang/gnat/Makefile
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2009-07-19 11:38:31 +0800
committerdeischen <deischen@FreeBSD.org>2009-07-19 11:38:31 +0800
commit065d42e2bb11ca4e6f3ac89b2f77482ba610b025 (patch)
treeae16337a67a629fb5173a17ee7c217e1bee1043a /lang/gnat/Makefile
parent36fbe4554d00c52fba0602ef7c7fa87da666829e (diff)
downloadfreebsd-ports-gnome-065d42e2bb11ca4e6f3ac89b2f77482ba610b025.tar.gz
freebsd-ports-gnome-065d42e2bb11ca4e6f3ac89b2f77482ba610b025.tar.zst
freebsd-ports-gnome-065d42e2bb11ca4e6f3ac89b2f77482ba610b025.zip
Update to the 2009 gpl edition.
Borrow some makefile foo from lang/gnat-gcc43.
Diffstat (limited to 'lang/gnat/Makefile')
-rw-r--r--lang/gnat/Makefile241
1 files changed, 116 insertions, 125 deletions
diff --git a/lang/gnat/Makefile b/lang/gnat/Makefile
index 9f2b1db799d9..ffad96101c30 100644
--- a/lang/gnat/Makefile
+++ b/lang/gnat/Makefile
@@ -7,115 +7,120 @@
# $FreeBSD$
#
# Note:
-# - FreeBSD tasking libraries created by Dan Eischen have been incorporated
-# into this edition
+# - FreeBSD tasking libraries are included in the stock source.
# - The default names of a number of binaries have been altered to avoid
# conflict with other gcc based products. Standard names can be provided
# using symbolic links.
-PORTNAME= gnat
-PORTVERSION= 2006
-PORTREVISION= 2
-CATEGORIES= lang
-MASTER_SITES= ${MASTER_SITE_LOCAL}:boot
+PORTNAME= gnat
+PORTVERSION= 2009
+PORTREVISION= 1
+CATEGORIES= lang
+MASTER_SITES= ${MASTER_SITE_LOCAL}:boot
MASTER_SITE_SUBDIR= deischen/gcc/:boot
-DISTFILES= ${GCC_SRCFILE}:gcc ${GNAT_SRCFILE}:gnat
+DISTFILES= ${gcc_srcfile}:gcc ${gnat_srcfile}:gnat
-MAINTAINER= eischen@vigrid.com
-COMMENT= The GNU Ada Compiler system
+MAINTAINER= eischen@vigrid.com
+COMMENT= The GNU Ada Compiler system
-CONFLICTS= gcc-3.4.*
-USE_GMAKE= yes
-USE_BISON= build
-USE_ICONV= yes
-USE_PERL5_RUN= yes
+LIB_DEPENDS= gmp.8:${PORTSDIR}/math/libgmp4 \
+ mpfr.3:${PORTSDIR}/math/mpfr
-.include <bsd.port.pre.mk>
+USE_GMAKE= yes
+USE_BISON= build
+USE_ICONV= yes
+USE_PERL5_BUILD= yes
+
+WRKSRC= ${WRKDIR}/build
-WRKSRC= ${WRKDIR}/gcc-34
-GNATNAME= gnat-gpl-2006-src
-GNUHOST= ${ARCH}-portbld-freebsd${OSREL}
-GCC_VERSION= 3.4.6
+MAN1= gnatgcc.1 gnatcpp.1 gnatgcov.1
+MAN7= fsf-funding.7 gfdl.7 gpl.7
+MAN7= ${fsf_mans:S/$/${fsf_suffix}.7/}
+
+.include <bsd.port.pre.mk>
+gcc_version= 4.3.4
+fsf_mans= fsf-funding gfdl gpl
+fsf_suffix= -${PORTNAME}
+gnuhost= ${CONFIGURE_TARGET}
+targlib= ${PREFIX}/lib/gcc-gnat
+targlibexec= ${PREFIX}/libexec/gcc-gnat
+gcc_srcdir= gcc-43-src
+gnat_srcdir= gnat-gpl-2009-src
+gcc_wrksrc= ${WRKDIR}/${gcc_srcdir}
+gnat_wrksrc= ${WRKDIR}/${gnat_srcdir}
# http://libre.adacore.com/:gcc
# http://libre.adacore.com/:gnat
-GCC_SRCFILE= gcc-3.4.6-src.tgz
-GNAT_SRCFILE= gnat-gpl-2006-src.tgz
+gcc_srcfile= gcc-43-branch-20090519-src.tgz
+gnat_srcfile= gnat-gpl-2009-src.tgz
-PLIST_SUB= GNUHOST=${GNUHOST} GCC_VERSION=${GCC_VERSION} \
- LIBRARY_VERSION=${LIBRARY_VERSION}
+PATCH_WRKSRC= ${gcc_wrksrc}
-# Make no mistake about what host/target we are building on/for.
-# This package does not support cross-compiling, and this fixes
-# problems with bsd.port.mk files from earlier FreeBSD 3.x releases.
-CONFIGURE_TARGET= ${GNUHOST}
+GNU_CONFIGURE= yes
+CONFIGURE_SCRIPT= ../${gcc_srcdir}/configure
CONFIGURE_ARGS= --enable-languages="c,ada" \
--program-prefix=gnat \
--disable-nls \
--with-system-zlib \
- --with-libiconv-prefix=${LOCALBASE}
+ --with-libiconv-prefix=${LOCALBASE} \
+ --libdir=${targlib} \
+ --libexecdir=${targlibexec} \
+ --disable-libada
+COMPILE_DATA= MAKEINFO=${FALSE}
+MAKE_ENV+= PTHREAD_LIBS=${PTHREAD_LIBS}
-TARGLIB= ${PREFIX}/lib/gcc/${GNUHOST}/${GCC_VERSION}
-GNU_CONFIGURE= yes
-MAN1= gnatgcc.1 gnatcpp.1 gnatgcov.1
-MAN7= fsf-funding.7 gfdl.7 gpl.7
-NO_PACKAGE= This version of GNAT produces GPL-tainted executables
+PLIST_SUB= GNUHOST=${gnuhost} GCC_VERSION=${gcc_version} \
+ LIBRARY_VERSION=${LIBRARY_VERSION}
# You need a compiler who calls an existing GNAT compiler (3.15 or greater).
# If you have one, point GNATGCC at it. 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.
-GNATGCC!= if ${WHICH} adagcc > /dev/null 2>&1; then \
- ${ECHO_CMD} "`${WHICH} adagcc`"; \
- else \
- ${ECHO_CMD} ""; \
- fi
-GNATBIND!= if ${WHICH} gnatbind > /dev/null 2>&1; then \
- ${ECHO_CMD} "`${WHICH} gnatbind`"; \
- else \
- ${ECHO_CMD} ""; \
- fi
-.if empty(GNATGCC)
-GNATGCC!= if ${WHICH} gnatgcc > /dev/null 2>&1; then \
- ${ECHO_CMD} "`${WHICH} gnatgcc`"; \
- else \
- ${ECHO_CMD} ""; \
- fi
-.endif
+GNATGCC!= if ${WHICH} gnatgcc > /dev/null 2>&1; then \
+ ${ECHO_CMD} "`${WHICH} gnatgcc`"; \
+ else \
+ ${ECHO_CMD} ""; \
+ fi
+GNATBIND!= if ${WHICH} gnatbind > /dev/null 2>&1; then \
+ ${ECHO_CMD} "`${WHICH} gnatbind`"; \
+ else \
+ ${ECHO_CMD} ""; \
+ fi
.if !empty(GNATGCC) && !empty(GNATBIND)
-have_boot!= if [ -x ${GNATGCC} -a -x ${GNATBIND} ]; then \
- ${ECHO_CMD} "$$PATH"; \
- else \
- ${ECHO_CMD} ""; \
- fi
+have_boot!= if [ -x ${GNATGCC} -a -x ${GNATBIND} ]; then \
+ ${ECHO_CMD} "$$PATH"; \
+ else \
+ ${ECHO_CMD} ""; \
+ fi
.else
have_boot=
.endif
.if empty(have_boot)
-ONLY_FOR_ARCHS= i386
-DISTFILES+= gnat-3.15p-boot.tar.gz:boot
-BUILD_DEPENDS+= ${LOCALBASE}/lib/compat/libc.so.4:${PORTSDIR}/misc/compat4x
+DISTFILES+= gnat-2005-boot.tgz:boot
+BUILD_DEPENDS+= ${LOCALBASE}/lib/compat/libc.so.6:${PORTSDIR}/misc/compat6x
# Warning! You need the trailing slash on GCC_EXEC_PREFIX.
-COMPILEDATA= 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
-have_boot= ${WRKDIR}/adaboot/bin:${PATH}
-GNATGCC= adagcc
+COMPILE_DATA+= GCC_EXEC_PREFIX=${WRKDIR}/adaboot/lib/gcc/ \
+ ADA_INCLUDE_PATH=${WRKDIR}/adaboot/lib/gcc/adainclude \
+ ADA_OBJECTS_PATH=${WRKDIR}/adaboot/lib/gcc/adalib
+GNATGCC= gnatgcc
+have_boot= ${WRKDIR}/adaboot/bin:${WRKDIR}/adaboot/libexec/gcc:${PATH}
.endif
# Make sure we use the Ada-aware gcc compiler.
-CC= ${GNATGCC}
-CONFIGURE_ENV= ${COMPILE_DATA} PATH=${have_boot}
+CC= ${GNATGCC}
+CONFIGURE_ENV+= ${COMPILE_DATA} CC=${GNATGCC} PATH=${have_boot}
+MAKE_ENV+= ${COMPILE_DATA} PATH=${have_boot}
# Shared library handling
+WANT_SHAREDLIBS=yes
.if defined(WANT_SHAREDLIBS)
CONFIGURE_ARGS+= --enable-shared
USE_LDCONFIG= yes
-LDCONFIG_DIRS= %%PREFIX%%/lib ${TARGLIB}
-LIBRARY_VERSION= 2006
+LDCONFIG_DIRS= %%PREFIX%%/lib ${targlib}
+LIBRARY_VERSION= 2009
PLIST_SUB+= SHAREDLIB=""
.else
CONFIGURE_ARGS+= --disable-shared
@@ -123,60 +128,32 @@ PLIST_SUB+= SHAREDLIB="@comment "
.endif
# Check for GNAT sources.
-.if !exists(${DISTDIR}/${GNAT_SRCFILE}) && !defined(PACKAGE_BUILDING)
-ECHO_MSG=/usr/bin/printf
-IGNORE= :\n\
-Because of licensing and registration restrictions, you must fetch the\n\
-source distribution manually. Please access http://libre.adacore.com/\n\
-with a web browser, register (it's free), and log in. Download the source\n\
-files:\n\
-\t${GNAT_SRCFILE}\n\
-\t${GCC_SRCFILE}\n\
-and place them in ${DISTDIR}.\n
+.if !exists(${DISTDIR}/${gnat_srcfile}) && !defined(PACKAGE_BUILDING)
+IGNORE= Because of licensing and registration restrictions, you must fetch the source distribution manually. Please access http://libre.adacore.com/ with a web browser, register (it's free), and log in. Download the source files: ${gnat_srcfile} ${gcc_srcfile} and place them in ${DISTDIR}.
.endif
pre-patch:
@${ECHO} "===> Applying FreeBSD ports tree patches for gcc34."
- @( cd ${WRKSRC}; \
- for i in ${PORTSDIR}/lang/gcc34/files/patch-*; do \
- ${PATCH} ${PATCH_ARGS} < $$i; \
- done )
- @${ECHO} "===> Applying GNAT supplied patches for gcc34."
- @( cd ${WRKSRC}; \
- ${PATCH} ${PATCH_ARGS} < ${WRKDIR}/${GNATNAME}/src/gcc-34.dif )
+ @${ECHO} "===> Applying GNAT supplied patches for gcc43."
+ @( cd ${gcc_wrksrc}/; \
+ ${CAT} ${gnat_wrksrc}/src/gcc-43.dif \
+ | ${AWK} ' { sub("\r", ""); print $0 }' | ${PATCH} ${PATCH_ARGS} )
@${ECHO} "===> Moving GNAT compiler sources into GCC tree."
- @( ${MV} ${WRKDIR}/${GNATNAME}/src/ada ${WRKDIR}/gcc-34/gcc )
-
-# Copy any additional files required into the correct locations, and also
-# remove .orig files leftover from patching so they won't get installed.
-post-patch:
- @(cd ${FILESDIR}; \
- for i in *.adb *.ads ; do \
- ${CP} $$i ${WRKSRC}/gcc/ada; \
- done )
+ @( ${MV} ${gnat_wrksrc}/src/ada ${gcc_wrksrc}/gcc )
pre-configure:
- @${TOUCH} ${TOUCH_FLAGS} ${WRKSRC}/gcc/cstamp-h.in
+ @${MKDIR} ${WRKSRC}
+ cd ${gcc_wrksrc} ; contrib/gcc_update --touch
+ ${RM} -f ${gcc_wrksrc}/gcc/*/*.info*
+ @${TOUCH} ${TOUCH_FLAGS} ${gcc_wrksrc}/gcc/cstamp-h.in
-#
-# Can't get this to work with default bsd.port.mk do-configure target.
-#
-do-configure:
- @(cd ${WRKSRC} && \
- ${SETENV} ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS})
-
-#
-# We intentionally override CFLAGS because the build procedure is explicitly
-# spelled out in gnat-3.13p-src/src/README.BUILD. Remove CFLAGS from the
-# do-build target at your own risk.
-#
do-build:
(cd ${WRKSRC}; \
PATH=${have_boot} \
- ${SETENV} ${COMPILEDATA} ${GMAKE} CC=${CC} )
+ ${SETENV} ${COMPILE_DATA} ${GMAKE} CC=${CC} )
(cd ${WRKSRC}; \
${SETENV} ${MAKE_ENV} \
- ${GMAKE} PTHREAD_LIBS=${PTHREAD_LIBS} bootstrap )
+ ${GMAKE} PTHREAD_LIBS=${PTHREAD_LIBS} bootstrap-lean )
(cd ${WRKSRC}; \
${SETENV} ${MAKE_ENV} \
${GMAKE} -C gcc PTHREAD_LIBS=${PTHREAD_LIBS} gnatlib )
@@ -189,16 +166,11 @@ do-build:
${SETENV} ${MAKE_ENV} \
${GMAKE} -C gcc PTHREAD_LIBS=${PTHREAD_LIBS} gnattools )
-do-install:
- (cd ${WRKSRC}; \
- ${SETENV} ${MAKE_ENV} ${GMAKE} ${INSTALL_TARGET} )
- ${INSTALL_SCRIPT} ${WRKSRC}/gcc/ada/gnathtml.pl ${PREFIX}/bin
-
post-install:
+ ${INSTALL_SCRIPT} ${gcc_wrksrc}/gcc/ada/gnathtml.pl ${PREFIX}/bin
@(for prog in \
${PREFIX}/bin/gnat \
${PREFIX}/bin/gnatbind \
- ${PREFIX}/bin/gnatbl \
${PREFIX}/bin/gnatchop \
${PREFIX}/bin/gnatclean \
${PREFIX}/bin/gnatcpp \
@@ -212,20 +184,39 @@ post-install:
${PREFIX}/bin/gnatname \
${PREFIX}/bin/gnatprep \
${PREFIX}/bin/gnatxref \
- ${PREFIX}/bin/${GNUHOST}-gcc-${GCC_VERSION} \
- ${PREFIX}/bin/${GNUHOST}-gnatgcc \
- ${PREFIX}/libexec/gcc/${GNUHOST}/${GCC_VERSION}/cc1 \
- ${PREFIX}/libexec/gcc/${GNUHOST}/${GCC_VERSION}/gnat1 \
- ${PREFIX}/libexec/gcc/${GNUHOST}/${GCC_VERSION}/collect2 ; \
+ ${PREFIX}/bin/${gnuhost}-gcc-${gcc_version} \
+ ${PREFIX}/bin/${gnuhost}-gnatgcc \
+ ${targlibexec}/${gnuhost}/${gcc_version}/cc1 \
+ ${targlibexec}/${gnuhost}/${gcc_version}/gnat1 \
+ ${targlibexec}/${gnuhost}/${gcc_version}/collect2 ; \
do \
if [ -x $$prog ]; then \
${STRIP_CMD} $$prog ; \
fi \
done)
- @(chown -R root:wheel ${TARGLIB})
-.if defined(WANT_SHAREDLIBS)
- ${MV} -f ${PREFIX}/lib/libgcc_s.* ${TARGLIB}
-.endif
- ${RM} -f ${PREFIX}/lib/libiberty.a
+ @(${CHOWN} -R root:wheel ${targlib})
+ @(${CHOWN} -R root:wheel ${targlibexec})
+ # This empty fortran directory is making trouble.
+ ${RM} -rf ${PREFIX}/lib/gcc-gnat/gcc/${CONFIGURE_TARGET}/${gcc_version}/finclude
+ # Version FSF funding and licensing manuals. XXX Fix before it happens!
+ 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.
+ ${RM} -f ${WRKDIR}/PLIST.lib
+ for d in lib/gcc-gnat libexec/gcc-gnat/gcc/${CONFIGURE_TARGET}/; do \
+ cd ${PREFIX}; \
+ if [ -d $${d} ]; then \
+ ${FIND} $${d} -type f -o -type l >>${WRKDIR}/PLIST.lib; \
+ ${FIND} $${d} -type d | ${SORT} -r | ${SED} -e 's/^/@dirrm /g' >>${WRKDIR}/PLIST.lib; \
+ fi; \
+ done
+ # Following directories should be removed on deinstall if empty. Add them to the temporary list.
+ ${ECHO_CMD} "@unexec ${RMDIR} %D/libexec/gcc-gnat/gcc/${CONFIGURE_TARGET} 2>/dev/null || true" >> ${WRKDIR}/PLIST.lib
+ ${ECHO_CMD} "@unexec ${RMDIR} %D/libexec/gcc-gnat/gcc 2>/dev/null || true" >> ${WRKDIR}/PLIST.lib
+ ${ECHO_CMD} "@unexec ${RMDIR} %D/libexec/gcc-gnat 2>/dev/null || true" >> ${WRKDIR}/PLIST.lib
+ # Insert the temporary list in the packing list.
+ cd ${WRKDIR}; ${SED} -i -e "/PLIST.lib/ r PLIST.lib" ${TMPPLIST}
.include <bsd.port.post.mk>