1
votes

I want to change the python prefix

I want to install my files in $(myown_pfx)/usr/lib/python2.7/site-packages

Now by default, the pythondir seems to point to $(prefix)/usr/lib/python2.7/site-packages

I have the following in my configure.ac

 AM_PATH_PYTHON([2.7])
 AC_SUBST([PYTHON_PREFIX], ["$myown_pfx"])

However, my expected files are still installed as if the PYTHON_PREFIX never changed to $myown_pfx, it was still the default $prefix.

I basically want to override the PYTHON_PREFIX, but have been unsuccessful, what am i missing?

I have been reading this documentation https://www.gnu.org/software/automake/manual/html_node/Python.html

1

1 Answers

0
votes

Regretfully AM_PATH_PYTHON sets it, unconditionally, as follows:

AC_SUBST([PYTHON_PREFIX], ['${prefix}'])

What can be done (other than recalculating pythondir similarly to what AM_PATH_PYTHON does) is to replace '${prefix}' by $myown_pfx:

pythondir=`echo "$pythondir" | sed s,'${prefix}',"$myown_pfx",`

or maybe better:

pythondir=`echo "$pythondir" | sed "s,$PYTHON_PREFIX,$myown_pfx,"`