1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 groups = System/Libraries
11 url = http://gmplib.org/
13 summary = A GNU arbitrary precision library.
16 The gmp package contains GNU MP, a library for arbitrary precision
17 arithmetic, signed integers operations, rational numbers and floating
18 point numbers. GNU MP is designed for speed, for both small and very
19 large operands. GNU MP is fast because it uses fullwords as the basic
20 arithmetic type, it uses fast algorithms, it carefully optimizes
21 assembly code for many CPUs' most common inner loops, and it generally
22 emphasizes speed over simplicity/elegance in its operations.
25 source_dl += https://gmplib.org/download/gmp/ ftp://ftp.gnu.org/gnu/gmp/
26 sources = %{thisapp}.tar.xz
34 # Build different versions of gmp to enhance the speed
40 if "%{DISTRO_ARCH}" == "x86_64"
44 if "%{DISTRO_ARCH}" == "i686"
45 # Build sse2 enabled version of gmp.
46 build_versions += sse2
51 configure_options += \
56 if "%{DISTRO_ARCH}" == "armv7hl"
57 # GMP cannot be built with THUMB support.
58 CFLAGS := %(echo "%{CFLAGS}" | sed -e "s/-mthumb//g")
59 CXXFLAGS := %(echo "%{CXXFLAGS}" | sed -e "s/-mthumb//g")
63 for version in %{build_versions}; do
64 mkdir -p build-${version}
67 ln -svf ../configure .
77 sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
78 -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
79 -e 's|-lstdc++ -lm|-lstdc++|' \
82 export LD_LIBRARY_PATH=$(pwd)/.libs
83 make %{PARALLELISMFLAGS} \
85 CXXFLAGS="${CXXFLAGS}"
89 for version in %{build_versions}; do
93 CXXFLAGS="%{CXXFLAGS}"
94 if [ "${version}" = "sse2" ]; then
96 CFLAGS="%{CFLAGS} -march=pentium4"
97 CXXFLAGS="%{CXXFLAGS} -march=pentium4"
107 for version in %{build_versions}; do
110 export LD_LIBRARY_PATH=$(pwd)/.libs
118 for version in %{build_versions}; do
121 if [ "${version}" = "sse2" ]; then
122 # Manually install sse2 libs.
123 mkdir -pv %{BUILDROOT}/usr/lib/sse2
125 install -m 755 .libs/libgmp.so.*.* %{BUILDROOT}/usr/lib/sse2
126 cp -a .libs/libgmp.so.[^.]* %{BUILDROOT}/usr/lib/sse2
127 chmod 755 %{BUILDROOT}/usr/lib/sse2/libgmp.so.[^.]*
129 install -m 755 .libs/libgmpxx.so.*.* %{BUILDROOT}/usr/lib/sse2
130 cp -a .libs/libgmpxx.so.? %{BUILDROOT}/usr/lib/sse2
131 chmod 755 %{BUILDROOT}/usr/lib/sse2/libgmpxx.so.?
133 make install DESTDIR="%{BUILDROOT}"
144 package %{name}-devel
148 package %{name}-debuginfo