]> Savannah Git Hosting - gnulib.git/commitdiff
modula2comp-script: New module.
authorBruno Haible <bruno@clisp.org>
Thu, 24 Apr 2025 22:56:09 +0000 (00:56 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 24 Apr 2025 22:56:09 +0000 (00:56 +0200)
* m4/modula2comp.m4: New file.
* modules/modula2comp-script: New file.

ChangeLog
m4/modula2comp.m4 [new file with mode: 0644]
modules/modula2comp-script [new file with mode: 0644]

index 05044ceb78b87e157bcc8c974a7e690f0803fe15..e01f8745374b2c7dfdc3086881c6fa1937a9c084 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-24  Bruno Haible  <bruno@clisp.org>
+
+       modula2comp-script: New module.
+       * m4/modula2comp.m4: New file.
+       * modules/modula2comp-script: New file.
+
 2025-04-24  Bruno Haible  <bruno@clisp.org>
 
        fbufmode: Don't require peeking into the FILE structure on recent Haiku.
diff --git a/m4/modula2comp.m4 b/m4/modula2comp.m4
new file mode 100644 (file)
index 0000000..1a25ca9
--- /dev/null
@@ -0,0 +1,34 @@
+# modula2comp.m4
+# serial 1
+dnl Copyright (C) 2025 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl This file is offered as-is, without any warranty.
+
+# Checks for a Modula-2 implementation.
+# Sets M2C and M2FLAGS (options that can be used with "$M2C").
+AC_DEFUN([gt_MODULA2COMP],
+[
+  AC_MSG_CHECKING([for GNU Modula-2 compiler])
+  pushdef([AC_MSG_CHECKING],[:])dnl
+  pushdef([AC_CHECKING],[:])dnl
+  pushdef([AC_MSG_RESULT],[:])dnl
+  AC_ARG_VAR([M2C], [Modula-2 compiler command])
+  AC_ARG_VAR([M2FLAGS], [Modula-2 compiler options])
+  AC_CHECK_TOOLS([M2C], [gm2])
+  popdef([AC_MSG_RESULT])dnl
+  popdef([AC_CHECKING])dnl
+  popdef([AC_MSG_CHECKING])dnl
+  if test -n "$M2C"; then
+    ac_result="$M2C"
+  else
+    ac_result="no"
+  fi
+  AC_MSG_RESULT([$ac_result])
+  AC_SUBST([M2C])
+  if test -z "$M2FLAGS" && test -n "$M2C"; then
+    M2FLAGS="-g -O2"
+  fi
+  AC_SUBST([M2FLAGS])
+])
diff --git a/modules/modula2comp-script b/modules/modula2comp-script
new file mode 100644 (file)
index 0000000..59cbcd0
--- /dev/null
@@ -0,0 +1,18 @@
+Description:
+Support for compiling Modula-2 programs.
+
+Files:
+m4/modula2comp.m4
+
+Depends-on:
+
+configure.ac:
+AC_REQUIRE([gt_MODULA2COMP])
+
+Makefile.am:
+
+License:
+GPLed build tool
+
+Maintainer:
+all