SHELL = /bin/sh
DEFS += -D_USE_OPENSSL
-INCS += -Iinclude
+INCS += -I/opt/local/include -Iinclude
CXXFLAGS += -W -Wall -Wextra $(DEFS) $(INCS)
PROG = libsnmp++.a
CXXFLAGS += -g3
endif
-INCS = -Iinclude -I3rdparty/snmp++/include
+UNAME = $(shell uname -s)
+
+ifeq ($(UNAME), Darwin)
+ BOOST_SUFFIX = -mt
+endif
+
+INCS = -I/opt/local/include -Iinclude -I3rdparty/snmp++/include
CXXFLAGS += -W -Wall -Wextra $(INCS) $(DEFS)
-LIBS = 3rdparty/snmp++/libsnmp++.a \
- -lboost_system \
- -lboost_program_options \
+LIBS = -L/opt/local/lib \
+ 3rdparty/snmp++/libsnmp++.a \
+ -lboost_system$(BOOST_SUFFIX) \
+ -lboost_program_options$(BOOST_SUFFIX) \
-lcurl \
-lssl \
-lcrypto \
include/version.h: version
version:
- @sed 's/@VERSION@/$(VERSION)/g' include/version.h.in > include/version.h
- @sed -i 's/@GIT_SHA@/'`git rev-parse --short HEAD`'/g' include/version.h
+ @sed 's/@VERSION@/$(VERSION)/g' include/version.h.in > include/version.h.tmp
+ @sed "s/@GIT_SHA@/$$(git rev-parse --short HEAD)/g" include/version.h.tmp > include/version.h
+ @rm include/version.h.tmp
$(PROG): version $(subst .cpp,.o,$(SOURCES)) snmplib
$(CXX) $(subst .cpp,.o,$(SOURCES)) $(LIBS) -o $@
: fout(),
consoleLog(true)
{}
- Logger(const std::string & fileName)
+ explicit Logger(const std::string & fileName)
: fout(fileName.c_str(), std::ios::app),
logFile(fileName),
consoleLog(!fout.is_open())
class PIDFile : private boost::noncopyable {
public:
PIDFile();
- PIDFile(const std::string & file);
+ explicit PIDFile(const std::string & file);
~PIDFile();
private:
const std::string fileName;
Settings(const Settings & rvalue);
~Settings();
- const Settings & operator=(const Settings & rvalue);
+ Settings & operator=(const Settings & rvalue);
// Accessors
bool isHelp() const throw() { return _isHelp; }
}
inline
-const Settings & Settings::operator=(const Settings & rvalue)
+Settings & Settings::operator=(const Settings & rvalue)
{
_isHelp = rvalue._isHelp;
_isVersion = rvalue._isVersion;
qi::rule<Iterator> comment, space, eol;
};
-inline
-bool sectionExists(const SectionsType & data, const std::string & sectionName) throw()
-{
- return data.find(sectionName) != data.end();
-}
-
inline
bool fieldExists(const SectionsType & data, const std::string & sectionName, const std::string & fieldName) throw()
{
void Syncer::run(const bool & running, bool & reload)
{
logger << "Syncer::run()" << std::endl;
- while (running) {
+ while (true) {
if (wait()) {
logger << "Syncer::run() - wait stopped by signal" << std::endl;
if (!running)