freebsd-ports at freebsd-ports at
Sat Jan 2 21:00:51 UTC 2010


This is an initial version of ''.

A user may set USE_GNAT to 'gnat-gcc' or 'gnat-gpl', currently.

gnat-gcc selects lang/gnat-gcc44 and gnat-gpl selects lang/gnat
as the Ada compiler used to compile ports.

I have made gnat-gcc the default as it supports more architectures
(I've been unable to get gnat-gpl to build on AMD64 as it seems to
specifically lack support for it).

As shown, GNAT_GCC_CFLAGS may also be set. These are optional
compiler flags (like CFLAGS).


# - GNAT Ada compiler selection.

# User settable knobs:
# Name               Default value      Description
# GNAT_GCC_CFLAGS    (empty)            Optional Ada compiler flags

GNAT_Include_MAINTAINER= freebsd-ports at

# Default case - a current lang/gnat-gcc port.
.if ${USE_GNAT} == "yes" || ${USE_GNAT} == "gnat-gcc"

BUILD_DEPENDS+= gnat-gcc44:${PORTSDIR}/lang/gnat-gcc44
RUN_DEPENDS+= gnat-gcc44:${PORTSDIR}/lang/gnat-gcc44
GNAT_GCC:= gcc44
GNAT_BIND:= gnatbind
GNAT_LINK:= gnatlink

# GNAT GPL port.
.elif ${USE_GNAT} == "gnat-gpl"

BUILD_DEPENDS+= gnat-gpl:${PORTSDIR}/lang/gnat
RUN_DEPENDS+= gnat-gpl:${PORTSDIR}/lang/gnat
GNAT_GCC:= gnatgcc
GNAT_BIND:= gnatbind
GNAT_LINK:= gnatlink

IGNORE= specifies unknown value "${USE_GNAT}" for USE_GNAT

  @echo USE_GCC=${USE_GCC}
  @echo GNAT_GCC=${GNAT_GCC}


An example of a port using this makefile:


# New ports collection makefile for: sdl-ada
# Date created: 02 December 2009
# Whom: freebsd-ports at
# $FreeBSD$

PORTNAME=       sdl-ada
PORTVERSION=    1.2.14
CATEGORIES=     devel

MAINTAINER=     freebsd-ports at
COMMENT=        This is a set of Ada bindings to the SDL library.


        @${ECHO_CMD} "${GNAT_GCC}"                            > "${WRKSRC}/conf-adacomp"
        @${ECHO_CMD} "${GNAT_GCC_CFLAGS}"                     > "${WRKSRC}/conf-adacflags"
        @${ECHO_CMD} "${GNAT_BIND}"                           > "${WRKSRC}/conf-adabind"
        @${ECHO_CMD} "${GNAT_LINK}"                           > "${WRKSRC}/conf-adalink"
        @${ECHO_CMD} "${CC}"                                  > "${WRKSRC}/conf-cc"
        @${ECHO_CMD} "${CFLAGS}"                              > "${WRKSRC}/conf-cflags"
        @${ECHO_CMD} "${LD}"                                  > "${WRKSRC}/conf-ld"
        @${ECHO_CMD} "${PREFIX}/bin"                          > "${WRKSRC}/conf-bindir"
        @${ECHO_CMD} "${PREFIX}/include/coreland/sdl-ada"     > "${WRKSRC}/conf-incdir"
        @${ECHO_CMD} "${PREFIX}/lib/coreland/sdl-ada-static"  > "${WRKSRC}/conf-slibdir"
        @${ECHO_CMD} "${PREFIX}/lib/coreland/sdl-ada"         > "${WRKSRC}/conf-dlibdir"
        @${ECHO_CMD} "${PREFIX}/share/coreland/sdl-ada-repos" > "${WRKSRC}/conf-repos"
        .if defined(DESTDIR) 
                @${ECHO_CMD} "${DESTDIR}" > "${WRKSRC}/conf-fakeroot"

.include <>


Comments welcome.


More information about the freebsd-ports mailing list