chiark / gitweb /
Strip only if prefix is provided.
authorxantares <xantares09@hotmail.com>
Sun, 1 Sep 2013 18:37:14 +0000 (20:37 +0200)
committerxantares <xantares09@hotmail.com>
Sun, 1 Sep 2013 18:37:14 +0000 (20:37 +0200)
configure.ac

index 728f68e69dc550ca3e4bd958beb557eb01389b16..f1b696386e7fcd297bb042387e5c45bd8a60cba6 100644 (file)
@@ -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)