File: ax_python_library.m4

package info (click to toggle)
geany-plugins 1.33%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 20,120 kB
  • sloc: ansic: 104,481; sh: 4,297; makefile: 1,533; python: 947
file content (29 lines) | stat: -rw-r--r-- 960 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
# Copyright (c) 2011 Colomban Wendling <ban@herbesfolles.org>
#
# AX_PYTHON_LIBRARY([action-if-found], [action-if-not-found])
#
# Tries to locate Python DSO path. It requires $PYTHON to be set

AC_DEFUN([AX_PYTHON_LIBRARY],[
	AC_REQUIRE([AX_PYTHON_DEVEL])

	AC_MSG_CHECKING([for Python DSO location])

	ax_python_library=`cat << EOD | $PYTHON - 2>/dev/null
from distutils.sysconfig import get_config_vars
from os.path import join as path_join

cvars = get_config_vars()
# support multiarch-enabled distributions like Ubuntu
if not 'MULTIARCH' in cvars.keys():
    cvars[['MULTIARCH']] = ''
# try to find the real installed lib, not the generic link
if not 'INSTSONAME' in cvars.keys():
    cvars[['INSTSONAME']] = cvars[['LDLIBRARY']]
print(path_join(cvars[['LIBDIR']], cvars[['MULTIARCH']], cvars[['INSTSONAME']]))
EOD`

	AC_SUBST([PYTHON_LIBRARY], [$ax_python_library])
	AC_MSG_RESULT([$PYTHON_LIBRARY])
	AS_IF([test -z "$ax_python_library"], [$2], [$1])
])