< prev index next >

make/autoconf/lib-tests.m4

Print this page
rev 59401 : [mq]: 8245610
rev 59403 : imported patch 8245610-copyright

@@ -1,7 +1,7 @@
 #
-# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 only, as
 # published by the Free Software Foundation.  Oracle designates this

@@ -55,10 +55,43 @@
   AC_SUBST(GRAALUNIT_LIB)
 ])
 
 ###############################################################################
 #
+# Setup and check for gtest framework source files
+#
+AC_DEFUN_ONCE([LIB_TESTS_SETUP_GTEST],
+[
+  AC_ARG_WITH(gtest, [AS_HELP_STRING([--with-gtest],
+      [specify prefix directory for the gtest framework])])
+
+  if test "x${with_gtest}" != x; then
+    AC_MSG_CHECKING([for gtest])
+    if test "x${with_gtest}" = xno; then
+      AC_MSG_RESULT([no, disabled])
+    elif test "x${with_gtest}" = xyes; then
+      AC_MSG_RESULT([no, error])
+      AC_MSG_ERROR([--with-gtest must have a value])
+    else
+      if ! test -s "${with_gtest}/googletest/include/gtest/gtest.h"; then
+        AC_MSG_RESULT([no])
+        AC_MSG_ERROR([Can't find 'googletest/include/gtest/gtest.h' under ${with_gtest} given with the --with-gtest option.])
+      elif ! test -s "${with_gtest}/googlemock/include/gmock/gmock.h"; then
+        AC_MSG_RESULT([no])
+        AC_MSG_ERROR([Can't find 'googlemock/include/gmock/gmock.h' under ${with_gtest} given with the --with-gtest option.])
+      else
+        GTEST_FRAMEWORK_SRC=${with_gtest}
+        AC_MSG_RESULT([$GTEST_FRAMEWORK_SRC])
+      fi
+    fi
+  fi
+
+  AC_SUBST(GTEST_FRAMEWORK_SRC)
+])
+
+###############################################################################
+#
 # Setup and check the Java Microbenchmark Harness
 #
 AC_DEFUN_ONCE([LIB_TESTS_SETUP_JMH],
 [
   AC_ARG_WITH(jmh, [AS_HELP_STRING([--with-jmh],
< prev index next >