File: x_ac_python.m4

package info (click to toggle)
devicexlib 0.8.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,364 kB
  • sloc: f90: 77,678; sh: 3,701; fortran: 773; makefile: 268; python: 246; ansic: 69; awk: 36
file content (43 lines) | stat: -rw-r--r-- 921 bytes parent folder | download | duplicates (2)
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
34
35
36
37
38
39
40
41
42
43

AC_DEFUN([X_AC_PYTHON], [

  have_python=
  check_python=

  AC_ARG_WITH(python,
     [AS_HELP_STRING([--with-python],[Link with python library. (default: no)])],
     [try_python=$withval; check_python=yes ], [check_python=no])

 #
 pyldflags=""
 pyincludes=""
 #
 if test "$check_python" = "yes" ; then
   #
   #AC_MSG_CHECKING([python])
   #
   AC_CHECK_PROG(pyconfig, python3-config, python3-config)
   if test "x$pyconfig" = "x" ; then
     if test "x$try_python" != "x" ; then
        AC_CHECK_PROG(pyconfig, $try_python"-config", $try_python"-config")
     fi
   fi
   #
   if test "x$pyconfig" = "x" ; then
     have_python=no
   else
     echo setting PYCONFIG... $pyconfig
     pyldflags="`$pyconfig --ldflags`"
     pyincludes=`$pyconfig --includes`
     try_dflags="$try_dflags -D__PYTHON"
     have_python=yes
   fi
   #
   #AC_MSG_RESULT($have_python)
 fi
 
 AC_SUBST(pyldflags)
 AC_SUBST(pyincludes)

])