error-standalone (2225B)
1 #!/usr/bin/env pthbs-build 2 #+musl-cross-make.d0431fc0def788be03da43136972361827de52c8e6f0a6f3890dc57fe32e8ecc 3 #+gnu-make.444e811a68f4f16724e21354b710fad3592e53a2dbf7c0c78658f3d4e7c8e465 4 #+busybox.f4ef3d511c029095beda8d21dd48f7730bec63fb09792ca951402d6620338089 5 #+busybox-diffutils.4a0933977737282afcd82b39d435b50946a700fe13472d24e4580a41fa852123 6 #@untar:-z:sha256:0e751989cea94e25d5166a6a1ed9bde218786e39dff82e1f01dff12fc78639d9:. 7 8 build_env_static() { 9 export LD_LIBRARY_PATH="$pthbs_build_environment/library" 10 export CPATH="$pthbs_build_environment/include" 11 export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS" 12 } 13 prefix=/versions/$pthbs_package 14 build_env_static 15 cd error-standalone-2.0 16 make -j${JOBS:-1} -l$((1+${JOBS:-1})) PREFIX=/versions/$pthbs_package \ 17 DESTDIR="$pthbs_destdir" \ 18 INCDIR="$prefix/include" \ 19 LIBDIR="$prefix/library" \ 20 install-static 21 22 cd "$pthbs_destdir/versions/$pthbs_package" 23 find -type d -o -print | awk -F/ ' 24 BEGIN { 25 x["./library/liberror.a"]=1 26 x["./include/error.h"]=1 27 } 28 29 function r1(s) { 30 sub("^[.]/[^/]*", ".", s) 31 return s 32 } 33 function s1(repl, s) { 34 sub("^[.]/[^/]*", "./"repl, s) 35 return s 36 } 37 function link(src) { 38 x[$0]=0 39 printf "%s\t%s\n", $0, src 40 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 41 } 42 $1!="."{exit 1} 43 44 45 $2 == "command" { link($0); next } 46 $2 == "bin" { link(s1("command", $0)); next } 47 48 $2 == "library.so" { link($0); next } 49 $2 == "library" { link($0); next } 50 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 51 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next } 52 53 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } 54 55 $2 == "man" { link($0); next } 56 $2 == "info" { link($0); next } 57 $2 == "doc" { link($0); next } 58 $2 == "icons" { link($0); next } 59 $2 == "terminfo" { link($0); next } 60 $2 == "data" { link($0); next } 61 $2 == "include" { link($0); next } 62 63 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 64 65 END { 66 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 67 for(fname in x) { 68 if(x[fname]) { 69 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 70 exit 3 71 } 72 } 73 }' >.install-links.new 74 mv .install-links.new .install-links