Template
28 lines
1009 B
Plaintext
28 lines
1009 B
Plaintext
# configure.ac - stupidtools bootstrap (autotools, C23).
|
|
#
|
|
# This is the *bootstrap* build only: stupidtools will later generate its
|
|
# own ./configure (self-hosting, todo 23). Only Makefile.am inputs are
|
|
# tracked in git; configure/Makefile* are generated and gitignored.
|
|
|
|
AC_PREREQ([2.71])
|
|
AC_INIT([stupidtools], [1.0.0], [[email protected]])
|
|
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
|
AC_CONFIG_SRCDIR([src/main.c])
|
|
AC_PROG_CC
|
|
|
|
# Require a compiler that actually accepts C23 (ISO/IEC 9899:2024).
|
|
# -std=c23: GCC >= 14, Clang >= 18. Never -std=c2y (next draft, not ratified).
|
|
save_CFLAGS="$CFLAGS"
|
|
CFLAGS="$CFLAGS -std=c23 -Werror"
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
|
[[#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
|
|
#error "C23 (__STDC_VERSION__ >= 202311L) required"
|
|
#endif]],
|
|
[[_Static_assert(1, "ok");]])],
|
|
[],
|
|
[AC_MSG_ERROR([a C compiler with C23 support (GCC >= 14 or Clang >= 18) is required])])
|
|
CFLAGS="$save_CFLAGS"
|
|
|
|
AC_CONFIG_FILES([Makefile src/Makefile])
|
|
AC_OUTPUT
|