Index: i18n/translate.pro
===================================================================
--- i18n/translate.pro	(revision 10047)
+++ i18n/translate.pro	(working copy)
@@ -1,3 +1,10 @@
+include ( ../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 SOURCES += ../libs/libmyth/dbsettings.cpp
 SOURCES += ../libs/libmyth/langsettings.cpp
 SOURCES += ../libs/libmyth/managedlist.cpp
Index: i18n/i18n.pro
===================================================================
--- i18n/i18n.pro	(revision 10047)
+++ i18n/i18n.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../settings.pro )
 
 TEMPLATE = app
Index: configure
===================================================================
--- configure	(revision 10047)
+++ configure	(working copy)
@@ -598,12 +598,15 @@
 
 # find source path
 source_path="`dirname $0`"
+source_path="`cd \"$source_path\"; pwd`"
 source_path_used="yes"
-if test -z "$source_path" -o "$source_path" = "." ; then
+if test -z "$source_path" -o "$source_path" = "`pwd`"; then
     source_path=`pwd`
     source_path_used="no"
 else
+    build_path="`pwd`"
     source_path="`cd \"$source_path\"; pwd`"
+    CONFIG_INCLUDEPATH="$CONFIG_INCLUDEPATH $build_path"
 fi
 
 FFMPEG_CONFIGURATION=""
@@ -2362,6 +2365,22 @@
 
 MYTH_CONFIG_H=libs/libmyth/mythconfig.h
 MYTH_CONFIG_MAK=libs/libmyth/mythconfig.mak
+
+# build tree in object directory if source path is different from current one
+if test "$source_path_used" = "yes" ; then
+
+    FILES=`cd $source_path;find -iname \*.pro |sed -e "s/^.\///"`
+    DIRS=`echo $FILES |xargs -n 1 |sed -e "s/\/*[^\/]*$//;/^$/D" |sort -u`
+    for dir in $DIRS ; do
+            mkdir -p $dir
+            ln -snf "$source_path/$dir" $dir/sourcedir
+    done
+    for f in $FILES ; do
+        ln -snf "$source_path/$f" $f
+    done
+fi
+
+
 echo "Creating $MYTH_CONFIG_H and $MYTH_CONFIG_MAK"
 
 date >> config.log
@@ -2370,6 +2389,8 @@
 echo "/* Automatically generated by configure - do not modify */" > $TMPH
 echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
 
+echo "SRC_PATH=$source_path" >> $MYTH_CONFIG_MAK
+echo "BUILD_PATH=$build_path" >> $MYTH_CONFIG_MAK
 echo "PREFIX=$prefix" >> $MYTH_CONFIG_MAK
 echo "LIBDIR=$libdir" >> $MYTH_CONFIG_MAK
 #echo "bindir=$bindir" >> $MYTH_CONFIG_MAK
@@ -2862,20 +2883,6 @@
   echo "#define always_inline"  >> $TMPH
 fi
 
-# build tree in object directory if source path is different from current one
-if test "$source_path_used" = "yes" ; then
-    DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
-          libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
-    FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
-    for dir in $DIRS ; do
-            mkdir -p $dir
-    done
-    for f in $FILES ; do
-        ln -sf "$source_path/$f" $f
-    done
-fi
-echo "SRC_PATH='$source_path'" >> $MYTH_CONFIG_MAK
-
 if test "$amr_wb" = "yes" ; then
   echo "#define AMR_WB 1" >> $TMPH
   echo "AMR_WB=yes" >> $MYTH_CONFIG_MAK
Index: version.pro
===================================================================
--- version.pro	(revision 10047)
+++ version.pro	(working copy)
@@ -5,7 +5,7 @@
 #        "exported" is reported as the revision.           #
 ############################################################
 
-SVNTREEDIR = $$system(pwd)
+SVNTREEDIR = $${SOURCE}
 
 SOURCES += version.cpp
 
Index: themes/themes.pro
===================================================================
--- themes/themes.pro	(revision 10047)
+++ themes/themes.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../settings.pro )
 
 QMAKE_STRIP = echo
Index: libs/libmythtv/nuppeldecoder.cpp
===================================================================
--- libs/libmythtv/nuppeldecoder.cpp	(revision 10047)
+++ libs/libmythtv/nuppeldecoder.cpp	(working copy)
@@ -12,7 +12,7 @@
 using namespace std;
 
 // MythTV headers
-#include "mythconfig.h"
+#include "config.h"
 #include "nuppeldecoder.h"
 #include "NuppelVideoPlayer.h"
 #include "remoteencoder.h"
Index: libs/libmythtv/firewirechannelbase.h
===================================================================
--- libs/libmythtv/firewirechannelbase.h	(revision 10047)
+++ libs/libmythtv/firewirechannelbase.h	(working copy)
@@ -12,7 +12,7 @@
 #include "tv_rec.h"
 #include "channelbase.h"
 
-#include "mythconfig.h"
+#include "config.h"
 
 namespace AVS
 {
Index: libs/libmythtv/NuppelVideoRecorder.cpp
===================================================================
--- libs/libmythtv/NuppelVideoRecorder.cpp	(revision 10047)
+++ libs/libmythtv/NuppelVideoRecorder.cpp	(working copy)
@@ -4,7 +4,7 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include "mythconfig.h"
+#include "config.h"
 #ifdef HAVE_SYS_SOUNDCARD_H
     #include <sys/soundcard.h>
 #elif HAVE_SOUNDCARD_H
Index: libs/libmythtv/videoout_quartz.cpp
===================================================================
--- libs/libmythtv/videoout_quartz.cpp	(revision 10047)
+++ libs/libmythtv/videoout_quartz.cpp	(working copy)
@@ -59,7 +59,7 @@
 
 #include "osd.h"
 #include "osdsurface.h"
-#include "mythconfig.h"
+#include "config.h"
 #ifdef CONFIG_MAC_ACCEL
 #include "videoout_accel_utils.h"
 #endif
Index: libs/libmythtv/avformatdecoder.cpp
===================================================================
--- libs/libmythtv/avformatdecoder.cpp	(revision 10047)
+++ libs/libmythtv/avformatdecoder.cpp	(working copy)
@@ -8,7 +8,7 @@
 using namespace std;
 
 // MythTV headers
-#include "mythconfig.h" // for CONFIG_DTS
+#include "config.h" // for CONFIG_DTS
 #include "avformatdecoder.h"
 #include "RingBuffer.h"
 #include "NuppelVideoPlayer.h"
Index: libs/libmythtv/libmythtv.pro
===================================================================
--- libs/libmythtv/libmythtv.pro	(revision 10047)
+++ libs/libmythtv/libmythtv.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 
 TEMPLATE = lib
@@ -7,9 +12,9 @@
 target.path = $${LIBDIR}
 INSTALLS = target
 
-INCLUDEPATH += ../.. ..
-INCLUDEPATH += ../libmyth ../libavcodec ../libavutil ../libmythmpeg2
-INCLUDEPATH += ./dvbdev ./mpeg
+INCLUDEPATH += $${SOURCE} $${SOURCE}/.. $${SOURCE}/../libmyth
+INCLUDEPATH += $${SOURCE}/../libavcodec $${SOURCE}/../libavutil
+INCLUDEPATH += $${SOURCE}/../libmythmpeg2 $${SOURCE}/dvbdev $${SOURCE}/mpeg
 DEPENDPATH  += ../libmyth ../libavcodec ../libavformat ../libavutil
 DEPENDPATH  += ../libmythmpeg2 ../libmythdvdnav
 DEPENDPATH  += ./dvbdev ./mpeg ./hdhomerun
Index: libs/libmythtv/mpeg/pespacket.cpp
===================================================================
--- libs/libmythtv/mpeg/pespacket.cpp	(revision 10047)
+++ libs/libmythtv/mpeg/pespacket.cpp	(working copy)
@@ -5,7 +5,7 @@
 #include "mythcontext.h"
 
 extern "C" {
-#include "mythconfig.h"
+#include "config.h"
 #include "../libavcodec/avcodec.h"
 #include "../libavformat/avformat.h"
 #include "../libavutil/crc.h"
Index: libs/libmythtv/videosource.cpp
===================================================================
--- libs/libmythtv/videosource.cpp	(revision 10047)
+++ libs/libmythtv/videosource.cpp	(working copy)
@@ -20,7 +20,7 @@
 #include <qdir.h>
 
 // MythTV headers
-#include "mythconfig.h"
+#include "config.h"
 #include "mythwidgets.h"
 #include "mythcontext.h"
 #include "mythdbcon.h"
Index: libs/libmythtv/selectavcdevice.cpp
===================================================================
--- libs/libmythtv/selectavcdevice.cpp	(revision 10047)
+++ libs/libmythtv/selectavcdevice.cpp	(working copy)
@@ -4,7 +4,7 @@
  *  Distributed as part of MythTV under GPL v2 and later.
  */
 
-#include "mythconfig.h"
+#include "config.h"
 
 #ifdef CONFIG_DARWIN
 # include "mythcontext.h"
Index: libs/libmythtv/videoout_xv.cpp
===================================================================
--- libs/libmythtv/videoout_xv.cpp	(revision 10047)
+++ libs/libmythtv/videoout_xv.cpp	(working copy)
@@ -33,7 +33,7 @@
 #include "xvmctextures.h"
 
 // MythTV General headers
-#include "mythconfig.h"
+#include "config.h"
 #include "mythcontext.h"
 #include "filtermanager.h"
 #define IGNORE_TV_PLAY_REC
Index: libs/libmythtv/ivtvdecoder.cpp
===================================================================
--- libs/libmythtv/ivtvdecoder.cpp	(revision 10047)
+++ libs/libmythtv/ivtvdecoder.cpp	(working copy)
@@ -8,7 +8,7 @@
 
 using namespace std;
 
-#include "mythconfig.h"
+#include "config.h"
 #include "ivtvdecoder.h"
 #include "RingBuffer.h"
 #include "NuppelVideoPlayer.h"
Index: libs/libmythtv/tv_rec.cpp
===================================================================
--- libs/libmythtv/tv_rec.cpp	(revision 10047)
+++ libs/libmythtv/tv_rec.cpp	(working copy)
@@ -16,7 +16,7 @@
 #include <qsocket.h>
 
 // MythTV headers
-#include "mythconfig.h"
+#include "config.h"
 #include "tv_rec.h"
 #include "osd.h"
 #include "mythcontext.h"
Index: libs/libmythtv/tv_rec.h
===================================================================
--- libs/libmythtv/tv_rec.h	(revision 10047)
+++ libs/libmythtv/tv_rec.h	(working copy)
@@ -15,7 +15,7 @@
 #include "tv.h"
 #include "util.h"
 
-#include "mythconfig.h"
+#include "config.h"
 
 class QSocket;
 class NuppelVideoRecorder;
Index: libs/libmythtv/selectavcdevice.h
===================================================================
--- libs/libmythtv/selectavcdevice.h	(revision 10047)
+++ libs/libmythtv/selectavcdevice.h	(working copy)
@@ -7,7 +7,7 @@
 #ifndef LIBMYTHTV_SELECTAVCDEVICE_H_
 # define LIBMYTHTV_SELECTAVCDEVICE_H_
 
-# include "mythconfig.h"
+# include "config.h"
 
 # ifdef CONFIG_DARWIN
 #  undef always_inline
Index: libs/libmythmpeg2/libmythmpeg2.pro
===================================================================
--- libs/libmythmpeg2/libmythmpeg2.pro	(revision 10047)
+++ libs/libmythmpeg2/libmythmpeg2.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 
 TEMPLATE = lib
@@ -20,7 +25,7 @@
 inc.path = $${PREFIX}/include/mythtv/mpeg2dec/
 inc.files = mpeg2.h
 
-INCLUDEPATH += ../../libs/libavcodec
+INCLUDEPATH += $${SOURCE}/../../libs/libavcodec
 
 INSTALLS += inc
 
Index: libs/libmythsoundtouch/libmythsoundtouch.pro
===================================================================
--- libs/libmythsoundtouch/libmythsoundtouch.pro	(revision 10047)
+++ libs/libmythsoundtouch/libmythsoundtouch.pro	(working copy)
@@ -1,11 +1,16 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 
 TEMPLATE = lib
 TARGET = mythsoundtouch-$$LIBVERSION
 CONFIG += thread staticlib warn_off
 
-INCLUDEPATH += ../../libs/libavcodec ../..
+INCLUDEPATH += $${SOURCE}/../../libs/libavcodec ../..
 
 QMAKE_CXXFLAGS_RELEASE += -fPIC -DPIC
 QMAKE_CXXFLAGS_DEBUG   += -fPIC -DPIC
Index: libs/libavformat/libavformat.pro
===================================================================
--- libs/libavformat/libavformat.pro	(revision 10047)
+++ libs/libavformat/libavformat.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 
 TEMPLATE = lib
@@ -7,7 +12,7 @@
 target.path = $${LIBDIR}
 INSTALLS = target
 
-INCLUDEPATH += ../ ../../ ../libavcodec ../libavutil ../libmythtv
+INCLUDEPATH += ../ ../../ $${SOURCE}/../libavcodec $${SOURCE}/../libavutil $${SOURCE}/../libmythtv
 
 DEFINES += HAVE_AV_CONFIG_H _LARGEFILE_SOURCE
 
Index: libs/libmythsamplerate/libmythsamplerate.pro
===================================================================
--- libs/libmythsamplerate/libmythsamplerate.pro	(revision 10047)
+++ libs/libmythsamplerate/libmythsamplerate.pro	(working copy)
@@ -1,11 +1,16 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 
 TEMPLATE = lib
 TARGET = mythsamplerate-$$LIBVERSION
 CONFIG += thread staticlib warn_off
 
-INCLUDEPATH += ../../ 
+INCLUDEPATH += $${SOURCE}/../../ 
 
 QMAKE_CFLAGS_RELEASE = $$OPTFLAGS -DHAVE_AV_CONFIG_H -I.. -fPIC -DPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
 QMAKE_CFLAGS_DEBUG = -g -DHAVE_AV_CONFIG_H -I.. -fPIC -DPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
Index: libs/libmythsamplerate/samplerate.c
===================================================================
--- libs/libmythsamplerate/samplerate.c	(revision 10047)
+++ libs/libmythsamplerate/samplerate.c	(working copy)
@@ -20,7 +20,7 @@
 #include	<stdlib.h>
 #include	<string.h>
 
-#include	"../libmyth/mythconfig.h"
+#include	"config.h"
 
 #include	"samplerate.h"
 #include	"common.h"
Index: libs/libmythui/libmythui.pro
===================================================================
--- libs/libmythui/libmythui.pro	(revision 10047)
+++ libs/libmythui/libmythui.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 
 TEMPLATE = lib
@@ -7,8 +12,8 @@
 target.path = $${LIBDIR}
 INSTALLS = target
 
-INCLUDEPATH += ../libmyth
-INCLUDEPATH += ../.. ../
+INCLUDEPATH += $${SOURCE}/../libmyth
+INCLUDEPATH += $${SOURCE}/../.. $${SOURCE}/..
 
 DEPENDPATH += ../libmyth .
 
Index: libs/libmyth/mythcdrom.cpp
===================================================================
--- libs/libmyth/mythcdrom.cpp	(revision 10047)
+++ libs/libmyth/mythcdrom.cpp	(working copy)
@@ -1,7 +1,7 @@
 #include "mythcdrom.h"
 #include <sys/stat.h>
 
-#include "mythconfig.h"
+#include "config.h"
 #include "mythcontext.h"
 
 // For testing
Index: libs/libmyth/mythmedia.cpp
===================================================================
--- libs/libmyth/mythmedia.cpp	(revision 10047)
+++ libs/libmyth/mythmedia.cpp	(working copy)
@@ -10,7 +10,7 @@
 
 // MythTV headers
 #include "mythmedia.h"
-#include "mythconfig.h"
+#include "config.h"
 #include "mythcontext.h"
 #include "util.h"
 
Index: libs/libmyth/util.cpp
===================================================================
--- libs/libmyth/util.cpp	(revision 10047)
+++ libs/libmyth/util.cpp	(working copy)
@@ -30,7 +30,7 @@
 #include <qfont.h>
 
 // Myth headers
-#include "mythconfig.h"
+#include "config.h"
 #include "exitcodes.h"
 #include "util.h"
 #include "mythcontext.h"
Index: libs/libmyth/libmyth.pro
===================================================================
--- libs/libmyth/libmyth.pro	(revision 10047)
+++ libs/libmyth/libmyth.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
  
 TEMPLATE = lib
@@ -33,7 +38,7 @@
 SOURCES += DisplayResScreen.cpp util-x11.cpp qmdcodec.cpp
 SOURCES += virtualkeyboard.cpp mythobservable.cpp mythsocket.cpp
 
-INCLUDEPATH += ../libmythsamplerate ../libmythsoundtouch ../.. ../
+INCLUDEPATH += $${SOURCE}/../libmythsamplerate $${SOURCE}/../libmythsoundtouch $${SOURCE}/../.. $${SOURCE}/../
 DEPENDPATH += ../libmythsamplerate ../libmythsoundtouch ../ ../libmythui
 
 LIBS += -L../libmythsamplerate -lmythsamplerate-$${LIBVERSION}
@@ -56,7 +61,7 @@
 inc.files += audiooutput.h inetcomms.h httpcomms.h mythmedia.h mythwizard.h
 inc.files += uilistbtntype.h generictree.h managedlist.h
 inc.files += visual.h volumebase.h output.h langsettings.h qmdcodec.h
-inc.files += exitcodes.h mythconfig.h mythconfig.mak virtualkeyboard.h
+inc.files += exitcodes.h config.h mythconfig.mak virtualkeyboard.h
 inc.files += mythevent.h mythobservable.h mythsocket.h
 
 using_oss {
Index: libs/libmyth/mythmediamonitor.cpp
===================================================================
--- libs/libmyth/mythmediamonitor.cpp	(revision 10047)
+++ libs/libmyth/mythmediamonitor.cpp	(working copy)
@@ -29,7 +29,7 @@
 #include "mythmediamonitor.h"
 #include "mythcontext.h"
 #include "mythdialogs.h"
-#include "mythconfig.h"
+#include "config.h"
 #include "mythcdrom.h"
 #include "mythhdd.h"
 
Index: libs/libavcodec/libavcodec.pro
===================================================================
--- libs/libavcodec/libavcodec.pro	(revision 10047)
+++ libs/libavcodec/libavcodec.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 
 TEMPLATE = lib
@@ -7,7 +12,7 @@
 target.path = $${LIBDIR}
 INSTALLS = target
 
-INCLUDEPATH = ../ ../../ ../libavutil
+INCLUDEPATH += ../ ../../  $${SOURCE}/../libavutil
 
 DEFINES += HAVE_AV_CONFIG_H _LARGEFILE_SOURCE
 
Index: libs/libavutil/libavutil.pro
===================================================================
--- libs/libavutil/libavutil.pro	(revision 10047)
+++ libs/libavutil/libavutil.pro	(working copy)
@@ -1,4 +1,10 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+    INCLUDEPATH += $$SRC_PATH
+}
 include ( ../../settings.pro )
 
 TEMPLATE = lib
@@ -8,7 +14,7 @@
 target.path = $${LIBDIR}
 INSTALLS = target
 
-INCLUDEPATH = ../ ../../
+INCLUDEPATH += ../ ../../
 
 DEFINES += HAVE_AV_CONFIG_H _LARGEFILE_SOURCE
 
Index: libs/libmythdvdnav/libmythdvdnav.pro
===================================================================
--- libs/libmythdvdnav/libmythdvdnav.pro	(revision 10047)
+++ libs/libmythdvdnav/libmythdvdnav.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 
 TEMPLATE = lib
Index: libs/libmythfreemheg/libmythfreemheg.pro
===================================================================
--- libs/libmythfreemheg/libmythfreemheg.pro	(revision 10047)
+++ libs/libmythfreemheg/libmythfreemheg.pro	(working copy)
@@ -1,7 +1,12 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 
-INCLUDEPATH += ../libmythtv
+INCLUDEPATH += $${SOURCE}/../libmythtv
 
 TEMPLATE = lib
 TARGET = mythfreemheg-$$LIBVERSION
Index: programs/mythuitest/mythuitest.pro
===================================================================
--- programs/mythuitest/mythuitest.pro	(revision 10047)
+++ programs/mythuitest/mythuitest.pro	(working copy)
@@ -1,14 +1,17 @@
-INCLUDEPATH += ../../libs/libmythui ../../libs/libmyth
-
-LIBS += -L../../libs/libmyth -L../../libs/libmythui
-
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 
 TEMPLATE = app
 TARGET = mythuitest
 CONFIG += thread opengl
 
+INCLUDEPATH += $${SOURCE}/../../libs/libmythui $${SOURCE}/../../libs/libmyth
+LIBS += -L../../libs/libmyth -L../../libs/libmythui
 LIBS += -lmythui-$$LIBVERSION -lmyth-$$LIBVERSION $$EXTRA_LIBS
 
 isEmpty(QMAKE_EXTENSION_SHLIB) {
Index: programs/programs-libs.pro
===================================================================
--- programs/programs-libs.pro	(revision 10047)
+++ programs/programs-libs.pro	(working copy)
@@ -1,5 +1,7 @@
-INCLUDEPATH += ../../libs/ ../../libs/libmyth ../../libs/libmythtv  ../..
-INCLUDEPATH += ../../libs/libavutil ../../libs/libavformat ../../libs/libavcodec
+INCLUDEPATH += $${SOURCE}/../../libs/ $${SOURCE}/../../libs/libmyth 
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv  $${SOURCE}/../..
+INCLUDEPATH += $${SOURCE}/../../libs/libavutil $${SOURCE}/../../libs/libavformat 
+INCLUDEPATH += $${SOURCE}/../../libs/libavcodec
 
 LIBS += -L../../libs/libmyth -L../../libs/libmythtv
 LIBS += -L../../libs/libavutil -L../../libs/libavcodec -L../../libs/libavformat
Index: programs/mythfrontend/globalsettings.cpp
===================================================================
--- programs/mythfrontend/globalsettings.cpp	(revision 10047)
+++ programs/mythfrontend/globalsettings.cpp	(working copy)
@@ -7,7 +7,7 @@
 #include <qdir.h>
 #include <qimage.h>
 
-#include "mythconfig.h"
+#include "config.h"
 #include "mythcontext.h"
 #include "mythdbcon.h"
 #include "dbsettings.h"
Index: programs/mythfrontend/main.cpp
===================================================================
--- programs/mythfrontend/main.cpp	(revision 10047)
+++ programs/mythfrontend/main.cpp	(working copy)
@@ -14,7 +14,7 @@
 #include <iostream>
 using namespace std;
 
-#include "mythconfig.h"
+#include "config.h"
 #include "tv.h"
 #include "proglist.h"
 #include "progfind.h"
Index: programs/mythfrontend/mythfrontend.pro
===================================================================
--- programs/mythfrontend/mythfrontend.pro	(revision 10047)
+++ programs/mythfrontend/mythfrontend.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 include ( ../../version.pro )
 include ( ../programs-libs.pro )
Index: programs/mythjobqueue/mythjobqueue.pro
===================================================================
--- programs/mythjobqueue/mythjobqueue.pro	(revision 10047)
+++ programs/mythjobqueue/mythjobqueue.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro)
 include ( ../programs-libs.pro)
 
Index: programs/mythtranscode/replex/replex.pro
===================================================================
--- programs/mythtranscode/replex/replex.pro	(revision 10047)
+++ programs/mythtranscode/replex/replex.pro	(working copy)
@@ -1,4 +1,11 @@
 include ( ../../../config.mak )
+
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../../../settings.pro)
 
 TEMPLATE = app
Index: programs/mythtranscode/mythtranscode.pro
===================================================================
--- programs/mythtranscode/mythtranscode.pro	(revision 10047)
+++ programs/mythtranscode/mythtranscode.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro)
 include ( ../programs-libs.pro)
 
