Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 344231 | Differences between
and this patch

Collapse All | Expand All

(-)a/macros/ac_python_devel.m4 (-17 / +6 lines)
Lines 20-33 AC_DEFUN([AC_PYTHON_DEVEL],[ Link Here
20
20
21
	# Check for Python include path
21
	# Check for Python include path
22
	AC_MSG_CHECKING([for Python include path])
22
	AC_MSG_CHECKING([for Python include path])
23
	python_path=`echo $PYTHON | sed "s,/bin.*$,,"`
23
	python_path=`$PYTHON -c 'import distutils.sysconfig; \
24
	for i in "$python_path/include/python$PYTHON_VERSION/" "$python_path/include/python/" "$python_path/" ; do
24
            print(distutils.sysconfig.get_python_inc())'`
25
		python_path=`find $i -type f -name Python.h -print | sed "1q"`
26
		if test -n "$python_path" ; then
27
			break
28
		fi
29
	done
30
	python_path=`echo $python_path | sed "s,/Python.h$,,"`
31
	AC_MSG_RESULT([$python_path])
25
	AC_MSG_RESULT([$python_path])
32
	if test -z "$python_path" ; then
26
	if test -z "$python_path" ; then
33
		AC_MSG_ERROR([cannot find Python include path])
27
		AC_MSG_ERROR([cannot find Python include path])
Lines 36-56 AC_DEFUN([AC_PYTHON_DEVEL],[ Link Here
36
30
37
	# Check for Python library path
31
	# Check for Python library path
38
	AC_MSG_CHECKING([for Python library path])
32
	AC_MSG_CHECKING([for Python library path])
39
	python_path=`echo $PYTHON | sed "s,/bin.*$,,"`
33
	python_path=`$PYTHON -c 'import distutils.sysconfig; \
40
	for i in "$python_path/lib/python$PYTHON_VERSION/config/" "$python_path/lib/python$PYTHON_VERSION/" "$python_path/lib/python/config/" "$python_path/lib/python/" "$python_path/" ; do
34
            print(distutils.sysconfig.get_config_var("LIBDIR"))'`
41
		python_path=`find $i -type f -name libpython$PYTHON_VERSION.* -print | sed "1q"`
42
		if test -n "$python_path" ; then
43
			break
44
		fi
45
	done
46
	python_path=`echo $python_path | sed "s,/libpython.*$,,"`
47
	AC_MSG_RESULT([$python_path])
35
	AC_MSG_RESULT([$python_path])
48
	if test -z "$python_path" ; then
36
	if test -z "$python_path" ; then
49
		AC_MSG_ERROR([cannot find Python library path])
37
		AC_MSG_ERROR([cannot find Python library path])
50
	fi
38
	fi
51
	AC_SUBST([PYTHON_LDFLAGS],["-L$python_path -lpython$PYTHON_VERSION"])
39
	AC_SUBST([PYTHON_LDFLAGS],["-L$python_path -lpython$PYTHON_VERSION"])
52
	#
40
	#
53
	python_site=`echo $python_path | sed "s/config/site-packages/"`
41
	python_site=`$PYTHON -c 'import distutils.sysconfig; \
42
            print(distutils.sysconfig.get_python_lib(standard_lib=False))'`
54
	AC_SUBST([PYTHON_SITE_PKG],[$python_site])
43
	AC_SUBST([PYTHON_SITE_PKG],[$python_site])
55
	#
44
	#
56
	# libraries which must be linked in when embedding
45
	# libraries which must be linked in when embedding

Return to bug 344231