diff --git a/MAC/APL/_GSO/MACScheduler/Makefile.am b/MAC/APL/_GSO/MACScheduler/Makefile.am
index 161f7455d022a4bf60641cbe45447f4764e96d94..9574c6ff92455fcaae5274595b53aa8cb4a3fae1 100644
--- a/MAC/APL/_GSO/MACScheduler/Makefile.am
+++ b/MAC/APL/_GSO/MACScheduler/Makefile.am
@@ -1,3 +1,11 @@
 SUBDIRS=src test
 
+DISTCHECK_CONFIGURE_FLAGS=\
+      --with-common=$(prefix)
+
+EXTRA_DIST = \
+      Makefile.common \
+      MACScheduler.spec \
+      autoconf_share/compiletool
+
 include $(top_srcdir)/Makefile.common
diff --git a/MAC/APL/_GSO/MACScheduler/configure.in b/MAC/APL/_GSO/MACScheduler/configure.in
index e7db65e3f574e6f19815a0524e741571c987924e..616c83318ac72b684ffefc98b48dc2ce1dec68a8 100644
--- a/MAC/APL/_GSO/MACScheduler/configure.in
+++ b/MAC/APL/_GSO/MACScheduler/configure.in
@@ -1,25 +1,27 @@
 dnl
 dnl Process this file with autoconf to produce a configure script.
 dnl
