From 570a5e1c9c7fe405b3b96cf3c5c6f1735c02696d Mon Sep 17 00:00:00 2001 From: xantares Date: Sun, 1 Sep 2013 20:37:14 +0200 Subject: [PATCH] Strip only if prefix is provided. --- configure.ac | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 728f68e..f1b6963 100644 --- a/configure.ac +++ b/configure.ac @@ -33,10 +33,6 @@ 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) @@ -148,8 +144,11 @@ elif test x"$GUILE_INSTALL_DIR" = "x"; then 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"` + if test "$prefix" != "NONE"; then + # strip guile install path to honor prefix + GUILE_INSTALL_DIR=`echo "$GUILE_INSTALL_DIR" | sed "s|$GUILE_PREFIX|$prefix|g"` + fi + AC_MSG_RESULT([$GUILE_INSTALL_DIR]) fi @@ -241,8 +240,10 @@ 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"` + if test "$prefix" != "NONE"; then + # strip octave install path to honor prefix + OCT_INSTALL_DIR=`echo "$OCT_INSTALL_DIR" | sed "s|$OCTAVE_PREFIX|$prefix|g"` + fi AC_MSG_RESULT($OCT_INSTALL_DIR) else AC_MSG_RESULT(unknown) @@ -261,8 +262,10 @@ 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"` + if test "$prefix" != "NONE"; then + # strip octave install path to honor prefix + M_INSTALL_DIR=`echo "$M_INSTALL_DIR" | sed "s|$OCTAVE_PREFIX|$prefix|g"` + fi AC_MSG_RESULT($M_INSTALL_DIR) else AC_MSG_RESULT(unknown) -- 2.30.2