@@ -17,6 +22,6 @@
 HEADERS += replex/element.h replex/mpg_common.h replex/multiplex.h \
            replex/pes.h     replex/ringbuffer.h
 
-INCLUDEPATH += replex
-INCLUDEPATH += ../../libs/libavcodec ../../libs/libavformat \
-               ../../libs/libavutil  ../../libs/libmythmpeg2
+INCLUDEPATH += $${SOURCE}/replex
+INCLUDEPATH += $${SOURCE}/../../libs/libavcodec $${SOURCE}/../../libs/libavformat \
+               $${SOURCE}/../../libs/libavutil  $${SOURCE}/../../libs/libmythmpeg2
Index: programs/mythcommflag/mythcommflag.pro
===================================================================
--- programs/mythcommflag/mythcommflag.pro	(revision 10047)
+++ programs/mythcommflag/mythcommflag.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include (../../settings.pro)
 include ( ../programs-libs.pro )
 
Index: programs/mythbackend/mythbackend.pro
===================================================================
--- programs/mythbackend/mythbackend.pro	(revision 10047)
+++ programs/mythbackend/mythbackend.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 include ( ../../version.pro )
 include ( ../programs-libs.pro )
Index: programs/mythbackend/main.cpp
===================================================================
--- programs/mythbackend/main.cpp	(revision 10047)
+++ programs/mythbackend/main.cpp	(working copy)
@@ -11,7 +11,7 @@
 #include <signal.h>
 #include <cerrno>
 
