Permalink
Browse files

updating the Makefile and configure files in order to be able to spec…

…ify the location of libboost_thread, since RHEL was failing to find it. updating test/test_Settings.cpp to include sys/stat.h and updating stat - I made these changes based off of commit d8db5e0
  • Loading branch information...
1 parent d8db5e0 commit 48d13a60336bf68179d4d81df24c6276b52d50d9 @poblahblahblah poblahblahblah committed Oct 8, 2012
Showing with 30 additions and 3 deletions.
  1. +1 −1 Makefile
  2. +27 −0 configure
  3. +2 −2 test/test_Settings.cpp
View
@@ -41,7 +41,7 @@ ifeq ($(OPT),)
OPT := -O2
endif
CXXFLAGS:=-pipe $(OPT) -g -Iinclude -MMD -D_LARGEFILE64_SOURCE -Wall -Werror
-SYS_LIBS:=$(BOOST_SYSTEM) -lboost_thread -lboost_signals -lpthread $(STATGRAB) \
+SYS_LIBS:=$(BOOST_SYSTEM) $(BOOST_THREAD) -lboost_signals -lpthread $(STATGRAB) \
$(BOOST_FILESYSTEM) -lboost_date_time #$(LIBRT)
all: $(DIR_DEPS) $(LIB_DEPS) $(BINS) tests ftests
View
@@ -17,6 +17,7 @@ echo "# makevars.config for istatd generated on " `date` > makevars.config
BOOST_SYSTEM=""
BOOST_FILESYSTEM=""
+BOOST_THREAD=""
STATGRAB=""
LIBRT=""
DESTDIR=""
@@ -34,6 +35,10 @@ while [ $# -gt 0 ]; do
shift
BOOST_FILESYSTEM="$1"
;;
+ --boost_thread)
+ shift
+ BOOST_THREAD="$1"
+ ;;
--statgrab)
shift
STATGRAB="$1"
@@ -62,6 +67,7 @@ while [ $# -gt 0 ]; do
echo "Options:"
echo "--boost_system -lboost_system-mt What is the boost_system library name?"
echo "--boost_filesystem -lboost_filesystem-mt What is the boost_filesystem library name?"
+ echo "--boost_thread -lboost_thread-mt What is the boost_thread library name?"
echo "--statgrab -lstatgrab What is the statgrab library name?"
echo "--librt -lrt What is the librt library name (if any)?"
echo "--prefix / What is the root of the install?"
@@ -120,6 +126,24 @@ if [ -z "$BOOST_FILESYSTEM" ]; then
exit 1
fi
fi
+
+# RHEL can't find boost_thread on its own.
+if [ -z "$BOOST_THREAD" ]; then
+ if [ -r /usr/lib64/libboost_thread.so ]; then
+ BOOST_THREAD=-lboost_thread
+ elif [ -r /usr/lib/libboost_thread.so ]; then
+ BOOST_THREAD=-lboost_thread
+ elif [ -r /usr/lib64/libboost_thread-mt.so ]; then
+ BOOST_THREAD=-lboost_thread-mt
+ elif [ -r /usr/lib/libboost_thread-mt.so ]; then
+ BOOST_THREAD=-lboost_thread-mt
+ else
+ echo "Cannot find boost_thread-mt.so (or boost_thread.so)"
+ echo "Specify it with --boost_thread or install libboost-dev-all."
+ exit 1
+ fi
+fi
+
if [ -z "$STATGRAB" ]; then
if [ -r /usr/lib64/libstatgrab.so ]; then
STATGRAB=-lstatgrab
@@ -154,6 +178,9 @@ fi
if [ ! -z "$BOOST_FILESYSTEM" ]; then
echo "BOOST_FILESYSTEM=$BOOST_FILESYSTEM" >> makevars.config
fi
+if [ ! -z "$BOOST_THREAD" ]; then
+ echo "BOOST_THREAD=$BOOST_THREAD" >> makevars.config
+fi
if [ ! -z "$STATGRAB" ]; then
echo "STATGRAB=$STATGRAB" >> makevars.config
fi
View
@@ -4,7 +4,7 @@
#include <boost/asio/io_service.hpp>
#include <istat/test.h>
#include <istat/Log.h>
-
+#include <sys/stat.h>
boost::asio::io_service svc;
class complete : public IComplete
@@ -136,7 +136,7 @@ void func_real()
// make sure the file exists
struct stat stbuf;
- assert_equal(0, stat("/tmp/test/config/allowCreate.set", &stbuf));
+ assert_equal(0, ::stat("/tmp/test/config/allowCreate.set", &stbuf));
}
void func()

0 comments on commit 48d13a6

Please sign in to comment.