libk  Check-in [ef45f6d08e]

Overview
Comment:target appropriate manpage section; rename boot.o to properly namespaced kboot.o; misc fixes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ef45f6d08e9c046eeb4c69362af7117e59c57c2d7a8bfe29cb9947c873dfe64f
User & Date: lexi on 2020-03-03 17:58:05
Other Links: manifest | tags
Context
2020-03-03
18:10
add target display check-in: ebe506a75e user: lexi tags: trunk
17:58
target appropriate manpage section; rename boot.o to properly namespaced kboot.o; misc fixes check-in: ef45f6d08e user: lexi tags: trunk
16:02
update distro URLs check-in: 1abe29c598 user: lexi tags: trunk
Changes

Modified build.sh from [773f649c53] to [dcf2a949b3].

58
59
60
61
62
63
64
65
66


67
68
69
70




71
72




73
74
75
76

77
78
79
80
81
82
83
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
...
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
	dos.*) bin_fmt=dosexe;;
	none.*) bin_fmt=bin;;
	*.32) bin_fmt=elf32;;
	*.64) bin_fmt=elf64;;
	*) say "cannot determine correct binary format to use for target $target"; exit 1;;
esac

# first, we establish the
# parameters of the build


has cc && _cc=cc
has clang && _cc=clang 
has gcc && _cc=gcc # prefer gcc
cc=${cc:-$_cc}




has m4 && _m4=m4
m4=${m4:-$_m4}




has nasm && asm=nasm
has yasm && asm=yasm # prefer yasm
export cc
export m4

export gen=${gen:-gen}
library=${library:-static} # {static|shared|both}
export verbose=${verbose:-quiet} # {no|quiet|loud}

doc=${doc:-yes}
export doc_html=${doc_html:-yes}
export doc_pdf=${doc_pdf:-yes}
................................................................................
	        build_shared_library=yes;;

	  both) build_static_library=yes
	        build_shared_library=yes;;
esac

check cc "your C compiler of choice"
check asm "an assembler that takes Intel syntax and nasm-style-macros"
check m4 "the path to your m4 installation"

export build=$(global/build-id.sh)

if test "$p_headers_errno" = ""; then
	case $os in
		lin) p_headers_errno="${p_headers_errno:-/usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h}";;

................................................................................
	for obj in ${fn_objects[@]} ${rt_objects[@]} ${data_objects[@]}; do
		report ar rc $to/libk.a $obj
	done
	report ranlib $to/libk.a
fi

if test $build_shared_library == yes; then
	report ld -r ${rt_objects[@]} -o $to/boot.o
	report ld -shared ${fn_objects[@]} ${data_objects[@]} -o $to/libk.so
fi

# fifth pass: compile the executable tools
# against the libraries created in pass 5

for mod in ${modules[@]}; do
	for exe in $(scan mod/$mod '*.exe.c'); do
		base="$(basename $exe)"
		dest="$to/$mod.${base%%.exe.c}"
		if test $build_shared_library == yes; then
			comp_c "$to/boot.o $exe" "$dest" -lk
		else
			comp_c "$exe" "$dest" -lk
		fi
	done
done

set +x
say "all passes finished; build $build complete at $(timestamp)"







|
<
>
>
|
|
|
|
>
>
>
>
|
|
>
>
>
>
|
|
<
<
>







 







|
|







 







|











|








58
59
60
61
62
63
64
65

66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83


84
85
86
87
88
89
90
91
..
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
...
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
	dos.*) bin_fmt=dosexe;;
	none.*) bin_fmt=bin;;
	*.32) bin_fmt=elf32;;
	*.64) bin_fmt=elf64;;
	*) say "cannot determine correct binary format to use for target $target"; exit 1;;
esac

# first, we establish the parameters of the build


# detect C compiler to use
	has cc && _cc=cc
	has clang && _cc=clang 
	has gcc && _cc=gcc # prefer gcc
	export cc=${cc:-$_cc}

# detect m4 implementation to use. TODO: determine if BSD m4
# is compatible with our macro sources, otherwise we'll need
# to fix that or make gm4 a dep if we can't
	has m4 && _m4=m4
	export m4=${m4:-$_m4}

# pick the assembler to use. long-term, we need to rewrite
# the x86* sources to just use gas, since gas is the only
# OSS assembler that seems to exist for other arches
	has nasm && asm=nasm
	has yasm && asm=yasm # prefer yasm



export gen=${gen:-gen}
library=${library:-static} # {static|shared|both}
export verbose=${verbose:-quiet} # {no|quiet|loud}

doc=${doc:-yes}
export doc_html=${doc_html:-yes}
export doc_pdf=${doc_pdf:-yes}
................................................................................
	        build_shared_library=yes;;

	  both) build_static_library=yes
	        build_shared_library=yes;;
esac

check cc "your C compiler of choice"
check asm "an assembler that takes Intel syntax and nasm-style macros"
check m4 "the path to your m4 binary"

export build=$(global/build-id.sh)

if test "$p_headers_errno" = ""; then
	case $os in
		lin) p_headers_errno="${p_headers_errno:-/usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h}";;

................................................................................
	for obj in ${fn_objects[@]} ${rt_objects[@]} ${data_objects[@]}; do
		report ar rc $to/libk.a $obj
	done
	report ranlib $to/libk.a
fi

if test $build_shared_library == yes; then
	report ld -r ${rt_objects[@]} -o $to/kboot.o
	report ld -shared ${fn_objects[@]} ${data_objects[@]} -o $to/libk.so
fi

# fifth pass: compile the executable tools
# against the libraries created in pass 5

for mod in ${modules[@]}; do
	for exe in $(scan mod/$mod '*.exe.c'); do
		base="$(basename $exe)"
		dest="$to/$mod.${base%%.exe.c}"
		if test $build_shared_library == yes; then
			comp_c "$to/kboot.o $exe" "$dest" -lk
		else
			comp_c "$exe" "$dest" -lk
		fi
	done
done

set +x
say "all passes finished; build $build complete at $(timestamp)"

Modified global/build-manpage.sh from [8cac5483dc] to [e0a00cdd85].

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
filename="$(basename "$file")"
stem=${filename%%.md}

mandest=${manpage_to:-"$to/doc/man"}
htmldest=${html_to:-"$to/doc/html"}
pdfdest=${pdf_to:-"$to/doc/pdf"}

section=${manual_section:-4}
man="$mandest/$stem.$section"
html="$htmldest/$stem.html"
pdf="$pdfdest/$stem.pdf"
fmt="$gen/$stem.tmp"

desc_rec="$(grep -m1 "^$stem:" global/modules)"
if test "$desc_rec" != ""; then







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
filename="$(basename "$file")"
stem=${filename%%.md}

mandest=${manpage_to:-"$to/doc/man"}
htmldest=${html_to:-"$to/doc/html"}
pdfdest=${pdf_to:-"$to/doc/pdf"}

section=${manual_section:-3}
man="$mandest/$stem.$section"
html="$htmldest/$stem.html"
pdf="$pdfdest/$stem.pdf"
fmt="$gen/$stem.tmp"

desc_rec="$(grep -m1 "^$stem:" global/modules)"
if test "$desc_rec" != ""; then