Commit 6ee5f7c3 6ee5f7c3a24fddc05fe172543bb78ce4b6c5acf3 by Sergey Poznyakoff

Improve configure script.

* configure.ac: New option --with-pythondir
(PYTHON_SITE_DIR, PYTHON_EXEC_DIR): New subst variables.
* python/libmu_py/Makefile.am: use pythonexec_LTLIBRARIES,
instead of pythonexec_LTLIBRARIES.
(pythonexecdir): New variable.
* python/mailutils/Makefile.am: use pythonsite_PYTHON,
instead of pkgpython_PYTHON.
(pythonsitedir): New variable.
1 parent 75fd6127
......@@ -1136,6 +1136,18 @@ if test "$status_python" = yes; then
if test "$status_python" = yes; then
AC_DEFINE(WITH_PYTHON,1,[Enable Python support])
MU_LIB_PY='${top_builddir}/python/libmu_py/libmu_py.la'
AC_SUBST([PYTHON_SITE_DIR])
AC_SUBST([PYTHON_EXEC_DIR])
AC_ARG_WITH([pythondir],
AC_HELP_STRING([--with-pythondir=DIR],
[Specify the directory to install Python modules to]),
[case $withval in
/*) PYTHON_SITE_DIR="${withval}/mailutils"
PYTHON_EXEC_DIR="${withval}/mailutils";;
*) AC_MSG_ERROR([Argument to --with-pythondir must be an absolute directory name]);;
esac],
[PYTHON_SITE_DIR='$(pkgpythondir)'
PYTHON_EXEC_DIR='$(pkgpyexecdir)'])
fi
fi
fi
......
......@@ -63,7 +63,8 @@ libmu_py_la_LIBADD = $(PYTHON_LIBS) @MU_COMMON_LIBRARIES@ \
@MU_AUTHLIBS@\
${MU_LIB_MAILUTILS}
pkgpyexec_LTLIBRARIES = c_api.la
c_api_la_LDFLAGS = -avoid-version -module -rpath $(pkgpyexecdir)
pythonexecdir=@PYTHON_EXEC_DIR@
pythonexec_LTLIBRARIES = c_api.la
c_api_la_LDFLAGS = -avoid-version -module -rpath $(pythonexecdir)
c_api_la_LIBADD = $(PYTHON_LIBS) ${MU_LIB_PY}
c_api_la_SOURCES = c_api.c
......
......@@ -17,7 +17,8 @@
## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
pkgpython_PYTHON=\
pythonsitedir=@PYTHON_SITE_DIR@
pythonsite_PYTHON=\
__init__.py \
error.py \
address.py \
......