skalibs (2322B)
1 #!/usr/bin/env pthbs-build 2 #+musl-cross-make.757bcca6771cad3395ae302e0fdc835ebf5b4a965c08e30d758e6149b0bacbcd 3 #+gnu-make.529116171fecc2bdac7c70e109d28270d765379c8a52cf7c3ea7453195bbf42b 4 #+busybox.3664b94c09ea6d35ce73985026762c142829e53fed4a38541af3afb00c37dd4a 5 #@git:18290598b001146c684d5b67762007fee0182071:skalibs 6 7 : ${JOBS:=1} 8 9 export CC="$pthbs_build_environment/command/x86_64-linux-musl-gcc" 10 export CXX="$pthbs_build_environment/command/x86_64-linux-musl-g++" 11 export LD="$pthbs_build_environment/command/x86_64-linux-musl-ld" 12 export AR="$pthbs_build_environment/command/x86_64-linux-musl-ar" 13 14 export CFLAGS="-O2 -ggdb" 15 16 prefix=/versions/$pthbs_package 17 cd skalibs 18 ./configure \ 19 --prefix="$prefix" \ 20 --sysdepdir="${prefix}/sysdeps" \ 21 --binprefix="${prefix}/command" \ 22 --extbinprefix="${prefix}/command" \ 23 --dynlibdir="${prefix}/library.so" \ 24 --libdir="${prefix}/library" \ 25 --includedir="${prefix}/include" \ 26 --disable-shared --enable-static 27 28 make -j${JOBS:-1} -l$((1+${JOBS:-1})) 29 make DESTDIR="$pthbs_destdir" install 30 31 cd "$pthbs_destdir/versions/$pthbs_package" 32 find -type d -o -print | awk -F/ ' 33 BEGIN { 34 } 35 36 function r1(s) { 37 sub("^[.]/[^/]*", ".", s) 38 return s 39 } 40 function s1(repl, s) { 41 sub("^[.]/[^/]*", "./"repl, s) 42 return s 43 } 44 function link(src) { 45 x[$0]=0 46 printf "%s\t%s\n", $0, src 47 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 48 } 49 $1!="."{exit 1} 50 51 52 $2 == "command" { link($0); next } 53 $2 == "bin" { link(s1("command", $0)); next } 54 55 $2 == "library.so" { link($0); next } 56 $2 == "library" { link($0); next } 57 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 58 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next } 59 60 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } 61 62 $2 == "man" { link($0); next } 63 $2 == "info" { link($0); next } 64 $2 == "doc" { link($0); next } 65 $2 == "icons" { link($0); next } 66 $2 == "terminfo" { link($0); next } 67 $2 == "data" { link($0); next } 68 $2 == "include" { link($0); next } 69 70 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 71 72 END { 73 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 74 for(fname in x) { 75 if(x[fname]) { 76 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 77 exit 3 78 } 79 } 80 }' >.install-links.new 81 mv .install-links.new .install-links