ax_check_real_file.m4 845 B

123456789101112131415161718192021222324252627
  1. # AX_CHECK_REAL_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  2. # ------------------------------------------------------------------
  3. #
  4. # Check for the existence of FILE, and make sure it is a real file or
  5. # directory, and not a symbolic link.
  6. #
  7. AC_DEFUN([AX_CHECK_REAL_FILE],
  8. [AC_DIAGNOSE([cross],
  9. [cannot check for file existence when cross compiling])dnl
  10. AS_VAR_PUSHDEF([ac_RealFile], [ac_cv_real_file_$1])dnl
  11. AC_CACHE_CHECK([for $1], ac_RealFile,
  12. [test "$cross_compiling" = yes &&
  13. AC_MSG_ERROR([cannot check for file existence when cross compiling])
  14. if test -r "$1"
  15. then
  16. if test -h "$1"
  17. then
  18. AS_VAR_SET(ac_RealFile, no)
  19. else
  20. AS_VAR_SET(ac_RealFile, yes)
  21. fi
  22. else
  23. AS_VAR_SET(ac_RealFile, no)
  24. fi])
  25. AS_IF([test AS_VAR_GET(ac_RealFile) = yes], [$2], [$3])[]dnl
  26. AS_VAR_POPDEF([ac_RealFile])dnl
  27. ])# AX_CHECK_REAL_FILE