mirror of https://github.com/tailix/libkernaux.git
Enable/disable features
This commit is contained in:
parent
95716cf4dc
commit
a3ddcd8ce9
47
Makefile.am
47
Makefile.am
|
@ -5,32 +5,47 @@ AM_CFLAGS = -std=c99 -Wall -Wextra -I$(top_srcdir)/include
|
||||||
lib_LIBRARIES = libkernaux.a
|
lib_LIBRARIES = libkernaux.a
|
||||||
|
|
||||||
TESTS = \
|
TESTS = \
|
||||||
examples/cmdline \
|
|
||||||
tests/test_cmdline \
|
|
||||||
tests/test_multiboot2_helpers \
|
|
||||||
tests/test_multiboot2_print \
|
|
||||||
tests/test_multiboot2_validation \
|
|
||||||
tests/test_pfa \
|
|
||||||
tests/test_stdlib
|
tests/test_stdlib
|
||||||
|
|
||||||
noinst_PROGRAMS = \
|
noinst_PROGRAMS = $(TESTS)
|
||||||
$(TESTS) \
|
|
||||||
tests/multiboot2_print1 \
|
|
||||||
tests/multiboot2_print2
|
|
||||||
|
|
||||||
libkernaux_a_SOURCES = \
|
libkernaux_a_SOURCES = \
|
||||||
src/cmdline.c \
|
|
||||||
src/console.c \
|
|
||||||
src/multiboot2/helpers.c \
|
|
||||||
src/multiboot2/is_valid.c \
|
|
||||||
src/multiboot2/print.c \
|
|
||||||
src/pfa.c \
|
|
||||||
src/stdlib.c
|
src/stdlib.c
|
||||||
|
|
||||||
if ARCH_X86
|
if ARCH_X86
|
||||||
libkernaux_a_SOURCES += src/arch/x86.S
|
libkernaux_a_SOURCES += src/arch/x86.S
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if ENABLE_CMDLINE
|
||||||
|
libkernaux_a_SOURCES += src/cmdline.c
|
||||||
|
TESTS += \
|
||||||
|
examples/cmdline \
|
||||||
|
tests/test_cmdline
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ENABLE_CONSOLE
|
||||||
|
libkernaux_a_SOURCES += src/console.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ENABLE_MULTIBOOT2
|
||||||
|
libkernaux_a_SOURCES += \
|
||||||
|
src/multiboot2/helpers.c \
|
||||||
|
src/multiboot2/is_valid.c \
|
||||||
|
src/multiboot2/print.c
|
||||||
|
TESTS += \
|
||||||
|
tests/test_multiboot2_helpers \
|
||||||
|
tests/test_multiboot2_print \
|
||||||
|
tests/test_multiboot2_validation
|
||||||
|
noinst_PROGRAMS += \
|
||||||
|
tests/multiboot2_print1 \
|
||||||
|
tests/multiboot2_print2
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ENABLE_PFA
|
||||||
|
libkernaux_a_SOURCES += src/pfa.c
|
||||||
|
TESTS += tests/test_pfa
|
||||||
|
endif
|
||||||
|
|
||||||
examples_cmdline_SOURCES = \
|
examples_cmdline_SOURCES = \
|
||||||
$(libkernaux_a_SOURCES) \
|
$(libkernaux_a_SOURCES) \
|
||||||
examples/cmdline.c
|
examples/cmdline.c
|
||||||
|
|
18
configure.ac
18
configure.ac
|
@ -10,10 +10,22 @@ AC_CONFIG_HEADERS([src/config.h])
|
||||||
|
|
||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
|
|
||||||
AS_IF([test x"${host_cpu}" = x"x86"],
|
AC_ARG_ENABLE([cmdline], AS_HELP_STRING([--disable-cmdline], [disable command line parser]))
|
||||||
[AC_DEFINE([ARCH_X86],[1],[architecture is x86])])
|
AC_ARG_ENABLE([console], AS_HELP_STRING([--disable-console], [disable serial console]))
|
||||||
|
AC_ARG_ENABLE([multiboot2], AS_HELP_STRING([--disable-multiboot2], [disable Multiboot 2 information parser]))
|
||||||
|
AC_ARG_ENABLE([pfa], AS_HELP_STRING([--disable-pfa], [disable Page Frame Allocator]))
|
||||||
|
|
||||||
AM_CONDITIONAL(ARCH_X86, test x"${host_cpu}" = x"x86")
|
AM_CONDITIONAL([ARCH_X86], [test x"$host_cpu" = x"x86"])
|
||||||
|
AM_CONDITIONAL([ENABLE_CMDLINE], [test x"$enable_cmdline" != x"no"])
|
||||||
|
AM_CONDITIONAL([ENABLE_CONSOLE], [test x"$enable_console" != x"no"])
|
||||||
|
AM_CONDITIONAL([ENABLE_MULTIBOOT2], [test x"$enable_multiboot2" != x"no"])
|
||||||
|
AM_CONDITIONAL([ENABLE_PFA], [test x"$enable_pfa" != x"no"])
|
||||||
|
|
||||||
|
AS_IF([test x"$host_cpu" = x"x86"], [AC_DEFINE([ARCH_X86], [1], [architecture is x86])])
|
||||||
|
AS_IF([test x"$enable_cmdline" != x"no"], [AC_DEFINE([ENABLE_CMDLINE], [1], [enabled command line parser])])
|
||||||
|
AS_IF([test x"$enable_console" != x"no"], [AC_DEFINE([ENABLE_CONSOLE], [1], [enabled serial console])])
|
||||||
|
AS_IF([test x"$enable_multiboot2" != x"no"], [AC_DEFINE([ENABLE_MULTIBOOT2], [1], [enabled Multiboot 2 information parser])])
|
||||||
|
AS_IF([test x"$enable_pfa" != x"no"], [AC_DEFINE([ENABLE_PFA], [1], [enabled Page Frame Allocator])])
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE([1.9 subdir-objects -Wall -Werror])
|
AM_INIT_AUTOMAKE([1.9 subdir-objects -Wall -Werror])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue