2 # Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 # This file defines a GNU autoconf M4-style macro that adds an
20 # --enable-tests configuration option to the package and controls
21 # whether the package will be built with or without unit and
26 # NL_ENABLE_TESTS(default)
28 # default - Whether the option should be enabled (yes) or disabled (no)
31 # Adds an --enable-tests configuration option to the package with a
32 # default value of 'default' (should be either 'no' or 'yes') and
33 # controls whether the package will be built with or without unit and
36 # The value 'nl_cv_build_tests' will be set to the result.
38 #------------------------------------------------------------------------------
40 AC_DEFUN([NL_ENABLE_TESTS],
42 # Check whether or not a default value has been passed in.
47 [m4_fatal([$0: invalid default value '$1'; must be 'yes' or 'no'])])
49 AC_CACHE_CHECK([whether to build tests],
53 [AS_HELP_STRING([--enable-tests],[Enable building of tests @<:@default=$1@:>@.])],
55 case "${enableval}" in
58 nl_cv_build_tests=${enableval}
62 AC_MSG_ERROR([Invalid value ${enableval} for --enable-tests])