-#include "mythconfig.h"
+#include "config.h"
 #ifdef CONFIG_DARWIN
     #include <sys/aio.h>    // O_SYNC
 #endif
Index: programs/mythtv-setup/mythtv-setup.pro
===================================================================
--- programs/mythtv-setup/mythtv-setup.pro	(revision 10047)
+++ programs/mythtv-setup/mythtv-setup.pro	(working copy)
@@ -1,5 +1,11 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
+
 include ( ../programs-libs.pro )
 
 TEMPLATE = app
Index: programs/programs.pro
===================================================================
--- programs/programs.pro	(revision 10047)
+++ programs/programs.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../settings.pro )
 
 TEMPLATE = subdirs
Index: programs/mythlcdserver/mythlcdserver.pro
===================================================================
--- programs/mythlcdserver/mythlcdserver.pro	(revision 10047)
+++ programs/mythlcdserver/mythlcdserver.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 include ( ../programs-libs.pro )
 
Index: programs/mythtv/mythtv.pro
===================================================================
--- programs/mythtv/mythtv.pro	(revision 10047)
+++ programs/mythtv/mythtv.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 include ( ../programs-libs.pro )
 
Index: programs/mythwelcome/mythwelcome.pro
===================================================================
--- programs/mythwelcome/mythwelcome.pro	(revision 10047)
+++ programs/mythwelcome/mythwelcome.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include (../../settings.pro)
 include (../programs-libs.pro)
 
