libk  Check-in [cfbfa7fcca]

Overview
Comment:add libk-config
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cfbfa7fccac75575af1e5c82b6cc8c0bad0e96d334884e2976cfadb00383e575
User & Date: lexi on 2020-05-20 14:27:24
Other Links: manifest | tags
Context
2020-05-20
17:40
fix markdown syntax check-in: ed18118c3c user: lexi tags: trunk
14:27
add libk-config check-in: cfbfa7fcca user: lexi tags: trunk
2020-03-04
12:47
tweak build infrastructure: global install script now respects prefix in all cases; update PKGBUILD to use install script correctly check-in: b6c435e95a user: lexi tags: trunk
Changes

Modified arch/posix.h from [1bb8ef8aa2] to [a61775181a].

whitespace changes only

Modified dist/PKGBUILD from [fbbd050911] to [db0797b3e0].

     5      5   url='https://c.comint.su/libk'
     6      6   license=(AGPL)
     7      7   source=('https://c.comint.su/libk/tarball/trunk/libk.tar.gz')
     8      8   md5sums=(SKIP)
     9      9   arch=(i686 x86_64 aarch64 armv7l)
    10     10   depends=()
    11     11   makedepends=(binutils bash yasm)
           12  +
           13  +# the following fields should be uncommented in release tarballs and in
           14  +# libk build scripts submitted to the AUR or maybe eventually the Arch
           15  +# community repositories.
           16  +
           17  +validpgpkeys=(
           18  +	BA8B6CB87AAF25B4F771C34CD8B3128C48456885
           19  +	1AA9AC700870CC08C8561BF9C24B9CD04DC6AE7F
           20  +)
           21  +
    12     22   
    13     23   build() {
    14     24   	export os=lin library=both
    15     25   	case $(uname -m) in
    16     26   		# i have no idea why, but the "arch" environment variable name
    17     27   		# appears tainted somehow, and gets blanked between here and
    18     28   		# the call to the build script. ugly hack but it works

Added global/cc-invoke.m4 version [02c091706a].

            1  +_libk_shebang_
            2  +define(quot,"'"'$1'"'")dnl
            3  +# generated from /global/cc-invoke.m4 by install.sh
            4  +
            5  +if test "$(echo -n)" = "-n"; then
            6  +	say() { echo $@' \c'; }
            7  +else
            8  +	say() { echo -n $@' '; }
            9  +fi
           10  +
           11  +libk_libs() {
           12  +	if test "$static" != 1; then
           13  +		say quot(_libk_libdir_/kboot.o) quot(-L`'_libk_libdir_) -lk
           14  +	else
           15  +		say quot(_libk_libdir_/libk.a)
           16  +	fi
           17  +}
           18  +
           19  +libk_cflags() {
           20  +	say quot(-I`'_libk_incdir_)
           21  +}
           22  +
           23  +libk_static() {
           24  +	say _libk_libdir_/libk.a
           25  +}
           26  +
           27  +libk_gcc() {
           28  +	say -ffreestanding -nostdlib 
           29  +}
           30  +
           31  +libk_clang() {
           32  +	say -ffreestanding -nostdlibinc
           33  +}
           34  +
           35  +usage() {
           36  +	echo "usage: $0 [flags]"
           37  +	echo "    $0 prints compiler flags necessary to compile libk programs."
           38  +	echo "    in general, you will need three kinds of flag sets:"
           39  +	echo "        linkage flags tell the compiler where to find libk binary libraries"
           40  +	echo "        for the final linking stage."
           41  +	echo "            --libs -l  : emit linkage flags"
           42  +	echo "            --static -s: modify emitted flags for static linking"
           43  +	echo "        compilation flags tell the compiler where to find headers."
           44  +	echo "            --cflags -c: emit compilation flags"
           45  +	echo "        compatibility flags set various compiler-specific options needed to"
           46  +	echo "        compile programs without the traditional C standard library."
           47  +	echo "            --gcc -g  : emit gcc-style compat flags"
           48  +	echo "            --clang -C: emit clang-style compat flags"
           49  +	echo "    $0 handles quoting automatically."
           50  +	exit 64
           51  +}
           52  +
           53  +for a in $@; do
           54  +	case $a in
           55  +		*help|-h) usage ;;
           56  +		*newlines|-n)
           57  +			say() {
           58  +				for l in $@; do
           59  +					echo $l
           60  +				done
           61  +			};;
           62  +		*libs|-l)   fns="$fns libk_libs"   ;;
           63  +		*cflags|-c) fns="$fns libk_cflags" ;;
           64  +		*gcc|-g)    fns="$fns libk_gcc" ;;
           65  +		*clang|-C)  fns="$fns libk_clang" ;;
           66  +		*static|-s) static=1 ;;
           67  +	esac
           68  +done
           69  +
           70  +for f in $fns; do
           71  +	$f
           72  +done

Modified install.sh from [bca498cfb3] to [973646497d].

     5      5   # linux directory hierarchy on systems where this doesn't make sense.
     6      6   
     7      7   check prefix 'a directory to install to'
     8      8   build="${build:-out}"
     9      9   
    10     10   bindir="${bindir:-$prefix/bin}"
    11     11   libdir="${libdir:-$prefix/lib}"
    12         -incdir="${incdir:-$prefix/include}"
           12  +incdir="${incdir:-$prefix/include/k}"
    13     13   sharedir="${sharedir:-$prefix/share}"
           14  +shebang="${shebang:-#!/usr/bin/env bash}"
    14     15   
    15     16   say "commencing install"
    16     17   say " - prefix: $prefix"
    17     18   say " - destinations:"
    18     19   say "   - binaries → $bindir"
    19     20   say "   - libraries → $libdir"
    20     21   say "   - headers → $incdir"
................................................................................
    33     34   say "installing binaries"
    34     35   # *.testbin files should not be installed
    35     36   install -Dm755 -t "$bindir" "$build/kgraft.attach"
    36     37   
    37     38   # Includes
    38     39   say "installing headers"
    39     40   for inc in "$build"/k/*; do
    40         -	install -Dm644 -t "$incdir/k" "$inc"
           41  +	install -Dm644 -t "$incdir" "$inc"
    41     42   done
    42     43   
    43     44   # Documentation
    44     45   say "installing documentation"
    45     46   for man in "$build"/doc/man/*; do
    46     47   	install -Dm644 -t "$sharedir/man" "$man"
    47     48   done
    48     49   for html in "$build"/doc/html/*; do
    49     50   	install -Dm644 -t "$sharedir/doc/libk/html" "$html"
    50     51   done
    51     52   for pdf in "$build"/doc/pdf/*; do
    52     53   	install -Dm644 -t "$sharedir/doc/libk/pdf" "$pdf"
    53     54   done
           55  +
           56  +say "building libk-config utility"
           57  +m4 >"$bindir/libk-config" \
           58  +	-D"_libk_bindir_=$bindir" -D"_libk_libdir_=$libdir" \
           59  +	-D"_libk_incdir_=$incdir" -D"_libk_sharedir_=$sharedir" \
           60  +	-D"_libk_shebang_=$shebang" \
           61  +	global/cc-invoke.m4
           62  +
           63  +chmod +x "$bindir/libk-config"
           64  +
    54     65   say "install complete"