Skip to content

mpfr: remove pregenerated files #522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion steps/SHA256SUMS.pkgs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ d4dff784cac3d58d0cedfd9a51b52ff100ad8654e10a7c8c41590351f48f57d6 m4-1.4.7_0.tar
caaf55115075a101bbc35b65eda1e93d37758dd6abc51365b46643db0a974c40 make-3.82_0.tar.bz2
d9581e8f03f133fb2eafdc4bdfa0f527a5ce50209420d00809388aa0f05b90c7 make-4.2.1_0.tar.bz2
17cd976bc0f6e897c6fffe43dd7c55d93ce0adadf1b4dc72925b80e2d266519f mpc-1.2.1_0.tar.bz2
98a9f55c01ed375fae21913284e7fa07ff434c0810f34d791f3fbaa1df221302 mpfr-4.1.0_0.tar.bz2
5fec0eab35498be54994e7f3d73bfe53c3ced6e5cf68cc9b45b2b4dc8ff1d5e9 mpfr-4.1.0_0.tar.bz2
5c590124471cc8c42b45d863c417314d05d9c89b1a3d61db8a36ba9b459ed391 musl-1.1.24_0.tar.bz2
fc60028b78ac34eda780478638818c5f587873337cf68f607082a3a81bae28ea musl-1.1.24_1.tar.bz2
5bf3cd3b9e5e12f88c492ba653006b4325a535ef5581d775f18a1338fc57b457 musl-1.1.24_2.tar.bz2
Expand Down
30 changes: 29 additions & 1 deletion steps/mpfr-4.1.0/pass1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
src_prepare() {
default

find . -name '*.info' -delete
# Remove pregenerated table in strtofr.c
sed -i '/^ {/,/ };$/d' src/strtofr.c
cp src/strtofr.c{,.old}
sed -i '/int RedInvLog2Table/ s/$/};/' src/strtofr.c

rm doc/*.info

# testfiles
rm tests/tfpif_*.dat tests/tstrtofr.c

AUTOMAKE=automake-1.15 ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi
}

Expand All @@ -21,6 +30,25 @@ src_configure() {

src_compile() {
make "${MAKEJOBS}" MAKEINFO=true DESTDIR="${DESTDIR}"

pushd src
cat > strtofr_gen.c <<EOF
#include <stdio.h>
#include <gmp.h>
#include <mpfr.h>
EOF
# Enable the bit of code that generates the table
sed -n '/^#define N 8$/,/^}$/p' strtofr.c >> strtofr_gen.c
gcc strtofr_gen.c -o strtofr_gen -std=gnu99 -I. -L.libs -lmpfr -lgmp
# ordering of 2>&1 >/dev/null is intentional here;
# stdout -> null
# stderr -> file (NOT null)
./strtofr_gen 2>strtofr_table >/dev/null
echo "};" >> strtofr_table
sed "/int RedInvLog2Table/ r strtofr_table" strtofr.c.old > strtofr.c
popd

make "${MAKEJOBS}" MAKEINFO=true DESTDIR="${DESTDIR}"
}

src_install() {
Expand Down
Loading