Index: programs/mythtvosd/mythtvosd.pro
===================================================================
--- programs/mythtvosd/mythtvosd.pro	(revision 10047)
+++ programs/mythtvosd/mythtvosd.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 
 TEMPLATE = app
@@ -8,7 +13,7 @@
 INSTALLS = target
 
 LIBS += $$EXTRA_LIBS 
-INCLUDEPATH += ../../libs/libmyth
+INCLUDEPATH += $${SOURCE}/../../libs/libmyth
 
 QMAKE_CLEAN += $(TARGET)
 
Index: programs/mythfilldatabase/mythfilldatabase.pro
===================================================================
--- programs/mythfilldatabase/mythfilldatabase.pro	(revision 10047)
+++ programs/mythfilldatabase/mythfilldatabase.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include ( ../../settings.pro )
 include ( ../programs-libs.pro )
 
@@ -9,7 +14,7 @@
 target.path = $${PREFIX}/bin
 INSTALLS = target
 
-INCLUDEPATH += ../../libs/libmyth ./../libs/libmythtv
+INCLUDEPATH += $${SOURCE}../../libs/libmyth $${SOURCE}/../libs/libmythtv
 DEPENDPATH  += ../../libs/libmyth ./../libs/libmythtv
 
 QMAKE_CLEAN += $(TARGET)
