sanity.m4 819 B

123456789101112131415161718192021222324252627
  1. # Check to make sure that the build environment is sane. -*- Autoconf -*-
  2. # Copyright (C) 1996-2014 Free Software Foundation, Inc.
  3. #
  4. # This file is free software; the Free Software Foundation
  5. # gives unlimited permission to copy and/or distribute it,
  6. # with or without modifications, as long as this notice is preserved.
  7. # AM_SANITY_CHECK
  8. # ---------------
  9. AC_DEFUN([AM_SANITY_CHECK],
  10. [AC_MSG_CHECKING([whether build environment is sane])
  11. # Reject unsafe characters in $srcdir or the absolute working directory
  12. # name. Accept space and tab only in the latter.
  13. am_lf='
  14. '
  15. case `pwd` in
  16. *[[\\\"\#\$\&\'\`$am_lf]]*)
  17. AC_MSG_ERROR([unsafe absolute working directory name]);;
  18. esac
  19. case $srcdir in
  20. *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
  21. AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
  22. esac
  23. AC_MSG_RESULT([yes])
  24. ])