Saturday, October 30, 2010

Installing Python script from automake, Fixup :)

In my previous blog post I added a wrapper script to start the Python script, but it turns out that this script don't work unless you pass --libdir=something to configure. I didn't catch that originally because I always specify the library directory due to the fact that I'm building both 32bit and 64bit binaries on my Solaris machine.

The following script should address the problem:

#! /bin/sh
prefix=@prefix@
exec_prefix=@exec_prefix@
root=@libdir@/python

if test -z "${PYTHONPATH}"; then
   PYTHONPATH=$root
else
   PYTHONPATH=$root:${PYTHONPATH}
fi
export PYTHONPATH
exec $root/`basename $0`.py "$@"

1 comment:

  1. Thanks for your postings. I run into this problem as well. Finally ended up implementing wrappers without python_wrapper.in template at all. Instead, I generate wrappers in Makefile.am with plain echo. There you can get the paths right more easily. Check out a snippet from my Makefile.am in pastebin.

    ReplyDelete