mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-26 05:02:18 +00:00
189 lines
5.4 KiB
Makefile
189 lines
5.4 KiB
Makefile
# Created by: John Marino <marino@FreeBSD.org>
|
|
# $FreeBSD$
|
|
|
|
PORTNAME= armv7
|
|
PORTVERSION= ${SNAPSHOT}
|
|
PORTREVISION= 1
|
|
CATEGORIES= lang
|
|
MASTER_SITES= ${MASTER_SITE_GCC}
|
|
MASTER_SITE_SUBDIR= releases/gcc-${GCC_VERSION}
|
|
PKGNAMEPREFIX= gnatdroid-
|
|
DISTNAME= arm-gnat-${PORTVERSION}
|
|
DISTFILES= gcc-${GCC_VERSION}.tar.bz2
|
|
|
|
MAINTAINER= marino@FreeBSD.org
|
|
COMMENT= C/Ada cross-compiler, target: Android ARMv7
|
|
|
|
LICENSE= GPLv3 GPLv3RLE
|
|
LICENSE_COMB= multi
|
|
|
|
BUILD_DEPENDS= gnatdroid-sysroot>=9:${PORTSDIR}/lang/gnatdroid-sysroot \
|
|
gnatdroid-binutils>=2.21:${PORTSDIR}/lang/gnatdroid-binutils
|
|
RUN_DEPENDS:= ${BUILD_DEPENDS}
|
|
|
|
NO_LICENSES_INSTALL= yes
|
|
|
|
.include "${.CURDIR}/../gcc-aux/Makefile.common"
|
|
|
|
# DELETE NEXT LINE AFTER NEXT UPDATE TO GCC-AUX 4.7 TO AVOID PORTEPOCH
|
|
# Without it, this port version regresses by a day
|
|
SNAPSHOT:= 20130413 # last portversion + 1
|
|
|
|
USES+= ada gmake
|
|
LANGS= c ada
|
|
APPLY_DIFFS= core ada ada-testsuite gcc-testsuite
|
|
NO_MTREE= YES
|
|
DISTINFO_FILE= ${.CURDIR}/../gcc-aux/distinfo
|
|
|
|
# Disable C++ until arm.cc/no-rtti issue resolved for libsupc++
|
|
|
|
OPTIONS_DEFINE= FORT OBJC #CXX
|
|
OPTIONS_DEFAULT=
|
|
OPTIONS_SUB= yes
|
|
CXX_DESC= Also build c++ language
|
|
FORT_DESC= Also build Fortran language
|
|
OBJC_DESC= Also build Objective-C language
|
|
|
|
DROID_TARGET= arm-android-eabi
|
|
DROID_ARCH= armv7-a
|
|
ARMVERSION= ARMv7
|
|
FPU= neon
|
|
WRKSRC= ${WRKDIR}/gcc-${GCC_VERSION}
|
|
BUILD_WRKSRC= ${WRKDIR}/build
|
|
PATCHDIR= ${.CURDIR}/../gcc-aux/files
|
|
CFG_SCRIPT= ${WRKSRC}/configure
|
|
REVFILE= ${WRKSRC}/gcc/REVISION
|
|
SRPREFIX= ${LOCALBASE}/android9
|
|
PREFIX= ${SRPREFIX}/${ARMVERSION}
|
|
INSTALLDIRS= lib libexec share
|
|
INSTALLDIRS+= ${DROID_TARGET}/lib
|
|
PLIST_SUB+= TARGET="${DROID_TARGET}"
|
|
PLIST_SUB+= GCCVERS="${GCC_VERSION}"
|
|
SUB_FILES= pkg-message
|
|
SUB_LIST= TARGET="${DROID_TARGET}"
|
|
CROSS= gnat gnatbind gnatchop gnatclean gnatfind gnatkr \
|
|
gnatlink gnatls gnatmake gnatprep gnatxref
|
|
|
|
ALL_TARGET= all
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
.if ${ARCH:S/amd64/x86_64/} == x86_64
|
|
OS_LABEL4VERS= "[${OPSYS}64 x Android ${ARMVERSION}]"
|
|
.else
|
|
OS_LABEL4VERS= "[${OPSYS}32 x Android ${ARMVERSION}]"
|
|
.endif
|
|
|
|
###########
|
|
## C++ ##
|
|
###########
|
|
|
|
.if ${PORT_OPTIONS:MCXX}
|
|
LANGS+= c++
|
|
APPLY_DIFFS+= cxx cxx-testsuite
|
|
INSTALLDIRS+= include/c++/${GCC_VERSION}
|
|
.endif
|
|
|
|
###############
|
|
## Fortran ##
|
|
###############
|
|
|
|
.if ${PORT_OPTIONS:MFORT}
|
|
LANGS+= fortran
|
|
APPLY_DIFFS+= fortran
|
|
.endif
|
|
|
|
###################
|
|
## Objective-C ##
|
|
###################
|
|
|
|
.if ${PORT_OPTIONS:MOBJC}
|
|
LANGS+= objc
|
|
.endif
|
|
|
|
CONFIGURE_ARGS= --enable-languages=${LANGS:Q}
|
|
CONFIGURE_ARGS+= --target=${DROID_TARGET}
|
|
CONFIGURE_ARGS+= --program-prefix=${DROID_TARGET}-
|
|
CONFIGURE_ARGS+= --prefix=${PREFIX}
|
|
CONFIGURE_ARGS+= --with-arch=${DROID_ARCH}
|
|
CONFIGURE_ARGS+= --with-system-zlib
|
|
CONFIGURE_ARGS+= --with-gmp=${LOCALBASE}
|
|
CONFIGURE_ARGS+= --with-mpfr=${LOCALBASE}
|
|
CONFIGURE_ARGS+= --with-mpc=${LOCALBASE}
|
|
CONFIGURE_ARGS+= ${ICONV_CONFIGURE_ARG}
|
|
CONFIGURE_ARGS+= --with-sysroot=${SRPREFIX}
|
|
CONFIGURE_ARGS+= --with-float=soft
|
|
CONFIGURE_ARGS+= --with-fpu=${FPU}
|
|
CONFIGURE_ARGS+= --enable-target-optspace
|
|
CONFIGURE_ARGS+= --enable-threads=posix
|
|
CONFIGURE_ARGS+= --disable-bootstrap
|
|
CONFIGURE_ARGS+= --disable-shared
|
|
CONFIGURE_ARGS+= --disable-libssp
|
|
CONFIGURE_ARGS+= --disable-libgomp
|
|
CONFIGURE_ARGS+= --disable-libmudflap
|
|
CONFIGURE_ARGS+= --disable-libquadmath
|
|
CONFIGURE_ARGS+= --disable-sjlj-exceptions
|
|
CONFIGURE_ARGS+= --disable-tls
|
|
CONFIGURE_ARGS+= --disable-nls
|
|
|
|
post-extract:
|
|
# Personalize GNAT for each different machine
|
|
@${ECHO} "-=> GNAT AUX ${OS_LABEL4VERS}" > ${REVFILE}
|
|
|
|
# Create new directories in preparation of applying diff files
|
|
.if ${PORT_OPTIONS:MCXX}
|
|
${MKDIR} ${WRKSRC}/libstdc++-v3/config/locale/dragonfly
|
|
${MKDIR} ${WRKSRC}/libstdc++-v3/config/os/bsd/dragonfly
|
|
.endif
|
|
|
|
# Apply required composite diff files
|
|
.for suffix in ${APPLY_DIFFS}
|
|
@${ECHO} "Applying composite patch diff-${suffix}"
|
|
@${PATCH} -d ${WRKSRC} -s -E < ${PATCHDIR}/diff-${suffix}
|
|
.endfor
|
|
|
|
do-configure:
|
|
${MKDIR} ${BUILD_WRKSRC}
|
|
cd ${BUILD_WRKSRC} && ${SETENV} ${CONFIGURE_ENV} \
|
|
${CFG_SCRIPT} ${CONFIGURE_ARGS}
|
|
|
|
pre-install:
|
|
# The "native tools" won't install unless a directory exists
|
|
${MKDIR} ${STAGEDIR}${PREFIX}/${DROID_TARGET}/bin
|
|
# Buggy makefile; seems to have forgotten this is a cross compiler
|
|
# Manually rename products so it doesn't rebuild them with new name
|
|
.for X in ${CROSS}
|
|
${CP} -a ${BUILD_WRKSRC}/gcc/${X}-cross ${BUILD_WRKSRC}/gcc/${X}
|
|
.endfor
|
|
|
|
do-install:
|
|
cd ${BUILD_WRKSRC} && ${GMAKE} install-strip DESTDIR=${STAGEDIR}
|
|
${MV} ${STAGEDIR}${PREFIX}/bin/${DROID_TARGET}-gcc \
|
|
${STAGEDIR}${PREFIX}/bin/${DROID_TARGET}-gnatgcc
|
|
${MV} ${STAGEDIR}${PREFIX}/${DROID_TARGET}/bin/gcc \
|
|
${STAGEDIR}${PREFIX}/${DROID_TARGET}/bin/gnatgcc
|
|
.if ${PORT_OPTIONS:MFORT}
|
|
${MV} ${STAGEDIR}${PREFIX}/bin/${DROID_TARGET}-gfortran \
|
|
${STAGEDIR}${PREFIX}/bin/${DROID_TARGET}-gnatgfortran
|
|
${MV} ${STAGEDIR}${PREFIX}/${DROID_TARGET}/bin/gfortran \
|
|
${STAGEDIR}${PREFIX}/${DROID_TARGET}/bin/gnatgfortran
|
|
.endif
|
|
|
|
post-install:
|
|
.for d in ${INSTALLDIRS}
|
|
cd ${STAGEDIR}${PREFIX}; ${FIND} $d \( -type f -or -type l \) | \
|
|
${SORT} >> ${TMPPLIST}
|
|
.endfor
|
|
.for loop in A B
|
|
cd ${STAGEDIR}${PREFIX}; ${FIND} * -type d -empty | \
|
|
${SORT} -dr | ${XARGS} ${RMDIR}
|
|
.endfor
|
|
cd ${STAGEDIR}${PREFIX}; ${FIND} * -type d | ${SORT} -dr | \
|
|
${SED} -e '/^bin$$/d' \
|
|
-e '/^${DROID_TARGET}\/bin$$/d' \
|
|
-e '/^${DROID_TARGET}\/lib$$/d' \
|
|
-e '/^${DROID_TARGET}$$/d' \
|
|
-e 's/^/@dirrm /g' >> ${TMPPLIST}
|
|
|
|
.include <bsd.port.post.mk>
|