elf.h (1590B)
1 #!/usr/bin/env pthbs-build 2 #+busybox.e60885fe93ee85c01831673bb29f0e62a64903f4ce3094e3dc35bc8ec8887ad9 3 #@sha256:a6ffb38364effd623e135b206ec97ff9e6826a1f285e349a3633df55db38bc9e:elf.h 4 5 installdir="$pthbs_destdir//versions/$pthbs_package" 6 mkdir -p "$installdir/include" 7 mv elf.h "$installdir/include" 8 9 cd "$pthbs_destdir/versions/$pthbs_package" 10 find -type d -o -print | awk -F/ ' 11 BEGIN { 12 } 13 14 function r1(s) { 15 sub("^[.]/[^/]*", ".", s) 16 return s 17 } 18 function s1(repl, s) { 19 sub("^[.]/[^/]*", "./"repl, s) 20 return s 21 } 22 function link(src) { 23 x[$0]=0 24 printf "%s\t%s\n", $0, src 25 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 26 } 27 $1!="."{exit 1} 28 29 30 $2 == "command" { link($0); next } 31 $2 == "bin" { link(s1("command", $0)); next } 32 33 $2 == "library.so" { link($0); next } 34 $2 == "library" { link($0); next } 35 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 36 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next } 37 38 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } 39 40 $2 == "man" { link($0); next } 41 $2 == "info" { link($0); next } 42 $2 == "doc" { link($0); next } 43 $2 == "icons" { link($0); next } 44 $2 == "terminfo" { link($0); next } 45 $2 == "data" { link($0); next } 46 $2 == "include" { link($0); next } 47 48 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 49 50 END { 51 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 52 for(fname in x) { 53 if(x[fname]) { 54 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 55 exit 3 56 } 57 } 58 }' >.install-links.new 59 mv .install-links.new .install-links