-AC_INIT(src/MACScheduler.h)
+AC_INIT
 dnl AC_CONFIG_AUX_DIR(config)
 dnl AM_CONFIG_HEADER(config/config.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(MACScheduler, 1.0)
+AM_INIT_AUTOMAKE(MACScheduler, 3.1)
 
+dnl
 dnl Initialize for LOFAR (may set compilers)
+dnl
 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
+AC_PROG_YACC
+AM_PROG_LEX
 
 dnl Checks for libraries.
 
@@ -53,7 +55,6 @@ dnl
 lofar_GENERAL
 lofar_COMPILETOOLS
 lofar_PVSS(1)
-
 lofar_INTERNAL(LCS/Common, common, LCS-Common-2_3, 1, Common/LofarTypes.h,,)
 lofar_INTERNAL(LCS/ACC/APS, aps, LCS-ACC-2_0, 1, APS/ParameterSet.h,,)
 lofar_INTERNAL(SAS/OTDB, otdb, HEAD, 1, OTDB/OTDBconnection.h,,)
@@ -69,4 +70,5 @@ AC_OUTPUT(
 src/Makefile
 test/Makefile
 Makefile
+MACScheduler.spec
 )
diff --git a/MAC/APL/_GSO/MACScheduler/src/Makefile.am b/MAC/APL/_GSO/MACScheduler/src/Makefile.am
index 89e774ff9fe46386a21feab7e214a5824fb237e1..469e5cad71e7d46c73f1555c3874ba7f6b8edfb2 100644
--- a/MAC/APL/_GSO/MACScheduler/src/Makefile.am
+++ b/MAC/APL/_GSO/MACScheduler/src/Makefile.am
@@ -7,7 +7,7 @@ SUFFIXES = .ph
 
 MACScheduler_CPPFLAGS= \
 	-DBOOST_DISABLE_THREADS \
-  -Wno-deprecated \
+	-Wno-deprecated \
 	-fmessage-length=0 \
 	-fdiagnostics-show-location=once \
 	-DUSE_TCPPORT_INSTEADOF_PVSSPORT
@@ -18,16 +18,29 @@ MACScheduler_SOURCES 		= \
 	MACSchedulerMain.cc \
 	SAS_Protocol.cc
 
+NOINSTHDRS = \
+	MACScheduler.h \
+	BeamletAllocator.h \
+	SAS_Protocol.ph
+
+INSTHDRS = 
+
+pkginclude_HEADERS = $(NOINSTHDRS) $(INSTHDRS)
+
+DOCHDRS	=	$(pkginclude_HEADERS)
+
 MACScheduler_LDADD		= -lpqxx $(LOFAR_DEPEND)
 MACScheduler_DEPENDENCIES	= $(LOFAR_DEPEND)
 
 include_HEADERS = 
 
 BUILT_SOURCES = 	\
-	SAS_Protocol.ph
+	SAS_Protocol.ph \
+	MACScheduler.conf \
+	MACScheduler.log_prop \
+	customPrepPVSSDB.ctl
 
-EXTRA_DIST =   \
-	SAS_Protocol.ph
+EXTRA_DIST = $(BUILT_SOURCES) $(configfiles_DATA) $(sysconf_DATA)
 
 #in case of make install these files will be copied to the bindir beside the test apps
 configfilesdir=$(bindir)
diff --git a/MAC/APL/_GSO/MACScheduler/test/Makefile.am b/MAC/APL/_GSO/MACScheduler/test/Makefile.am
index 974dc982b27965deb864de7b4598d9f8a849f933..969c8fa7060fa807a833626c978fcaf849375569 100644
--- a/MAC/APL/_GSO/MACScheduler/test/Makefile.am
+++ b/MAC/APL/_GSO/MACScheduler/test/Makefile.am
@@ -1,53 +1,62 @@
-noinst_PROGRAMS 		= \
+noinst_PROGRAMS = \
 	BeamletAllocatorTest \
 	addVI
 
-bin_PROGRAMS 		= \
+bin_PROGRAMS = \
 	MACScheduleTest
 
-BeamletAllocatorTest_CPPFLAGS= \
+BeamletAllocatorTest_CPPFLAGS = \
 	-Wno-deprecated \
 	-fmessage-length=0 \
 	-fdiagnostics-show-location=once
 
-BeamletAllocatorTest_SOURCES 		= \
+BeamletAllocatorTest_SOURCES = \
 	BeamletAllocatorTest.cc \
 	$(top_srcdir)/src/BeamletAllocator.cc
 
-BeamletAllocatorTest_LDADD		= 
+BeamletAllocatorTest_LDADD = 
 
-addVI_CPPFLAGS= \
+addVI_CPPFLAGS = \
 	-Wno-deprecated \
 	-fmessage-length=0 \
 	-fdiagnostics-show-location=once
 
-addVI_SOURCES 		= addVI.cc
+addVI_SOURCES = addVI.cc
 
-addVI_LDADD		= 
+addVI_LDADD = 
 
-MACScheduleTest_CPPFLAGS= \
-  -Wno-deprecated \
+MACScheduleTest_CPPFLAGS = \
+	-Wno-deprecated \
 	-fmessage-length=0 \
 	-fdiagnostics-show-location=once
 
-MACScheduleTest_SOURCES 		= \
+MACScheduleTest_SOURCES = \
 	MACScheduleMain.cc \
 	MACScheduleAnswer.cc \
 	MACScheduleTask.cc 
 
-MACScheduleTest_LDADD		= 
-
-sysconf_DATA= \
-	MACScheduleTest.conf
-
 BUILT_SOURCES = \
+	MACScheduleTest.conf \
 	BeamletAllocatorTest.log_prop \
 	MACScheduleTest.log_prop
 
-EXTRA_DIST = \
+NOINSTHDRS = \
+	MACScheduleTask.h \
+        MACScheduleAnswer.h
+
+INSTHDRS =
+
+pkginclude_HEADERS = $(NOINSTHDRS) $(INSTHDRS)
+
+MACScheduleTest_LDADD = 
+
+sysconf_DATA = \
+	MACScheduleTest.conf \
 	BeamletAllocatorTest.log_prop \
 	MACScheduleTest.log_prop
 
+EXTRA_DIST = $(BUILT_SOURCES) $(sysconf_data)
+
 %.log_prop: %.log_prop.in
 	cp $< $@