2020-11-27 04:28:13 -05:00
|
|
|
AC_PREREQ([2.68])
|
2020-11-27 05:33:23 -05:00
|
|
|
AC_INIT([libkernaux],
|
2022-01-22 19:26:58 -05:00
|
|
|
[0.2.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])
|
2022-01-17 11:00:10 -05:00
|
|
|
AC_CONFIG_SRCDIR([src/assert.c])
|
2020-11-27 04:28:13 -05:00
|
|
|
|
2022-01-17 07:33:28 -05:00
|
|
|
AC_CANONICAL_BUILD
|
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
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
|
2022-01-19 06:40:12 -05:00
|
|
|
dnl Features (enabled by default)
|
2022-01-21 08:21:47 -05:00
|
|
|
AC_ARG_ENABLE([bloat], AS_HELP_STRING([--disable-bloat], [disable unnecessary heavy binary data]))
|
2022-01-19 06:40:12 -05:00
|
|
|
AC_ARG_ENABLE([float], AS_HELP_STRING([--disable-float], [disable floating-point arithmeric]))
|
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
dnl Features (disabled by default)
|
2022-01-19 06:14:46 -05:00
|
|
|
AC_ARG_ENABLE([tests], AS_HELP_STRING([--enable-tests], [enable tests and examples]))
|
2021-12-15 05:45:40 -05:00
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
dnl Packages (enabled by default)
|
2022-01-20 07:22:34 -05:00
|
|
|
AC_ARG_WITH( [all], AS_HELP_STRING([--without-all], [without all default packages]))
|
2022-01-19 06:14:46 -05:00
|
|
|
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( [framebuffer], AS_HELP_STRING([--without-framebuffer], [without framebuffer]))
|
|
|
|
AC_ARG_WITH( [mbr], AS_HELP_STRING([--without-mbr], [without Master Boot Record]))
|
|
|
|
AC_ARG_WITH( [multiboot2], AS_HELP_STRING([--without-multiboot2], [without Multiboot 2 information parser]))
|
|
|
|
AC_ARG_WITH( [ntoa], AS_HELP_STRING([--without-ntoa], [without itoa/ftoa]))
|
|
|
|
AC_ARG_WITH( [pfa], AS_HELP_STRING([--without-pfa], [without Page Frame Allocator]))
|
|
|
|
AC_ARG_WITH( [printf], AS_HELP_STRING([--without-printf], [without printf]))
|
|
|
|
AC_ARG_WITH( [units], AS_HELP_STRING([--without-units], [without measurement units utils]))
|
2021-12-17 20:27:45 -05:00
|
|
|
|
|
|
|
dnl Packages (disabled by default)
|
2022-01-19 06:14:46 -05:00
|
|
|
AC_ARG_WITH( [libc], AS_HELP_STRING([--with-libc], [with libc replacement]))
|
2022-01-23 13:41:07 -05:00
|
|
|
AC_ARG_WITH( [libc-atoi], AS_HELP_STRING([--with-libc-atoi], [with atoi replacement]))
|
2022-01-23 13:17:03 -05:00
|
|
|
AC_ARG_WITH( [libc-isdigit], AS_HELP_STRING([--with-libc-isdigit], [with isdigit replacement]))
|
2022-01-23 13:25:36 -05:00
|
|
|
AC_ARG_WITH( [libc-isspace], AS_HELP_STRING([--with-libc-isspace], [with isspace replacement]))
|
2022-01-19 06:14:46 -05:00
|
|
|
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]))
|
|
|
|
AC_ARG_WITH( [libc-strnlen], AS_HELP_STRING([--with-libc-strnlen], [with strnlen replacement]))
|
2021-12-17 20:27:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-20 07:22:34 -05:00
|
|
|
AC_DEFUN([do_without_all],
|
|
|
|
[
|
|
|
|
if test -z "$with_cmdline"; then with_cmdline=no; fi
|
|
|
|
if test -z "$with_console"; then with_console=no; fi
|
|
|
|
if test -z "$with_elf"; then with_elf=no; fi
|
|
|
|
if test -z "$with_framebuffer"; then with_framebuffer=no; fi
|
|
|
|
if test -z "$with_mbr"; then with_mbr=no; fi
|
|
|
|
if test -z "$with_multiboot2"; then with_multiboot2=no; fi
|
|
|
|
if test -z "$with_ntoa"; then with_ntoa=no; fi
|
|
|
|
if test -z "$with_pfa"; then with_pfa=no; fi
|
|
|
|
if test -z "$with_printf"; then with_printf=no; fi
|
|
|
|
if test -z "$with_units"; then with_units=no; fi
|
|
|
|
])
|
|
|
|
AS_IF([test "$with_all" = no], do_without_all)
|
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
AC_DEFUN([do_with_libc],
|
2021-12-15 05:45:40 -05:00
|
|
|
[
|
2022-01-23 13:41:07 -05:00
|
|
|
if test -z "$with_libc_atoi"; then with_libc_atoi=yes; fi
|
2022-01-23 13:17:03 -05:00
|
|
|
if test -z "$with_libc_isdigit"; then with_libc_isdigit=yes; fi
|
2022-01-23 13:25:36 -05:00
|
|
|
if test -z "$with_libc_isspace"; then with_libc_isspace=yes; fi
|
2022-01-19 06:14:46 -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
|
|
|
|
if test -z "$with_libc_strnlen"; then with_libc_strnlen=yes; fi
|
2021-12-15 05:45:40 -05:00
|
|
|
])
|
2021-12-17 20:27:45 -05:00
|
|
|
AS_IF([test "$with_libc" = yes], do_with_libc)
|
2021-12-15 05:45:40 -05:00
|
|
|
|
2022-01-17 07:33:28 -05:00
|
|
|
|
|
|
|
|
|
|
|
AS_IF([test "$host_cpu" != "$build_cpu" -a "$enable_tests" = yes], AC_MSG_ERROR([can not build cross-platform tests]))
|
|
|
|
|
2022-01-19 05:35:02 -05:00
|
|
|
AS_IF([test "$with_ntoa" = no -a "$with_printf" != no], AC_MSG_ERROR([package `printf' requires package `ntoa']))
|
|
|
|
AS_IF([test "$with_ntoa" = no -a "$with_units" != no], AC_MSG_ERROR([package `units' requires package `ntoa']))
|
2022-01-17 04:54:44 -05:00
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
dnl Architecture
|
2022-01-22 15:33:31 -05:00
|
|
|
AM_CONDITIONAL([ASM_I386], [test "$host_cpu" = i386])
|
|
|
|
AM_CONDITIONAL([ASM_RISCV64], [test "$host_cpu" = riscv64])
|
|
|
|
AM_CONDITIONAL([ASM_X86_64], [test "$host_cpu" = x86_64])
|
2021-12-15 05:45:40 -05:00
|
|
|
|
2022-01-19 06:40:12 -05:00
|
|
|
dnl Features (enabled by default)
|
2022-01-22 15:33:31 -05:00
|
|
|
AM_CONDITIONAL([ENABLE_BLOAT], [test "$enable_bloat" != no])
|
|
|
|
AM_CONDITIONAL([ENABLE_FLOAT], [test "$enable_float" != no])
|
2022-01-19 06:40:12 -05:00
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
dnl Features (disabled by default)
|
2022-01-22 15:33:31 -05:00
|
|
|
AM_CONDITIONAL([ENABLE_TESTS], [test "$enable_tests" = yes])
|
2021-12-15 05:45:40 -05:00
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
dnl Packages (enabled by default)
|
2022-01-22 15:33:31 -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_FRAMEBUFFER], [test "$with_framebuffer" != no])
|
|
|
|
AM_CONDITIONAL([WITH_MBR], [test "$with_mbr" != no])
|
|
|
|
AM_CONDITIONAL([WITH_MULTIBOOT2], [test "$with_multiboot2" != no])
|
|
|
|
AM_CONDITIONAL([WITH_NTOA], [test "$with_ntoa" != no])
|
|
|
|
AM_CONDITIONAL([WITH_PFA], [test "$with_pfa" != no])
|
|
|
|
AM_CONDITIONAL([WITH_PRINTF], [test "$with_printf" != no])
|
|
|
|
AM_CONDITIONAL([WITH_UNITS], [test "$with_units" != no])
|
2021-12-17 20:27:45 -05:00
|
|
|
|
|
|
|
dnl Packages (disabled by default)
|
2022-01-23 13:41:07 -05:00
|
|
|
AM_CONDITIONAL([WITH_LIBC_ATOI], [test "$with_libc_atoi" = yes])
|
2022-01-23 13:17:03 -05:00
|
|
|
AM_CONDITIONAL([WITH_LIBC_ISDIGIT], [test "$with_libc_isdigit" = yes])
|
2022-01-23 13:25:36 -05:00
|
|
|
AM_CONDITIONAL([WITH_LIBC_ISSPACE], [test "$with_libc_isspace" = yes])
|
2022-01-22 15:33:31 -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])
|
|
|
|
AM_CONDITIONAL([WITH_LIBC_STRNLEN], [test "$with_libc_strnlen" = yes])
|
2021-12-17 20:27:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl Architecture
|
2022-01-22 15:33:31 -05:00
|
|
|
AS_IF([test "$host_cpu" = i386], [AC_DEFINE([ASM_I386], [1], [architecture is i386])])
|
|
|
|
AS_IF([test "$host_cpu" = riscv64], [AC_DEFINE([ASM_RISCV64], [1], [architecture is RISC-V 64-bit])])
|
|
|
|
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
|
|
|
|
2022-01-19 06:40:12 -05:00
|
|
|
dnl Features (enabled by default)
|
2022-01-22 15:33:31 -05:00
|
|
|
AS_IF([test "$enable_bloat" != no], [AC_DEFINE([ENABLE_BLOAT], [1], [enabled unnecessary heavy binary data])])
|
|
|
|
AS_IF([test "$enable_float" != no], [AC_DEFINE([ENABLE_FLOAT], [1], [enabled floating-point arithmeric])])
|
2022-01-19 06:40:12 -05:00
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
dnl Features (disabled by default)
|
2022-01-22 15:33:31 -05:00
|
|
|
AS_IF([test "$enable_tests" = yes], [AC_DEFINE([ENABLE_TESTS], [1], [enabled tests and examples])])
|
2020-11-29 22:27:43 -05:00
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
dnl Packages (enabled by default)
|
2022-01-22 15:33:31 -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_framebuffer" != no], [AC_DEFINE([WITH_FRAMEBUFFER], [1], [with framebuffer])])
|
|
|
|
AS_IF([test "$with_mbr" != no], [AC_DEFINE([WITH_MBR], [1], [with Master Boot Record])])
|
|
|
|
AS_IF([test "$with_multiboot2" != no], [AC_DEFINE([WITH_MULTIBOOT2], [1], [with Multiboot 2 information parser])])
|
|
|
|
AS_IF([test "$with_ntoa" != no], [AC_DEFINE([WITH_NTOA], [1], [with ntoa])])
|
|
|
|
AS_IF([test "$with_pfa" != no], [AC_DEFINE([WITH_PFA], [1], [with Page Frame Allocator])])
|
|
|
|
AS_IF([test "$with_printf" != no], [AC_DEFINE([WITH_PRINTF], [1], [with printf])])
|
|
|
|
AS_IF([test "$with_units", != no], [AC_DEFINE([WITH_UNITS], [1], [with measurement units utils])])
|
2021-12-17 20:27:45 -05:00
|
|
|
|
|
|
|
dnl Packages (disabled by default)
|
2022-01-23 13:41:07 -05:00
|
|
|
AS_IF([test "$with_libc_atoi" = yes], [AC_DEFINE([WITH_LIBC_ATOI], [1], [with atoi replacement])])
|
2022-01-23 13:17:03 -05:00
|
|
|
AS_IF([test "$with_libc_isdigit" = yes], [AC_DEFINE([WITH_LIBC_ISDIGIT], [1], [with isdigit replacement])])
|
2022-01-23 13:25:36 -05:00
|
|
|
AS_IF([test "$with_libc_isspace" = yes], [AC_DEFINE([WITH_LIBC_ISSPACE], [1], [with isspace replacement])])
|
2022-01-22 15:33:31 -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])])
|
|
|
|
AS_IF([test "$with_libc_strnlen" = yes], [AC_DEFINE([WITH_LIBC_STRNLEN], [1], [with strnlen replacement])])
|
2021-12-17 20:27:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-11 01:00:06 -05:00
|
|
|
AM_INIT_AUTOMAKE([1.9 subdir-objects])
|
2020-11-27 04:28:13 -05:00
|
|
|
|
|
|
|
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
|
2020-11-27 06:00:34 -05:00
|
|
|
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
|