Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.6KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_prog_scalac.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_PROG_SCALAC
  8. #
  9. # DESCRIPTION
  10. #
  11. # AX_PROG_SCALAC will check that a scala compiler is available, that it
  12. # works and set SCALAC for the Makefile.
  13. #
  14. # AX_PROG_SCALAC will search the path for a Scala compiler. To choose
  15. # another compiler use the environment variable SCALAC.
  16. #
  17. # LICENSE
  18. #
  19. # Copyright (c) 2013 Sveinung Kvilhaugsvik <sveinung84@users.sourceforge.net>
  20. #
  21. # Copying and distribution of this file, with or without modification, are
  22. # permitted in any medium without royalty provided the copyright notice
  23. # and this notice are preserved. This file is offered as-is, without any
  24. # warranty.
  25. #serial 2
  26. AC_ARG_VAR(SCALAC, [scala compiler])
  27. AC_DEFUN([AX_PROG_SCALAC], [
  28. AC_CHECK_PROGS(SCALAC, [scalac])
  29. AS_IF([test x"$SCALAC" != x], [
  30. AC_CACHE_VAL(ax_cv_scalac_works, [
  31. AC_MSG_CHECKING([if the Scala compiler works])
  32. TESTFILE=conftest.scala
  33. echo ["object conftest {"] > $TESTFILE
  34. echo [" def main(args: Array[String]): Unit = return"] >> $TESTFILE
  35. echo ["}"] >> $TESTFILE
  36. [$SCALAC $TESTFILE && ax_cv_scalac_works=yes || ax_cv_scalac_works=no]
  37. AC_MSG_RESULT($ax_cv_scalac_works)
  38. AS_IF([test x"$ax_cv_scalac_works" != xyes], [
  39. AC_MSG_ERROR([Scala compiler does not work. Unable to compile $TESTFILE])
  40. ])
  41. ])
  42. ], AC_MSG_WARN([Scala compiler not found]))
  43. ])