diff options
author | Frederic Culot <culot@FreeBSD.org> | 2011-09-07 05:22:05 +0000 |
---|---|---|
committer | Frederic Culot <culot@FreeBSD.org> | 2011-09-07 05:22:05 +0000 |
commit | 6d05a639a774bc879e556e22c42bebbfdc26ba97 (patch) | |
tree | 999c80b1fc318a60651b986f5eab3276ace46d51 /lang/gnatdroid-armv5 | |
parent | Add a couple of missing entries to pkg-plist. (diff) |
The gnatdroid-armv5 port builds a C/Ada cross-compiler based on GCC 4.6 that
targets the Android operating system (version 2.3, API level 9) running on
ARM architecture (version 5). This produces binaries that run natively on
Android devices as well as the Android SDK emulator.
WWW: http://www.dragonlace.net
PR: ports/160426
Submitted by: John Marino <freebsdml@marino.st>
Notes
Notes:
svn path=/head/; revision=281353
Diffstat (limited to 'lang/gnatdroid-armv5')
-rw-r--r-- | lang/gnatdroid-armv5/Makefile | 123 | ||||
-rw-r--r-- | lang/gnatdroid-armv5/distinfo | 2 | ||||
-rw-r--r-- | lang/gnatdroid-armv5/files/patch-configure | 11 | ||||
-rw-r--r-- | lang/gnatdroid-armv5/files/patch-gcc__Makefile.in | 27 | ||||
-rw-r--r-- | lang/gnatdroid-armv5/files/patch-gcc__ada__adaint.c | 50 | ||||
-rw-r--r-- | lang/gnatdroid-armv5/files/patch-libiberty__getpagesize.c | 15 | ||||
-rw-r--r-- | lang/gnatdroid-armv5/files/patch-libiberty__setprotitle.c | 14 | ||||
-rw-r--r-- | lang/gnatdroid-armv5/pkg-descr | 6 | ||||
-rw-r--r-- | lang/gnatdroid-armv5/pkg-plist | 33 |
9 files changed, 281 insertions, 0 deletions
diff --git a/lang/gnatdroid-armv5/Makefile b/lang/gnatdroid-armv5/Makefile new file mode 100644 index 000000000000..190e4b121e54 --- /dev/null +++ b/lang/gnatdroid-armv5/Makefile @@ -0,0 +1,123 @@ +# New ports collection makefile for: gnatdroid-armv5 +# Date created: 2011-07-20 +# Whom: John Marino <draco@marino> +# +# $FreeBSD$ +# + +PORTNAME= armv5 +PORTVERSION= 20110627 +CATEGORIES= lang +MASTER_SITES= http://downloads.dragonlace.net/src/ \ + http://dragonlace.mirrors.ada.cx/src/ +PKGNAMEPREFIX= gnatdroid- +DISTNAME= arm-gnat-${PORTVERSION} + +MAINTAINER= draco@marino.st +COMMENT= C/Ada cross-compiler, target: Android ARMv5 + +BUILD_DEPENDS= gnatdroid-sysroot>=9:${PORTSDIR}/lang/gnatdroid-sysroot \ + gnatdroid-binutils>=2.21:${PORTSDIR}/lang/gnatdroid-binutils \ + ${LOCALBASE}/lib/libgmp.so:${PORTSDIR}/math/gmp \ + ${LOCALBASE}/lib/libmpfr.so:${PORTSDIR}/math/mpfr \ + ${LOCALBASE}/lib/libmpc.so:${PORTSDIR}/math/mpc +RUN_DEPENDS:= ${BUILD_DEPENDS} +BUILD_DEPENDS+= gnat-aux>=20110325:${PORTSDIR}/lang/gnat-aux + +USE_BZIP2= YES +USE_GMAKE= YES +HAS_CONFIGURE= YES +USE_ICONV= YES +USE_BISON= build +ALL_TARGET= default +NO_MTREE= YES +MAKE_JOBS_SAFE= YES + +DROID_TARGET= arm-android-eabi +DROID_ARCH= armv5te +ARMVERSION= ARMv5 +FPU= vfp +GCC_BRANCH= 4.6 +GCC_VERSION= 4.6.1 +WRKSRC= ${WRKDIR}/gcc-${GCC_BRANCH}-${PORTVERSION} +BUILDDIR= ${WRKDIR}/build +CFG_SCRIPT= ${WRKSRC}/configure +REVFILE= ${WRKSRC}/gcc/REVISION +SRPREFIX= ${LOCALBASE}/android9 +PREFIX= ${SRPREFIX}/${ARMVERSION} +FULL_GNATGCC= ${LOCALBASE}/bin/gnatgcc +PLIST_SUB+= TARGET="${DROID_TARGET}" +PLIST_SUB+= GCCVERS="${GCC_VERSION}" + +ADA_CONFIGURE_ENV= CC=${FULL_GNATGCC} + +.include <bsd.port.pre.mk> + +.if ${ARCH} == "amd64" +OS_LABEL4VERS= "[FreeBSD64 x Android ${ARMVERSION}]" +.else +OS_LABEL4VERS= "[FreeBSD32 x Android ${ARMVERSION}]" +.endif + +CONFIGURE_ARGS= --enable-languages=c,ada +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+= --with-libiconv-prefix=${LOCALBASE} +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-libstdcxx-pch +CONFIGURE_ARGS+= --disable-tls +CONFIGURE_ARGS+= --disable-nls + +post-extract: + # Personalize GNAT for each different machine + @${ECHO} "-=> GNAT AUX ${OS_LABEL4VERS}" > ${REVFILE} + +do-configure: + ${MKDIR} ${BUILDDIR} + cd ${BUILDDIR} && ${SETENV} ${ADA_CONFIGURE_ENV} \ + ${CFG_SCRIPT} ${CONFIGURE_ARGS} + +do-build: + cd ${BUILDDIR} && ${GMAKE} ${_MAKE_JOBS} all + +do-install: + cd ${BUILDDIR} && ${GMAKE} install-strip DESTDIR=${DESTDIR} + ${MV} ${PREFIX}/bin/${DROID_TARGET}-gcc \ + ${PREFIX}/bin/${DROID_TARGET}-gnatgcc + ${MV} ${PREFIX}/${DROID_TARGET}/bin/gcc \ + ${PREFIX}/${DROID_TARGET}/bin/gnatgcc + +post-install: +.for d in lib/gcc libexec/gcc share + cd ${PREFIX}; ${FIND} $d \( -type f -or -type l \) | ${SORT} >> ${TMPPLIST} + cd ${PREFIX}; ${FIND} $d -type d | ${SORT} -dr | \ + ${SED} -e 's/^/@dirrm /g' >> ${TMPPLIST} +.endfor + @${ECHO} "@dirrm include" >> ${TMPPLIST} + @${ECHO} "@dirrm libexec" >> ${TMPPLIST} + @${ECHO} "@dirrm lib" >> ${TMPPLIST} + + @${ECHO} "============================================================" + @${ECHO} " Add to path: ${PREFIX}/bin" + @${ECHO} " All binaries have prefix of ${DROID_TARGET}-" + @${ECHO} " e.g. ${DROID_TARGET}-gnatgcc" + @${ECHO} " ${DROID_TARGET}-gnatmake" + @${ECHO} "============================================================" + +.include <bsd.port.post.mk> diff --git a/lang/gnatdroid-armv5/distinfo b/lang/gnatdroid-armv5/distinfo new file mode 100644 index 000000000000..77a11f8a6504 --- /dev/null +++ b/lang/gnatdroid-armv5/distinfo @@ -0,0 +1,2 @@ +SHA256 (arm-gnat-20110627.tar.bz2) = 3698806aabc63ab93a23e57c2fc4065f41f788e2ac9cff4a05ae501723e7499f +SIZE (arm-gnat-20110627.tar.bz2) = 19133878 diff --git a/lang/gnatdroid-armv5/files/patch-configure b/lang/gnatdroid-armv5/files/patch-configure new file mode 100644 index 000000000000..4b5aed1b474a --- /dev/null +++ b/lang/gnatdroid-armv5/files/patch-configure @@ -0,0 +1,11 @@ +--- configure.orig 2011-07-18 00:12:43.000000000 +0200 ++++ configure 2011-07-18 00:13:35.000000000 +0200 +@@ -3233,7 +3233,7 @@ + libgloss_dir=arm + ;; + arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* ) +- noconfigdirs="$noconfigdirs target-libffi target-qthreads" ++ noconfigdirs="$noconfigdirs target-libffi target-qthreads target-libstdc++-v3" + libgloss_dir=arm + ;; + arm*-*-linux-gnueabi) diff --git a/lang/gnatdroid-armv5/files/patch-gcc__Makefile.in b/lang/gnatdroid-armv5/files/patch-gcc__Makefile.in new file mode 100644 index 000000000000..5665dd51464c --- /dev/null +++ b/lang/gnatdroid-armv5/files/patch-gcc__Makefile.in @@ -0,0 +1,27 @@ +--- gcc/Makefile.in.orig 2011-01-09 00:44:20.000000000 +0100 ++++ gcc/Makefile.in 2011-01-09 00:53:28.000000000 +0100 +@@ -306,11 +306,11 @@ + # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is + # -I../zlib, unless we were configured with --with-system-zlib, in which + # case both are empty. +-ZLIB = @zlibdir@ -lz ++ZLIB = -Wl,-Bstatic @zlibdir@ -lz -Wl,-Bdynamic + ZLIBINC = @zlibinc@ + + # How to find GMP +-GMPLIBS = @GMPLIBS@ ++GMPLIBS = -Wl,-Bstatic @GMPLIBS@ -Wl,-Bdynamic + GMPINC = @GMPINC@ + + # How to find PPL +@@ -626,8 +626,8 @@ + LIBINTL_DEP = @LIBINTL_DEP@ + + # Character encoding conversion library. +-LIBICONV = @LIBICONV@ +-LIBICONV_DEP = @LIBICONV_DEP@ ++LIBICONV = -Wl,-Bstatic -L/usr/local/lib -liconv -Wl,-Bdynamic ++LIBICONV_DEP = + + # The GC method to be used on this system. + GGC=@GGC@.o diff --git a/lang/gnatdroid-armv5/files/patch-gcc__ada__adaint.c b/lang/gnatdroid-armv5/files/patch-gcc__ada__adaint.c new file mode 100644 index 000000000000..3c86667e7a0c --- /dev/null +++ b/lang/gnatdroid-armv5/files/patch-gcc__ada__adaint.c @@ -0,0 +1,50 @@ +--- gcc/ada/adaint.c.orig 2011-04-16 05:34:37.000000000 -0500 ++++ gcc/ada/adaint.c 2011-08-19 23:28:10.000000000 -0500 +@@ -1201,6 +1201,47 @@ + free (pname); + } + ++#elif defined (__ANDROID__) ++ ++ /* ++ * ext2 /ext3/ext4/fat16/fat32 have no path limits ++ * /data/local/tmp normally requires rooted devices, if it even exists ++ * /sdcard is the standard location for external storage. Nativeactivity ++ * manifest needs to authorize its use, otherwise it might not have the ++ * proper permissions. ++ */ ++ ++ int testfd; ++ char *datadir = getenv ("ANDROID_DATA"); ++ ++ if (datadir == NULL) ++ strcpy (tmp_filename, "/data/local/tmp/gnat-XXXXXX"); ++ else ++ sprintf (tmp_filename, "%s/local/tmp/gnat-XXXXXX", datadir); ++ ++ testfd = mkstemp (tmp_filename); ++ if (testfd != -1) ++ { ++ close (testfd); ++ return; ++ } ++ ++ char *sdcard = getenv ("EXTERNAL_STORAGE"); ++ ++ if (sdcard == NULL) ++ strcpy (tmp_filename, "/sdcard/gnat-XXXXXX"); ++ else ++ sprintf (tmp_filename, "%s/gnat-XXXXXX", sdcard); ++ ++ testfd = mkstemp (tmp_filename); ++ if (testfd != -1) ++ { ++ close (testfd); ++ return; ++ } ++ ++ tmpnam (tmp_filename); ++ + #elif defined (linux) || defined (__FreeBSD__) || defined (__NetBSD__) \ + || defined (__DragonFly__) \ + || defined (__OpenBSD__) || defined(__GLIBC__) diff --git a/lang/gnatdroid-armv5/files/patch-libiberty__getpagesize.c b/lang/gnatdroid-armv5/files/patch-libiberty__getpagesize.c new file mode 100644 index 000000000000..3ae29662d72e --- /dev/null +++ b/lang/gnatdroid-armv5/files/patch-libiberty__getpagesize.c @@ -0,0 +1,15 @@ +--- libiberty/getpagesize.c.orig 2011-01-29 06:55:10 +0100 ++++ libiberty/getpagesize.c 2011-01-29 07:07:40 +0100 +@@ -20,6 +20,7 @@ + + */ + ++#ifndef __ANDROID__ + #ifndef VMS + + #include "config.h" +@@ -88,3 +89,4 @@ + } + + #endif /* VMS */ ++#endif /* __ANDROID__ */ diff --git a/lang/gnatdroid-armv5/files/patch-libiberty__setprotitle.c b/lang/gnatdroid-armv5/files/patch-libiberty__setprotitle.c new file mode 100644 index 000000000000..da2d25f8ae9f --- /dev/null +++ b/lang/gnatdroid-armv5/files/patch-libiberty__setprotitle.c @@ -0,0 +1,14 @@ +--- libiberty/setproctitle.c.orig 2011-01-29 07:11:03 +0100 ++++ libiberty/setproctitle.c 2011-01-29 07:28:55 +0100 +@@ -40,9 +40,11 @@ + void + setproctitle (const char *name ATTRIBUTE_UNUSED, ...) + { ++#ifndef __ANDROID__ + #ifdef PR_SET_NAME + /* On Linux this sets the top visible "comm", but not necessarily + the name visible in ps. */ + prctl (PR_SET_NAME, name); + #endif ++#endif + } diff --git a/lang/gnatdroid-armv5/pkg-descr b/lang/gnatdroid-armv5/pkg-descr new file mode 100644 index 000000000000..78bf48e82e62 --- /dev/null +++ b/lang/gnatdroid-armv5/pkg-descr @@ -0,0 +1,6 @@ +The gnatdroid-armv5 port builds a C/Ada cross-compiler based on GCC 4.6 that +targets the Android operating system (version 2.3, API level 9) running on +ARM architecture (version 5). This produces binaries that run natively on +Android devices as well as the Android SDK emulator. + +WWW: http://www.dragonlace.net diff --git a/lang/gnatdroid-armv5/pkg-plist b/lang/gnatdroid-armv5/pkg-plist new file mode 100644 index 000000000000..d3bda63180f4 --- /dev/null +++ b/lang/gnatdroid-armv5/pkg-plist @@ -0,0 +1,33 @@ +bin/%%TARGET%%-gnatbind +bin/%%TARGET%%-gnatchop +bin/%%TARGET%%-gnat +bin/%%TARGET%%-gnatkr +bin/%%TARGET%%-gnatlink +bin/%%TARGET%%-gnatls +bin/%%TARGET%%-gnatmake +bin/%%TARGET%%-gnatname +bin/%%TARGET%%-gnatprep +bin/%%TARGET%%-gnatxref +bin/%%TARGET%%-gnatfind +bin/%%TARGET%%-gnatclean +bin/%%TARGET%%-gcov +bin/%%TARGET%%-cpp +bin/%%TARGET%%-gnatgcc +bin/%%TARGET%%-gcc-%%GCCVERS%% +lib/libiberty.a +%%TARGET%%/bin/gnatbind +%%TARGET%%/bin/gnatchop +%%TARGET%%/bin/gnat +%%TARGET%%/bin/gnatkr +%%TARGET%%/bin/gnatlink +%%TARGET%%/bin/gnatls +%%TARGET%%/bin/gnatmake +%%TARGET%%/bin/gnatprep +%%TARGET%%/bin/gnatgcc +%%TARGET%%/lib/armv7-a/thumb/libiberty.a +%%TARGET%%/lib/armv7-a/libiberty.a +%%TARGET%%/lib/thumb/libiberty.a +%%TARGET%%/lib/libiberty.a +@dirrm %%TARGET%%/lib/armv7-a/thumb +@dirrm %%TARGET%%/lib/armv7-a +@dirrm %%TARGET%%/lib/thumb |