Skip to content

Commit 65da0c0

Browse files
committed
new package: gprbuild
1 parent f480718 commit 65da0c0

File tree

4 files changed

+109
-0
lines changed

4 files changed

+109
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- a/gpr/src/gpr_imports.c
2+
+++ b/gpr/src/gpr_imports.c
3+
@@ -69,6 +69,11 @@
4+
char __gnat_shared_libgcc_default = SHARED;
5+
const char *__gnat_default_libgcc_subdir = "lib";
6+
7+
+#elif defined(__ANDROID__)
8+
+int __gnat_link_max = 8192;
9+
+char __gnat_shared_libgcc_default = STATIC;
10+
+const char *__gnat_default_libgcc_subdir = "lib";
11+
+
12+
#elif defined (linux) || defined(__GLIBC__)
13+
int __gnat_link_max = 8192;
14+
char __gnat_shared_libgcc_default = STATIC;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--- a/src/gprlib.adb
2+
+++ b/src/gprlib.adb
3+
@@ -2211,17 +2211,7 @@
4+
"no toolchain version for language " & Line (1 .. Last));
5+
6+
elsif Line (1 .. Last) = "ada" then
7+
- Get_Line (IO_File, Line, Last);
8+
-
9+
- if Last > 5 and then Line (1 .. 5) = GNAT_And_Space then
10+
- GNAT_Version := new String'(Line (6 .. Last));
11+
- GNAT_Version_Set := True;
12+
-
13+
- Free (Libgnat);
14+
- Free (Libgnarl);
15+
- Libgnat := new String'("-lgnat-" & Line (6 .. Last));
16+
- Libgnarl := new String'("-lgnarl-" & Line (6 .. Last));
17+
- end if;
18+
+ Skip_Line (IO_File);
19+
20+
else
21+
Skip_Line (IO_File);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/Makefile
2+
+++ b/Makefile
3+
@@ -27,7 +27,7 @@
4+
HOST = $(shell gcc -dumpmachine)
5+
TARGET := $(shell gcc -dumpmachine)
6+
7+
-prefix := $(dir $(shell which gnatls))..
8+
+prefix := $(dir $(shell command -v gnatls))..
9+
BUILD = production
10+
PROCESSORS = 0
11+
BUILD_DIR =

tur-on-device/gprbuild/build.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
TERMUX_PKG_HOMEPAGE=https://github.com/AdaCore/gprbuild
2+
TERMUX_PKG_DESCRIPTION="An advanced build system designed to help automate the construction of multi-language systems"
3+
TERMUX_PKG_LICENSE="custom"
4+
TERMUX_PKG_LICENSE_FILE="COPYING3, COPYING.RUNTIME"
5+
TERMUX_PKG_MAINTAINER="@termux-user-repository"
6+
TERMUX_PKG_VERSION="25.0.0"
7+
TERMUX_PKG_SRCURL=https://github.com/AdaCore/gprbuild/archive/refs/tags/v$TERMUX_PKG_VERSION.tar.gz
8+
TERMUX_PKG_SHA256=d12f94c1ec0b6e219f6b162f71f57129d22426e7798092f5f85b9ec2cc818bf1
9+
TERMUX_PKG_DEPENDS="gcc-11, gcc-default-11, gnat, gprconfig-kb"
10+
TERMUX_PKG_BUILD_DEPENDS="gprbuild-bootstrap, xmlada"
11+
TERMUX_PKG_BUILD_IN_SRC=true
12+
TERMUX_PKG_AUTO_UPDATE=true
13+
14+
termux_step_pre_configure() {
15+
if [ "${TERMUX_ON_DEVICE_BUILD}" = false ]; then
16+
termux_error_exit "This package doesn't support cross-compiling."
17+
fi
18+
}
19+
20+
termux_step_configure() {
21+
export GNATMAKE="gnatmake-11"
22+
23+
CFLAGS="${CFLAGS/-Oz/-Os}"
24+
CXXFLAGS="${CXXFLAGS/-Oz/-Os}"
25+
LDFLAGS="${LDFLAGS/-static-openmp/''}"
26+
27+
CROSS_PREFIX=$TERMUX_ARCH-linux-android
28+
if [ "$TERMUX_ARCH" == "arm" ]; then
29+
CROSS_PREFIX=arm-linux-androideabi
30+
fi
31+
32+
export AR=$CROSS_PREFIX-ar
33+
export AS=$CROSS_PREFIX-as
34+
export LD=$CROSS_PREFIX-ld
35+
export NM=$CROSS_PREFIX-nm
36+
export CC=$CROSS_PREFIX-gcc-11
37+
export FC=$CROSS_PREFIX-gfortran-11
38+
export CXX=$CROSS_PREFIX-g++-11
39+
unset CPP CXXCPP STRINGS
40+
export STRIP=$CROSS_PREFIX-strip
41+
export RANLIB=$CROSS_PREFIX-ranlib
42+
43+
export PATH="$PREFIX/opt/gprbuild-bootstrap/bin:$PATH"
44+
45+
# FIXME: Build machine is not properly guessed?
46+
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+="
47+
--build=$TERMUX_HOST_PLATFORM
48+
--host=$TERMUX_HOST_PLATFORM
49+
--target=$TERMUX_HOST_PLATFORM
50+
"
51+
}
52+
53+
termux_step_make() {
54+
make LIBRARY_TYPE=relocatable all
55+
}
56+
57+
termux_step_make_install() {
58+
make LIBRARY_TYPE=relocatable install
59+
}
60+
61+
termux_step_post_make_install() {
62+
rm -f $TERMUX_PREFIX/doinstall
63+
}

0 commit comments

Comments
 (0)