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