1997-09-25 08:48:00 +00:00
# New ports collection makefile for: GNU Ada gnat
2005-11-29 00:01:24 +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:
2009-07-19 03:38:31 +00:00
# - FreeBSD tasking libraries are included in the stock source.
1997-09-25 08:48:00 +00:00
# - 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
2009-07-19 03:38:31 +00:00
PORTNAME = gnat
PORTVERSION = 2009
PORTREVISION = 1
CATEGORIES = lang
MASTER_SITES = ${ MASTER_SITE_LOCAL } :boot
2005-11-29 00:01:24 +00:00
MASTER_SITE_SUBDIR = deischen/gcc/:boot
2009-07-19 03:38:31 +00:00
DISTFILES = ${ gcc_srcfile } :gcc ${ gnat_srcfile } :gnat
1996-11-12 02:19:40 +00:00
2009-07-19 03:38:31 +00:00
MAINTAINER = eischen@vigrid.com
COMMENT = The GNU Ada Compiler system
1995-03-28 04:41:43 +00:00
2009-07-19 03:38:31 +00:00
LIB_DEPENDS = gmp.8:${ PORTSDIR } /math/libgmp4 \
mpfr.3:${ PORTSDIR } /math/mpfr
2005-11-29 00:01:24 +00:00
2009-07-19 09:43:00 +00:00
ONLY_FOR_ARCHS = i386
2009-07-19 03:38:31 +00:00
USE_GMAKE = yes
USE_BISON = build
USE_ICONV = yes
USE_PERL5_BUILD = yes
WRKSRC = ${ WRKDIR } /build
1999-06-24 11:11:28 +00:00
2009-07-19 03:38:31 +00:00
MAN1 = gnatgcc.1 gnatcpp.1 gnatgcov.1
MAN7 = fsf-funding.7 gfdl.7 gpl.7
MAN7 = ${ fsf_mans : S / $/ ${ fsf_suffix } .7/ }
. i n c l u d e < b s d . p o r t . p r e . m k >
2005-11-29 00:01:24 +00:00
2009-07-19 03:38:31 +00:00
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 }
2005-11-29 00:01:24 +00:00
# http://libre.adacore.com/:gcc
# http://libre.adacore.com/:gnat
2009-07-19 03:38:31 +00:00
gcc_srcfile = gcc-43-branch-20090519-src.tgz
gnat_srcfile = gnat-gpl-2009-src.tgz
1997-09-25 08:48:00 +00:00
2009-07-19 03:38:31 +00:00
PATCH_WRKSRC = ${ gcc_wrksrc }
2000-11-01 18:57:03 +00:00
2009-07-19 03:38:31 +00:00
GNU_CONFIGURE = yes
CONFIGURE_SCRIPT = ../${ gcc_srcdir } /configure
2005-11-29 00:01:24 +00:00
CONFIGURE_ARGS = --enable-languages= "c,ada" \
--program-prefix= gnat \
--disable-nls \
--with-system-zlib \
2009-07-19 03:38:31 +00:00
--with-libiconv-prefix= ${ LOCALBASE } \
--libdir= ${ targlib } \
--libexecdir= ${ targlibexec } \
--disable-libada
COMPILE_DATA = MAKEINFO = ${ FALSE }
MAKE_ENV += PTHREAD_LIBS = ${ PTHREAD_LIBS }
2005-11-29 00:01:24 +00:00
2009-07-19 03:38:31 +00:00
PLIST_SUB = GNUHOST = ${ gnuhost } GCC_VERSION = ${ gcc_version } \
LIBRARY_VERSION = ${ LIBRARY_VERSION }
2005-11-29 00:01:24 +00:00
# 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
1999-06-24 11:11:28 +00:00
# a minimum (still pretty large) compiler toolset and use that to build.
2009-07-19 03:38:31 +00:00
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
1995-03-28 04:41:43 +00:00
2005-11-29 00:01:24 +00:00
. i f ! e m p t y ( G N A T G C C ) & & ! e m p t y ( G N A T B I N D )
2009-07-19 03:38:31 +00:00
have_boot != if [ -x ${ GNATGCC } -a -x ${ GNATBIND } ] ; then \
${ ECHO_CMD } " $$ PATH " ; \
else \
${ ECHO_CMD } "" ; \
fi
1999-06-24 11:11:28 +00:00
. e l s e
2005-11-29 00:01:24 +00:00
have_boot =
1999-06-24 11:11:28 +00:00
. e n d i f
. i f e m p t y ( h a v e _ b o o t )
2009-07-19 03:38:31 +00:00
DISTFILES += gnat-2005-boot.tgz:boot
BUILD_DEPENDS += ${ LOCALBASE } /lib/compat/libc.so.6:${ PORTSDIR } /misc/compat6x
1999-06-24 11:11:28 +00:00
# Warning! You need the trailing slash on GCC_EXEC_PREFIX.
2009-07-19 03:38:31 +00:00
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 }
1999-06-24 11:11:28 +00:00
. e n d i f
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.
2009-07-19 03:38:31 +00:00
CC = ${ GNATGCC }
CONFIGURE_ENV += ${ COMPILE_DATA } CC = ${ GNATGCC } PATH = ${ have_boot }
MAKE_ENV += ${ COMPILE_DATA } PATH = ${ have_boot }
1995-03-28 04:41:43 +00:00
2005-11-29 00:01:24 +00:00
# Shared library handling
2009-07-19 03:38:31 +00:00
WANT_SHAREDLIBS = yes
2005-11-29 00:01:24 +00:00
. i f d e f i n e d ( W A N T _ S H A R E D L I B S )
CONFIGURE_ARGS += --enable-shared
- Remove unneeded dependency from gtk12/gtk20 [1]
- Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORG
- Remove X11BASE support in favor of LOCALBASE or PREFIX
- Use USE_LDCONFIG instead of INSTALLS_SHLIB
- Remove unneeded USE_GCC 3.4+
Thanks to all Helpers:
Dmitry Marakasov, Chess Griffin, beech@, dinoex, rafan, gahr,
ehaupt, nox, itetcu, flz, pav
PR: 116263
Tested on: pointyhat
Approved by: portmgr (pav)
2008-04-19 17:56:05 +00:00
USE_LDCONFIG = yes
2009-07-19 03:38:31 +00:00
LDCONFIG_DIRS = %%PREFIX%%/lib ${ targlib }
LIBRARY_VERSION = 2009
2005-11-29 00:01:24 +00:00
PLIST_SUB += SHAREDLIB = ""
2000-11-01 18:57:03 +00:00
. e l s e
2005-11-29 00:01:24 +00:00
CONFIGURE_ARGS += --disable-shared
2005-11-29 01:11:25 +00:00
PLIST_SUB += SHAREDLIB = "@comment "
2000-11-01 18:57:03 +00:00
. e n d i f
2005-11-29 00:01:24 +00:00
# Check for GNAT sources.
2009-07-19 03:38:31 +00:00
. i f ! e x i s t s ( $ { D I S T D I R } / $ { g n a t _ s r c f i l e } ) & & ! d e f i n e d ( P A C K A G E _ B U I L D I N G )
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 } .
1999-11-09 12:33:43 +00:00
. e n d i f
1997-09-25 08:48:00 +00:00
pre-patch :
2005-11-29 00:01:24 +00:00
@${ ECHO } "===> Applying FreeBSD ports tree patches for gcc34."
2009-07-19 03:38:31 +00:00
@${ 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 } )
2002-12-01 19:10:48 +00:00
@${ ECHO } "===> Moving GNAT compiler sources into GCC tree."
2009-07-19 03:38:31 +00:00
@( ${ MV } ${ gnat_wrksrc } /src/ada ${ gcc_wrksrc } /gcc )
1995-03-28 04:41:43 +00:00
1999-06-24 11:11:28 +00:00
pre-configure :
2009-07-19 03:38:31 +00:00
@${ MKDIR } ${ WRKSRC }
cd ${ gcc_wrksrc } ; contrib/gcc_update --touch
${ RM } -f ${ gcc_wrksrc } /gcc/*/*.info*
@${ TOUCH } ${ TOUCH_FLAGS } ${ gcc_wrksrc } /gcc/cstamp-h.in
1999-06-24 11:11:28 +00:00
do-build :
( cd ${ WRKSRC } ; \
2005-11-29 00:01:24 +00:00
PATH = ${ have_boot } \
2009-07-19 03:38:31 +00:00
${ SETENV } ${ COMPILE_DATA } ${ GMAKE } CC = ${ CC } )
2000-11-01 18:57:03 +00:00
( cd ${ WRKSRC } ; \
2006-12-26 16:53:48 +00:00
${ SETENV } ${ MAKE_ENV } \
2009-07-19 03:38:31 +00:00
${ GMAKE } PTHREAD_LIBS = ${ PTHREAD_LIBS } bootstrap-lean )
1999-06-24 11:11:28 +00:00
( cd ${ WRKSRC } ; \
2006-12-26 16:53:48 +00:00
${ SETENV } ${ MAKE_ENV } \
2005-11-29 00:01:24 +00:00
${ GMAKE } -C gcc PTHREAD_LIBS = ${ PTHREAD_LIBS } gnatlib )
. i f d e f i n e d ( W A N T _ S H A R E D L I B S )
1999-06-24 11:11:28 +00:00
( cd ${ WRKSRC } ; \
2006-12-26 16:53:48 +00:00
${ SETENV } ${ MAKE_ENV } \
2005-11-29 00:01:24 +00:00
${ GMAKE } -C gcc PTHREAD_LIBS = ${ PTHREAD_LIBS } gnatlib-shared )
. e n d i f
2002-12-01 19:10:48 +00:00
( cd ${ WRKSRC } ; \
2006-12-26 16:53:48 +00:00
${ SETENV } ${ MAKE_ENV } \
2005-11-29 00:01:24 +00:00
${ GMAKE } -C gcc PTHREAD_LIBS = ${ PTHREAD_LIBS } gnattools )
1995-03-28 04:41:43 +00:00
1997-09-25 08:48:00 +00:00
post-install :
2009-07-19 03:38:31 +00:00
${ INSTALL_SCRIPT } ${ gcc_wrksrc } /gcc/ada/gnathtml.pl ${ PREFIX } /bin
2005-11-29 00:01:24 +00:00
@( for prog in \
1999-06-24 11:11:28 +00:00
${ PREFIX } /bin/gnat \
${ PREFIX } /bin/gnatbind \
${ PREFIX } /bin/gnatchop \
2005-11-29 00:01:24 +00:00
${ PREFIX } /bin/gnatclean \
${ PREFIX } /bin/gnatcpp \
1999-06-24 11:11:28 +00:00
${ PREFIX } /bin/gnatfind \
2005-11-29 00:01:24 +00:00
${ PREFIX } /bin/gnatgcc \
${ PREFIX } /bin/gnatgcov \
1999-06-24 11:11:28 +00:00
${ PREFIX } /bin/gnatkr \
${ PREFIX } /bin/gnatlink \
${ PREFIX } /bin/gnatls \
${ PREFIX } /bin/gnatmake \
2005-11-29 00:01:24 +00:00
${ PREFIX } /bin/gnatname \
1999-06-24 11:11:28 +00:00
${ PREFIX } /bin/gnatprep \
${ PREFIX } /bin/gnatxref \
2009-07-19 03:38:31 +00:00
${ 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 ; \
2005-11-29 00:01:24 +00:00
do \
1999-06-24 11:11:28 +00:00
if [ -x $$ prog ] ; then \
2003-09-24 09:37:11 +00:00
${ STRIP_CMD } $$ prog ; \
1999-06-24 11:11:28 +00:00
fi \
done )
2009-07-19 03:38:31 +00:00
@( ${ 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 }
1995-03-28 04:41:43 +00:00
1999-06-24 11:11:28 +00:00
. i n c l u d e < b s d . p o r t . p o s t . m k >