mrrl

Minimal Reliable Reproducible Linux
git clone https://ccx.te2000.cz/git/mrrl
Log | Files | Refs | Submodules | README

gnu-make:old (3119B)


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