1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-13 11:04:27 -05:00
libkernaux/configure.ac

121 lines
5.2 KiB
Text
Raw Normal View History

2020-11-27 04:28:13 -05:00
AC_PREREQ([2.68])
2020-11-27 05:33:23 -05:00
AC_INIT([libkernaux],
[0.0.0],
2021-12-12 07:13:52 -05:00
[https://github.com/tailix/libkernaux/issues],
2020-11-27 05:33:23 -05:00
[libkernaux],
2021-12-12 07:13:52 -05:00
[https://github.com/tailix/libkernaux])
2020-11-27 04:28:13 -05:00
2020-12-06 23:42:52 -05:00
AC_CONFIG_HEADERS([config.h])
2020-11-27 04:28:13 -05:00
AC_CONFIG_SRCDIR([src/pfa.c])
2020-11-29 23:13:13 -05:00
AC_CANONICAL_HOST
2020-11-29 22:27:43 -05:00
2021-12-15 05:45:40 -05:00
dnl Features (disabled by default)
2021-12-15 05:45:40 -05:00
AC_ARG_ENABLE([assert], AS_HELP_STRING([--enable-assert], [enable runtime assertions]))
2021-12-19 21:22:43 -05:00
AC_ARG_ENABLE([guard], AS_HELP_STRING([--enable-guard], [enable argument guards]))
AC_ARG_ENABLE([guard-cond], AS_HELP_STRING([--enable-guard-cond], [enable condition guard]))
AC_ARG_ENABLE([guard-null], AS_HELP_STRING([--enable-guard-null], [enable NULL-guard]))
2021-12-15 05:45:40 -05:00
dnl Packages (enabled by default)
AC_ARG_WITH( [cmdline], AS_HELP_STRING([--without-cmdline], [without command line parser]))
AC_ARG_WITH( [console], AS_HELP_STRING([--without-console], [without serial console]))
AC_ARG_WITH( [elf], AS_HELP_STRING([--without-elf], [without ELF utils]))
AC_ARG_WITH( [multiboot2], AS_HELP_STRING([--without-multiboot2], [without Multiboot 2 information parser]))
AC_ARG_WITH( [pfa], AS_HELP_STRING([--without-pfa], [without Page Frame Allocator]))
AC_ARG_WITH( [units], AS_HELP_STRING([--without-units], [without measurement units utils]))
dnl Packages (disabled by default)
AC_ARG_WITH( [libc], AS_HELP_STRING([--with-libc], [with libc replacement]))
AC_ARG_WITH( [libc-memset], AS_HELP_STRING([--with-libc-memset], [with memset replacement]))
AC_ARG_WITH( [libc-strcpy], AS_HELP_STRING([--with-libc-strcpy], [with strcpy replacement]))
AC_ARG_WITH( [libc-strlen], AS_HELP_STRING([--with-libc-strlen], [with strlen replacement]))
2021-12-19 21:22:43 -05:00
AC_DEFUN([do_enable_guard],
[
if test -z "$enable_guard_cond"; then enable_guard_cond=yes; fi
if test -z "$enable_guard_null"; then enable_guard_null=yes; fi
])
AS_IF([test "$enable_guard" = yes], do_enable_guard)
AC_DEFUN([do_with_libc],
2021-12-15 05:45:40 -05:00
[
if test -z "$with_libc_memset"; then with_libc_memset=yes; fi
if test -z "$with_libc_strcpy"; then with_libc_strcpy=yes; fi
if test -z "$with_libc_strlen"; then with_libc_strlen=yes; fi
2021-12-15 05:45:40 -05:00
])
AS_IF([test "$with_libc" = yes], do_with_libc)
2021-12-15 05:45:40 -05:00
dnl Architecture
AM_CONDITIONAL([ASM_I386], [test "$host_cpu" = i386])
AM_CONDITIONAL([ASM_X86_64], [test "$host_cpu" = x86_64])
2021-12-15 05:45:40 -05:00
dnl Features (disabled by default)
2021-12-19 21:34:26 -05:00
AM_CONDITIONAL([ENABLE_ASSERT], [test "$enable_assert" = yes])
AM_CONDITIONAL([ENABLE_GUARD_COND], [test "$enable_guard_cond" = yes])
AM_CONDITIONAL([ENABLE_GUARD_NULL], [test "$enable_guard_null" = yes])
2021-12-15 05:45:40 -05:00
dnl Packages (enabled by default)
2021-12-19 21:34:26 -05:00
AM_CONDITIONAL([WITH_CMDLINE], [test "$with_cmdline" != no])
AM_CONDITIONAL([WITH_CONSOLE], [test "$with_console" != no])
AM_CONDITIONAL([WITH_ELF], [test "$with_elf" != no])
AM_CONDITIONAL([WITH_MULTIBOOT2], [test "$with_multiboot2" != no])
AM_CONDITIONAL([WITH_PFA], [test "$with_pfa" != no])
AM_CONDITIONAL([WITH_UNITS], [test "$with_units" != no])
dnl Packages (disabled by default)
2021-12-19 21:34:26 -05:00
AM_CONDITIONAL([WITH_LIBC_MEMSET], [test "$with_libc_memset" = yes])
AM_CONDITIONAL([WITH_LIBC_STRCPY], [test "$with_libc_strcpy" = yes])
AM_CONDITIONAL([WITH_LIBC_STRLEN], [test "$with_libc_strlen" = yes])
dnl Architecture
AS_IF([test "$host_cpu" = i386], [AC_DEFINE([ASM_I386], [1], [architecture is i386])])
AS_IF([test "$host_cpu" = x86_64], [AC_DEFINE([ASM_X86_64], [1], [architecture is x86_64])])
2021-12-17 18:43:19 -05:00
dnl Features (disabled by default)
2021-12-18 22:08:18 -05:00
AS_IF([test "$enable_assert" = yes], [AC_DEFINE([KERNAUX_ENABLE_ASSERT], [1], [enabled runtime assertions])])
2021-12-19 21:22:43 -05:00
AS_IF([test "$enable_guard_cond" = yes], [AC_DEFINE([KERNAUX_ENABLE_GUARD_COND], [1], [enabled condition guard])])
AS_IF([test "$enable_guard_null" = yes], [AC_DEFINE([KERNAUX_ENABLE_GUARD_NULL], [1], [enabled NULL-guard])])
2020-11-29 22:27:43 -05:00
dnl Packages (enabled by default)
2021-12-18 22:08:18 -05:00
AS_IF([test "$with_cmdline" != no], [AC_DEFINE([WITH_CMDLINE], [1], [with command line parser])])
AS_IF([test "$with_console" != no], [AC_DEFINE([WITH_CONSOLE], [1], [with serial console])])
AS_IF([test "$with_elf" != no], [AC_DEFINE([WITH_ELF], [1], [with ELF utils])])
AS_IF([test "$with_multiboot2" != no], [AC_DEFINE([WITH_MULTIBOOT2], [1], [with Multiboot 2 information parser])])
AS_IF([test "$with_pfa" != no], [AC_DEFINE([WITH_PFA], [1], [with Page Frame Allocator])])
AS_IF([test "$with_units", != no], [AC_DEFINE([WITH_UNITS], [1], [with measurement units utils])])
dnl Packages (disabled by default)
2021-12-18 22:08:18 -05:00
AS_IF([test "$with_libc_memset" = yes], [AC_DEFINE([WITH_LIBC_MEMSET], [1], [with memset replacement])])
AS_IF([test "$with_libc_strcpy" = yes], [AC_DEFINE([WITH_LIBC_STRCPY], [1], [with strcpy replacement])])
AS_IF([test "$with_libc_strlen" = yes], [AC_DEFINE([WITH_LIBC_STRLEN], [1], [with strlen replacement])])
2020-11-27 04:28:13 -05:00
AM_INIT_AUTOMAKE([1.9 subdir-objects -Wall -Werror])
AC_CONFIG_FILES([
Makefile
2020-11-27 05:29:53 -05:00
include/Makefile
2020-11-27 04:28:13 -05:00
])
AC_LANG([C])
2020-11-27 05:33:23 -05:00
AM_PROG_AR
AM_PROG_AS
2020-11-27 04:28:13 -05:00
AC_PROG_CC
2020-11-27 08:43:58 -05:00
AC_PROG_CC_C99
2020-11-27 04:28:13 -05:00
AC_PROG_RANLIB
2020-12-05 23:04:02 -05:00
AC_C_INLINE
2020-12-06 05:27:55 -05:00
AC_CHECK_HEADER_STDBOOL
2021-12-17 13:22:05 -05:00
AC_CHECK_HEADERS([stdarg.h stddef.h stdint.h])
2020-11-27 04:28:13 -05:00
AC_OUTPUT