ast_check_gnu_make.m4 835 B

1234567891011121314151617181920
  1. AC_DEFUN([AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK([for GNU make], [ac_cv_GNU_MAKE],
  2. ac_cv_GNU_MAKE='Not Found' ;
  3. ac_cv_GNU_MAKE_VERSION_MAJOR=0 ;
  4. ac_cv_GNU_MAKE_VERSION_MINOR=0 ;
  5. for a in make gmake gnumake ; do
  6. if test -z "$a" ; then continue ; fi ;
  7. if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
  8. ac_cv_GNU_MAKE=$a ;
  9. ac_cv_GNU_MAKE_VERSION_MAJOR=`$ac_cv_GNU_MAKE --version | grep "GNU Make" | cut -f3 -d' ' | cut -f1 -d'.'`
  10. ac_cv_GNU_MAKE_VERSION_MINOR=`$ac_cv_GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.' | cut -c1-2`
  11. break;
  12. fi
  13. done ;
  14. ) ;
  15. if test "x$ac_cv_GNU_MAKE" = "xNot Found" ; then
  16. AC_MSG_ERROR( *** Please install GNU make. It is required to build Asterisk!)
  17. exit 1
  18. fi
  19. AC_SUBST([GNU_MAKE], [$ac_cv_GNU_MAKE])
  20. ])