|
1 | 1 | # |
2 | | -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
| 2 | +# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | # |
5 | 5 | # This code is free software; you can redistribute it and/or modify it |
@@ -55,6 +55,39 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_GRAALUNIT], |
55 | 55 | AC_SUBST(GRAALUNIT_LIB) |
56 | 56 | ]) |
57 | 57 |
|
| 58 | +############################################################################### |
| 59 | +# |
| 60 | +# Setup and check for gtest framework source files |
| 61 | +# |
| 62 | +AC_DEFUN_ONCE([LIB_TESTS_SETUP_GTEST], |
| 63 | +[ |
| 64 | + AC_ARG_WITH(gtest, [AS_HELP_STRING([--with-gtest], |
| 65 | + [specify prefix directory for the gtest framework])]) |
| 66 | +
|
| 67 | + if test "x${with_gtest}" != x; then |
| 68 | + AC_MSG_CHECKING([for gtest]) |
| 69 | + if test "x${with_gtest}" = xno; then |
| 70 | + AC_MSG_RESULT([no, disabled]) |
| 71 | + elif test "x${with_gtest}" = xyes; then |
| 72 | + AC_MSG_RESULT([no, error]) |
| 73 | + AC_MSG_ERROR([--with-gtest must have a value]) |
| 74 | + else |
| 75 | + if ! test -s "${with_gtest}/googletest/include/gtest/gtest.h"; then |
| 76 | + AC_MSG_RESULT([no]) |
| 77 | + AC_MSG_ERROR([Can't find 'googletest/include/gtest/gtest.h' under ${with_gtest} given with the --with-gtest option.]) |
| 78 | + elif ! test -s "${with_gtest}/googlemock/include/gmock/gmock.h"; then |
| 79 | + AC_MSG_RESULT([no]) |
| 80 | + AC_MSG_ERROR([Can't find 'googlemock/include/gmock/gmock.h' under ${with_gtest} given with the --with-gtest option.]) |
| 81 | + else |
| 82 | + GTEST_FRAMEWORK_SRC=${with_gtest} |
| 83 | + AC_MSG_RESULT([$GTEST_FRAMEWORK_SRC]) |
| 84 | + fi |
| 85 | + fi |
| 86 | + fi |
| 87 | +
|
| 88 | + AC_SUBST(GTEST_FRAMEWORK_SRC) |
| 89 | +]) |
| 90 | + |
58 | 91 | ############################################################################### |
59 | 92 | # |
60 | 93 | # Setup and check the Java Microbenchmark Harness |
|
0 commit comments