Index: build.sh ================================================================== --- build.sh +++ build.sh @@ -60,22 +60,30 @@ *.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 +# 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} @@ -93,12 +101,12 @@ 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" +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 @@ -274,11 +282,11 @@ 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 -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 @@ -286,14 +294,14 @@ 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 + 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)" Index: global/build-manpage.sh ================================================================== --- global/build-manpage.sh +++ global/build-manpage.sh @@ -14,11 +14,11 @@ mandest=${manpage_to:-"$to/doc/man"} htmldest=${html_to:-"$to/doc/html"} pdfdest=${pdf_to:-"$to/doc/pdf"} -section=${manual_section:-4} +section=${manual_section:-3} man="$mandest/$stem.$section" html="$htmldest/$stem.html" pdf="$pdfdest/$stem.pdf" fmt="$gen/$stem.tmp"