File: acinclude.m4

package info (click to toggle)
packagekit 1.1.13-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 15,812 kB
  • sloc: ansic: 55,117; cpp: 10,846; python: 7,560; xml: 6,388; sh: 4,566; perl: 1,738; makefile: 1,552; ruby: 1,341
file content (33 lines) | stat: -rw-r--r-- 1,036 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
dnl Macros to help with configuring Python extensions via autoconf.
dnl  Copyright (C) 1998,  James Henstridge <james@daa.com.au>
dnl
dnl  Distribute under the same rules as Autoconf itself.
dnl
dnl Used similar to AC_CHECK_LIB and associates.
dnl Swiped from http://www.initd.org/svn/psycopg/psycopg1/trunk/aclocal.m4

dnl PY_CHECK_MOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
dnl Check if a module containing a given symbol is visible to python.
AC_DEFUN([PY_CHECK_MOD],
[AC_REQUIRE([AM_PATH_PYTHON])
py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
AC_MSG_CHECKING(for ifelse([$3],[],,[$2 in ])python module $1)
AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
if $PYTHON -c 'import $1 ifelse([$2],[],,[; $1.$2])' 1>&AC_FD_CC 2>&AC_FD_CC; then
  eval "py_cv_mod_$py_mod_var=yes"
else
  eval "py_cv_mod_$py_mod_var=no"
fi
])
py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
if test "x$py_val" != xno; then
  AC_MSG_RESULT(yes)
  ifelse([$3], [],, [$3
])dnl
else
  AC_MSG_RESULT(no)
  ifelse([$4], [],, [$4
])dnl
fi
])