[Bf-committers] Quicktime & autoconf

Kester Maddock bf-committers@blender.org
Thu, 1 May 2003 13:21:28 +1200


--Boundary-00=_YaHs+DscIZRhG2R
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello,

I get the same problem.  It turns out that embedded python needs a few 
(platform dependant) arguments added when linking: -Xlinker -export-dynamic

Fortunately, you can get the correct arguments from python itself, which the 
attached patch to configure.ac will do.  It adds the output of
$PYTHON -c "import distutils.sysconfig; print 
distutils.sysconfig.get_config_var('LINKFORSHARED')"
to LDFLAGS

See http://www.python.org/doc/current/ext/link-reqs.html for more details.

I am testing this on Linux.  You might need a full version of python installed 
for this to work.

Kester

On Thu, 01 May 2003 4:29, Meino Christian Cramer wrote:
[Snip]
>   I trace the whole thing with strace to get sure...but as before,
>   there was not a file which cant be found, but there were unresolved
>   symbols:
>
>      [mccramer/] :/usr/local/bin/blender 2>&1 | grep -v GOTH
>      Traceback (most recent call last):
>        File "Text", line 1, in ?
>      ImportError: /usr/lib/python2.2/lib-dynload/math.so: undefined symbol:
> PyExc_OverflowError Traceback (most recent call last):
>        File "Text", line 1, in ?
>      ImportError: /usr/lib/python2.2/lib-dynload/math.so: undefined symbol:
> PyExc_OverflowError
>
>      Blender quit
>
>  What sysmbol is not found depends on the Python code, which is used.
>  PocAnim (for examples) could not start due to other unresolved
>  symbols.
>
>  The above exmaple was generated with the following code snippet:
>
>  from math import * [ALT-P twice]
>
>  Same code directly entered into the python shel does not have anyp
>  problems, which would have, if the PYTHONPATH wasn't correct.
[Snip]
--Boundary-00=_YaHs+DscIZRhG2R
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="blender-python-linkpatch.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="blender-python-linkpatch.diff"

Index: configure.ac
===================================================================
RCS file: /cvsroot/bf-blender/blender/configure.ac,v
retrieving revision 1.38
diff -u -r1.38 configure.ac
--- configure.ac	16 Apr 2003 23:28:00 -0000	1.38
+++ configure.ac	1 May 2003 01:06:56 -0000
@@ -191,6 +191,12 @@
 
 #Python!
   AM_PATH_PYTHON(2.0)
+  AC_CACHE_CHECK([Python link args...],
+    [am_cv_python_ldflags],
+    [am_cv_python_ldflags=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LINKFORSHARED')"`])
+
+  LDFLAGS="$LDFLAGS $am_cv_python_ldflags"
+
 #Find out what path to use for python.
 python_sysprefix=`echo "import sys; print sys.prefix" | python -`
 

--Boundary-00=_YaHs+DscIZRhG2R--