Index: programs/mythshutdown/mythshutdown.pro
===================================================================
--- programs/mythshutdown/mythshutdown.pro	(revision 10047)
+++ programs/mythshutdown/mythshutdown.pro	(working copy)
@@ -1,4 +1,9 @@
 include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
 include (../../settings.pro)
 include (../programs-libs.pro)
 
Index: filters/linearblend/linearblend.pro
===================================================================
--- filters/linearblend/linearblend.pro	(revision 10047)
+++ filters/linearblend/linearblend.pro	(working copy)
@@ -1,7 +1,14 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
 include ( ../filter-avcodec.pro )
 
-INCLUDEPATH += ../../libs/libmythtv ../..
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv $${SOURCE}/../..
 
 # Input
 SOURCES += filter_linearblend.c
Index: filters/convert/convert.pro
===================================================================
--- filters/convert/convert.pro	(revision 10047)
+++ filters/convert/convert.pro	(working copy)
@@ -1,6 +1,13 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
 
-INCLUDEPATH += ../../libs/libmythtv
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv
 
 # Input
 SOURCES += filter_convert.c
Index: filters/quickdnr/quickdnr.pro
===================================================================
--- filters/quickdnr/quickdnr.pro	(revision 10047)
+++ filters/quickdnr/quickdnr.pro	(working copy)
@@ -1,7 +1,14 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
 include ( ../filter-avcodec.pro )
 
