PageRenderTime 33ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/tools/autotools/m4/perl-autofrisk.m4

#
m4 | 57 lines | 25 code | 4 blank | 28 comment | 0 complexity | 2ffaee245ed31e7657879201b8cb31a1 MD5 | raw file
Possible License(s): GPL-2.0
  1. #
  2. # SYNOPSIS
  3. #
  4. # PERL_AUTOFRISK_MODULES(MODULES,[ACTION-IF-TRUE],[ACTION-IF-FALSE])
  5. #
  6. # This macro looks if the supplied MODULES are available under the perl
  7. # interpreter supplied into the PERL environment variable.
  8. # All log message will be dumped to config.log.
  9. #
  10. # COPYLEFT
  11. #
  12. # Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
  13. #
  14. # This program is free software; you can redistribute it and/or
  15. # modify it under the terms of the GNU General Public License as
  16. # published by the Free Software Foundation; either version 2 of the
  17. # License, or (at your option) any later version.
  18. #
  19. # This program is distributed in the hope that it will be useful, but
  20. # WITHOUT ANY WARRANTY; without even the implied warranty of
  21. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  22. # General Public License for more details.
  23. #
  24. # You should have received a copy of the GNU General Public License
  25. # along with this program; if not, write to the Free Software
  26. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  27. # 02111-1307, USA.
  28. AC_DEFUN([PERL_AUTOFRISK_MODULES],[
  29. pa_perl_modules="$1"
  30. AS_IF([test -n "$PERL"],[
  31. pa_perl_modules_failed=0
  32. for pa_perl_module in $pa_perl_modules; do
  33. AC_MSG_CHECKING(for perl module $pa_perl_module)
  34. # Perform check and log its output to config.log
  35. AS_IF([AC_TRY_COMMAND($PERL "-M$pa_perl_module" -e exit 1>&AS_MESSAGE_LOG_FD)],[
  36. AC_MSG_RESULT([yes]);
  37. ],[
  38. AC_MSG_RESULT([no]);
  39. pa_perl_modules_failed=1
  40. ])
  41. done
  42. AS_IF([test "$pa_perl_modules_failed" = 0],[
  43. :
  44. $2
  45. ],[
  46. :
  47. $3
  48. ])
  49. ],[
  50. :
  51. $3
  52. ])
  53. ])