# This it taken from project GetSpot http://spot.lip6.fr/wiki/GetSpot, also see here # http://stackoverflow.com/questions/5056606/how-to-use-autotools-to-build-python-interface-at-same-time-as-library # Darwin needs some help in figuring out where non-installed libtool # libraries are (on this platform libtool encodes the expected final # path of dependent libraries in each library). modpath='../.libs:@abs_top_builddir@/src/.libs' # .. is for the *.py files, and ../.libs for the *.so. We used to # rely on a module called ltihooks.py to teach the import function how # to load a Libtool library, but it started to cause issues with # Python 2.6. pypath='..:../.libs:@abs_srcdir@/..:@abs_srcdir@/../.libs:$PYTHONPATH' test -z "$1" && PYTHONPATH=$modpath DYLD_LIBRARY_PATH=$modpath LD_LIBRARY_PATH=$modpath exec @PYTHON@ case $1 in *.py) PYTHONPATH=$modpath DYLD_LIBRARY_PATH=$modpath LD_LIBRARY_PATH=$modpath exec @PYTHON@ "$@";; *.test) exec sh -x "$@";; *) echo "Unknown extension" >&2 exit 2;; esac