]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - gmp/gmp.nm
Merge remote-tracking branch 'stevee/pcre'
[people/ms/ipfire-3.x.git] / gmp / gmp.nm
CommitLineData
58608bd4 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
58608bd4
MT
4###############################################################################
5
802ea3af 6name = gmp
bef9b7be 7version = 6.0.0
02881f15 8release = 1
482cb9d2 9
802ea3af
MT
10groups = System/Libraries
11url = http://gmplib.org/
12license = LGPLv3+
13summary = A GNU arbitrary precision library.
58608bd4 14
802ea3af 15description
482cb9d2
MT
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
58608bd4 22 emphasizes speed over simplicity/elegance in its operations.
802ea3af 23end
58608bd4 24
bef9b7be
MT
25source_dl += https://gmplib.org/download/gmp/ ftp://ftp.gnu.org/gnu/gmp/
26sources = %{thisapp}.tar.xz
64dc7375 27
802ea3af
MT
28build
29 requires
30 gcc-c++
31 m4
32 end
64dc7375 33
01841414
MT
34 # Build different versions of gmp to enhance the speed
35 # of the OS.
36 build_versions = base
37
38 export ABI = standard
ed91fe31
MT
39
40 if "%{DISTRO_ARCH}" == "x86_64"
41 ABI = 64
42 end
58608bd4 43
ed91fe31 44 if "%{DISTRO_ARCH}" == "i686"
01841414
MT
45 # Build sse2 enabled version of gmp.
46 build_versions += sse2
47
ed91fe31
MT
48 ABI = 32
49 end
50
01841414 51 configure_options += \
01841414
MT
52 --enable-cxx \
53 --enable-mpbsd \
54 --disable-static
55
bef9b7be
MT
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
01841414
MT
62 prepare_cmds
63 for version in %{build_versions}; do
3b0f022c 64 mkdir -p build-${version}
01841414
MT
65
66 cd build-${version}
67 ln -svf ../configure .
68 cd ..
69 done
70 end
71
482cb9d2 72 build_one
bef9b7be
MT
73 ./configure \
74 %{configure_options}
482cb9d2
MT
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
ed91fe31 88 build
01841414
MT
89 for version in %{build_versions}; do
90 cd build-${version}
91
92 CFLAGS="%{CFLAGS}"
482cb9d2 93 CXXFLAGS="%{CXXFLAGS}"
01841414
MT
94 if [ "${version}" = "sse2" ]; then
95 # Enable sse2.
bef9b7be
MT
96 CFLAGS="%{CFLAGS} -march=pentium4"
97 CXXFLAGS="%{CXXFLAGS} -march=pentium4"
01841414
MT
98 fi
99
482cb9d2 100 %{build_one}
01841414
MT
101
102 cd ..
103 done
802ea3af
MT
104 end
105
106 test
01841414
MT
107 for version in %{build_versions}; do
108 cd build-${version}
109
482cb9d2 110 export LD_LIBRARY_PATH=$(pwd)/.libs
01841414
MT
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.?
01841414
MT
132 else
133 make install DESTDIR="%{BUILDROOT}"
134 fi
135
136 cd ..
137 done
802ea3af
MT
138 end
139end
140
141packages
142 package %{name}
01841414 143
802ea3af
MT
144 package %{name}-devel
145 template DEVEL
146 end
482cb9d2 147
1f9bc2f0
MT
148 package %{name}-debuginfo
149 template DEBUGINFO
150 end
802ea3af 151end