2 # Copyright 2014-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 implements a GNU M4 autoconf macro for checking for
20 # the existence of files.
22 # The autoconf version of AC_CHECK_FILE is absolutely broken in
23 # that it cannot check for files when cross-compiling even though
24 # the only thing it relies upon is a shell file readability
28 # AX_CHECK_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
29 # -------------------------------------------------------------
31 # Check for the existence of FILE.
32 AC_DEFUN([AX_CHECK_FILE],
33 [AS_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl
34 AC_CACHE_CHECK([for $1], [ac_File],
35 [if test -r "$1"; then
36 AS_VAR_SET([ac_File], [yes])
38 AS_VAR_SET([ac_File], [no])
40 AS_VAR_IF([ac_File], [yes], [$2], [$3])
41 AS_VAR_POPDEF([ac_File])dnl