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