- add support for gcc6 in build script -g 6

- fix issue #132
This commit is contained in:
SoftCoder 2016-10-17 19:05:21 -07:00
parent 6d7bb258a9
commit 2107958ad2
3 changed files with 25 additions and 12 deletions

@ -1 +1 @@
Subproject commit 0834a3d3275e1ead9a0ef73232413f2966f01297
Subproject commit a1e6be21823b1c597129e3c81f4301177c32fba7

View File

@ -20,12 +20,13 @@ MAKE_ONLY=0
CLANG_FORCED=0
WANT_STATIC_LIBS="-DWANT_STATIC_LIBS=ON"
FORCE_EMBEDDED_LIBS=0
GCC_FORCED_VERSION=0
LUA_FORCED_VERSION=0
FORCE_32BIT_CROSS_COMPILE=0
COMPILATION_WITHOUT=0
BUILD_MEGAGLEST_TESTS="ON"
while getopts "c:defhl:mnwx" option; do
while getopts "c:defg:hl:mnwx" option; do
case "${option}" in
c)
CPU_COUNT=${OPTARG}
@ -43,14 +44,19 @@ while getopts "c:defhl:mnwx" option; do
CLANG_FORCED=1
# echo "${option} value: ${OPTARG}"
;;
g)
GCC_FORCED_VERSION=${OPTARG}
echo "${option} value: ${OPTARG} GCC_FORCED_VERSION [${GCC_FORCED_VERSION}]"
;;
h)
echo "Usage: $0 <option>"
echo " where <option> can be: -c x, -d, -e, -f, -m, -n, -h, -l x, -w, -x"
echo " where <option> can be: -c x, -d, -e, -f, -m, -n, -h, -l x, -w, -x -g"
echo " option descriptions:"
echo " -c x : Force the cpu / cores count to x - example: -c 4"
echo " -d : Force DYNAMIC compile (do not want static libs)"
echo " -e : Force compile with EMBEDDED libraries"
echo " -f : Force using CLANG compiler"
echo " -g x : Force using GCC version x - example: -g 6"
echo " -l x : Force using LUA version x - example: -l 5.3"
echo " -m : Force running CMAKE only to create Make files (do not compile)"
echo " -n : Force running MAKE only to compile (assume CMAKE already built make files)"
@ -264,6 +270,11 @@ elif [ "`echo $CC | grep -oF 'clang'`" = 'clang' -a "`echo $CXX | grep -oF 'clan
#exit 1;
fi
if [ "$GCC_FORCED_VERSION" != "0" ] && [ "$GCC_FORCED_VERSION" != "" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_C_COMPILER=$(which gcc-$GCC_FORCED_VERSION) -DCMAKE_CXX_COMPILER=$(which g++-$GCC_FORCED_VERSION)"
echo "USER WANTS TO FORCE USE of GCC $GCC_FORCED_VERSION"
fi
if [ "$LUA_FORCED_VERSION" != "0" ] && [ "$LUA_FORCED_VERSION" != "" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DFORCE_LUA_VERSION=$LUA_FORCED_VERSION"
#echo "USER WANTS TO FORCE USE of LUA $LUA_FORCED_VERSION"

View File

@ -156,16 +156,18 @@ void Thread::addThreadToList() {
}
void Thread::removeThreadFromList() {
MutexSafeWrapper safeMutex(&Thread::mutexthreadList);
std::vector<Thread *>::iterator iterFind = std::find(Thread::threadList.begin(),Thread::threadList.end(),this);
if(iterFind == Thread::threadList.end()) {
if(this != cleanupThread.get()) {
char szBuf[8096]="";
snprintf(szBuf,8095,"In [%s::%s Line: %d] iterFind == Thread::threadList.end()",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
throw megaglest_runtime_error(szBuf);
if(Thread::threadList.empty() == false) {
std::vector<Thread *>::iterator iterFind = std::find(Thread::threadList.begin(),Thread::threadList.end(),this);
if(iterFind == Thread::threadList.end()) {
if(this != cleanupThread.get()) {
char szBuf[8096]="";
snprintf(szBuf,8095,"In [%s::%s Line: %d] iterFind == Thread::threadList.end() Thread::threadList.size() = %ld",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,Thread::threadList.size());
throw megaglest_runtime_error(szBuf);
}
}
else {
Thread::threadList.erase(iterFind);
}
}
else {
Thread::threadList.erase(iterFind);
}
safeMutex.ReleaseLock();
}