1997-09-25 08:48:00 +00:00
|
|
|
# New ports collection makefile for: GNU Ada gnat
|
1995-03-28 04:41:43 +00:00
|
|
|
# Date created: Sat Mar 18 02:16:45 1995
|
1998-01-18 09:08:45 +00:00
|
|
|
# Whom: hsu
|
1997-09-25 08:48:00 +00:00
|
|
|
# Porter (original): nils@guru.ims.uni-stuttgart.de
|
|
|
|
# Porter (version 3): maurice@serc.rmit.edu.au
|
1995-03-28 04:41:43 +00:00
|
|
|
#
|
1999-08-25 06:35:40 +00:00
|
|
|
# $FreeBSD$
|
1998-01-18 09:08:45 +00:00
|
|
|
#
|
|
|
|
# Note:
|
1999-06-24 11:11:28 +00:00
|
|
|
# - FreeBSD tasking libraries created by Dan Eischen have been incorporated
|
1997-09-25 08:48:00 +00:00
|
|
|
# into this edition
|
|
|
|
# - The default names of a number of binaries have been altered to avoid
|
1999-06-24 11:11:28 +00:00
|
|
|
# conflict with other gcc based products. Standard names can be provided
|
|
|
|
# using symbolic links.
|
1997-09-25 08:48:00 +00:00
|
|
|
|
2000-04-12 06:21:15 +00:00
|
|
|
PORTNAME= gnat
|
2002-02-09 08:40:28 +00:00
|
|
|
PORTVERSION= 3.14p
|
1996-11-12 02:19:40 +00:00
|
|
|
CATEGORIES= lang
|
2000-11-01 18:57:03 +00:00
|
|
|
MASTER_SITES= ftp://cs.nyu.edu/pub/gnat/${PORTVERSION}/ \
|
|
|
|
${MASTER_SITE_LOCAL} ${MASTER_SITE_GNU}
|
2000-11-03 10:03:09 +00:00
|
|
|
MASTER_SITE_SUBDIR= deischen/gcc .
|
2000-11-01 18:57:03 +00:00
|
|
|
DISTFILES= ${GNATNAME}.tgz gcc-2.8.1.tar.gz
|
1996-11-12 02:19:40 +00:00
|
|
|
|
1999-06-24 11:11:28 +00:00
|
|
|
MAINTAINER= eischen@vigrid.com
|
1995-03-28 04:41:43 +00:00
|
|
|
|
1999-06-24 11:11:28 +00:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2000-11-01 18:57:03 +00:00
|
|
|
WRKSRC= ${WRKDIR}/gcc-2.8.1
|
|
|
|
GNATNAME= gnat-${PORTVERSION}-src
|
1999-06-24 11:11:28 +00:00
|
|
|
GNUHOST= ${ARCH}-unknown-freebsd${OSREL}
|
|
|
|
GCC_VERSION= 2.8.1
|
1997-09-25 08:48:00 +00:00
|
|
|
|
2000-11-01 18:57:03 +00:00
|
|
|
PLIST_SUB= GNUHOST=${GNUHOST} GCC_VERSION=${GCC_VERSION} \
|
|
|
|
LIBRARY_VERSION=${LIBRARY_VERSION} \
|
|
|
|
SHARED_MAJOR=${SHARED_MAJOR}
|
|
|
|
|
1999-06-24 11:11:28 +00:00
|
|
|
# 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= --host=${GNUHOST} --target=${GNUHOST}
|
|
|
|
CONFIGURE_ARGS= --program-prefix=ada
|
|
|
|
GNU_CONFIGURE= yes
|
1999-03-02 21:25:09 +00:00
|
|
|
USE_GMAKE= yes
|
1997-10-03 09:57:05 +00:00
|
|
|
MAN1= adagcc.1 cccp.1
|
|
|
|
|
2000-11-01 18:57:03 +00:00
|
|
|
# You need a compiler who calls an existing GNAT compiler (3.12 or greater).
|
1999-06-24 11:11:28 +00:00
|
|
|
# If you have one, point CC at it. By default, we'll look for one in the
|
|
|
|
# obvious places. If we can't find one, we'll fetch a distfile containing
|
|
|
|
# a minimum (still pretty large) compiler toolset and use that to build.
|
|
|
|
|
2000-11-01 18:57:03 +00:00
|
|
|
# For the GNAT compiler, we look in ${PREFIX} and in ${LOCALBASE}.
|
1999-06-24 11:11:28 +00:00
|
|
|
.ifdef PREFIX
|
|
|
|
have_boot!= if [ -x ${PREFIX}/bin/adagcc -a -x ${PREFIX}/bin/gnatbind ]; then \
|
2002-01-29 11:24:09 +00:00
|
|
|
${ECHO_CMD} "${PREFIX}/bin"; \
|
1999-06-24 11:11:28 +00:00
|
|
|
else \
|
2002-01-29 11:24:09 +00:00
|
|
|
${ECHO_CMD} ""; \
|
1999-06-24 11:11:28 +00:00
|
|
|
fi
|
|
|
|
.else
|
|
|
|
have_boot=
|
|
|
|
.endif
|
|
|
|
.if empty(have_boot)
|
2000-12-19 16:45:51 +00:00
|
|
|
have_boot!= if [ -x ${LOCALBASE}/bin/adagcc -a -x ${LOCALBASE}/bin/gnatbind ]; then \
|
2002-01-29 11:24:09 +00:00
|
|
|
${ECHO_CMD} "${LOCALBASE}/bin"; \
|
1999-06-24 11:11:28 +00:00
|
|
|
else \
|
2002-01-29 11:24:09 +00:00
|
|
|
${ECHO_CMD} ""; \
|
1999-06-24 11:11:28 +00:00
|
|
|
fi
|
|
|
|
.endif
|
1995-03-28 04:41:43 +00:00
|
|
|
|
1999-06-24 11:11:28 +00:00
|
|
|
#
|
1999-11-09 12:33:43 +00:00
|
|
|
# Check for attempts to cross-compile or build an aout GNAT compiler.
|
1999-06-24 11:11:28 +00:00
|
|
|
.if empty(have_boot)
|
|
|
|
have_boot!= if [ ${PORTOBJFORMAT} = "aout" ]; then \
|
2002-01-29 11:24:09 +00:00
|
|
|
${ECHO_CMD} "borken for aout"; \
|
1999-06-24 11:11:28 +00:00
|
|
|
else \
|
2002-01-29 11:24:09 +00:00
|
|
|
${ECHO_CMD} ""; \
|
1999-06-24 11:11:28 +00:00
|
|
|
fi
|
|
|
|
.else
|
|
|
|
have_boot!= if [ `file ${have_boot}/adagcc | awk ' { print $$2 }'` = "ELF" ]; then \
|
|
|
|
if [ ${PORTOBJFORMAT} = "elf" ]; then \
|
2002-01-29 11:24:09 +00:00
|
|
|
${ECHO_CMD} ${have_boot}; \
|
1999-06-24 11:11:28 +00:00
|
|
|
else \
|
2002-01-29 11:24:09 +00:00
|
|
|
${ECHO_CMD} "borken for aout"; \
|
1999-06-24 11:11:28 +00:00
|
|
|
fi \
|
|
|
|
else \
|
2002-01-29 11:24:09 +00:00
|
|
|
${ECHO_CMD} "borken for aout"; \
|
1999-06-24 11:11:28 +00:00
|
|
|
fi
|
|
|
|
.endif
|
|
|
|
|
1999-11-09 12:33:43 +00:00
|
|
|
.if ${have_boot} == "borken for aout"
|
|
|
|
BROKEN= "Cannot build with or for an aout compiler."
|
1999-06-24 11:11:28 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if empty(have_boot)
|
2000-11-01 18:57:03 +00:00
|
|
|
DISTFILES+= gnat-3.13p-boot.tar.gz
|
1999-06-24 11:11:28 +00:00
|
|
|
# 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
|
|
|
|
.endif
|
1995-03-28 04:41:43 +00:00
|
|
|
|
1999-06-24 11:11:28 +00:00
|
|
|
# Make sure we use the Ada-aware gcc compiler.
|
2000-11-01 18:57:03 +00:00
|
|
|
CC = adagcc
|
1999-06-24 11:11:28 +00:00
|
|
|
CONFIGURE_ENV= ${COMPILE_DATA} PATH=${have_boot}/bin:$$PATH
|
1995-03-28 04:41:43 +00:00
|
|
|
|
2000-11-01 18:57:03 +00:00
|
|
|
.if OVERRIDE_CFLAGS
|
|
|
|
GNATCFLAGS= ${CFLAGS}
|
|
|
|
GNATLIBCFLAGS= ${CFLAGS}
|
|
|
|
.else
|
|
|
|
GNATCFLAGS= -O2
|
|
|
|
GNATLIBCFLAGS= -O2
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Shared library handling
|
2002-02-09 08:40:28 +00:00
|
|
|
LIBRARY_VERSION= 3.14
|
2000-11-01 18:57:03 +00:00
|
|
|
SHARED_MAJOR= 1
|
|
|
|
|
1999-11-09 12:33:43 +00:00
|
|
|
# Account for signal set changes
|
|
|
|
.if ${OSVERSION} > 400010
|
|
|
|
SIGSET_WORDS= 4
|
|
|
|
SIGACTION= new_struct_sigaction
|
|
|
|
.else
|
|
|
|
SIGSET_WORDS= 1
|
|
|
|
SIGACTION= old_struct_sigaction
|
|
|
|
.endif
|
|
|
|
|
1997-09-25 08:48:00 +00:00
|
|
|
pre-patch:
|
2000-11-01 18:57:03 +00:00
|
|
|
@if [ ! -f ${WRKSRC}/config/i386/freebsd-aout.h ]; then \
|
|
|
|
${MV} ${WRKSRC}/config/i386/freebsd.h ${WRKSRC}/config/i386/freebsd-aout.h; \
|
|
|
|
${MV} ${WRKSRC}/config/i386/freebsd-elf.h ${WRKSRC}/config/i386/freebsd.h; \
|
|
|
|
fi
|
1998-01-18 09:08:45 +00:00
|
|
|
@${ECHO} "===> Applying FreeBSD patches to gcc for ${DISTNAME}"
|
1999-06-24 11:11:28 +00:00
|
|
|
-( ${PATCH} ${PATCH_ARGS} < ${FILESDIR}/freebsdgcc28-patches )
|
2000-11-01 18:57:03 +00:00
|
|
|
@${ECHO} "===> Patching gcc for ${GNATNAME}"
|
|
|
|
-( ${PATCH} ${PATCH_ARGS} < ${WRKDIR}/${GNATNAME}/src/gcc-281.dif )
|
1999-06-24 11:11:28 +00:00
|
|
|
@${ECHO} "===> Copying GNAT compiler sources into GCC tree."
|
2000-11-01 18:57:03 +00:00
|
|
|
-( ${MV} ${WRKDIR}/${GNATNAME}/src/ada ${WRKDIR}/gcc-2.8.1 )
|
1999-11-09 12:33:43 +00:00
|
|
|
@${ECHO} "===> Making way for FreeBSD GNAT support files"
|
|
|
|
-( ${RM} -f ${WRKSRC}/ada/[45]f* )
|
1995-03-28 04:41:43 +00:00
|
|
|
|
1999-06-24 11:11:28 +00:00
|
|
|
# Copy any additional files required into the correct locations.
|
|
|
|
post-patch:
|
1997-09-25 08:48:00 +00:00
|
|
|
(cd ${FILESDIR}; \
|
1999-06-24 11:11:28 +00:00
|
|
|
for i in *.adb *.ads ; do \
|
|
|
|
${CP} $$i ${WRKSRC}/ada; \
|
|
|
|
done )
|
1995-03-28 04:41:43 +00:00
|
|
|
|
1999-06-24 11:11:28 +00:00
|
|
|
pre-configure:
|
1999-11-09 12:33:43 +00:00
|
|
|
@(cd ${WRKSRC}/config/${ARCH}/ ; \
|
1999-06-24 11:11:28 +00:00
|
|
|
MAJ=`sysctl -n kern.osreldate | ${SED} -e '/.....$$/s///'` ; \
|
|
|
|
${MV} freebsd.h freebsd.h.in ; \
|
|
|
|
${SED} -e "s:__FreeBSD__=[0-9]*:__FreeBSD__=$${MAJ}:" freebsd.h.in \
|
1999-11-09 12:33:43 +00:00
|
|
|
>freebsd.h)
|
|
|
|
@(cd ${WRKSRC}/ada/ ; \
|
|
|
|
${MV} 5fosinte.ads 5fosinte.ads.in ; \
|
|
|
|
${SED} -e "s:__FreeBSD__sigset_words:${SIGSET_WORDS}:" \
|
|
|
|
-e "s:__FreeBSD__sigaction:${SIGACTION}:" 5fosinte.ads.in \
|
|
|
|
> 5fosinte.ads)
|
|
|
|
@${TOUCH} ${TOUCH_FLAGS} ${WRKSRC}/cstamp-h.in
|
1999-06-24 11:11:28 +00:00
|
|
|
@(cd ${WRKSRC}/ada; \
|
|
|
|
${TOUCH} treeprs.ads a-[es]info.h nmake.ad[bs])
|
|
|
|
|
|
|
|
#
|
|
|
|
# Can't get this to work with default bsd.port.mk do-configure target.
|
|
|
|
#
|
1995-04-24 11:29:30 +00:00
|
|
|
do-configure:
|
1999-06-24 11:11:28 +00:00
|
|
|
@(cd ${WRKSRC} && ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS})
|
|
|
|
|
|
|
|
#
|
|
|
|
# We intentionally override CFLAGS because the build procedure is explicitly
|
2000-11-01 18:57:03 +00:00
|
|
|
# spelled out in gnat-3.13p-src/src/README.BUILD. Remove CFLAGS from the
|
1999-06-24 11:11:28 +00:00
|
|
|
# do-build target at your own risk.
|
|
|
|
#
|
|
|
|
do-build:
|
|
|
|
(cd ${WRKSRC}; \
|
|
|
|
PATH=${have_boot}/bin:$$PATH \
|
2000-11-01 18:57:03 +00:00
|
|
|
${COMPILEDATA} ${GMAKE} CC="${CC}" OLDCC="adagcc" CFLAGS="${GNATCFLAGS}" LANGUAGES="c ada gcov" )
|
|
|
|
(cd ${WRKSRC}; \
|
|
|
|
${GMAKE} CFLAGS="${GNATCFLAGS}" LANGUAGES="c ada gcov" bootstrap )
|
1999-06-24 11:11:28 +00:00
|
|
|
(cd ${WRKSRC}; \
|
2000-11-01 18:57:03 +00:00
|
|
|
${GMAKE} CFLAGS="${GNATCFLAGS}" gnattools )
|
1999-06-24 11:11:28 +00:00
|
|
|
(cd ${WRKSRC}; \
|
2000-11-01 18:57:03 +00:00
|
|
|
${GMAKE} CFLAGS="${GNATCFLAGS}" GNATLIBCFLAGS="-fPIC ${GNATLIBCFLAGS}" \
|
|
|
|
soext=.so.${SHARED_MAJOR} LIBRARY_VERSION=${LIBRARY_VERSION} \
|
|
|
|
gnatlib-shared )
|
|
|
|
${MV} ${WRKSRC}/ada/rts/lib*-${LIBRARY_VERSION}.so.${SHARED_MAJOR} \
|
|
|
|
${WRKSRC}/ada
|
|
|
|
${RM} ${WRKSRC}/stamp-gnatlib2
|
1999-06-24 11:11:28 +00:00
|
|
|
(cd ${WRKSRC}; \
|
2000-11-01 18:57:03 +00:00
|
|
|
${GMAKE} CFLAGS="${GNATCFLAGS}" GNATLIBCFLAGS="${GNATLIBCFLAGS}" gnatlib )
|
2002-02-09 08:40:28 +00:00
|
|
|
.ifndef(NOPORTDOCS)
|
|
|
|
${RM} ${WRKDIR}/gnat-3.14p-src/examples/*.orig
|
|
|
|
.endif
|
1995-03-28 04:41:43 +00:00
|
|
|
|
1995-04-24 11:29:30 +00:00
|
|
|
do-install:
|
1999-06-24 11:11:28 +00:00
|
|
|
(cd ${WRKSRC}; \
|
1999-11-09 12:33:43 +00:00
|
|
|
${GMAKE} CC="${CC}" LANGUAGES="c ada gcov" ${INSTALL_TARGET} )
|
2000-11-01 18:57:03 +00:00
|
|
|
${INSTALL_DATA} \
|
|
|
|
${WRKSRC}/ada/libgnat-${LIBRARY_VERSION}.so.${SHARED_MAJOR} \
|
|
|
|
${PREFIX}/lib
|
|
|
|
${INSTALL_DATA} \
|
|
|
|
${WRKSRC}/ada/libgnarl-${LIBRARY_VERSION}.so.${SHARED_MAJOR} \
|
|
|
|
${PREFIX}/lib
|
|
|
|
${LN} -s ${PREFIX}/lib/libgnat-${LIBRARY_VERSION}.so.${SHARED_MAJOR} \
|
|
|
|
${PREFIX}/lib/gcc-lib/${GNUHOST}/${GCC_VERSION}/adalib/libgnat.so
|
|
|
|
${LN} -s ${PREFIX}/lib/libgnarl-${LIBRARY_VERSION}.so.${SHARED_MAJOR} \
|
|
|
|
${PREFIX}/lib/gcc-lib/${GNUHOST}/${GCC_VERSION}/adalib/libgnarl.so
|
2002-02-09 08:40:28 +00:00
|
|
|
.ifndef(NOPORTDOCS)
|
|
|
|
${MKDIR} ${EXAMPLESDIR}
|
|
|
|
${INSTALL_DATA} \
|
|
|
|
${WRKDIR}/gnat-3.14p-src/examples/* ${EXAMPLESDIR}
|
|
|
|
.endif
|
1997-09-25 08:48:00 +00:00
|
|
|
|
|
|
|
post-install:
|
1999-06-24 11:11:28 +00:00
|
|
|
@(for prog in ${PREFIX}/bin/adagcc \
|
1999-11-09 12:33:43 +00:00
|
|
|
${PREFIX}/bin/adagcov \
|
1999-06-24 11:11:28 +00:00
|
|
|
${PREFIX}/bin/gnat \
|
|
|
|
${PREFIX}/bin/gnatbind \
|
|
|
|
${PREFIX}/bin/gnatbl \
|
|
|
|
${PREFIX}/bin/gnatchop \
|
|
|
|
${PREFIX}/bin/gnatfind \
|
|
|
|
${PREFIX}/bin/gnatkr \
|
|
|
|
${PREFIX}/bin/gnatlink \
|
|
|
|
${PREFIX}/bin/gnatls \
|
|
|
|
${PREFIX}/bin/gnatmake \
|
|
|
|
${PREFIX}/bin/gnatmem \
|
|
|
|
${PREFIX}/bin/gnatprep \
|
|
|
|
${PREFIX}/bin/gnatpsta \
|
|
|
|
${PREFIX}/bin/gnatpsys \
|
|
|
|
${PREFIX}/bin/gnatxref \
|
|
|
|
${PREFIX}/bin/${GNUHOST}-gcc \
|
|
|
|
${PREFIX}/lib/gcc-lib/${GNUHOST}/${GCC_VERSION}/cc1 \
|
|
|
|
${PREFIX}/lib/gcc-lib/${GNUHOST}/${GCC_VERSION}/gnat1 \
|
|
|
|
${PREFIX}/lib/gcc-lib/${GNUHOST}/${GCC_VERSION}/cpp ; do \
|
|
|
|
if [ -x $$prog ]; then \
|
|
|
|
strip $$prog ; \
|
|
|
|
fi \
|
|
|
|
done)
|
1999-11-09 12:33:43 +00:00
|
|
|
@(${TOUCH} ${TOUCH_FLAGS} ${PREFIX}/lib/gcc-lib/${GNUHOST}/${GCC_VERSION}/include/float.h)
|
2000-11-01 18:57:03 +00:00
|
|
|
@(chown -R bin:bin ${PREFIX}/lib/gcc-lib/${GNUHOST}/${GCC_VERSION})
|
|
|
|
${LDCONFIG} -m ${PREFIX}/lib
|
1995-03-28 04:41:43 +00:00
|
|
|
|
1999-06-24 11:11:28 +00:00
|
|
|
.include <bsd.port.post.mk>
|