diff --git a/MAC/APL/PAC/_VirtualBackend/src/Makefile.am b/MAC/APL/PAC/_VirtualBackend/src/Makefile.am index 37e53dc63e5454e25b2837e460eff72d0e0a73e5..e30a50c3392d6f7388e56f2bc503c5847306a7dc 100644 --- a/MAC/APL/PAC/_VirtualBackend/src/Makefile.am +++ b/MAC/APL/PAC/_VirtualBackend/src/Makefile.am @@ -32,8 +32,7 @@ VirtualBackend_CPPFLAGS = \ -fdiagnostics-show-location=once \ -DUSE_TCPPORT_INSTEADOF_PVSSPORT -configfilesdir=$(bindir) -configfiles_DATA= \ +sysconf_DATA= \ VirtualBackend.conf \ CEPAppDefault.param diff --git a/MAC/APL/PIC/MIS/src/Makefile.am b/MAC/APL/PIC/MIS/src/Makefile.am index 25bc968eded5e43e6f7df0c58a0d8a0f889ee07b..c99af2e1a031729a0cc4b9b60350f96496e2c57c 100644 --- a/MAC/APL/PIC/MIS/src/Makefile.am +++ b/MAC/APL/PIC/MIS/src/Makefile.am @@ -32,11 +32,9 @@ MACInformationServer_CPPFLAGS = BUILT_SOURCES = \ MIS_Protocol.ph -EXTRA_DIST = \ - MIS_Protocol.ph +EXTRA_DIST = $(BUILT_SOURCES) -configfilesdir=$(bindir) -configfiles_DATA= \ +sysconf_DATA= \ MACInformationServer.conf %.conf: %.conf.in diff --git a/MAC/APL/PIC/_NodeManager/src/Makefile.am b/MAC/APL/PIC/_NodeManager/src/Makefile.am index 29c4842d22dcc7ae99aac2816e09a356ddc27b06..b8a73133a14e35d253a9ba32693b914ff296d8da 100644 --- a/MAC/APL/PIC/_NodeManager/src/Makefile.am +++ b/MAC/APL/PIC/_NodeManager/src/Makefile.am @@ -47,11 +47,9 @@ NodeManager_CPPFLAGS = BUILT_SOURCES = \ NM_Protocol.ph -EXTRA_DIST = \ - NM_Protocol.ph +EXTRA_DIST = $(BUILT_SOURCES) -configfilesdir=$(bindir) -configfiles_DATA= \ +sysconf_DATA= \ NodeManager.conf %.conf: %.conf.in diff --git a/MAC/GCF/LogSys/CLP/src/Makefile.am b/MAC/GCF/LogSys/CLP/src/Makefile.am index b28a2bdbc917c84d5107d03a200e9aeb494d4fb7..3980e5bba30f98abcaeb0e6d04bb321c6df95253 100644 --- a/MAC/GCF/LogSys/CLP/src/Makefile.am +++ b/MAC/GCF/LogSys/CLP/src/Makefile.am @@ -25,8 +25,11 @@ CodeLoggingProcessor_DEPENDENCIES = libclp.la $(LOFAR_DEPEND) \ CodeLoggingProcessor_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"CLP\" \ -I$(top_srcdir)/include -configfilesdir=$(bindir) -configfiles_DATA= \ +BUILT_SOURCES = + +EXTRA_DIST = $(BUILT_SOURCES) + +sysconf_DATA= \ CodeLoggingProcessor.conf \ CodeLoggingProcessor.log_prop diff --git a/MAC/GCF/LogSys/KVLogSys/src/Makefile.am b/MAC/GCF/LogSys/KVLogSys/src/Makefile.am index 0de3ab6e35bbb5365b683a848590f3acb3d2208e..cb9535f46fe518c93d691c0acb7a346759754757 100644 --- a/MAC/GCF/LogSys/KVLogSys/src/Makefile.am +++ b/MAC/GCF/LogSys/KVLogSys/src/Makefile.am @@ -60,11 +60,9 @@ KeyValueLoggerMaster_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"KVLM\" BUILT_SOURCES = \ KVL_Protocol.ph -EXTRA_DIST = \ - KVL_Protocol.ph +EXTRA_DIST = $(BUILT_SOURCES) -configfilesdir=$(bindir) -configfiles_DATA= \ +sysconf_DATA= \ KeyValueLoggerDaemon.conf \ KeyValueLoggerMaster.conf \ KeyValueLoggerDaemon.log_prop \ diff --git a/MAC/GCF/TM/src/GCF_Task.cc b/MAC/GCF/TM/src/GCF_Task.cc index 6c5cdd9493a32581f6d69e1ef750a82156c4a614..ce5c8950bd6b58a8879a6139549a42bc94d3c35f 100644 --- a/MAC/GCF/TM/src/GCF_Task.cc +++ b/MAC/GCF/TM/src/GCF_Task.cc @@ -71,16 +71,33 @@ void GCFTask::init(int argc, char** argv) _argc = argc; _argv = argv; - string appName(argv[0]); - + string procName(argv[0]); + ifstream logPropFile; - // Try to open the log_prop file - string logPropFileName = appName + ".log_prop"; + // Construct the etc path for config files + string etcPath(procName); + // Find last '/' + string::size_type pos = etcPath.rfind('/'); + if (pos == string::npos) pos = 0; // not found: so erase whole filename + else pos++; // found : increase pos to avoid erasing the '/' too + + if (pos == 0 || pos == 1) etcPath = "/etc/"; // no '/' or only one '/' (at the 0 position) + else + { + etcPath.erase(pos); + etcPath += "../etc/"; // becomes e.g. /opt/lofar/bin/../etc/ + } + + procName.erase(0, pos); // erase path + + // Try to open the log_prop file, if process has its own log_prop file then use it in + // the INIT_LOGGER otherwise use the default mac.log_prop + string logPropFileName = etcPath + procName + ".log_prop"; logPropFile.open(logPropFileName.c_str(), ifstream::in); if (!logPropFile) { - logPropFileName = "./mac.log_prop"; + logPropFileName = etcPath + "mac.log_prop"; } else { @@ -90,7 +107,8 @@ void GCFTask::init(int argc, char** argv) INIT_LOGGER(logPropFileName.c_str()); ParameterSet* pParamSet = ParameterSet::instance(); - pParamSet->adoptFile(appName + ".conf"); + pParamSet->setSearchPath(etcPath); + pParamSet->adoptFile(procName + ".conf"); if (_doExit) exit(-1); diff --git a/MAC/GCF/TM/src/Makefile.am b/MAC/GCF/TM/src/Makefile.am index bc734a8a4641f5e948bb8396886504859257fe93..bd826b7822dd4c9bd4a3cd2e4cc1b86ccb28dbf5 100644 --- a/MAC/GCF/TM/src/Makefile.am +++ b/MAC/GCF/TM/src/Makefile.am @@ -62,14 +62,14 @@ libgcftm_la_CPPFLAGS=-I$(top_srcdir)/include \ libgcftm_la_CXXFLAGS=-fmessage-length=0 -BUILT_SOURCES = \ - SB_Protocol.ph \ - mac.log_prop +BUILT_SOURCES = \ + SB_Protocol.ph -EXTRA_DIST = \ - SB_Protocol.ph \ - mac.log_prop +EXTRA_DIST = $(BUILT_SOURCES) +sysconf_DATA = \ + mac.log_prop + %.log_prop: %.log_prop.in cp $< $@ diff --git a/MAC/GCF/TM/src/ServiceBroker/Makefile.am b/MAC/GCF/TM/src/ServiceBroker/Makefile.am index 736be1275db0c5ba22cd3e2def4bfe32ce344ad2..a16fa65d262d861682cb6e092547189d61d73229 100644 --- a/MAC/GCF/TM/src/ServiceBroker/Makefile.am +++ b/MAC/GCF/TM/src/ServiceBroker/Makefile.am @@ -22,19 +22,16 @@ ServiceBroker_DEPENDENCIES = libsb.la $(LOFAR_DEPEND) \ ServiceBroker_CPPFLAGS= -I$(top_srcdir)/include ServiceBroker_CXXFLAGS=-fmessage-length=0 -BUILT_SOURCES = \ - ServiceBroker.conf +BUILT_SOURCES = -EXTRA_DIST = \ - ServiceBroker.conf +EXTRA_DIST = $(BUILT_SOURCES) -configfilesdir=$(bindir) -configfiles_DATA= \ +sysconf_DATA= \ ServiceBroker.conf install-data-local: - echo "mac.gcf.sb.host=`hostname -s`" >> $(bindir)/ServiceBroker.conf - echo "mac.gcf.sb.range1.host=`hostname`" >> $(bindir)/ServiceBroker.conf + echo "mac.gcf.sb.host=`hostname -s`" >> $(sysconfdir)/ServiceBroker.conf + echo "mac.gcf.sb.range1.host=`hostname`" >> $(sysconfdir)/ServiceBroker.conf %.conf: gcf-sb.conf.in cp $< $@ diff --git a/MAC/GCF/TM/test/Makefile.am b/MAC/GCF/TM/test/Makefile.am index 171b9cb8c980fbf413260e2d4f2685f15e13a3e9..1e046cb71e9805156251192e12963478d4e401be 100644 --- a/MAC/GCF/TM/test/Makefile.am +++ b/MAC/GCF/TM/test/Makefile.am @@ -1,16 +1,14 @@ -check_PROGRAMS = echoapp ping +bin_PROGRAMS = tmEcho tmPing -TESTS = #echoapp ping +tmEcho_SOURCES = Echo.cc Echo_Protocol.cc +tmEcho_LDADD = ../src/libgcftm.la +tmEcho_DEPENDENCIES = ../src/libgcftm.la $(LOFAR_DEPEND) +tmEcho_CPPFLAGS=-I$(top_srcdir)/include -echoapp_SOURCES = Echo.cc Echo_Protocol.cc -echoapp_LDADD = ../src/libgcftm.la -echoapp_DEPENDENCIES = ../src/libgcftm.la $(LOFAR_DEPEND) -echoapp_CPPFLAGS=-I$(top_srcdir)/include - -ping_SOURCES = Ping.cc Echo_Protocol.cc -ping_LDADD = ../src/libgcftm.la -ping_DEPENDENCIES = ../src/libgcftm.la $(LOFAR_DEPEND) -ping_CPPFLAGS=-I$(top_srcdir)/include +tmPing_SOURCES = Ping.cc Echo_Protocol.cc +tmPing_LDADD = ../src/libgcftm.la +tmPing_DEPENDENCIES = ../src/libgcftm.la $(LOFAR_DEPEND) +tmPing_CPPFLAGS=-I$(top_srcdir)/include AUTOGEN = autogen SUFFIXES = .ph @@ -18,23 +16,18 @@ SUFFIXES = .ph $(AUTOGEN) --writable -L $(top_srcdir)/autogen $< BUILT_SOURCES = \ - Echo_Protocol.ph \ - echoapp.conf \ - ping.conf \ - ServiceBroker.conf + Echo_Protocol.ph EXTRA_DIST = \ - Echo_Protocol.ph \ - echoapp.conf \ - ping.conf \ - ServiceBroker.conf + Echo_Protocol.ph + +sysconf_DATA=\ + tmEcho.conf \ + tmPing.conf %.conf: tm-test.conf.in ln -sf $< $@ -ServiceBroker.conf: $(bindir)/ServiceBroker.conf - cp $< $@ - clean-local: rm -f *.ph diff --git a/MAC/GCF/_PAL/PA/src/Makefile.am b/MAC/GCF/_PAL/PA/src/Makefile.am index c1dfbd7d114dfa3f07ec74014fe252cbbb5cbb30..472043c7cc91f144d9fc41279b9d286967a118c5 100644 --- a/MAC/GCF/_PAL/PA/src/Makefile.am +++ b/MAC/GCF/_PAL/PA/src/Makefile.am @@ -34,7 +34,13 @@ AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"PA\" configfilesdir=$(bindir) configfiles_DATA= \ loadAPC \ - preparePVSS-DB \ + preparePVSS-DB + +BUILT_SOURCES = + +EXTRA_DIST = $(BUILT_SOURCES) + +sysconf_DATA= \ PropertyAgent.conf install-data-local: diff --git a/MAC/GCF/_PAL/PI/src/Makefile.am b/MAC/GCF/_PAL/PI/src/Makefile.am index 993e3fcf975a04edc64924e96db19bdf0f03b372..38e92f4c4d03f35e10284e6da96a5f1c8e4206f2 100644 --- a/MAC/GCF/_PAL/PI/src/Makefile.am +++ b/MAC/GCF/_PAL/PI/src/Makefile.am @@ -36,8 +36,11 @@ PropertyInterface_DEPENDENCIES = libpi.la \ AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"PI\" -configfilesdir=$(bindir) -configfiles_DATA= \ +BUILT_SOURCES = + +EXTRA_DIST = $(BUILT_SOURCES) + +sysconf_DATA= \ PropertyInterface.conf %.conf: gcf-pi.conf.in diff --git a/MAC/GCF/_PAL/PML/src/Makefile.am b/MAC/GCF/_PAL/PML/src/Makefile.am index 160642d67ff7928fd75c4d0f9cb84157924b5a08..aebb37e50aa322420b4589e923d7546ae630a079 100644 --- a/MAC/GCF/_PAL/PML/src/Makefile.am +++ b/MAC/GCF/_PAL/PML/src/Makefile.am @@ -43,8 +43,11 @@ libpml_la_CPPFLAGS= -I$(top_srcdir)/include \ AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"PML\" -configfilesdir=$(bindir) -configfiles_DATA= \ +BUILT_SOURCES = + +EXTRA_DIST = $(BUILT_SOURCES) + +sysconf_DATA= \ gcf-pml.conf %.conf: %.conf.in diff --git a/MAC/GCF/_PAL/SAL/test/Makefile.am b/MAC/GCF/_PAL/SAL/test/Makefile.am index d87926d40f0d0f84ab442b479fb125510cb95388..c06691baf5863ff2893e19f5082cd16450f85059 100644 --- a/MAC/GCF/_PAL/SAL/test/Makefile.am +++ b/MAC/GCF/_PAL/SAL/test/Makefile.am @@ -1,19 +1,19 @@ cppflags = -I$(top_srcdir)/SAL/src \ -I$(top_srcdir)/include -check_PROGRAMS = echoapp ping +check_PROGRAMS = salEcho salPing -TESTS = #echoapp ping +TESTS = #salEcho salPing -echoapp_SOURCES = Echo.cc Service.cc Echo_Protocol.cc -echoapp_LDADD = ../src/libsal.la $(LOFAR_DEPEND) -echoapp_DEPENDENCIES = ../src/libsal.la $(LOFAR_DEPEND) -echoapp_CPPFLAGS = $(cppflags) +salEcho_SOURCES = Echo.cc Service.cc Echo_Protocol.cc +salEcho_LDADD = ../src/libsal.la $(LOFAR_DEPEND) +salEcho_DEPENDENCIES = ../src/libsal.la $(LOFAR_DEPEND) +salEcho_CPPFLAGS = $(cppflags) -ping_SOURCES = Ping.cc Echo_Protocol.cc -ping_LDADD = ../src/libsal.la $(LOFAR_DEPEND) -ping_DEPENDENCIES = ../src/libsal.la $(LOFAR_DEPEND) -ping_CPPFLAGS= $(cppflags) +salPing_SOURCES = Ping.cc Echo_Protocol.cc +salPing_LDADD = ../src/libsal.la $(LOFAR_DEPEND) +salPing_DEPENDENCIES = ../src/libsal.la $(LOFAR_DEPEND) +salPing_CPPFLAGS= $(cppflags) AUTOGEN = autogen SUFFIXES = .ph @@ -21,22 +21,17 @@ SUFFIXES = .ph $(AUTOGEN) --writable -L $(datadir)/GCF/TM $< BUILT_SOURCES = \ - Echo_Protocol.ph \ - echoapp.conf \ - ping.conf \ - ServiceBroker.conf + Echo_Protocol.ph -EXTRA_DIST = \ - Echo_Protocol.ph \ - echoapp.conf \ - ping.conf +EXTRA_DIST = $(BUILT_SOURCES) + +sysconf_DATA= \ + salEcho.conf \ + salPing.conf %.conf: sal-test.conf.in ln -sf $< $@ -ServiceBroker.conf: $(bindir)/ServiceBroker.conf - cp $< $@ - clean-local: rm -f *.ph diff --git a/MAC/GCF/_PALlight/PMLlight/src/Makefile.am b/MAC/GCF/_PALlight/PMLlight/src/Makefile.am index 9e2e276177cfe318178c24a0341b7cf2b6bd01c6..7891bac1491b0fa431c4d89ff1a33cbb49c8de86 100644 --- a/MAC/GCF/_PALlight/PMLlight/src/Makefile.am +++ b/MAC/GCF/_PALlight/PMLlight/src/Makefile.am @@ -27,9 +27,11 @@ libgcfpallight_la_DEPENDENCIES= libpmllight.la $(LOFAR_DEPEND) AM_CPPFLAGS = -DLOFARLOGGER_SUBPACKAGE=\"RTC\" +sysconf_DATA= \ + gcf-pmllight.conf + configfilesdir=$(bindir) configfiles_DATA= \ - gcf-pmllight.conf \ genTypeInfo %.conf: %.conf.in diff --git a/MAC/Test/GCF/MAC/src/Makefile.am b/MAC/Test/GCF/MAC/src/Makefile.am index 13d61057501eb29e7127cb7dd930b03b7bb73ac0..6278efd5e9da6fb65845fa4be1d5cff021092a9a 100644 --- a/MAC/Test/GCF/MAC/src/Makefile.am +++ b/MAC/Test/GCF/MAC/src/Makefile.am @@ -34,18 +34,19 @@ Application3_DEPENDENCIES = libgcftest.la $(LOFAR_DEPEND) BUILT_SOURCES = \ TST_Protocol.ph -EXTRA_DIST = \ - TST_Protocol.ph +EXTRA_DIST = $(BUILT_SOURCES) AM_CXXFLAGS=-fmessage-length=0 #in case of make install these files will be copied to the bindir beside the test apps configfilesdir=$(bindir) configfiles_DATA= \ + customPrepPVSSDB.ctl + +sysconf_DATA= \ Application1.conf \ Application2.conf \ - Application3.conf \ - customPrepPVSSDB.ctl + Application3.conf %.conf: gcf-test.conf.in cp $< $@ diff --git a/MAC/Test/GCF/RTC/src/Makefile.am b/MAC/Test/GCF/RTC/src/Makefile.am index a3d313e351626d1b5c2b04c35f844051e7086dd2..4cdcbfcc40fed6093819ebf0ee0e27dde05957f4 100644 --- a/MAC/Test/GCF/RTC/src/Makefile.am +++ b/MAC/Test/GCF/RTC/src/Makefile.am @@ -26,14 +26,12 @@ RTPing_DEPENDENCIES = librtc.la $(LOFAR_DEPEND) BUILT_SOURCES = \ Echo_Protocol.ph -EXTRA_DIST = \ - Echo_Protocol.ph +EXTRA_DIST = $(BUILT_SOURCES) AM_CXXFLAGS=-fmessage-length=0 #in case of make install these files will be copied to the bindir beside the test apps -configfilesdir=$(bindir) -configfiles_DATA= \ +sysconf_DATA= \ RTEcho.conf \ RTPing.conf