]> git.ipfire.org Git - ipfire-3.x.git/blob - gmp/gmp.nm
kernel: Enable /dev/mem
[ipfire-3.x.git] / gmp / gmp.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = gmp
7 version = 6.1.2
8 release = 1
9
10 groups = System/Libraries
11 url = http://gmplib.org/
12 license = LGPLv3+
13 summary = A GNU arbitrary precision library.
14
15 description
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.
23 end
24
25 source_dl += https://gmplib.org/download/gmp/ ftp://ftp.gnu.org/gnu/gmp/
26 sources = %{thisapp}.tar.xz
27
28 build
29 requires
30 gcc-c++
31 m4
32 end
33
34 # Build different versions of gmp to enhance the speed
35 # of the OS.
36 build_versions = base
37
38 export ABI = standard
39
40 if "%{DISTRO_ARCH}" == "x86_64"
41 ABI = 64
42 end
43
44 if "%{DISTRO_ARCH}" == "i686"
45 # Build sse2 enabled version of gmp.
46 build_versions += sse2
47
48 ABI = 32
49 end
50
51 configure_options += \
52 --enable-cxx \
53 --enable-mpbsd \
54 --disable-static
55
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")
60 end
61
62 prepare_cmds
63 for version in %{build_versions}; do
64 mkdir -p build-${version}
65
66 cd build-${version}
67 ln -svf ../configure .
68 cd ..
69 done
70 end
71
72 build_one
73 ./configure \
74 %{configure_options}
75
76 # Kill RPATHs.
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++|' \
80 -i libtool
81
82 export LD_LIBRARY_PATH=$(pwd)/.libs
83 make %{PARALLELISMFLAGS} \
84 CFLAGS="${CFLAGS}" \
85 CXXFLAGS="${CXXFLAGS}"
86 end
87
88 build
89 for version in %{build_versions}; do
90 cd build-${version}
91
92 CFLAGS="%{CFLAGS}"
93 CXXFLAGS="%{CXXFLAGS}"
94 if [ "${version}" = "sse2" ]; then
95 # Enable sse2.
96 CFLAGS="%{CFLAGS} -march=pentium4"
97 CXXFLAGS="%{CXXFLAGS} -march=pentium4"
98 fi
99
100 %{build_one}
101
102 cd ..
103 done
104 end
105
106 test
107 for version in %{build_versions}; do
108 cd build-${version}
109
110 export LD_LIBRARY_PATH=$(pwd)/.libs
111 make check
112
113 cd ..
114 done
115 end
116
117 install
118 for version in %{build_versions}; do
119 cd build-${version}
120
121 if [ "${version}" = "sse2" ]; then
122 # Manually install sse2 libs.
123 mkdir -pv %{BUILDROOT}/usr/lib/sse2
124
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.[^.]*
128
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.?
132 else
133 make install DESTDIR="%{BUILDROOT}"
134 fi
135
136 cd ..
137 done
138 end
139 end
140
141 packages
142 package %{name}
143
144 package %{name}-devel
145 template DEVEL
146 end
147
148 package %{name}-debuginfo
149 template DEBUGINFO
150 end
151 end