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.

61 lines
2.5KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_dirname.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_DIRNAME(PATHNAME)
  8. #
  9. # DESCRIPTION
  10. #
  11. # Parts of the implementation have been taken from AS_DIRNAME from the
  12. # main autoconf package in generation 2.5x. However, we do only use "sed"
  13. # to cut out the dirname, and we do additionally clean up some dir/..
  14. # parts in the resulting pattern.
  15. #
  16. # this macro may be used in autoconf 2.13 scripts as well.
  17. #
  18. # LICENSE
  19. #
  20. # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
  21. #
  22. # This program is free software; you can redistribute it and/or modify it
  23. # under the terms of the GNU General Public License as published by the
  24. # Free Software Foundation; either version 3 of the License, or (at your
  25. # option) any later version.
  26. #
  27. # This program is distributed in the hope that it will be useful, but
  28. # WITHOUT ANY WARRANTY; without even the implied warranty of
  29. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  30. # Public License for more details.
  31. #
  32. # You should have received a copy of the GNU General Public License along
  33. # with this program. If not, see <https://www.gnu.org/licenses/>.
  34. #
  35. # As a special exception, the respective Autoconf Macro's copyright owner
  36. # gives unlimited permission to copy, distribute and modify the configure
  37. # scripts that are the output of Autoconf when processing the Macro. You
  38. # need not follow the terms of the GNU General Public License when using
  39. # or distributing such scripts, even though portions of the text of the
  40. # Macro appear in them. The GNU General Public License (GPL) does govern
  41. # all other use of the material that constitutes the Autoconf Macro.
  42. #
  43. # This special exception to the GPL applies to versions of the Autoconf
  44. # Macro released by the Autoconf Archive. When you make and distribute a
  45. # modified version of the Autoconf Macro, you may extend this special
  46. # exception to the GPL to apply to your modified version as well.
  47. #serial 8
  48. AC_DEFUN([AX_DIRNAME],
  49. [echo X[]$1 |
  50. sed ['s/\/[^\/:][^\/:]*\/..\//\//g
  51. s/\/[^\/:][^\/:]*\/..\//\//g
  52. s/\/[^\/:][^\/:]*\/..\//\//g
  53. s/\/[^\/:][^\/:]*\/..\//\//g
  54. /^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  55. /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  56. /^X\(\/\/\)$/{ s//\1/; q; }
  57. /^X\(\/\).*/{ s//\1/; q; }
  58. s/.*/./; q']])