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.

105 lines
3.6KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_prog_java_cc.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_PROG_JAVA_CC
  8. #
  9. # DESCRIPTION
  10. #
  11. # Finds the appropriate java compiler on your path. By preference the java
  12. # compiler is gcj, then jikes then javac.
  13. #
  14. # The macro can take one argument specifying a space separated list of
  15. # java compiler names.
  16. #
  17. # For example:
  18. #
  19. # AX_PROG_JAVA_CC(javac, gcj)
  20. #
  21. # The macro also sets the compiler options variable: JAVA_CC_OPTS to
  22. # something sensible:
  23. #
  24. # - for GCJ it sets it to: @GCJ_OPTS@
  25. # (if GCJ_OPTS is not yet defined then it is set to "-C")
  26. #
  27. # - no other compiler has applicable options yet
  28. #
  29. # Here's an example configure.in:
  30. #
  31. # AC_INIT(Makefile.in)
  32. # AX_PROG_JAVA_CC()
  33. # AC_OUTPUT(Makefile)
  34. # dnl End.
  35. #
  36. # And here's the start of the Makefile.in:
  37. #
  38. # PROJECT_ROOT := @srcdir@
  39. # # Tool definitions.
  40. # JAVAC := @JAVA_CC@
  41. # JAVAC_OPTS := @JAVA_CC_OPTS@
  42. # JAR_TOOL := @jar_tool@
  43. #
  44. # LICENSE
  45. #
  46. # Copyright (c) 2008 Nic Ferrier <nferrier@tapsellferrier.co.uk>
  47. #
  48. # This program is free software; you can redistribute it and/or modify it
  49. # under the terms of the GNU General Public License as published by the
  50. # Free Software Foundation; either version 2 of the License, or (at your
  51. # option) any later version.
  52. #
  53. # This program is distributed in the hope that it will be useful, but
  54. # WITHOUT ANY WARRANTY; without even the implied warranty of
  55. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  56. # Public License for more details.
  57. #
  58. # You should have received a copy of the GNU General Public License along
  59. # with this program. If not, see <https://www.gnu.org/licenses/>.
  60. #
  61. # As a special exception, the respective Autoconf Macro's copyright owner
  62. # gives unlimited permission to copy, distribute and modify the configure
  63. # scripts that are the output of Autoconf when processing the Macro. You
  64. # need not follow the terms of the GNU General Public License when using
  65. # or distributing such scripts, even though portions of the text of the
  66. # Macro appear in them. The GNU General Public License (GPL) does govern
  67. # all other use of the material that constitutes the Autoconf Macro.
  68. #
  69. # This special exception to the GPL applies to versions of the Autoconf
  70. # Macro released by the Autoconf Archive. When you make and distribute a
  71. # modified version of the Autoconf Macro, you may extend this special
  72. # exception to the GPL to apply to your modified version as well.
  73. #serial 5
  74. # AX_PROG_JAVA_CC([COMPILER ...])
  75. # --------------------------
  76. # COMPILER ... is a space separated list of java compilers to search for.
  77. # This just gives the user an opportunity to specify an alternative
  78. # search list for the java compiler.
  79. AU_ALIAS([AC_PROG_JAVA_CC], [AX_PROG_JAVA_CC])
  80. AC_DEFUN([AX_PROG_JAVA_CC],
  81. [AC_ARG_VAR([JAVA_CC], [java compiler command])dnl
  82. AC_ARG_VAR([JAVA_CC_FLAGS], [java compiler flags])dnl
  83. m4_ifval([$1],
  84. [AC_CHECK_TOOLS(JAVA_CC, [$1])],
  85. [AC_CHECK_TOOL(JAVA_CC, gcj)
  86. if test -z "$JAVA_CC"; then
  87. AC_CHECK_TOOL(JAVA_CC, javac)
  88. fi
  89. if test -z "$JAVA_CC"; then
  90. AC_CHECK_TOOL(JAVA_CC, jikes)
  91. fi
  92. ])
  93. if test "$JAVA_CC" = "gcj"; then
  94. if test "$GCJ_OPTS" = ""; then
  95. AC_SUBST(GCJ_OPTS,-C)
  96. fi
  97. AC_SUBST(JAVA_CC_OPTS, @GCJ_OPTS@,
  98. [Define the compilation options for GCJ])
  99. fi
  100. test -z "$JAVA_CC" && AC_MSG_ERROR([no acceptable java compiler found in \$PATH])
  101. ])# AX_PROG_JAVA_CC