libk  Diff

Differences From Artifact [669569b504]:

To Artifact [a37c2dbfb1]:


20
21
22
23
24
25
26





27
28
29
30
31







32
33
34
35
36
37
38
..
78
79
80
81
82
83
84

85

86












87
88
89
90
91








92
93
94
95
96
97
98
	./clean.sh
fi

# TODO: make it possible for user to change
#       default set with environment vars
modules=(kcore kmem kstr kio kgraft kfile)






target=$arch.$os
if test "$bits" != ""; then
	target=$target.$bits
fi








case $os in
	lin|?bsd|and|dar|osx) posix=yes; unix=yes;;
	hai) posix=yes; unix=no;;
	*) posix=no; unix=no;;
esac

case $os.$bits in
................................................................................

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)


case $os in

	lin) p_headers_syscall=${p_headers_syscall:-/usr/include/asm/unistd_${bits}.h}












	p_headers_errno=${p_headers_errno:-/usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h};;

	fbsd) p_headers_syscall=${p_headers_syscall:-/usr/include/sys/syscall.h}
	p_headers_errno=${p_headers_errno:-/usr/include/errno.h};;
esac









check p_headers_syscall \
	'the location of a header defining your syscall numbers'
check p_headers_errno \
	'the location of a header defining the values of each errno symbol'

macro_compile_env="-Datom_target_arch=$arch -Datom_target_os=$os -Dtarget_posix=$posix -Dtarget_unix=$unix"







>
>
>
>
>





>
>
>
>
>
>
>







 







>
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
|

<
|
|
>
>
>
>
>
>
>
>







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
..
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
	./clean.sh
fi

# TODO: make it possible for user to change
#       default set with environment vars
modules=(kcore kmem kstr kio kgraft kfile)

# compose an arch tuple. this is used in
# places, mostly to select the correct
# version of assembly files for a given
# platform (each has an arch tuple in its
# name, following the linkage specifier)
target=$arch.$os
if test "$bits" != ""; then
	target=$target.$bits
fi

# determine whether we have unix or posix
# APIs depending on the operating system.
# presumably if the user is running a bash
# script there is some degree of posix
# support available, but we might still be
# building for windows from within cygwin
# or whatever
case $os in
	lin|?bsd|and|dar|osx) posix=yes; unix=yes;;
	hai) posix=yes; unix=no;;
	*) posix=no; unix=no;;
esac

case $os.$bits in
................................................................................

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_syscall" = ""; then
	case $os in
		lin) headers_syscall_search=(
				/usr/include/asm/unistd_${bits}.h
				/usr/include/asm-generic/unistd.h
				/usr/include/*-linux-gnu/asm/unistd_${bits}.h
			);;

		fbsd) p_headers_syscall_search=(
				/usr/include/sys/syscall.h
			);;
	esac
fi

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}";;


		fbsd) p_headers_errno="${p_headers_errno:-/usr/include/errno.h}";;
	esac
fi

for f in "${headers_syscall_search[@]}"; do
	test -e "$f" || continue
	p_headers_syscall="$f"
	say "using syscall headers at $f"
	break;
done

check p_headers_syscall \
	'the location of a header defining your syscall numbers'
check p_headers_errno \
	'the location of a header defining the values of each errno symbol'

macro_compile_env="-Datom_target_arch=$arch -Datom_target_os=$os -Dtarget_posix=$posix -Dtarget_unix=$unix"