-INCLUDEPATH += ../../libs/libmythtv ../../libs/libavcodec ../..
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv $${SOURCE}/../../libs/libavcodec $${SOURCE}/../..
 
 # Input
 SOURCES += filter_quickdnr.c
Index: filters/postprocess/postprocess.pro
===================================================================
--- filters/postprocess/postprocess.pro	(revision 10047)
+++ filters/postprocess/postprocess.pro	(working copy)
@@ -1,7 +1,14 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
 include ( ../filter-avcodec.pro )
 
-INCLUDEPATH += ../../libs/libmythtv
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv
 DEPENDPATH  += ../../libs/libmythtv
 
 SOURCES += filter_postprocess.c
Index: filters/onefield/onefield.pro
===================================================================
--- filters/onefield/onefield.pro	(revision 10047)
+++ filters/onefield/onefield.pro	(working copy)
@@ -1,6 +1,13 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
 
-INCLUDEPATH += ../../libs/libmythtv
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv
 
 # Input
 SOURCES += filter_onefield.c
Index: filters/bobdeint/bobdeint.pro
===================================================================
--- filters/bobdeint/bobdeint.pro	(revision 10047)
+++ filters/bobdeint/bobdeint.pro	(working copy)
@@ -1,6 +1,13 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
 
-INCLUDEPATH += ../../libs/libmythtv
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv
 
 # Input
 SOURCES += filter_bobdeint.c
