summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorkx <kx@radix-linux.su>2026-10-01 12:02:28 +0300
committerkx <kx@radix-linux.su>2026-10-01 12:02:28 +0300
commitba1b04d64bdfaf377915b22f77520216ebe47674 (patch)
tree044343035c28b2b04ca9725f26e9b7c39342d19c /configure.ac
parent124b140798456778e2a96851cc7268aa9a726698 (diff)
downloadmcpu-cpp-1.0.2.tar.xz
Version 1.0.21.0.2
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac190
1 files changed, 190 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..87f5503
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,190 @@
+AC_PREREQ([2.69])
+
+m4_include([acsite.m4])
+
+AC_INIT([mcpu-cpp], [1.0.2], [], [mcpu-cpp])
+
+AC_MCPU_CPP_REQUIRE_BASH
+
+AC_MCPU_CPP_HEADLINE([mcpu-cpp], [MCPU Languages Preprocessor], [MCPU_CPP_VERSION],dnl
+[Copyright (c) 1998-2026 Andrey V.Kosteltsev])dnl
+
+AC_MSG_CFG_PART(Getting the canonical system type)
+AC_CANONICAL_HOST
+
+AC_MSG_CFG_PART(Init Automake environment)
+AC_CONFIG_SRCDIR([src/main.c])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip subdir-objects])
+
+dnl With the project convention --prefix=/usr, system configuration belongs
+dnl in /etc rather than /usr/etc unless the caller explicitly selects another
+dnl sysconfdir.
+if test "x$sysconfdir" = 'x${prefix}/etc'; then
+ if test "x$prefix" = xNONE || test "x$prefix" = x/usr; then
+ sysconfdir=/etc
+ fi
+fi
+
+AC_MSG_CFG_PART(Test for GNU Compiler Collection)
+AC_USE_SYSTEM_EXTENSIONS
+AC_PROG_CC
+AC_PROG_LN_S
+MCPU_CPP_REQUIRE_GCC
+
+AC_MSG_CFG_PART(Test for LibMPUIO)
+#MCPU_CPP_CHECK_LIBMPUIO
+dnl ============================================================
+dnl Check for LibMPU
+dnl ============================================================
+AC_CHECK_LIBMPU(
+ [1.0.25],
+ [yes],
+ [
+ AC_DEFINE(
+ [HAVE_LIBMPU],
+ [1],
+ [Define to 1 if LibMPU is available.]
+ )
+ LIBMPU_VERSION=`$LIBMPU_CONFIG --version 2>/dev/null`
+ AC_SUBST([LIBMPU_VERSION])
+ ],
+ [
+ AC_MSG_ERROR([LibMPU version 1.0.25 or later is required.])
+ ]
+)
+
+dnl ============================================================
+dnl Check for LibMPUIO
+dnl ============================================================
+AC_CHECK_LIBMPUIO(
+ [1.0.4],
+ [yes],
+ [
+ AC_DEFINE(
+ [HAVE_LIBMPUIO],
+ [1],
+ [Define to 1 if LibMPUIO is available.]
+ )
+ LIBMPUIO_VERSION=`$LIBMPUIO_CONFIG --version 2>/dev/null`
+ AC_SUBST([LIBMPUIO_VERSION])
+ ],
+ [
+ AC_MSG_ERROR([LibMPUIO version 1.0.4 or later is required.])
+ ]
+)
+
+AC_MSG_CFG_PART(Test for LibMPU ABI)
+MCPU_CPP_CHECK_LIBMPU_ABI
+
+AC_MSG_CFG_PART(Define MCPU installation layout)
+
+mcpu_cpp_prefix="$prefix"
+if test "x$mcpu_cpp_prefix" = xNONE; then
+ mcpu_cpp_prefix="$ac_default_prefix"
+fi
+
+mcpu_cpp_exec_prefix="$exec_prefix"
+if test "x$mcpu_cpp_exec_prefix" = xNONE; then
+ mcpu_cpp_exec_prefix="$mcpu_cpp_prefix"
+fi
+
+mcpu_cpp_save_prefix="$prefix"
+mcpu_cpp_save_exec_prefix="$exec_prefix"
+prefix="$mcpu_cpp_prefix"
+exec_prefix="$mcpu_cpp_exec_prefix"
+eval mcpu_cpp_bindir="\"$bindir\""
+eval mcpu_cpp_libdir="\"$libdir\""
+eval mcpu_cpp_sysconfdir="\"$sysconfdir\""
+prefix="$mcpu_cpp_save_prefix"
+exec_prefix="$mcpu_cpp_save_exec_prefix"
+
+mcpu_cpp_root="$mcpu_cpp_libdir/mcpu"
+mcpu_cpp_private_bindir="$mcpu_cpp_root/bin"
+mcpu_cpp_private_etcdir="$mcpu_cpp_root/etc"
+mcpu_cpp_private_includedir="$mcpu_cpp_root/include"
+
+MCPU_CPP_ROOT="$mcpu_cpp_root"
+MCPU_CPP_BINDIR="$mcpu_cpp_private_bindir"
+MCPU_CPP_ETCDIR="$mcpu_cpp_private_etcdir"
+MCPU_CPP_INCLUDEDIR="$mcpu_cpp_private_includedir"
+AC_SUBST([MCPU_CPP_ROOT])
+AC_SUBST([MCPU_CPP_BINDIR])
+AC_SUBST([MCPU_CPP_ETCDIR])
+AC_SUBST([MCPU_CPP_INCLUDEDIR])
+
+mcpu_cpp_public_link_target="$mcpu_cpp_private_bindir/mcpu-cpp"
+case "$mcpu_cpp_bindir:$mcpu_cpp_private_bindir" in
+ "$mcpu_cpp_exec_prefix"/*:"$mcpu_cpp_exec_prefix"/*)
+ mcpu_cpp_bindir_rel=${mcpu_cpp_bindir#"$mcpu_cpp_exec_prefix/"}
+ mcpu_cpp_target_rel=${mcpu_cpp_private_bindir#"$mcpu_cpp_exec_prefix/"}
+ mcpu_cpp_up=
+ mcpu_cpp_rest=$mcpu_cpp_bindir_rel
+ while :; do
+ mcpu_cpp_up="../$mcpu_cpp_up"
+ case "$mcpu_cpp_rest" in
+ */*) mcpu_cpp_rest=${mcpu_cpp_rest#*/} ;;
+ *) break ;;
+ esac
+ done
+ mcpu_cpp_public_link_target="$mcpu_cpp_up$mcpu_cpp_target_rel/mcpu-cpp"
+ ;;
+esac
+MCPU_CPP_PUBLIC_LINK_TARGET="$mcpu_cpp_public_link_target"
+AC_SUBST([MCPU_CPP_PUBLIC_LINK_TARGET])
+
+AC_DEFINE_UNQUOTED([MCPU_CPP_SYSTEM_CONFIG_FILE],
+ ["$mcpu_cpp_sysconfdir/mcpu/mcpu-cpp.conf"],
+ [Optional system-wide mcpu-cpp configuration override.])
+
+
+AC_MSG_CFG_PART(OUTPUT Substitutions)
+AC_CONFIG_FILES([
+ Makefile
+ src/Makefile
+ tests/Makefile
+ doc/Makefile
+ man/Makefile
+ man/ru/Makefile
+ etc/Makefile
+ etc/mcpu-cpp.conf
+])
+AC_OUTPUT
+
+AC_MSG_CFG_PART(Configuration summary)
+AC_MSG_NOTICE([mcpu-cpp configuration:])
+AC_MSG_NOTICE([ version : $PACKAGE_VERSION])
+AC_MSG_NOTICE([ host : $host])
+AC_MSG_NOTICE([ prefix : $prefix])
+AC_MSG_NOTICE([ install MCPU root : $mcpu_cpp_root])
+AC_MSG_NOTICE([ runtime config : <runtime-root>/etc/mcpu-cpp.conf])
+AC_MSG_NOTICE([ system override : $mcpu_cpp_sysconfdir/mcpu/mcpu-cpp.conf])
+AC_MSG_NOTICE([ runtime MCPU include : <runtime-root>/include])
+AC_MSG_NOTICE([ public command : $mcpu_cpp_bindir/mcpu-cpp])
+AC_MSG_NOTICE([ public symlink : $mcpu_cpp_public_link_target])
+AC_MSG_NOTICE([ mpuio-config : $LIBMPUIO_CONFIG])
+AC_MSG_NOTICE([ LibMPU version : $LIBMPU_VERSION])
+AC_MSG_NOTICE([ LibMPUIO version : $LIBMPUIO_VERSION])
+AC_MSG_NOTICE([ LibMPUIO CFLAGS : $LIBMPUIO_CFLAGS])
+AC_MSG_NOTICE([ LibMPUIO LDFLAGS : $LIBMPUIO_LDFLAGS])
+AC_MSG_NOTICE([ LibMPUIO LIBS : $LIBMPUIO_LIBS])
+AC_MSG_NOTICE([ LibMPU real I/O limit : $MCPU_CPP_MPU_REAL_IO_LIMIT])
+AC_MSG_NOTICE([ LibMPU math fn limit : $MCPU_CPP_MPU_MATH_FN_LIMIT])
+AC_MSG_NOTICE([ LibMPU int max width : $MCPU_CPP_MPU_INT_MAX_WIDTH])
+AC_MSG_NOTICE([ LibMPU byte order : $MCPU_CPP_MPU_BYTE_ORDER])
+AC_MSG_NOTICE([ LibMPU word order : $MCPU_CPP_MPU_WORD_ORDER])
+AC_MSG_NOTICE([ machine reg width : $MCPU_CPP_MPU_REGISTER_WIDTH])
+AC_MSG_NOTICE([ size_t width : $MCPU_CPP_SIZE_WIDTH])
+AC_MSG_NOTICE([ ssize_t width : $MCPU_CPP_SSIZE_WIDTH])
+
+if test -f "config.h"; then
+ echo ""
+ echo "Now you can run:"
+ echo " \`${TB}make${TN}' to compile,"
+ echo " \`${TB}make install${TN}' to make and install ${TB}mcpu-cpp${TN},"
+ echo " \`${TB}make dist${TN}' to create distributable tarballs, or"
+ echo " \`${TB}make distclean${TN}' to clean before configure for another target."
+ echo "Enjoy."
+ echo ""
+fi