]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips64: modify configure.ac to check for cavium supported toolchain
authorPetar Jovanovic <mips32r2@gmail.com>
Wed, 29 Jan 2014 18:08:50 +0000 (18:08 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Wed, 29 Jan 2014 18:08:50 +0000 (18:08 +0000)
Modify configure to check if we can pass -march=octeon or -march=octeon2
flags to the compiler. This part is required as it gives us information how
to compile (i.e. whether to compile) tests specific for Cavium Octeon boards.

Patch by Zahid Anwar, with minor modifications.

Related to Bugzilla issue 326444.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13783

configure.ac

index 91996261c93cb6cbc934d506dadc33a0449305ab..fb17ce4afd0d261203fd925fb2ae9dd2793be68f 100644 (file)
@@ -1490,6 +1490,45 @@ CFLAGS=$safe_CFLAGS
 AC_SUBST(FLAG_M64)
 
 
+# does this compiler support -march=octeon (Cavium OCTEON I Specific) ?
+AC_MSG_CHECKING([if gcc accepts -march=octeon])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS -march=octeon"
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+  return 0;
+]])], [
+FLAG_OCTEON="-march=octeon"
+AC_MSG_RESULT([yes])
+], [
+FLAG_OCTEON=""
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+AC_SUBST(FLAG_OCTEON)
+
+# does this compiler support -march=octeon2 (Cavium OCTEON II Specific) ?
+AC_MSG_CHECKING([if gcc accepts -march=octeon2])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS -march=octeon2"
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+  return 0;
+]])], [
+FLAG_OCTEON2="-march=octeon2"
+AC_MSG_RESULT([yes])
+], [
+FLAG_OCTEON2=""
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+AC_SUBST(FLAG_OCTEON2)
+
+
 # does this compiler support -mmmx ?
 AC_MSG_CHECKING([if gcc accepts -mmmx])