diff --git a/.gitattributes b/.gitattributes
index 1e60a0e2eca371d2d32d11fc2c8b412f6180dac3..1a9edd2473510ad285fd313039aa96435d876bdc 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -234,6 +234,7 @@ MAC/APL/Navigator/source/RCUplot2.gps -text svneol=native#application/octet-stre
 MAC/APL/Navigator/source/RCUplot3.gps -text svneol=native#application/octet-stream
 MAC/APL/Navigator/source/RCUplot4.gps -text svneol=native#application/octet-stream
 MAC/APL/PAC/BeamServer/test/weights.dat -text svneol=unset#unset
+MAC/APL/PAC/CAL_Protocol/package.doc -text
 MAC/APL/PAC/_StationOperations/Makefile.am -text svneol=native#application/octet-stream
 MAC/APL/PAC/_StationOperations/bootstrap -text svneol=native#application/octet-stream
 MAC/APL/PAC/_StationOperations/configure.in -text svneol=native#application/octet-stream
diff --git a/MAC/APL/PAC/CAL_Protocol/CAL_Protocol.spec.in b/MAC/APL/PAC/CAL_Protocol/CAL_Protocol.spec.in
new file mode 100644
index 0000000000000000000000000000000000000000..9b2db864eb3e6b51f0c411d60d01322a92ff4f1d
--- /dev/null
+++ b/MAC/APL/PAC/CAL_Protocol/CAL_Protocol.spec.in
@@ -0,0 +1,162 @@
+# -*- Mode:rpm-spec -*-
+# CAL_Protocol.spec.in
+#
+
+##############################################################################
+#
+# Preamble
+#
+##############################################################################
+
+Summary: The CAL_Protocol library can be used to communicate with the CalServer calibration process.
+
+%define release @RPM_RELEASE@
+%define version @VERSION@
+%define pkgname @PACKAGE@
+%define pkgdir %{pkgname}-%{version}-%{release}
+%define prefix /opt/lofar
+%define configure_args @RPM_CONFIGURE_ARGS@
+##define build_kernel_version @BUILD_KERNEL_VERSION@
+
+Name: %{pkgname}
+Version: %{version}
+Release: %{release}
+Copyright: LGPL
+Group: Application/System
+Source: %{pkgname}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{pkgdir}-root
+URL: http://www.astron.nl
+Prefix: %{prefix}
+BuildArchitectures: i386 # Target platforms, i.e., i586
+##Requires: Common = 1.2   ## define dependent packages here
+Packager: %{packager}
+Distribution: The LOFAR project
+Vendor: ASTRON
+
+AutoReqProv: no
+
+%description
+
+The CAL_Protocol library implements the protocol towards the CalServer calibration
+process. Any programs wishing to communicate with the CalServer can use this
+library.
+
+##############################################################################
+#
+# prep
+#
+##############################################################################
+%prep
+echo $prefix
+
+# create the build directory, untar the source
+%setup
+
+##############################################################################
+#
+# build
+#
+##############################################################################
+%build
+./configure %{configure_args} --prefix=%{prefix} && make
+
+##############################################################################
+#
+# install
+#
+##############################################################################
+%install
+# To make things work with BUILDROOT
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+mkdir -p $RPM_BUILD_ROOT%{prefix}
+make DESTDIR="$RPM_BUILD_ROOT" install
+
+#uninstall
+
+##############################################################################
+#
+# verify
+#
+##############################################################################
+#verify
+
+##############################################################################
+#
+# clean
+#
+##############################################################################
+%clean
+# Call me paranoid, but I do not want to be responsible for nuking
+# someone's harddrive!
+if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
+then
+  echo
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo @                                                                    @
+  echo @  RPM_BUILD_ROOT is not what I expected.  Please clean it yourself. @
+  echo @                                                                    @
+  echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  echo
+else
+  echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
+  rm -rf "$RPM_BUILD_ROOT"
+fi
+
+##############################################################################
+#
+# files
+#
+##############################################################################
+
+# empty 'files' means all distributed files
+%files
+%defattr(-, root, root)
+%{prefix}
+
+# Your application file list goes here
+# %{prefix}/lib/lib*.so*
+
+# Documentation
+# doc COPYING ChangeLog README AUTHORS NEWS
+# doc doc/*
+
+# link the module to the correct path
+%post 
+
+# before uninstall
+%preun
+
+# after uninstall
+%postun
+
+##############################################################################
+#
+# package devel
+#
+##############################################################################
+
+#package devel
+#Summary: Development files for %{pkgname}
+#Group: Applications/System
+#description devel
+#Development files for %{pkgname}.
+
+#files devel
+
+# Your development files go here
+# Programmers documentation goes here
+#doc doc
+
+# end of file
diff --git a/MAC/APL/PAC/CAL_Protocol/Makefile.am b/MAC/APL/PAC/CAL_Protocol/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..81e473d40054b2cc26de2c05a00997d3e7d77a4c
--- /dev/null
+++ b/MAC/APL/PAC/CAL_Protocol/Makefile.am
@@ -0,0 +1,11 @@
+SUBDIRS=src test include
+
+DISTCHECK_CONFIGURE_FLAGS=\
+      --with-common=$(prefix)
+
+EXTRA_DIST = \
+      Makefile.common \
+      CAL_Protocol.spec \
+      autoconf_share/compiletool
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/APL/PAC/CAL_Protocol/bootstrap b/MAC/APL/PAC/CAL_Protocol/bootstrap
new file mode 100755
index 0000000000000000000000000000000000000000..7f674c416802db5e7c438f093a99e63f63c784aa
--- /dev/null
+++ b/MAC/APL/PAC/CAL_Protocol/bootstrap
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+../../../../autoconf_share/bootstrap ../../../../autoconf_share
diff --git a/MAC/APL/PAC/CAL_Protocol/configure.in b/MAC/APL/PAC/CAL_Protocol/configure.in
new file mode 100644
index 0000000000000000000000000000000000000000..4209dbf9e2c5b092cbee1359b10f2799b7efb0b2
--- /dev/null
+++ b/MAC/APL/PAC/CAL_Protocol/configure.in
@@ -0,0 +1,71 @@
+dnl
+dnl Process this file with autoconf to produce a configure script.
+dnl
+AC_INIT
+dnl AC_CONFIG_AUX_DIR(config)
+dnl AM_CONFIG_HEADER(config/config.h)
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(CAL_Protocol, 1.0, no-define)
+
+dnl Initialize for LOFAR (may set compilers)
+lofar_INIT
+
+dnl Checks for programs.
+AC_PROG_AWK
+AC_PROG_YACC
+AC_PROG_CC
+AC_PROG_CXX
+AM_PROG_LEX
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_DISABLE_SHARED
+AC_PROG_LIBTOOL
+
+dnl Checks for libraries.
+
+dnl dnl Replace `main' with a function in -lfl:
+dnl AC_CHECK_LIB(fl, main)
+dnl dnl Replace `main' with a function in -lcosev_r:
+dnl AC_CHECK_LIB(cosev_r, main)
+dnl dnl Replace `main' with a function in -lcosnm_r:
+dnl AC_CHECK_LIB(cosnm_r, main)
+dnl dnl Replace `main' with a function in -lorb_r:
+dnl AC_CHECK_LIB(orb_r, main)
+dnl dnl Replace `main' with a function in -lpthread:
+dnl AC_CHECK_LIB(pthread, main)
+dnl dnl Replace `main' with a function in -lvport_r:
+dnl AC_CHECK_LIB(vport_r, main)
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(unistd.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_SIZE_T
+
+dnl Checks for library functions.
+AC_FUNC_VPRINTF
+
+dnl
+dnl Check for LOFAR specific things
+dnl
+lofar_GENERAL
+lofar_INTERNAL(LCS/Common, common, LCS-Common-2_3, 1, Common/LofarTypes.h,,)
+lofar_INTERNAL(MAC/GCF/TM, GCFTM, MAC-GCF-6_0, 1, GCF/TM/GCF_Control.h,,)
+lofar_INTERNAL(MAC/GCF/GCFCommon, GCFCommon, MAC-GCF-6_0, 1, GCF/GCF_Defines.h,,)
+lofar_INTERNAL(MAC/APL/RTCCommon, RTCCommon, MAC-RTC-4_0, 1, APL/RTCCommon/Marshalling.h,,)
+lofar_EXTERNAL(BLITZ, 1, blitz/blitz.h,,,,'gnu3:-Wno-unused gnu3:-ftemplate-depth-30',, -lm)
+
+dnl
+dnl Output Makefiles
+dnl
+AC_OUTPUT(
+include/Makefile
+include/APL/Makefile
+include/APL/CAL_Protocol/Makefile
+src/Makefile
+test/Makefile
+Makefile
+CAL_Protocol.spec
+)
diff --git a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/AntennaGains.h b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/AntennaGains.h
index e857aa0ace7b363668c7a8994f1be536468857f0..896bb4d13362bbd06c188a3420dbf03b526b214a 100644
--- a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/AntennaGains.h
+++ b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/AntennaGains.h
@@ -27,9 +27,7 @@
 
 #include <math.h>
 #include <blitz/array.h>
-#ifdef USE_CAL_THREAD
 #include <pthread.h>
-#endif
 
 namespace LOFAR {
   namespace CAL {
@@ -91,13 +89,8 @@ namespace LOFAR {
       /**
        * lock/unlock
        */
-#ifdef USE_CAL_THREAD
       inline int lock()   const { return pthread_mutex_lock((pthread_mutex_t*)m_mutex);   }
       inline int unlock() const { return pthread_mutex_unlock((pthread_mutex_t*)m_mutex); }
-#else
-      inline int lock()   const { return 0; }
-      inline int unlock() const { return 0; }
-#endif
 
     public:
       /*@{*/
@@ -120,9 +113,7 @@ namespace LOFAR {
       blitz::Array<double, 3>               m_quality;
       bool                                  m_done; // has the calibration finished
 
-#ifdef USE_CAL_THREAD
       const pthread_mutex_t* m_mutex; // control access to the m_done flag
-#endif
     };
 
   }; // namespace CAL
diff --git a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/CalibrationInterface.h b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/CalibrationInterface.h
index 382fd1b11c345ddb6cc2618b4c379040367ef42a..f7455889a8544201a48c0fda581602ae4e349083 100644
--- a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/CalibrationInterface.h
+++ b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/CalibrationInterface.h
@@ -25,7 +25,7 @@
 #define CALIBRATIONINTERFACE_H_
 
 #include <APL/CAL_Protocol/SubArray.h>
-#include "ACC.h"
+#include <APL/CAL_Protocol/ACC.h>
 #include <APL/CAL_Protocol/AntennaGains.h>
 
 namespace LOFAR {
diff --git a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/Makefile.am b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..c54e49cfb6565d3db11ce6bb09d5af6bf8feae79
--- /dev/null
+++ b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/Makefile.am
@@ -0,0 +1,25 @@
+
+INSTHDRS = \
+	AntennaArray.h \
+	AntennaArrayData.h \
+	AntennaGains.h \
+	SharedResource.h \
+	SpectralWindow.h \
+	SubArray.h \
+	CalibrationInterface.h \
+	ACC.h
+
+apldir = $(includedir)/APL/CAL_Protocol
+apl_HEADERS = $(INSTHDRS)
+
+# nobase_pkginclude_HEADERS = $(INSTHDRS) $(TCCHDRS)
+
+NOINSTHDRS =
+
+TCCHDRS =
+
+noinst_HEADERS = $(NOINSTHDRS)
+
+DOCHDRS = $(INSTHDRS) $(NOINSTHDRS)
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SharedResource.h b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SharedResource.h
index 1081b5c12d5b510b1ab2afffd97baf53ed9d88b5..cbd9a310c650f33f9475a4eeb76ab5f5c2f67f6b 100644
--- a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SharedResource.h
+++ b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SharedResource.h
@@ -33,9 +33,7 @@
 #include <Common/LofarLogger.h>
 #endif
 
-#ifdef USE_CAL_THREAD
 #include <pthread.h>
-#endif
 
 namespace LOFAR {
   namespace CAL {
@@ -48,20 +46,12 @@ namespace LOFAR {
 	m_maxreaders(maxreaders),
 	m_maxwriters(maxwriters)
       {
-#ifdef USE_CAL_THREAD
 	(void)pthread_mutex_init(&m_mutex, 0);
-#endif
       }
       virtual ~SharedResource() {}
 
-#ifdef USE_CAL_THREAD
       inline int mutex_lock()   { return pthread_mutex_lock(&m_mutex);   }
       inline int mutex_unlock() { return pthread_mutex_unlock(&m_mutex); }
-#else
-      inline int mutex_lock()   { return 0; }
-      inline int mutex_unlock() { return 0; }
-#endif
-	
     
       /*@{*/
       /**
@@ -155,9 +145,7 @@ namespace LOFAR {
       int m_semaphore;
       int m_maxreaders;
       int m_maxwriters;
-#ifdef USE_CAL_THREAD
       pthread_mutex_t m_mutex;
-#endif
     };
 
   }; // namespace CAL
diff --git a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SubArray.h b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SubArray.h
index b3652ac8e0b02374de918ae9a287cd6e530e7dbd..f41467c65813fbdc5e37412a14f0cd0f4adc057b 100644
--- a/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SubArray.h
+++ b/MAC/APL/PAC/CAL_Protocol/include/APL/CAL_Protocol/SubArray.h
@@ -30,11 +30,11 @@
 
 #include <APL/RTCCommon/Subject.h>
 
-#include "SpectralWindow.h"
-#include "AntennaArray.h"
+#include <APL/CAL_Protocol/SpectralWindow.h>
+#include <APL/CAL_Protocol/AntennaArray.h>
 /*#include "ACC.h"*/
 #include "SharedResource.h"
-#include "AntennaGains.h"
+#include <APL/CAL_Protocol/AntennaGains.h>
 
 namespace LOFAR {
   namespace CAL {
diff --git a/MAC/APL/PAC/CAL_Protocol/include/APL/Makefile.am b/MAC/APL/PAC/CAL_Protocol/include/APL/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..242e2ee3d84e963fcd7a26cf726e45c312b8ad07
--- /dev/null
+++ b/MAC/APL/PAC/CAL_Protocol/include/APL/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS	= CAL_Protocol
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/APL/PAC/CAL_Protocol/include/Makefile.am b/MAC/APL/PAC/CAL_Protocol/include/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..803db7814f3a21ef886065f90b42a16c729d4e26
--- /dev/null
+++ b/MAC/APL/PAC/CAL_Protocol/include/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS	= APL
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/APL/PAC/CAL_Protocol/package.doc b/MAC/APL/PAC/CAL_Protocol/package.doc
new file mode 100644
index 0000000000000000000000000000000000000000..c459091335a084e60231d9e9fb3077b479709f18
--- /dev/null
+++ b/MAC/APL/PAC/CAL_Protocol/package.doc
@@ -0,0 +1,2 @@
+// \ingroup PAC
+// \defgroup CAL_Protocol CAL_Protocol Description
diff --git a/MAC/APL/PAC/CAL_Protocol/src/ACC.cc b/MAC/APL/PAC/CAL_Protocol/src/ACC.cc
index f38cfa97e1017134631fa907e9459acbf2f42df1..87e769f192c76456756d641a903446a6cce972c5 100644
--- a/MAC/APL/PAC/CAL_Protocol/src/ACC.cc
+++ b/MAC/APL/PAC/CAL_Protocol/src/ACC.cc
@@ -24,7 +24,7 @@
 #include <lofar_config.h>
 #include <Common/LofarLogger.h>
 
-#include "ACC.h"
+#include <APL/CAL_Protocol/ACC.h>
 #include <blitz/array.h>
 #include <fstream>
 #include <stdio.h>
diff --git a/MAC/APL/PAC/CAL_Protocol/src/AntennaArray.cc b/MAC/APL/PAC/CAL_Protocol/src/AntennaArray.cc
index 7de6b42979df23a5c33b895cddc03f3b12d09777..1bbec13dbf5e52acbda4d1b7c24e9c5af145952e 100644
--- a/MAC/APL/PAC/CAL_Protocol/src/AntennaArray.cc
+++ b/MAC/APL/PAC/CAL_Protocol/src/AntennaArray.cc
@@ -24,9 +24,8 @@
 #include <lofar_config.h>
 #include <Common/LofarLogger.h>
 
-#include "CalConstants.h"
-#include "AntennaArray.h"
-#include "AntennaArrayData.h"
+#include <APL/CAL_Protocol/AntennaArray.h>
+#include <APL/CAL_Protocol/AntennaArrayData.h>
 
 #include <blitz/array.h>
 #include <fstream>
diff --git a/MAC/APL/PAC/CAL_Protocol/src/AntennaArrayData.cc b/MAC/APL/PAC/CAL_Protocol/src/AntennaArrayData.cc
index 57f452eb369ac2089f3da3503a6b8fb0fb119a64..6894c86d24fa5daa4188f325b82f7d4f2f685b09 100644
--- a/MAC/APL/PAC/CAL_Protocol/src/AntennaArrayData.cc
+++ b/MAC/APL/PAC/CAL_Protocol/src/AntennaArrayData.cc
@@ -21,7 +21,7 @@
 //#
 //#  $Id$
 
-#include "AntennaArrayData.h"
+#include <APL/CAL_Protocol/AntennaArrayData.h>
 #include <string>
 #include <fstream>
 
diff --git a/MAC/APL/PAC/CAL_Protocol/src/AntennaGains.cc b/MAC/APL/PAC/CAL_Protocol/src/AntennaGains.cc
index 4a61f98ba4c87e866392553046fdb9eef8050888..2f471402e12d18df7d93f5a1b0a4509e5ce5a70e 100644
--- a/MAC/APL/PAC/CAL_Protocol/src/AntennaGains.cc
+++ b/MAC/APL/PAC/CAL_Protocol/src/AntennaGains.cc
@@ -24,7 +24,7 @@
 #include <lofar_config.h>
 #include <Common/LofarLogger.h>
 
-#include "AntennaGains.h"
+#include <APL/CAL_Protocol/AntennaGains.h>
 #include <APL/RTCCommon/Marshalling.h>
 #include <Common/LofarTypes.h>
 
@@ -36,9 +36,7 @@ using namespace CAL;
 AntennaGains::AntennaGains() : m_mutex(new pthread_mutex_t)
 {
   ASSERT(m_mutex);
-#ifdef USE_CAL_THREAD
   pthread_mutex_init((pthread_mutex_t*)m_mutex, 0);
-#endif
   lock();
 
   m_done = false;
@@ -55,9 +53,7 @@ AntennaGains::AntennaGains() : m_mutex(new pthread_mutex_t)
 AntennaGains::AntennaGains(int nantennas, int npol, int nsubbands) : m_mutex(new pthread_mutex_t)
 {
   ASSERT(m_mutex);
-#ifdef USE_CAL_THREAD
   pthread_mutex_init((pthread_mutex_t*)m_mutex, 0);
-#endif
   lock(); m_done = false; unlock();
 
   if (nantennas < 0 || npol < 0 || nsubbands < 0)
diff --git a/MAC/APL/PAC/CAL_Protocol/src/CAL_Protocol.prot b/MAC/APL/PAC/CAL_Protocol/src/CAL_Protocol.prot
index 8d0c47f4c39de637aef80525a1a0917541c65942..867f3583f5d9a84e26a912a2bef2321ad713c2bd 100644
--- a/MAC/APL/PAC/CAL_Protocol/src/CAL_Protocol.prot
+++ b/MAC/APL/PAC/CAL_Protocol/src/CAL_Protocol.prot
@@ -11,9 +11,9 @@ id = "(LOFAR::GCF::TM::F_APL_PROTOCOL+13)";
 // e.g.
 // include = '<sys/time.h>';
 
-include = '"AntennaGains.h"';
-include = '"SubArray.h"';
-include = '"SpectralWindow.h"';
+include = '<APL/CAL_Protocol/AntennaGains.h>';
+include = '<APL/CAL_Protocol/SubArray.h>';
+include = '<APL/CAL_Protocol/SpectralWindow.h>';
 include = '<APL/RTCCommon/Timestamp.h>';
 
 include = '<bitset>';
diff --git a/MAC/APL/PAC/CAL_Protocol/src/Makefile.am b/MAC/APL/PAC/CAL_Protocol/src/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..2f825189b98c58406cf8dd698e0292157566ad02
--- /dev/null
+++ b/MAC/APL/PAC/CAL_Protocol/src/Makefile.am
@@ -0,0 +1,54 @@
+
+AUTOGEN = autogen
+SUFFIXES = .ph
+%.ph: %.prot
+	$(AUTOGEN) --writable -L $(datadir)/GCF/TM $<
+%.cc: %.prot
+	$(AUTOGEN) --writable -L $(datadir)/GCF/TM $<
+
+BUILT_SOURCES = \
+	CAL_Protocol.ph
+
+EXTRA_DIST = \
+	CAL_Protocol.ph
+
+phdir=$(includedir)/APL/CAL_Protocol
+ph_HEADERS = \
+	$(EXTRA_DIST)
+
+lib_LTLIBRARIES         = libcal_protocol.la
+
+libcal_protocol_la_SOURCES = \
+	CAL_Protocol.cc \
+	AntennaArray.cc \
+	AntennaArrayData.cc \
+	AntennaGains.cc \
+	SpectralWindow.cc \
+	SubArray.cc \
+	ACC.cc
+
+# AM_YFLAGS               = -d -p KeyParse
+# AM_LFLAGS               = -PKeyTokenize
+# LEX_OUTPUT_ROOT         = lex.KeyTokenize
+
+# if HAVE_SHMEM
+# libcal_protocol_la_LIBADD     = shmem/libshmem.la
+# endif
+
+bin_PROGRAMS =
+
+# Lines to build a program prg
+#prg_SOURCES		= prg.cc
+#prg_LDADD		= libcal_protocol.la
+#prg_DEPENDENCIES	= libcal_protocol.la $(LOFAR_DEPEND)
+
+glishdir = $(libexecdir)/glish
+dist_glish_SCRIPTS = 
+
+pythondir = $(bindir)
+dist_python_SCRIPTS = 
+
+scriptdir = $(bindir)
+dist_script_SCRIPTS = 
+
+include $(top_srcdir)/Makefile.common
diff --git a/MAC/APL/PAC/CAL_Protocol/src/SpectralWindow.cc b/MAC/APL/PAC/CAL_Protocol/src/SpectralWindow.cc
index 693eaa0baeab3448ac02b7bb9579432c35283465..94dbcc6c20b0654d1feec6239386101c46d4dbd5 100644
--- a/MAC/APL/PAC/CAL_Protocol/src/SpectralWindow.cc
+++ b/MAC/APL/PAC/CAL_Protocol/src/SpectralWindow.cc
@@ -24,7 +24,7 @@
 #include <lofar_config.h>
 #include <Common/LofarLogger.h>
 
-#include "SpectralWindow.h"
+#include <APL/CAL_Protocol/SpectralWindow.h>
 
 #include <blitz/array.h>
 #include <sstream>
diff --git a/MAC/APL/PAC/CAL_Protocol/src/SubArray.cc b/MAC/APL/PAC/CAL_Protocol/src/SubArray.cc
index 2cf78a0ee9ea36bcd4cfc2bae63c8391b1cf071d..54c6cf2bd61dd7a064c6ae552d62de90a67bb448 100644
--- a/MAC/APL/PAC/CAL_Protocol/src/SubArray.cc
+++ b/MAC/APL/PAC/CAL_Protocol/src/SubArray.cc
@@ -21,8 +21,8 @@
 //#
 //#  $Id$
 
-#include "SubArray.h"
-#include "CalibrationInterface.h"
+#include <APL/CAL_Protocol/SubArray.h>
+#include <APL/CAL_Protocol/CalibrationInterface.h>
 #include <Common/LofarLogger.h>
 #include <APL/RTCCommon/Marshalling.h>
 
@@ -30,6 +30,9 @@ using namespace std;
 using namespace blitz;
 using namespace LOFAR;
 using namespace CAL;
+
+// forward declaration
+class CalibrationInterface;
     
 SubArray::SubArray() : AntennaArray(), m_spw("undefined", 0, 0, 0, 0)
 {
diff --git a/MAC/APL/PAC/CAL_Protocol/test/Makefile.am b/MAC/APL/PAC/CAL_Protocol/test/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..96e8d08ef634a7132711d4a8c7a7c0e670ab1092
--- /dev/null
+++ b/MAC/APL/PAC/CAL_Protocol/test/Makefile.am
@@ -0,0 +1,30 @@
+check_PROGRAMS        =
+
+# programs to run through supplied checktools
+CHECKTOOLPROGS        =
+#ENDCHECKTOOLPROGS
+
+# scripts used to run tests
+TESTSCRIPTS           =
+
+# scripts and possible programs to run tests
+TESTS	              = $(TESTSCRIPTS)
+
+XFAIL_TESTS           =
+
+# all files (.run, .stdout, .in, .log_prop, etc.) needed to run tests
+EXTRA_DIST            = $(TESTSCRIPTS)
+
+# Lines to build a test program testprg
+#testprg_SOURCES		= testprg.cc
+#testprg_LDADD			= ../src/libcal_protocol.la
+#testprg_DEPENDENCIES		= ../src/libcal_protocol.la $(LOFAR_DEPEND)
+
+TESTS_ENVIRONMENT		= lofar_sharedir=$(lofar_sharedir) \
+				  srcdir=$(srcdir) \
+				  LOFARROOT=$(LOFARROOT) \
+				  LOFARDATAROOT=$(LOFARDATAROOT) \
+				  MPIBIN=$(MPIBIN)
+
+
+include $(top_srcdir)/Makefile.common