source: git/m4/ax_python_module.m4 @ 84b294

spielwiese
Last change on this file since 84b294 was 84b294, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
python-related autoconf macro for pyobjects
  • Property mode set to 100644
File size: 1.2 KB
Line 
1# ===========================================================================
2#     http://www.gnu.org/software/autoconf-archive/ax_python_module.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7#   AX_PYTHON_MODULE(modname[, fatal])
8#
9# DESCRIPTION
10#
11#   Checks for Python module.
12#
13#   If fatal is non-empty then absence of a module will trigger an error.
14#
15# LICENSE
16#
17#   Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
18#
19#   Copying and distribution of this file, with or without modification, are
20#   permitted in any medium without royalty provided the copyright notice
21#   and this notice are preserved. This file is offered as-is, without any
22#   warranty.
23
24#serial 5
25
26AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
27AC_DEFUN([AX_PYTHON_MODULE],[
28    if test -z $PYTHON;
29    then
30        PYTHON="python"
31    fi
32    PYTHON_NAME=`basename $PYTHON`
33    AC_MSG_CHECKING($PYTHON_NAME module: $1)
34        $PYTHON -c "import $1" 2>/dev/null
35        if test $? -eq 0;
36        then
37                AC_MSG_RESULT(yes)
38                eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
39        else
40                AC_MSG_RESULT(no)
41                eval AS_TR_CPP(HAVE_PYMOD_$1)=no
42                #
43                if test -n "$2"
44                then
45                        AC_MSG_ERROR(failed to find required module $1)
46                        exit 1
47                fi
48        fi
49])
Note: See TracBrowser for help on using the repository browser.