strace (3933B)
1 #!/usr/bin/env pthbs-build 2 #+busybox.539513a18a06a21e4660004fea30f3658959c5c7f54488b66b5fee7120b0c27c 3 #+busybox-findutils.3ba95afbbde5f39d6a3c0b17d82ff2e5350904cf19dd40acdf1c60ed126d3bda 4 #+busybox-awk.4ac003d165540d0084cd08c1386f136343851ef344ac5ff844769b058049d859 5 #+busybox-diffutils.b820ef7a40bea977a2bf740425ae15b2d9a21097bcf3a2f5ec77c21782b9deb8 6 #+musl-cross-make.ef7f483eefcad5b8f2d6c8329e61a0acaca7864b88e9521cb839392c62f45676 7 #+gnu-make.6c204d453a2d9b4e29dd7b9f93fc7c5a928284402b8646493cf72004f748753c 8 #+m4.24db011b72096e07a0a7df3d38942fd5ea0bb7d245ea0408aec9d8e5c4091cc7 9 #+patch.c713f3aa67a288e6bb986c0545f22f7e63211a00383bac354bba563b8320da95 10 #+libunwind.5373ee6911aca845a3275c9fccdb27443bc6007d449e9fd6f8c454735a2a82ca 11 #@sha256:37d93db7135d47852dbe763f1b18b3aeab142431a6f5268a17fc700387a326e4:strace-6.5-static.patch 12 #@untar:-J:sha256:e209daf0ee038ca5adcc4c277e9273b4d51f46a2ff86da575d36742ac3508a17:. 13 14 15 # - build script start - 16 17 autotools_config() { 18 prefix=/versions/$pthbs_package 19 ./configure -C \ 20 --prefix="$prefix" \ 21 --build="$(${CC:-gcc} -dumpmachine)" \ 22 --bindir="$prefix/command" \ 23 --sbindir="$prefix/command" \ 24 --infodir="$prefix/info" \ 25 --localedir="$prefix/locale" \ 26 --mandir="$prefix/man" \ 27 --libdir="$prefix/library" \ 28 --docdir="$prefix/doc/strace" \ 29 --datadir="$prefix/data" \ 30 --datarootdir="$prefix/data" \ 31 --localstatedir='/var/pthbs' \ 32 "$@" 33 34 } 35 36 autotools_config_static() { 37 build_env_static 38 autotools_config "$@" --enable-static --disable-shared 39 } 40 41 build_env_static() { 42 export LD_LIBRARY_PATH="$pthbs_build_environment/library" 43 export CPATH="$pthbs_build_environment/include" 44 export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS" 45 } 46 47 check_static() { 48 local exe || true 49 exe=$pthbs_destdir'/versions'/$pthbs_package/$1 50 if ! test -f $exe; then 51 printf '%s\n' "Error: file '$1' doesn't exist!" 52 exit 1 53 fi 54 local interp_info || true 55 interp_info=$(readelf --string-dump=.interp "$exe") || exit $? 56 if test x '!=' "x$interp_info"; then 57 printf '%s\n' "Error: '$1' is a dynamic binary!" 58 exit 1 59 fi 60 } 61 62 prefix=/versions/$pthbs_package 63 dest=${pthbs_destdir%/}${prefix} 64 cd 'strace-6.13' 65 patch -p1 <../strace-6.5-static.patch 66 67 68 69 autotools_config_static --with-unwind --without-libdw --enable-mpers=check 70 71 72 make -j${JOBS:-1} -l$((1+${JOBS:-1})) 73 74 make DESTDIR="$pthbs_destdir" install 75 76 77 78 check_static command/strace 79 80 81 82 cd "$pthbs_destdir/versions/$pthbs_package" 83 find -type d -o -print | awk -F/ ' 84 BEGIN { 85 x["./command/strace"]=1 86 x["./command/strace-log-merge"]=1 87 x["./man/man1/strace.1"]=1 88 x["./man/man1/strace-log-merge.1"]=1 89 } 90 91 function r1(s) { 92 sub("^[.]/[^/]*", ".", s) 93 return s 94 } 95 function s1(repl, s) { 96 sub("^[.]/[^/]*", "./"repl, s) 97 return s 98 } 99 function link(src) { 100 x[$0]=0 101 printf "%s\t%s\n", $0, src 102 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 103 } 104 $1!="."{exit 1} 105 106 107 $2 == "config" { link($0); next } 108 $2 == "keys" { link($0); next } 109 $2 == "zsh" { link($0); next } 110 $2 == "env" { link($0); next } 111 $2 == "command" { link($0); next } 112 $2 == "bin" { link(s1("command", $0)); next } 113 114 $2 == "library.so" { link($0); next } 115 $2 == "library" { link($0); next } 116 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 117 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } 118 119 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } 120 121 $2 == "man" { link($0); next } 122 $2 == "info" { link($0); next } 123 $2 == "doc" { link($0); next } 124 $2 == "icons" { link($0); next } 125 $2 == "terminfo" { link($0); next } 126 $2 == "data" { link($0); next } 127 $2 == "include" { link($0); next } 128 129 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 130 131 END { 132 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 133 for(fname in x) { 134 if(x[fname]) { 135 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 136 exit 3 137 } 138 } 139 }' >.install-links.new 140 mv .install-links.new .install-links 141