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.

80 lines
3.3KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_class.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_CLASS
  8. #
  9. # DESCRIPTION
  10. #
  11. # AX_CHECK_CLASS tests the existence of a given Java class, either in a
  12. # jar or in a '.class' file.
  13. #
  14. # *Warning*: its success or failure can depend on a proper setting of the
  15. # CLASSPATH env. variable.
  16. #
  17. # Note: This is part of the set of autoconf M4 macros for Java programs.
  18. # It is VERY IMPORTANT that you download the whole set, some macros depend
  19. # on other. Unfortunately, the autoconf archive does not support the
  20. # concept of set of macros, so I had to break it for submission. The
  21. # general documentation, as well as the sample configure.in, is included
  22. # in the AX_PROG_JAVA macro.
  23. #
  24. # LICENSE
  25. #
  26. # Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
  27. #
  28. # This program is free software; you can redistribute it and/or modify it
  29. # under the terms of the GNU General Public License as published by the
  30. # Free Software Foundation; either version 2 of the License, or (at your
  31. # option) any later version.
  32. #
  33. # This program is distributed in the hope that it will be useful, but
  34. # WITHOUT ANY WARRANTY; without even the implied warranty of
  35. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  36. # Public License for more details.
  37. #
  38. # You should have received a copy of the GNU General Public License along
  39. # with this program. If not, see <https://www.gnu.org/licenses/>.
  40. #
  41. # As a special exception, the respective Autoconf Macro's copyright owner
  42. # gives unlimited permission to copy, distribute and modify the configure
  43. # scripts that are the output of Autoconf when processing the Macro. You
  44. # need not follow the terms of the GNU General Public License when using
  45. # or distributing such scripts, even though portions of the text of the
  46. # Macro appear in them. The GNU General Public License (GPL) does govern
  47. # all other use of the material that constitutes the Autoconf Macro.
  48. #
  49. # This special exception to the GPL applies to versions of the Autoconf
  50. # Macro released by the Autoconf Archive. When you make and distribute a
  51. # modified version of the Autoconf Macro, you may extend this special
  52. # exception to the GPL to apply to your modified version as well.
  53. #serial 12
  54. AU_ALIAS([AC_CHECK_CLASS], [AX_CHECK_CLASS])
  55. AC_DEFUN([AX_CHECK_CLASS],[
  56. AC_REQUIRE([AX_PROG_JAVA])
  57. ac_var_name=`echo $1 | sed 's/\./_/g'`
  58. dnl Normally I'd use a AC_CACHE_CHECK here but since the variable name is
  59. dnl dynamic I need an extra level of extraction
  60. AC_MSG_CHECKING([for $1 class])
  61. AC_CACHE_VAL(ax_cv_class_$ac_var_name, [
  62. AX_TRY_COMPILE_JAVA([$1], , [eval "ac_cv_class_$ac_var_name=yes"],
  63. [eval "ac_cv_class_$ac_var_name=no"])
  64. eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
  65. eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`"
  66. HAVE_LAST_CLASS=$ac_var_val
  67. if test x$ac_var_val = xyes; then
  68. ifelse([$2], , :, [$2])
  69. else
  70. ifelse([$3], , :, [$3])
  71. fi
  72. ])
  73. dnl for some reason the above statement didn't fall though here?
  74. dnl do scripts have variable scoping?
  75. eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
  76. AC_MSG_RESULT($ac_var_val)
  77. ])