1# 2# Copyright 2014-2016 Nest Labs Inc. All Rights Reserved. 3# 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 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 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. 15# 16 17# 18# Description: 19# This file implements a GNU M4 autoconf macro for checking for 20# the existence of files. 21# 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 25# check. 26# 27 28# AX_CHECK_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 29# ------------------------------------------------------------- 30# 31# Check for the existence of FILE. 32AC_DEFUN([AX_CHECK_FILE], 33[AS_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl 34AC_CACHE_CHECK([for $1], [ac_File], 35[if test -r "$1"; then 36 AS_VAR_SET([ac_File], [yes]) 37else 38 AS_VAR_SET([ac_File], [no]) 39fi]) 40AS_VAR_IF([ac_File], [yes], [$2], [$3]) 41AS_VAR_POPDEF([ac_File])dnl 42])# AX_CHECK_FILE 43