[PATCH] Add GMP as a prerequisite for GDB

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Dec 11 13:00:20 UTC 2020


---
 bare/config/devel/gmp-6.1.0.cfg   | 18 ++++++++++
 rtems/config/6/rtems-default.bset |  1 +
 rtems/config/7/rtems-default.bset |  1 +
 source-builder/config/gmp.cfg     | 60 +++++++++++++++++++++++++++++++
 4 files changed, 80 insertions(+)
 create mode 100644 bare/config/devel/gmp-6.1.0.cfg
 create mode 100644 source-builder/config/gmp.cfg

diff --git a/bare/config/devel/gmp-6.1.0.cfg b/bare/config/devel/gmp-6.1.0.cfg
new file mode 100644
index 0000000..7bedba9
--- /dev/null
+++ b/bare/config/devel/gmp-6.1.0.cfg
@@ -0,0 +1,18 @@
+#
+# GMP 6.1.0
+#
+
+%if %{release} == %{nil}
+%define release 1
+%endif
+
+%include %{_configdir}/base.cfg
+
+%define gmp_version 6.1.0
+
+%hash sha512 gmp-%{gmp_version}.tar.bz2 3c82aeab9c1596d4da8afac2eec38e429e84f3211e1a572cf8fd2b546493c44c039b922a1133eaaa48bd7f3e11dbe795a384e21ed95cbe3ecc58d7ac02246117
+
+#
+# The GMP build instructions.
+#
+%include %{_configdir}/gmp.cfg
diff --git a/rtems/config/6/rtems-default.bset b/rtems/config/6/rtems-default.bset
index 0dc2e77..220778c 100644
--- a/rtems/config/6/rtems-default.bset
+++ b/rtems/config/6/rtems-default.bset
@@ -11,6 +11,7 @@
 #
 
 devel/expat-2.1.0-1
+devel/gmp-6.1.0
 tools/rtems-gdb-head
 
 tools/rtems-binutils-head
diff --git a/rtems/config/7/rtems-default.bset b/rtems/config/7/rtems-default.bset
index b37d75f..acb7059 100644
--- a/rtems/config/7/rtems-default.bset
+++ b/rtems/config/7/rtems-default.bset
@@ -6,6 +6,7 @@
 #
 
 devel/expat-2.1.0-1
+devel/gmp-6.1.0
 tools/rtems-gdb-head
 
 tools/rtems-binutils-head
diff --git a/source-builder/config/gmp.cfg b/source-builder/config/gmp.cfg
new file mode 100644
index 0000000..0e9118e
--- /dev/null
+++ b/source-builder/config/gmp.cfg
@@ -0,0 +1,60 @@
+#
+# The GNU Multiple Precision Arithmetic Library (GMP)
+#
+# This configuration file configure's, make's and install's GMP.
+#
+
+%if %{release} == %{nil}
+%define release 1
+%endif
+
+Name:      gmp-%{gmp_version}-%{_host}-%{release}
+Summary:   The GNU Multiple Precision Arithmetic Library (GMP) v%{gmp_version} for target %{_target} on host %{_host}
+Version:   %{gmp_version}
+Release:   %{release}
+URL: 	   https://gmplib.org/
+
+#
+# Source
+#
+%source set gmp https://gcc.gnu.org/pub/gcc/infrastructure/gmp-%{gmp_version}.tar.bz2
+
+#
+# Prepare the source code.
+#
+%prep
+  build_top=$(pwd)
+
+  %source setup gmp -q -n gmp-%{gmp_version}
+  %patch setup gmp -p1
+
+  cd ${build_top}
+
+%build
+  build_top=$(pwd)
+
+  cd gmp-%{gmp_version}
+
+  %{host_build_flags}
+
+  ./configure \
+    --build=%{_build} --host=%{_host} \
+    --verbose \
+    --prefix=%{_prefix} --bindir=%{_bindir} \
+    --exec-prefix=%{_exec_prefix} \
+    --includedir=%{_includedir} --libdir=%{_libdir} \
+    --mandir=%{_mandir} --infodir=%{_infodir}
+
+  %{__make} %{?_smp_mflags} all
+
+  cd ${build_top}
+
+%install
+  build_top=$(pwd)
+
+  rm -rf $SB_BUILD_ROOT
+
+  cd gmp-%{gmp_version}
+  %{__make} DESTDIR=$SB_BUILD_ROOT install
+
+  cd ${build_top}
-- 
2.26.2



More information about the devel mailing list