mrrl

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

skalibs:bootstrap (2747B)


      1 #!/usr/bin/env pthbs-build
      2 #@pragma:nosandbox
      3 #+musl-cross-make.9be7a57aa0035ff26870115e69056e25445f3a96768a7d81251e7073630aadf9
      4 #+gnu-make.05bfcd168c0d3714ecba9e27d84e02bfd2ef8f754c26c162be357882390451fc
      5 #+busybox.23105cf3c52263661c44f7d855ae5dfc7287f5f8b60d6a026dedee24f4cf7a2e
      6 #+nawk.abe3790fd5e321ccd4e1ab7dab56339222e2eee686bc4b2241e7853104a4a500
      7 #@git:82a99e9cd7251135bb05505a2fa350dcf68819f1:skalibs
      8 
      9 
     10 # - build script start -
     11 
     12 prefix=/home/ccx/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/home/ccx/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