mrrl

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

skalibs:bootstrap (2729B)


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