gnu-make:bootstrap (2792B)
1 #!/usr/bin/env pthbs-build 2 #@pragma:nosandbox 3 #@pragma:nopath 4 #+musl-cross-make.473310ee8dd6c0b20a1b81598700e61a0e38dcfe0b8503bd5cdbb9bf4f9af4fc 5 #@untar:-z:sha256:dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3:. 6 7 8 # - build script start - 9 10 autotools_config() { 11 prefix=/versions/$pthbs_package 12 ./configure -C \ 13 --prefix="$prefix" \ 14 --build="$(${CC:-gcc} -dumpmachine)" \ 15 --bindir="$prefix/command" \ 16 --sbindir="$prefix/command" \ 17 --infodir="$prefix/info" \ 18 --localedir="$prefix/locale" \ 19 --mandir="$prefix/man" \ 20 --libdir="$prefix/library" \ 21 --docdir="$prefix/doc/gnu-make" \ 22 --datadir="$prefix/data" \ 23 --datarootdir="$prefix/data" \ 24 --localstatedir='/var/pthbs' \ 25 "$@" 26 27 } 28 29 autotools_config_static() { 30 build_env_static 31 autotools_config "$@" --enable-static --disable-shared 32 } 33 34 prefix=/versions/$pthbs_package 35 dest=${pthbs_destdir%/}${prefix} 36 cd 'make-4.4.1' 37 38 39 mcm=/versions/musl-cross-make.473310ee8dd6c0b20a1b81598700e61a0e38dcfe0b8503bd5cdbb9bf4f9af4fc 40 41 export PATH="$mcm/bin:$PATH" 42 export CC="$mcm/bin/x86_64-linux-musl-gcc" 43 export CXX="$mcm/bin/x86_64-linux-musl-g++" 44 export CFLAGS="-D_GNU_SOURCE" 45 export LDFLAGS="-static" 46 47 autotools_config --enable-static --disable-shared --disable-nls 48 49 50 make -j${JOBS:-1} -l$((1+${JOBS:-1})) 51 52 make DESTDIR="$pthbs_destdir" install 53 54 55 56 57 58 cd "$pthbs_destdir/versions/$pthbs_package" 59 find -type d -o -print | awk -F/ ' 60 BEGIN { 61 x["./command/make"]=1 62 x["./man/man1/make.1"]=1 63 } 64 65 function r1(s) { 66 sub("^[.]/[^/]*", ".", s) 67 return s 68 } 69 function s1(repl, s) { 70 sub("^[.]/[^/]*", "./"repl, s) 71 return s 72 } 73 function link(src) { 74 x[$0]=0 75 printf "%s\t%s\n", $0, src 76 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 77 } 78 $1!="."{exit 1} 79 80 81 $2 == "config" { link($0); next } 82 $2 == "keys" { link($0); next } 83 $2 == "zsh" { link($0); next } 84 $2 == "env" { link($0); next } 85 $2 == "command" { link($0); next } 86 $2 == "bin" { link(s1("command", $0)); next } 87 88 $2 == "library.so" { link($0); next } 89 $2 == "library" { link($0); next } 90 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 91 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } 92 93 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } 94 95 $2 == "man" { link($0); next } 96 $2 == "info" { link($0); next } 97 $2 == "doc" { link($0); next } 98 $2 == "icons" { link($0); next } 99 $2 == "terminfo" { link($0); next } 100 $2 == "data" { link($0); next } 101 $2 == "include" { link($0); next } 102 103 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 104 105 END { 106 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 107 for(fname in x) { 108 if(x[fname]) { 109 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 110 exit 3 111 } 112 } 113 }' >.install-links.new 114 mv .install-links.new .install-links 115