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