m4 (5658B)
1 #!/usr/bin/env pthbs-build 2 #+musl-cross-make.4bca2cd43f4a72eaaeefc4befc0b0ce736a5906ec0245552a8db7dc56fa9e5ec 3 #+gnu-make.fb4cff1c46827d02016d0f94d5256a263e7710025f7480fffb7580dc922a6069 4 #+busybox.504428034e649f598212c8994966e36667178683ec90987355f495ad3ca4abac 5 #+busybox-bzip2.4ea548a271f41e7147568dc02e5071fb200eab38a9a22e733d3106b71e354812 6 #+busybox-gzip.0999e8c6a8b7df82fc1cf10ade2468fb2bc4352f76d4b1d2af5099a65ccada9b 7 #+busybox-lzop.f0d93621bfd8ca106a8590562d93158b05087e5ef48068c7a84d9967b67d2d25 8 #+busybox-unzip.737f61aac20ef6c0554fca59bb599bf98e4fb77fbd97fba65a3692ac9d4afb84 9 #+busybox-xz.639cf99dd37a7d6f719b937d13af92202e01adf11c130f8647574c1d9ef5b0d2 10 #+busybox-cpio.d22266c2b6c056c0ea96873402d06591aa23368ea24d91f1fbf8a8327cb210f8 11 #+busybox-dpkg.2b0dd2fa41e946e98f2f8948ae3d3a152a069c77460768d9c76d41f56974e514 12 #+busybox-rpm.62bb242b4fbb3fd51b233ed9ce6c257ab997b1ee3a68ef3048656addc98f3d97 13 #+busybox-tar.dd3d9b0075fc038df431ce2a16fc1b140de521e1aa6d154dc7b607f9403d5ac0 14 #+busybox-ed.6ff6cd59168705c6b256d800cde7e8c69dd05c556520317dae6a0b492029fe6b 15 #+busybox-sed.8793bcd2536ab32fa528bbb0c22f0c014663ac5e045193aa7bd113a07f58c5b9 16 #+busybox-vi.db3d29c62845a55b7c5491d057cb9ea6c6deba93c567f4ef9eb15f06be8ad171 17 #+busybox-xxd.9dff38f0c9dbf57856a0824bc23cc99cb31a67ce5138de7a6de2e255880a5696 18 #+busybox-process-extra.448a35fa5362e576a23ef306ec6e0da2f625adae08cc5c3b12a01d5d28f76ce6 19 #+busybox-procps.835712dc539d5583773d175255a5c4e27b5823d97e855948d27cc2c194247b0f 20 #+busybox-psmisc.f2434b74cd3e07ddea335da52c222567bc111b621f0f060afef8bcc26a8d96fd 21 #+busybox-ash.039eb4051853cdde4d03b8dbd5d6128957bf933be5ac398471666e5db0d33dab 22 #+busybox-bc.e731e83c11906525d676777835256a3f478779eafe7152701adfc46558d73009 23 #+busybox-coreutils.a57a12f85d58388c284d4f93f6c485d4bc2a7eac0d0f4be57b20d2ddbd4c8b8f 24 #+busybox-coreutils-extra.09de38ce2d65026888577e8314766e4b17205b2a99a4fecfdd5cd89c1cd82aed 25 #+busybox-daemontools.d12e277e7154028f0beaae44ad1e2c7e1cd12d28549b6861604fc634c3e09aaf 26 #+busybox-grep.474abd8ddad6afb320c55141078cb4507d02c4610181a4d72a4d98ba93434a60 27 #+busybox-misc.ea211db457ee098923eeff82a4388d5864254a6c2718f38471b5b2867c73d158 28 #+busybox-sh.49a7505969c9882c8a9a7ad3f5dba6d1382add3559f4da21ceafb2708d3fd4c8 29 #+busybox-util-linux-unpriv.95b792cd49d1f00d5488b15d93809166916ef3b8a63a69ea11f3bf6e92a74f24 30 #+busybox-findutils.db22f512240124b15d61cf8d0ceafebc98649f6f137608a2d1bd66f18e81ad8c 31 #+busybox-diffutils.eed6ca067c994ab56e63b8b97a60f6e9f3625d3f9aeda53306e23bb42186ce78 32 #+nawk.abe3790fd5e321ccd4e1ab7dab56339222e2eee686bc4b2241e7853104a4a500 33 #@untar:-z:sha256:3be4a26d825ffdfda52a56fc43246456989a3630093cced3fbddf4771ee58a70:. 34 35 36 # - build script start - 37 38 autotools_config() { 39 prefix=/home/ccx/versions/$pthbs_package 40 ./configure -C \ 41 --prefix="$prefix" \ 42 --build="$(${CC:-gcc} -dumpmachine)" \ 43 --bindir="$prefix/command" \ 44 --sbindir="$prefix/command" \ 45 --infodir="$prefix/info" \ 46 --localedir="$prefix/locale" \ 47 --mandir="$prefix/man" \ 48 --libdir="$prefix/library" \ 49 --docdir="$prefix/doc/m4" \ 50 --datadir="$prefix/data" \ 51 --datarootdir="$prefix/data" \ 52 --localstatedir='/var/pthbs' \ 53 "$@" 54 55 } 56 57 autotools_config_static() { 58 autotools_config "$@" --enable-static --disable-shared 59 } 60 61 build_env_static() { 62 export CFLAGS="-ffile-prefix-map=${pthbs_workdir}=builddir $CFLAGS" 63 export CXXFLAGS="-ffile-prefix-map=${pthbs_workdir}=builddir $CXXFLAGS" 64 export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS" 65 } 66 67 check_static() { 68 local exe || true 69 exe=$pthbs_destdir'/home/ccx/versions'/$pthbs_package/$1 70 if ! test -f $exe; then 71 printf '%s\n' "Error: file '$1' doesn't exist!" 72 exit 1 73 fi 74 local interp_info || true 75 interp_info=$(readelf --string-dump=.interp "$exe") || exit $? 76 if test x '!=' "x$interp_info"; then 77 printf '%s\n' "Error: '$1' is a dynamic binary!" 78 exit 1 79 fi 80 } 81 82 prefix=/home/ccx/versions/$pthbs_package 83 dest=${pthbs_destdir%/}${prefix} 84 cd 'm4-1.4.19' 85 86 87 build_env_static 88 autotools_config_static --disable-nls 89 90 91 make -j${JOBS:-1} -l$((1+${JOBS:-1})) 92 93 make DESTDIR="$pthbs_destdir" install 94 95 96 97 check_static command/m4 98 99 100 101 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" 102 find -type d -o -print | awk -F/ ' 103 BEGIN { 104 x["./command/m4"]=1 105 } 106 107 function r1(s) { 108 sub("^[.]/[^/]*", ".", s) 109 return s 110 } 111 function s1(repl, s) { 112 sub("^[.]/[^/]*", "./"repl, s) 113 return s 114 } 115 function link(src) { 116 x[$0]=0 117 printf "%s\t%s\n", $0, src 118 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 119 } 120 $1!="."{exit 1} 121 $2 == "env" { link($0); next } 122 $2 == ".env-template" { link($0); next } 123 124 $2 == "command" { link($0); next } 125 $2 == "command" { link($0); next } 126 $2 == "bin" { link(s1("command", $0)); next } 127 $2 == "sbin" { link(s1("command", $0)); next } 128 129 $2 == "library.so" { link($0); next } 130 $2 == "library" { link($0); next } 131 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 132 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } 133 134 $2 == "share" && $3 == "info" { link(s1("info", r1($0))); next } 135 $2 == "share" && $3 == "man" { link(s1("man", r1($0))); next } 136 $2 == "share" && $3 == "doc" { link(s1("doc", r1($0))); next } 137 138 $2 == "config" { link($0); next } 139 $2 == "man" { link($0); next } 140 $2 == "info" { link($0); next } 141 $2 == "doc" { link($0); next } 142 $2 == "data" { link($0); next } 143 $2 == "include" { link($0); next } 144 145 146 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 147 148 END { 149 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 150 retcode = 0 151 for(fname in x) { 152 if(x[fname]) { 153 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 154 retcode = 3 155 } 156 } 157 exit retcode 158 }' >.install-links.new 159 mv .install-links.new .install-links 160