Index: configure
===================================================================
--- configure	(revision 17446)
+++ configure	(working copy)
@@ -181,6 +181,8 @@
   echo ""
   echo "  --enable-mac-bundle      produce standalone OS X apps (e.g. mythfrontend.app)"
   echo ""
+  echo "  --runtime-prefix=PREFIX  prefix to be used at runtime"
+  echo "                           (e.g. .. or /myth/latest)"
   echo "  --with-bindings=LIST     install the bindings specified in the"
   echo "                           comma-separated list"
   echo "                           Supported bindings: perl, python"
@@ -1160,6 +1162,7 @@
 CONFIG_DEFINES=""
 CONFIG_INCLUDEPATH=""
 PROFILEFLAGS=""
+RUNPREFIX=$PREFIX
 audio_alsa="default"
 audio_alsa_libs="-lasound"
 audio_arts="default"
@@ -1395,6 +1398,8 @@
   ;;
   --enable-mac-bundle) enable mac_bundle
   ;;
+  --runtime-prefix=*) RUNPREFIX="$optval"
+  ;;
   --previous|--prev)
       echo "No history of previous configure parameters."
   ;;
@@ -2889,6 +2894,7 @@
 echo "DistCC                    $distcc$distcc_txt"
 echo "qmake                     $(which $qmake)"
 echo "install prefix            $PREFIX"
+echo "runtime prefix            $RUNPREFIX"
 <<BLOCK_QUOTE
 echo "source path               $source_path"
 echo "C compiler                $cc"
@@ -3075,6 +3081,7 @@
 echo "#define FFMPEG_CONFIG_H" >> $TMPH
 echo "#define FFMPEG_CONFIGURATION \"$FFMPEG_CONFIGURATION\"" >> $TMPH
 
+echo "RUNPREFIX=$RUNPREFIX" >> $MYTH_CONFIG_MAK
 echo "PREFIX=$PREFIX" >> $MYTH_CONFIG_MAK
 echo "LIBDIR=$libdir" >> $MYTH_CONFIG_MAK
 <<BLOCK_QUOTE
Index: libs/libmyth/mythcontext.cpp
===================================================================
--- libs/libmyth/mythcontext.cpp	(revision 17446)
+++ libs/libmyth/mythcontext.cpp	(working copy)
@@ -221,9 +221,8 @@
     Settings *m_settings;          ///< connection stuff, theme, button style
     Settings *m_qtThemeSettings;   ///< everything else theme-related
 
-    QString   m_installprefix;     ///< Compile-time PREFIX, or generated
+    QString   m_installprefix;     ///< Compile-time RUNPREFIX, or generated
                                    ///< from enviroment ($MYTHTVDIR or $cwd)
-    QString   m_installlibdir;     ///< Compile-time LIBDIR, or generated
 
     bool      m_gui;               ///< Should this context use GUI elements?
     bool      m_backend;           ///< Is this host any sort of backend?
@@ -314,7 +313,7 @@
 MythContextPrivate::MythContextPrivate(MythContext *lparent)
     : parent(lparent),
       m_settings(new Settings()), m_qtThemeSettings(new Settings()),
-      m_installprefix(PREFIX), m_installlibdir(LIBDIR),
+      m_installprefix(RUNPREFIX),
       m_gui(false), m_backend(false), m_themeloaded(false),
       m_menuthemepathname(QString::null), m_themepathname(QString::null),
       m_backgroundimage(NULL),
@@ -356,30 +355,12 @@
 
         VERBOSE(VB_IMPORTANT+VB_EXTRA,
                 "Relative PREFIX!\nappDir=" + prefixDir.canonicalPath() +
-                "\nprefix=" + m_installprefix + ", libdir=" + m_installlibdir);
+                "\nprefix=" + m_installprefix);
         prefixDir.cd(m_installprefix);
         m_installprefix = prefixDir.canonicalPath();
-
-        // Not strictly necessary, but it tidies up the path:
-        if (QDir(m_installlibdir).isRelative())
-        {
-            prefixDir = qApp->applicationDirPath();
-            prefixDir.cd(m_installlibdir);
-            m_installlibdir = prefixDir.canonicalPath();
-        }
     }
-    else if (prefixDir.path().contains(".app/Contents/MacOS"))
-    {
-        prefixDir.cd("../Resources");
-        if (QDir(prefixDir.canonicalPath() + "/bin").exists() ||
-            QDir(prefixDir.canonicalPath() + "/share").exists())
-            m_installprefix = prefixDir.canonicalPath();
-        if (QDir(prefixDir.canonicalPath() + "/lib").exists())
-            m_installlibdir = prefixDir.canonicalPath() + "/lib";
-    }
 
-    VERBOSE(VB_IMPORTANT, QString("Using runtime prefix = %1, libdir = %2")
-                          .arg(m_installprefix).arg(m_installlibdir));
+    VERBOSE(VB_IMPORTANT, "Using runtime prefix = " + m_installprefix);
 }
 
 MythContextPrivate::~MythContextPrivate()
@@ -1945,7 +1926,7 @@
 
 QString MythContext::GetLibraryDir(void) 
 { 
-    return d->m_installlibdir + "/mythtv/"; 
+    return d->m_installprefix + "/mythtv/"; 
 }
 
 QString MythContext::GetThemesParentDir(void) 
Index: settings.pro
===================================================================
--- settings.pro	(revision 17446)
+++ settings.pro	(working copy)
@@ -3,6 +3,12 @@
 isEmpty( PREFIX ) {
     PREFIX = /usr/local
 }
+isEmpty( RUNPREFIX ) {
+    RUNPREFIX = $$PREFIX
+}
+isEmpty( LIBDIR ) {
+    LIBDIR = $${RUNPREFIX}/lib
+}
 
 LIBVERSION = 0.22
 VERSION = 0.22.0
@@ -89,6 +95,7 @@
 DEFINES += $$CONFIG_DEFINES
 DEFINES += _GNU_SOURCE
 DEFINES += _FILE_OFFSET_BITS=64
+DEFINES += RUNPREFIX=\\\"$${RUNPREFIX}\\\"
 DEFINES += PREFIX=\\\"$${PREFIX}\\\"
 DEFINES += LIBDIR=\\\"$${LIBDIR}\\\"
 
Index: contrib/OSX/build/osx-packager.pl
===================================================================
--- contrib/OSX/build/osx-packager.pl	(revision 17446)
+++ contrib/OSX/build/osx-packager.pl	(working copy)
@@ -483,6 +483,7 @@
   'mythtv'
   =>  [
         '--prefix=' . $PREFIX,
+        '--runtime-prefix=../Resources',
         # To "cross compile" something for a lesser Mac:
         #'--tune=G3',
         #'--disable-altivec',
