Fix use of -fPIC in test script under Cygwin

pull/326/head
Jeffrey Walton 2016-10-14 04:16:04 -04:00
parent 0e82232d1d
commit 4b73230e36
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 17 additions and 4 deletions

View File

@ -472,6 +472,15 @@ else
fi fi
fi fi
# Cygwin and noisy compiles
rm -f "$TMP/adhoc.exe" > /dev/null 2>&1
if [[ (-z "$HAVE_PIC") ]]; then
HAVE_PIC=$("$CXX" -DCRYPTOPP_ADHOC_MAIN -fPIC adhoc.cpp -o "$TMP/adhoc.exe" 2>&1 | grep -c 'warning')
if [[ "$HAVE_PIC" -ne "0" ]]; then
HAVE_PIC=1
fi
fi
# GCC 4.8; Clang 3.4 # GCC 4.8; Clang 3.4
rm -f "$TMP/adhoc.exe" > /dev/null 2>&1 rm -f "$TMP/adhoc.exe" > /dev/null 2>&1
if [[ (-z "$HAVE_UBSAN") ]]; then if [[ (-z "$HAVE_UBSAN") ]]; then
@ -1795,10 +1804,14 @@ if [[ ("$GCC_COMPILER" -ne "0" || "$CLANG_COMPILER" -ne "0" || "$INTEL_COMPILER"
"$MAKE" clean > /dev/null 2>&1 "$MAKE" clean > /dev/null 2>&1
rm -f adhoc.cpp > /dev/null 2>&1 rm -f adhoc.cpp > /dev/null 2>&1
CXXFLAGS="$DEBUG_CXXFLAGS -march=i686 -fPIC -pipe ${DEPRECATED_CXXFLAGS[@]}" if [[ "$HAVE_PIC" -ne "0" ]]; then
PIC_FLAG=-fPIC
fi
CXXFLAGS="$DEBUG_CXXFLAGS -march=i686 $PIC_FLAG -pipe ${DEPRECATED_CXXFLAGS[@]}"
CXX="$CXX" "$MAKE" "${MAKEARGS[@]}" CXXFLAGS="$CXXFLAGS" static 2>&1 | tee -a "$TEST_RESULTS" CXX="$CXX" "$MAKE" "${MAKEARGS[@]}" CXXFLAGS="$CXXFLAGS" static 2>&1 | tee -a "$TEST_RESULTS"
CXXFLAGS="$DEBUG_CXXFLAGS -march=native -fPIC -pipe ${DEPRECATED_CXXFLAGS[@]}" CXXFLAGS="$DEBUG_CXXFLAGS -march=native $PIC_FLAG -pipe ${DEPRECATED_CXXFLAGS[@]}"
CXX="$CXX" "$MAKE" "${MAKEARGS[@]}" CXXFLAGS="$CXXFLAGS" cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" CXX="$CXX" "$MAKE" "${MAKEARGS[@]}" CXXFLAGS="$CXXFLAGS" cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
@ -1824,10 +1837,10 @@ if [[ ("$GCC_COMPILER" -ne "0" || "$CLANG_COMPILER" -ne "0" || "$INTEL_COMPILER"
"$MAKE" clean > /dev/null 2>&1 "$MAKE" clean > /dev/null 2>&1
rm -f adhoc.cpp > /dev/null 2>&1 rm -f adhoc.cpp > /dev/null 2>&1
CXXFLAGS="$RELEASE_CXXFLAGS -march=i686 -fPIC -pipe ${DEPRECATED_CXXFLAGS[@]}" CXXFLAGS="$RELEASE_CXXFLAGS -march=i686 $PIC_FLAG -pipe ${DEPRECATED_CXXFLAGS[@]}"
CXX="$CXX" "$MAKE" "${MAKEARGS[@]}" CXXFLAGS="$CXXFLAGS" static 2>&1 | tee -a "$TEST_RESULTS" CXX="$CXX" "$MAKE" "${MAKEARGS[@]}" CXXFLAGS="$CXXFLAGS" static 2>&1 | tee -a "$TEST_RESULTS"
CXXFLAGS="$RELEASE_CXXFLAGS -march=native -fPIC -pipe ${DEPRECATED_CXXFLAGS[@]}" CXXFLAGS="$RELEASE_CXXFLAGS -march=native $PIC_FLAG -pipe ${DEPRECATED_CXXFLAGS[@]}"
CXX="$CXX" "$MAKE" "${MAKEARGS[@]}" CXXFLAGS="$CXXFLAGS" cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" CXX="$CXX" "$MAKE" "${MAKEARGS[@]}" CXXFLAGS="$CXXFLAGS" cryptest.exe 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then