diff --git a/.gitattributes b/.gitattributes
index b3f95ea9d9a25552c312d56c83544b9d97758ce3..0cda5f58273a4c43ab4b3d1a30c8bb8a45bf10d7 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -270,7 +270,6 @@ LCS/Common/src/Common-Model.cat -text
 LCS/LACE/bootstrap -text
 LCS/Stream/bootstrap -text
 LCS/Tools/config.h.cmake -text
-LCS/Tools/lofar_config.h.cmake -text
 LCS/Tools/src/countalllines -text
 LCS/Tools/src/countlines -text
 LCS/Tools/src/countpurecode -text
diff --git a/CMake/LofarConfig.cmake b/CMake/LofarConfig.cmake
index ea686d96cb9f7ecccce4a3d4c69093229b29c097..c3c3f0c0a43853d4c146d00662f8675abd04a119 100644
--- a/CMake/LofarConfig.cmake
+++ b/CMake/LofarConfig.cmake
@@ -18,12 +18,26 @@
 #  along with this program; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+# Only process this file when we're ate the top-level source directory.
+if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
 
-# Configure header containing global configurations for LOFAR builds. 
-# We should only do this when we're at the top-level source directory.
-if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
+  # Configure header containing global configurations for LOFAR builds. 
   message(STATUS "Generating lofar_config.h ...")
   configure_file(
-    ${LOFAR_ROOT}/lofar_config.h.cmake
+    ${CMAKE_SOURCE_DIR}/lofar_config.h.cmake
     ${CMAKE_BINARY_DIR}/include/lofar_config.h)
-endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
+
+  # Configure the lofarinit script files and mark them for install
+  message(STATUS "Generating lofarinit scripts ...")
+  configure_file(
+    ${CMAKE_SOURCE_DIR}/lofarinit.sh.in
+    ${CMAKE_BINARY_DIR}/lofarinit.sh @ONLY)
+  configure_file(
+    ${CMAKE_SOURCE_DIR}/lofarinit.csh.in
+    ${CMAKE_BINARY_DIR}/lofarinit.csh @ONLY)
+  install(FILES
+    ${CMAKE_BINARY_DIR}/lofarinit.sh
+    ${CMAKE_BINARY_DIR}/lofarinit.csh
+    DESTINATION .)
+
+endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
diff --git a/LCS/Tools/lofar_config.h.cmake b/LCS/Tools/lofar_config.h.cmake
deleted file mode 100644
index 525dee6b88064de4ca461bff09983352a2ebf763..0000000000000000000000000000000000000000
--- a/LCS/Tools/lofar_config.h.cmake
+++ /dev/null
@@ -1,124 +0,0 @@
-/* config.h.cmake.  [LOFAR.LCS.Tools].  */
-
-/* Define if building universal (internal helper macro) */
-#cmakedefine AC_APPLE_UNIVERSAL_BUILD
-
-/* Define as __PRETTY_FUNCTION__, __FUNCTION__, or "<unknown>" */
-#cmakedefine AUTO_FUNCTION_NAME
-
-/* Define if DbgAssert is enabled */
-#cmakedefine ENABLE_DBGASSERT
-
-/* Define if TRACER is enabled */
-#cmakedefine ENABLE_TRACER
-
-/* Define if backtrace() is available */
-#cmakedefine HAVE_BACKTRACE
-
-/* Define if libbfd is available */
-#cmakedefine HAVE_BFD
-
-/* Define to 1 if you have the `cplus_demangle' function. */
-#cmakedefine HAVE_CPLUS_DEMANGLE
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#cmakedefine HAVE_DLFCN_H
-
-/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
-#cmakedefine HAVE_DOPRNT
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#cmakedefine HAVE_INTTYPES_H
-
-/* Define if LOG4CPLUS is installed */
-#cmakedefine HAVE_LOG4CPLUS
-
-/* Define if LOG4CXX is installed */
-#cmakedefine HAVE_LOG4CXX
-
-/* Define if `long long' is supported */
-#cmakedefine HAVE_LONG_LONG
-
-/* Define to 1 if you have the <memory.h> header file. */
-#cmakedefine HAVE_MEMORY_H
-
-/* Define if using Rational Purify */
-#cmakedefine HAVE_PURIFY
-
-/* Defined if shared memory is used */
-#cmakedefine HAVE_SHMEM
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#cmakedefine HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#cmakedefine HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#cmakedefine HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#cmakedefine HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#cmakedefine HAVE_SYS_TYPES_H
-
-/* Define if `uint' is supported */
-#cmakedefine HAVE_UINT
-
-/* Define if `ulong' is supported */
-#cmakedefine HAVE_ULONG
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#cmakedefine HAVE_UNISTD_H
-
-/* Define if `ushort' is supported */
-#cmakedefine HAVE_USHORT
-
-/* Define to 1 if you have the `vprintf' function. */
-#cmakedefine HAVE_VPRINTF
-
-/* Define if we are compiling with debugging information */
-#cmakedefine LOFAR_DEBUG
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#cmakedefine LT_OBJDIR
-
-/* Define to the address where bug reports for this package should be sent. */
-#cmakedefine PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#cmakedefine PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#cmakedefine PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#cmakedefine PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#cmakedefine PACKAGE_VERSION
-
-/* Define RPM release nr */
-#cmakedefine RPM_RELEASE
-
-/* Define to 1 if you have the ANSI C header files. */
-#cmakedefine STDC_HEADERS
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#cmakedefine WORDS_BIGENDIAN
-
-/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
-   `char[]'. */
-#cmakedefine YYTEXT_POINTER
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#cmakedefine const
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#cmakedefine size_t
diff --git a/LCS/Tools/src/CMakeLists.txt b/LCS/Tools/src/CMakeLists.txt
index ba5c69f707579ceb215688d1bd677a56ef0079a2..fb14af0c15fda303082b84ad498ac59701c3a5fc 100644
--- a/LCS/Tools/src/CMakeLists.txt
+++ b/LCS/Tools/src/CMakeLists.txt
@@ -61,13 +61,3 @@ install(FILES
   templates/test.sh_template  		      
   templates/test_makefile.am_template
   DESTINATION share/templates)
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lofarinit.sh.in
-               ${CMAKE_BINARY_DIR}/lofarinit.sh @ONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lofarinit.csh.in
-               ${CMAKE_BINARY_DIR}/lofarinit.csh @ONLY)
-
-install(FILES
-  ${CMAKE_BINARY_DIR}/lofarinit.sh
-  ${CMAKE_BINARY_DIR}/lofarinit.csh
-  DESTINATION .)
diff --git a/LCS/Tools/src/Makefile.am b/LCS/Tools/src/Makefile.am
index 01d2cd9cf3f182e6fee2bde7737231d95d62e4bd..a58abb5ee45602c9feb579d22c85272631f450ae 100644
--- a/LCS/Tools/src/Makefile.am
+++ b/LCS/Tools/src/Makefile.am
@@ -42,7 +42,7 @@ dist_template_DATA  = templates/header.cc_template \
 # They have to be sourced; fill in the correct path. 
 install-data-local:
 	@for FIL in lofarinit.sh lofarinit.csh; do \
-	  sed -e "s%[@]prefix[@]%$(prefix)%" -e "s%[@]libdir[@]%$(libdir)%" $(srcdir)/$$FIL.in > $$FIL.tmp; \
+	  sed -e "s%[@]prefix[@]%$(prefix)%" -e "s%[@]libdir[@]%$(libdir)%" $(lofar_top_srcdir)/$$FIL.in > $$FIL.tmp; \
 	  echo "$(INSTALL_DATA) $$FIL.tmp $(prefix)/$$FIL"; \
 	  $(INSTALL_DATA) $$FIL.tmp $(prefix)/$$FIL; \
 	  $(RM) $$FIL.tmp; \
diff --git a/LCS/Tools/src/lofarinit.csh.in b/lofarinit.csh.in
similarity index 100%
rename from LCS/Tools/src/lofarinit.csh.in
rename to lofarinit.csh.in
diff --git a/LCS/Tools/src/lofarinit.sh.in b/lofarinit.sh.in
similarity index 100%
rename from LCS/Tools/src/lofarinit.sh.in
rename to lofarinit.sh.in