From 44f13a292b073d3a8ccbc2db6103c52183003400 Mon Sep 17 00:00:00 2001 From: xantares Date: Fri, 30 Aug 2013 17:12:57 +0200 Subject: [PATCH] Plugins installation honor prefix --- configure.ac | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a781597..728f68e 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,10 @@ if test "x$with_cxx" = xyes; then fi AC_SUBST(NLOPT_SUFFIX) +if test "$prefix" = "NONE"; then + prefix=$ac_default_prefix +fi + AC_ARG_WITH(mthreads, [AC_HELP_STRING([--with-mthreads], [use -mthreads compiler flag])], with_mthrads=$withval,with_mthreads=no) @@ -138,8 +142,14 @@ if test "x$GUILE" = xunknown; then AC_MSG_WARN([can't find guile, disabling Guile wrapper]) GUILE_CONFIG=unknown elif test x"$GUILE_INSTALL_DIR" = "x"; then + AC_CHECK_PROGS(GUILE_CONFIG, guile-config, echo) + AC_MSG_CHECKING(guile prefix) + GUILE_PREFIX=`guile-config info prefix` + AC_MSG_RESULT($GUILE_PREFIX) AC_MSG_CHECKING([for Guile installation directory]) GUILE_INSTALL_DIR=`guile -c '(display (%site-dir))'` + # strip guile install path to honor prefix + GUILE_INSTALL_DIR=`echo "$GUILE_INSTALL_DIR" | sed "s|$GUILE_PREFIX|$prefix|g"` AC_MSG_RESULT([$GUILE_INSTALL_DIR]) fi @@ -214,7 +224,11 @@ elif test x"$OCT_INSTALL_DIR" = "x"; then # try to find installation directory AC_CHECK_PROGS(OCTAVE, octave, echo) AC_CHECK_PROGS(OCTAVE_CONFIG, octave-config, echo) - + + AC_MSG_CHECKING(octave prefix) + OCTAVE_PREFIX=`octave-config --print PREFIX 2> /dev/null` + AC_MSG_RESULT($OCTAVE_PREFIX) + AC_MSG_CHECKING(where octave plugins go) OCT_INSTALL_DIR=`octave-config --oct-site-dir 2> /dev/null | grep '/'` if test -z "$OCT_INSTALL_DIR"; then @@ -227,6 +241,8 @@ elif test x"$OCT_INSTALL_DIR" = "x"; then OCT_INSTALL_DIR=`echo "DEFAULT_LOADPATH" | $OCTAVE -q 2> /dev/null | tr ':' '\n' | grep "site/oct" | head -1` fi if test -n "$OCT_INSTALL_DIR"; then + # strip octave install path to honor prefix + OCT_INSTALL_DIR=`echo "$OCT_INSTALL_DIR" | sed "s|$OCTAVE_PREFIX|$prefix|g"` AC_MSG_RESULT($OCT_INSTALL_DIR) else AC_MSG_RESULT(unknown) @@ -245,6 +261,8 @@ elif test x"$OCT_INSTALL_DIR" = "x"; then M_INSTALL_DIR=`echo "DEFAULT_LOADPATH" | $OCTAVE -q 2> /dev/null | tr ':' '\n' | grep "site/m" | head -1` fi if test -n "$M_INSTALL_DIR"; then + # strip octave install path to honor prefix + M_INSTALL_DIR=`echo "$M_INSTALL_DIR" | sed "s|$OCTAVE_PREFIX|$prefix|g"` AC_MSG_RESULT($M_INSTALL_DIR) else AC_MSG_RESULT(unknown) -- 2.30.2