mpfr (4332B)
1 #!/usr/bin/env pthbs-build 2 #+musl-cross-make.9be7a57aa0035ff26870115e69056e25445f3a96768a7d81251e7073630aadf9 3 #+gnu-make.05bfcd168c0d3714ecba9e27d84e02bfd2ef8f754c26c162be357882390451fc 4 #+busybox.23105cf3c52263661c44f7d855ae5dfc7287f5f8b60d6a026dedee24f4cf7a2e 5 #+m4.b0e22ef7946f84d34196869bd6845993b87a25bfcb3c26a0d64cf926089dabce 6 #+nawk.abe3790fd5e321ccd4e1ab7dab56339222e2eee686bc4b2241e7853104a4a500 7 #+gmp.d9302a6becadcc9ee59a2089e6051e8cf491292e7510e1d696b9f9996249cb07 8 #@untar:-J:sha256:b67ba0383ef7e8a8563734e2e889ef5ec3c3b898a01d00fa0a6869ad81c6ce01:. 9 10 11 # - build script start - 12 13 autotools_config() { 14 prefix=/home/ccx/versions/$pthbs_package 15 ./configure -C \ 16 --prefix="$prefix" \ 17 --build="$(${CC:-gcc} -dumpmachine)" \ 18 --bindir="$prefix/command" \ 19 --sbindir="$prefix/command" \ 20 --infodir="$prefix/info" \ 21 --localedir="$prefix/locale" \ 22 --mandir="$prefix/man" \ 23 --libdir="$prefix/library" \ 24 --docdir="$prefix/doc/mpfr" \ 25 --datadir="$prefix/data" \ 26 --datarootdir="$prefix/data" \ 27 --localstatedir='/var/pthbs' \ 28 "$@" 29 30 } 31 32 autotools_config_static() { 33 autotools_config "$@" --enable-static --disable-shared 34 } 35 36 build_env_static() { 37 export CFLAGS="-ffile-prefix-map=${pthbs_workdir}=builddir $CFLAGS" 38 export CXXFLAGS="-ffile-prefix-map=${pthbs_workdir}=builddir $CXXFLAGS" 39 export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS" 40 } 41 42 check_static() { 43 local exe || true 44 exe=$pthbs_destdir'/home/ccx/versions'/$pthbs_package/$1 45 if ! test -f $exe; then 46 printf '%s\n' "Error: file '$1' doesn't exist!" 47 exit 1 48 fi 49 local interp_info || true 50 interp_info=$(readelf --string-dump=.interp "$exe") || exit $? 51 if test x '!=' "x$interp_info"; then 52 printf '%s\n' "Error: '$1' is a dynamic binary!" 53 exit 1 54 fi 55 } 56 57 prefix=/home/ccx/versions/$pthbs_package 58 dest=${pthbs_destdir%/}${prefix} 59 cd 'mpfr-4.2.2' 60 61 62 build_env_static 63 export CPATH=$pthbs_build_environment/'include' 64 export LIBRARY_PATH=$pthbs_build_environment/'library' 65 export LD_LIBRARY_PATH=$pthbs_build_environment/'library.so' 66 67 autotools_config_static \ 68 CFLAGS="-g -Og -static --static" \ 69 CXXFLAGS="-g -Og -static --static" \ 70 LDFLAGS="-s --static $LDFLAGS" 71 72 73 make -j${JOBS:-1} -l$((1+${JOBS:-1})) \ 74 MULTILIB_OSDIRNAMES= \ 75 INFO_DEPS= \ 76 infodir= \ 77 ac_cv_prog_lex_root=lex.yy \ 78 MAKEINFO=false \ 79 MAKE="make MULTILIB_OSDIRNAMES= INFO_DEPS= infodir= ac_cv_prog_lex_root=lex.yy MAKEINFO=false " \ 80 all 81 82 make -j${JOBS:-1} -l$((1+${JOBS:-1})) \ 83 MULTILIB_OSDIRNAMES= \ 84 INFO_DEPS= \ 85 infodir= \ 86 ac_cv_prog_lex_root=lex.yy \ 87 MAKEINFO=false \ 88 MAKE="make MULTILIB_OSDIRNAMES= INFO_DEPS= infodir= ac_cv_prog_lex_root=lex.yy MAKEINFO=false " \ 89 DESTDIR="$pthbs_destdir" \ 90 install 91 92 93 94 95 96 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" 97 find -type d -o -print | awk -F/ ' 98 BEGIN { 99 x["./library/libmpfr.a"]=1 100 x["./include/mpfr.h"]=1 101 x["./include/mpf2mpfr.h"]=1 102 } 103 104 function r1(s) { 105 sub("^[.]/[^/]*", ".", s) 106 return s 107 } 108 function s1(repl, s) { 109 sub("^[.]/[^/]*", "./"repl, s) 110 return s 111 } 112 function link(src) { 113 x[$0]=0 114 printf "%s\t%s\n", $0, src 115 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 116 } 117 $1!="."{exit 1} 118 $2 == "env" { link($0); next } 119 $2 == ".env-template" { link($0); next } 120 121 $2 == "command" { link($0); next } 122 $2 == "command" { link($0); next } 123 $2 == "bin" { link(s1("command", $0)); next } 124 $2 == "sbin" { link(s1("command", $0)); next } 125 126 $2 == "library.so" { link($0); next } 127 $2 == "library" { link($0); next } 128 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 129 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } 130 131 $2 == "share" && $3 == "info" { link(s1("info", r1($0))); next } 132 $2 == "share" && $3 == "man" { link(s1("man", r1($0))); next } 133 $2 == "share" && $3 == "doc" { link(s1("doc", r1($0))); next } 134 135 $2 == "config" { link($0); next } 136 $2 == "man" { link($0); next } 137 $2 == "info" { link($0); next } 138 $2 == "doc" { link($0); next } 139 $2 == "data" { link($0); next } 140 $2 == "include" { link($0); next } 141 142 143 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 144 145 END { 146 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 147 retcode = 0 148 for(fname in x) { 149 if(x[fname]) { 150 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 151 retcode = 3 152 } 153 } 154 exit retcode 155 }' >.install-links.new 156 mv .install-links.new .install-links 157