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.

65 lines
2.7KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_func_getopt_long.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_FUNC_GETOPT_LONG
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check for getopt_long support.
  12. #
  13. # This assume that the standard getopt.h file (from GNU libc) is available
  14. # as lib/gnugetopt.h. If needed, this file will be linked as getopt.h, but
  15. # we want to default to the system's getopt.h file. (See
  16. # http://sources.redhat.com/ml/automake/2000-09/msg00041.html for an
  17. # explanation about why using the system's getopt.h file is important.)
  18. #
  19. # LICENSE
  20. #
  21. # Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
  22. #
  23. # This program is free software; you can redistribute it and/or modify it
  24. # under the terms of the GNU General Public License as published by the
  25. # Free Software Foundation; either version 2 of the License, or (at your
  26. # option) any later version.
  27. #
  28. # This program is distributed in the hope that it will be useful, but
  29. # WITHOUT ANY WARRANTY; without even the implied warranty of
  30. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  31. # Public License for more details.
  32. #
  33. # You should have received a copy of the GNU General Public License along
  34. # with this program. If not, see <https://www.gnu.org/licenses/>.
  35. #
  36. # As a special exception, the respective Autoconf Macro's copyright owner
  37. # gives unlimited permission to copy, distribute and modify the configure
  38. # scripts that are the output of Autoconf when processing the Macro. You
  39. # need not follow the terms of the GNU General Public License when using
  40. # or distributing such scripts, even though portions of the text of the
  41. # Macro appear in them. The GNU General Public License (GPL) does govern
  42. # all other use of the material that constitutes the Autoconf Macro.
  43. #
  44. # This special exception to the GPL applies to versions of the Autoconf
  45. # Macro released by the Autoconf Archive. When you make and distribute a
  46. # modified version of the Autoconf Macro, you may extend this special
  47. # exception to the GPL to apply to your modified version as well.
  48. #serial 6
  49. AU_ALIAS([ADL_FUNC_GETOPT_LONG], [AX_FUNC_GETOPT_LONG])
  50. AC_DEFUN([AX_FUNC_GETOPT_LONG],
  51. [AC_PREREQ(2.49)dnl
  52. # clean out junk possibly left behind by a previous configuration
  53. rm -f lib/getopt.h
  54. # Check for getopt_long support
  55. AC_CHECK_HEADERS([getopt.h])
  56. AC_CHECK_FUNCS([getopt_long],,
  57. [# FreeBSD has a gnugetopt library for this
  58. AC_CHECK_LIB([gnugetopt],[getopt_long],[AC_DEFINE([HAVE_GETOPT_LONG])],
  59. [# use the GNU replacement
  60. AC_LIBOBJ(getopt)
  61. AC_LIBOBJ(getopt1)
  62. AC_CONFIG_LINKS([lib/getopt.h:lib/gnugetopt.h])])])])