author | mullan |
Wed, 13 Nov 2019 13:43:06 -0500 | |
changeset 59059 | 27a266d5fb13 |
parent 52595 | 16609197022c |
permissions | -rw-r--r-- |
50908 | 1 |
# |
2 |
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
############################################################################### |
|
27 |
# |
|
28 |
# Check for graalunit libs, needed for running graalunit tests. |
|
29 |
# |
|
30 |
AC_DEFUN_ONCE([LIB_TESTS_SETUP_GRAALUNIT], |
|
31 |
[ |
|
32 |
AC_ARG_WITH(graalunit-lib, [AS_HELP_STRING([--with-graalunit-lib], |
|
33 |
[specify location of 3rd party libraries used by Graal unit tests])]) |
|
34 |
||
35 |
GRAALUNIT_LIB= |
|
36 |
if test "x${with_graalunit_lib}" != x; then |
|
37 |
AC_MSG_CHECKING([for graalunit libs]) |
|
38 |
if test "x${with_graalunit_lib}" = xno; then |
|
39 |
AC_MSG_RESULT([disabled, graalunit tests can not be run]) |
|
40 |
elif test "x${with_graalunit_lib}" = xyes; then |
|
41 |
AC_MSG_RESULT([not specified]) |
|
42 |
AC_MSG_ERROR([You must specify the path to 3rd party libraries used by Graal unit tests]) |
|
43 |
else |
|
44 |
GRAALUNIT_LIB="${with_graalunit_lib}" |
|
45 |
if test ! -d "${GRAALUNIT_LIB}"; then |
|
46 |
AC_MSG_RESULT([no]) |
|
47 |
AC_MSG_ERROR([Could not find graalunit 3rd party libraries as specified. (${with_graalunit_lib})]) |
|
48 |
else |
|
49 |
AC_MSG_RESULT([$GRAALUNIT_LIB]) |
|
50 |
fi |
|
51 |
fi |
|
52 |
fi |
|
53 |
||
54 |
BASIC_FIXUP_PATH([GRAALUNIT_LIB]) |
|
55 |
AC_SUBST(GRAALUNIT_LIB) |
|
56 |
]) |
|
57 |
||
52595
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
58 |
############################################################################### |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
59 |
# |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
60 |
# Setup and check the Java Microbenchmark Harness |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
61 |
# |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
62 |
AC_DEFUN_ONCE([LIB_TESTS_SETUP_JMH], |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
63 |
[ |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
64 |
AC_ARG_WITH(jmh, [AS_HELP_STRING([--with-jmh], |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
65 |
[Java Microbenchmark Harness for building the OpenJDK Microbenchmark Suite])]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
66 |
|
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
67 |
AC_MSG_CHECKING([for jmh (Java Microbenchmark Harness)]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
68 |
if test "x$with_jmh" = xno || test "x$with_jmh" = x; then |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
69 |
AC_MSG_RESULT([no, disabled]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
70 |
elif test "x$with_jmh" = xyes; then |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
71 |
AC_MSG_RESULT([no, error]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
72 |
AC_MSG_ERROR([--with-jmh requires a directory containing all jars needed by JMH]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
73 |
else |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
74 |
# Path specified |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
75 |
JMH_HOME="$with_jmh" |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
76 |
if test ! -d [$JMH_HOME]; then |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
77 |
AC_MSG_RESULT([no, error]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
78 |
AC_MSG_ERROR([$JMH_HOME does not exist or is not a directory]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
79 |
fi |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
80 |
BASIC_FIXUP_PATH([JMH_HOME]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
81 |
|
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
82 |
jar_names="jmh-core jmh-generator-annprocess jopt-simple commons-math3" |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
83 |
for jar in $jar_names; do |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
84 |
found_jar_files=$($ECHO $(ls $JMH_HOME/$jar-*.jar 2> /dev/null)) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
85 |
|
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
86 |
if test "x$found_jar_files" = x; then |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
87 |
AC_MSG_RESULT([no]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
88 |
AC_MSG_ERROR([--with-jmh does not contain $jar-*.jar]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
89 |
elif ! test -e "$found_jar_files"; then |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
90 |
AC_MSG_RESULT([no]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
91 |
AC_MSG_ERROR([--with-jmh contain multiple $jar-*.jar: $found_jar_files]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
92 |
fi |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
93 |
|
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
94 |
found_jar_var_name=found_${jar//-/_} |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
95 |
eval $found_jar_var_name='"'$found_jar_files'"' |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
96 |
done |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
97 |
AC_MSG_RESULT([yes]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
98 |
|
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
99 |
JMH_CORE_JAR=$found_jmh_core |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
100 |
JMH_GENERATOR_JAR=$found_jmh_generator_annprocess |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
101 |
JMH_JOPT_SIMPLE_JAR=$found_jopt_simple |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
102 |
JMH_COMMONS_MATH_JAR=$found_commons_math3 |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
103 |
|
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
104 |
|
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
105 |
if [ [[ "$JMH_CORE_JAR" =~ jmh-core-(.*)\.jar$ ]] ] ; then |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
106 |
JMH_VERSION=${BASH_REMATCH[[1]]} |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
107 |
else |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
108 |
JMH_VERSION=unknown |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
109 |
fi |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
110 |
|
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
111 |
AC_MSG_NOTICE([JMH core version: $JMH_VERSION]) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
112 |
fi |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
113 |
|
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
114 |
AC_SUBST(JMH_CORE_JAR) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
115 |
AC_SUBST(JMH_GENERATOR_JAR) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
116 |
AC_SUBST(JMH_JOPT_SIMPLE_JAR) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
117 |
AC_SUBST(JMH_COMMONS_MATH_JAR) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
118 |
AC_SUBST(JMH_VERSION) |
16609197022c
8061281: Microbenchmark suite build support, directory layout and sample benchmarks
redestad
parents:
50908
diff
changeset
|
119 |
]) |