-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
99 lines (85 loc) · 2.41 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
51
52
53
54
55
56
57
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
92
93
94
95
96
97
98
99
AC_PREREQ([2.69])
AC_INIT([PML], [0.1], [[email protected]])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([pml-config.h])
AM_INIT_AUTOMAKE
AM_SILENT_RULES([yes])
AC_CANONICAL_HOST
save_CFLAGS="$CFLAGS"
CFLAGS="$save_CFLAGS -ffreestanding"
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$save_LDFLAGS -nostartfiles -nostdlib"
save_LIBS="$LIBS"
LIBS="$save_LIBS -lgcc"
AC_PROG_CC
AM_PROG_AS
AC_PROG_RANLIB
AM_PATH_PYTHON([3.5])
case "$host_cpu" in
x86_64 )
ARCH=x86_64
ELF_MACHINE=EM_X86_64
;;
* )
AC_MSG_ERROR([host CPU $host_cpu not supported])
;;
esac
ARCH_DIR="arch/$ARCH"
AC_SUBST([ARCH])
AC_SUBST([ARCH_DIR])
AC_DEFINE_UNQUOTED([ELF_MACHINE], [$ELF_MACHINE],
[Required value in the e_machine field of an ELF header])
AC_ARG_WITH([bootdir],
AS_HELP_STRING([--with-bootdir=DIR], [directory to install boot files]),
[bootdir="$withval"], [bootdir=/boot])
case "$bootdir" in
/* ) ;;
* )
AC_MSG_ERROR([boot directory must be an absolute path])
;;
esac
AC_SUBST([bootdir])
AC_ARG_WITH([gdb-script],
AS_HELP_STRING([--with-gdb-script], [embed GDB script in kernel executable]),
[if test "x$with_gdb_script" != xno; then
AC_PATH_PROG([XXD], [xxd], [no])
if test "x$XXD" = xno; then
AC_MSG_ERROR([xxd program is required to build inline GDB script])
fi
AC_SUBST([XXD])
fi], [with_gdb_script=no])
AM_CONDITIONAL([GDB_SCRIPT], [test "x$with_gdb_script" != xno])
PML_DEFAULT_FEATURE([apic], [USE_APIC],
[disable interrupt management with the APIC],
[Use the APIC for interrupt management])
PML_DEFAULT_FEATURE([smp], [ENABLE_SMP],
[disable support for multiple processors],
[Enable symmetric multiprocessing])
PML_CC_VEC
# For autoconf 2.69, CFLAGS seems to not take effect here so only issue
# a warning if elf.h isn't found since it might be available when compiling
AC_CHECK_HEADERS([elf.h], [], AC_MSG_WARN([elf.h not found]))
CFLAGS="$save_CFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"
AM_CONDITIONAL([ARCH_X86_64], [test "$ARCH" = x86_64])
AC_CONFIG_LINKS([
kernel/boot.S:$ARCH_DIR/boot.S
include/pml/io.h:include/pml/$ARCH/io.h
include/pml/interrupt.h:include/pml/$ARCH/interrupt.h
include/pml/memory.h:include/pml/$ARCH/memory.h
include/pml/serial.h:include/pml/$ARCH/serial.h
include/pml/thread.h:include/pml/$ARCH/thread.h
])
AC_CONFIG_FILES([
Makefile
arch/x86_64/Makefile
drivers/Makefile
drivers/fs/Makefile
drivers/fs/ext2/Makefile
include/Makefile
include/pml/Makefile
kernel/Makefile
util/Makefile
])
AC_OUTPUT