summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2025-11-12 21:49:50 +0100
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2025-11-12 21:49:50 +0100
commit7de14dbc0b642ee492fe592ccb53e8d81a4dc599 (patch)
tree1c44602db0d917a3176da535cbfa327edeec4e4a /configure.ac
Initial commit
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac38
1 files changed, 38 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..db455d8
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,38 @@
+AC_INIT([aplwc], [0.0.1], [peter@pmikkelsen.com])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([-Wall -Werror check-news std-options])
+AM_SILENT_RULES([yes])
+AC_PROG_CC
+AM_PROG_AR
+AC_CONFIG_FILES([
+ Makefile
+ src/Makefile
+ src/core/Makefile
+ src/bin/Makefile
+ src/include/Makefile
+ src/tests/Makefile
+])
+LT_INIT
+
+AC_DEFUN([OPTIONAL_FEATURE], [
+ AH_TEMPLATE([$3], [Define to 1 to enable $4])
+ AC_MSG_CHECKING([whether $4 should be enabled])
+ AC_ARG_ENABLE([$1],
+ [AS_HELP_STRING([--enable-$1], [Enable $4 [default=no]])],
+ [AS_CASE([${enableval}],
+ [yes], [],
+ [no], [],
+ [AC_MSG_ERROR([bad value for --enable-$1: ${enableval}])])],
+ [enable_$2=no])
+ AC_MSG_RESULT($enable_$2)
+ AS_CASE([${enable_$2}],
+ [yes], [AC_DEFINE([$3], [1])],
+ [no], [AC_DEFINE([$3], [0])])
+ AM_CONDITIONAL([$3], [test "x$enable_$2" = "xyes"])
+])
+
+OPTIONAL_FEATURE([runtime-checks], [runtime_checks], [ENABLE_RUNTIME_CHECKS], [additional runtime checks])
+OPTIONAL_FEATURE([inline-pockets], [inline_pockets], [ENABLE_INLINE_POCKETS], [the "inline pockets" optimisation])
+
+AC_CONFIG_HEADERS([config.h])
+AC_OUTPUT