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.

76 lines
2.9KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_xtra_classpath.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_XTRA_CLASSPATH(<classpath>,<class>,<jarfile>,<action-if-found>,<action-if-not-found>)
  8. #
  9. # DESCRIPTION
  10. #
  11. # Set $1 to extra classpath components required for class $2 found in a
  12. # jar file in $3. If the class is found do $4 and otherwise do $5. Uses
  13. # AX_JAVA_CHECK_CLASS for testing whether a class is available
  14. #
  15. # LICENSE
  16. #
  17. # Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
  18. #
  19. # This program is free software; you can redistribute it and/or modify it
  20. # under the terms of the GNU General Public License as published by the
  21. # Free Software Foundation; either version 2 of the License, or (at your
  22. # option) any later version.
  23. #
  24. # This program is distributed in the hope that it will be useful, but
  25. # WITHOUT ANY WARRANTY; without even the implied warranty of
  26. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  27. # Public License for more details.
  28. #
  29. # You should have received a copy of the GNU General Public License along
  30. # with this program. If not, see <https://www.gnu.org/licenses/>.
  31. #
  32. # As a special exception, the respective Autoconf Macro's copyright owner
  33. # gives unlimited permission to copy, distribute and modify the configure
  34. # scripts that are the output of Autoconf when processing the Macro. You
  35. # need not follow the terms of the GNU General Public License when using
  36. # or distributing such scripts, even though portions of the text of the
  37. # Macro appear in them. The GNU General Public License (GPL) does govern
  38. # all other use of the material that constitutes the Autoconf Macro.
  39. #
  40. # This special exception to the GPL applies to versions of the Autoconf
  41. # Macro released by the Autoconf Archive. When you make and distribute a
  42. # modified version of the Autoconf Macro, you may extend this special
  43. # exception to the GPL to apply to your modified version as well.
  44. #serial 11
  45. AU_ALIAS([DPS_XTRA_CLASSPATH], [AX_XTRA_CLASSPATH])
  46. AC_DEFUN([AX_XTRA_CLASSPATH],[
  47. AC_PROG_SED
  48. POTENTIAL_LOCATIONS="/usr/share/java"
  49. for jhome in `ls -dr /usr/java/* /usr/local/java/* 2> /dev/null`; do
  50. for jdir in lib jre/lib; do
  51. POTENTIAL_LOCATIONS="$POTENTIAL_LOCATIONS $jhome/$jdir"
  52. done; done
  53. AX_JAVA_CHECK_CLASS([$2],[got="yes"],[got="no"])
  54. cpxtra=""; saved_cp="${CLASSPATH}";
  55. for location in $POTENTIAL_LOCATIONS; do
  56. for jfile in $3; do
  57. if test "x$got" != "xyes" && test -f "$location/$jfile"; then
  58. CLASSPATH="${saved_cp}:$location/$jfile"
  59. AX_JAVA_CHECK_CLASS([$2],[got="yes"; cpxtra="$location/$jfile:"],[got="no"])
  60. fi; done; done;
  61. if test "x${saved_cp}" != "x"; then
  62. CLASSPATH="${saved_cp}"
  63. else unset CLASSPATH; fi
  64. if test "x$got" = "xyes"; then
  65. $1="$cpxtra"
  66. $4
  67. true; else
  68. $5
  69. false; fi
  70. ])