Index: filters/filter-avcodec.pro
===================================================================
--- filters/filter-avcodec.pro	(revision 10047)
+++ filters/filter-avcodec.pro	(working copy)
@@ -3,7 +3,7 @@
 # This eliminates a linker warning
 CONFIG += qt
 
-INCLUDEPATH += ../../libs/libavcodec ../../libs/libavutil
+INCLUDEPATH += $${SOURCE}/../../libs/libavcodec $${SOURCE}/../../libs/libavutil
 DEPENDPATH  += ../../libs/libavcodec ../../libs/libavutil
 
 LIBS += -L../../libs/libavutil -lmythavutil-$${LIBVERSION}
Index: filters/adjust/adjust.pro
===================================================================
--- filters/adjust/adjust.pro	(revision 10047)
+++ filters/adjust/adjust.pro	(working copy)
@@ -1,7 +1,14 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
 include ( ../filter-avcodec.pro )
 
-INCLUDEPATH += ../../libs/libmythtv ../../libs/libavcodec ../..
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv $${SOURCE}/../../libs/libavcodec $${SOURCE}/../..
 
 # Input
 SOURCES += filter_adjust.c
Index: filters/force/force.pro
===================================================================
--- filters/force/force.pro	(revision 10047)
+++ filters/force/force.pro	(working copy)
@@ -1,6 +1,13 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
 
-INCLUDEPATH += ../../libs/libmythtv
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv
 
 # Input
 SOURCES += filter_force.c
Index: filters/crop/crop.pro
===================================================================
--- filters/crop/crop.pro	(revision 10047)
+++ filters/crop/crop.pro	(working copy)
@@ -1,7 +1,14 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
 include ( ../filter-avcodec.pro )
 
-INCLUDEPATH += ../../libs/libmythtv ../../libs/libavcodec ../..
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv $${SOURCE}/../../libs/libavcodec $${SOURCE}/../..
 
 # Input
 SOURCES += filter_crop.c
Index: filters/kerneldeint/kerneldeint.pro
===================================================================
--- filters/kerneldeint/kerneldeint.pro	(revision 10047)
+++ filters/kerneldeint/kerneldeint.pro	(working copy)
@@ -1,7 +1,14 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
 include ( ../filter-avcodec.pro )
 
-INCLUDEPATH += ../../libs/libmythtv ../../libs/libavcodec ../..
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv $${SOURCE}/../../libs/libavcodec $${SOURCE}/../..
 
 # Input
 SOURCES += filter_kerneldeint.c
Index: filters/ivtc/ivtc.pro
===================================================================
--- filters/ivtc/ivtc.pro	(revision 10047)
+++ filters/ivtc/ivtc.pro	(working copy)
@@ -1,6 +1,17 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
+include ( ../filter-avcodec.pro )
 
-INCLUDEPATH += ../../libs/libmythtv ../..
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv $${SOURCE}/../../libs/libavcodec $${SOURCE}/../..
 
+
+#INCLUDEPATH += $${SOURCE}../../libs/libmythtv $${SOURCE}/../..
+
 # Input
 SOURCES += pullup.c filter_ivtc.c
Index: filters/invert/invert.pro
===================================================================
--- filters/invert/invert.pro	(revision 10047)
+++ filters/invert/invert.pro	(working copy)
@@ -1,6 +1,13 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
 
-INCLUDEPATH += ../../libs/libmythtv
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv
 
 # Input
 SOURCES += filter_invert.c
Index: filters/denoise3d/denoise3d.pro
===================================================================
--- filters/denoise3d/denoise3d.pro	(revision 10047)
+++ filters/denoise3d/denoise3d.pro	(working copy)
@@ -1,7 +1,14 @@
+include ( ../../config.mak )
+SOURCE=.
+exists ( sourcedir ) {
+    SOURCE=$$system( readlink sourcedir )
+    VPATH=$$SOURCE
+}
+
 include ( ../filter-common.pro )
 include ( ../filter-avcodec.pro )
 
-INCLUDEPATH += ../../libs/libmythtv ../../libs/libavcodec ../..
+INCLUDEPATH += $${SOURCE}/../../libs/libmythtv $${SOURCE}/../../libs/libavcodec $${SOURCE}/../..
 
 # Input
 SOURCES += filter_denoise3d.c
