summaryrefslogtreecommitdiffstats
path: root/m4/ax_python_module.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:59:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:59:48 +0000
commit3b9b6d0b8e7f798023c9d109c490449d528fde80 (patch)
tree2e1c188dd7b8d7475cd163de9ae02c428343669b /m4/ax_python_module.m4
parentInitial commit. (diff)
downloadbind9-3b9b6d0b8e7f798023c9d109c490449d528fde80.tar.xz
bind9-3b9b6d0b8e7f798023c9d109c490449d528fde80.zip
Adding upstream version 1:9.18.19.upstream/1%9.18.19upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/ax_python_module.m4')
-rw-r--r--m4/ax_python_module.m433
1 files changed, 33 insertions, 0 deletions
diff --git a/m4/ax_python_module.m4 b/m4/ax_python_module.m4
new file mode 100644
index 0000000..b3422fc
--- /dev/null
+++ b/m4/ax_python_module.m4
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: FSFAP
+#
+# SYNOPSIS
+#
+# AX_PYTHON_MODULE(MODULE[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# Checks for Python module.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Andrew Collier
+# (c) 2020 Internet Systems Consortium
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+AC_DEFUN([AX_PYTHON_MODULE],[
+ AC_MSG_CHECKING([for python module: $1])
+ $PYTHON -c "import $1" >/dev/null 2>&1
+ AS_IF([test $? -eq 0],
+ [AC_MSG_RESULT([yes])
+ eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
+ $2
+ ],
+ [AC_MSG_RESULT([no])
+ eval AS_TR_CPP(HAVE_PYMOD_$1)=no
+ $3
+ ])
+ ])