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.

78 lines
2.2KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_lib_id3.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_LIB_ID3([ACTION-IF-TRUE], [ACTION-IF-FALSE])
  8. #
  9. # DESCRIPTION
  10. #
  11. # This macro will check for the existence of id3lib
  12. # (http://id3lib.sourceforge.net/). It does this by checking for the
  13. # header file id3.h and the id3 library object file. A --with-id3lib
  14. # option is supported as well. The following output variables are set with
  15. # AC_SUBST:
  16. #
  17. # ID3_CPPFLAGS
  18. # ID3_LDFLAGS
  19. # ID3_LIBS
  20. #
  21. # You can use them like this in Makefile.am:
  22. #
  23. # AM_CPPFLAGS = $(ID3_CPPFLAGS)
  24. # AM_LDFLAGS = $(ID3_LDFLAGS)
  25. # program_LDADD = $(ID3_LIBS)
  26. #
  27. # Additionally, the C preprocessor symbol HAVE_ID3LIB will be defined with
  28. # AC_DEFINE if id3lib is available.
  29. #
  30. # LICENSE
  31. #
  32. # Copyright (c) 2009 Oskar Liljeblad <oskar@osk.mine.nu>
  33. #
  34. # Copying and distribution of this file, with or without modification, are
  35. # permitted in any medium without royalty provided the copyright notice
  36. # and this notice are preserved. This file is offered as-is, without any
  37. # warranty.
  38. #serial 6
  39. AU_ALIAS([AC_LIB_ID3], [AX_LIB_ID3])
  40. AC_DEFUN([AX_LIB_ID3], [
  41. AH_TEMPLATE([HAVE_ID3LIB], [Define if id3lib is available])
  42. AC_ARG_WITH(id3lib, [ --with-id3lib=DIR prefix for id3 library files and headers], [
  43. if test "$withval" = "no"; then
  44. ac_id3_path=
  45. $2
  46. elif test "$withval" = "yes"; then
  47. ac_id3_path=/usr
  48. else
  49. ac_id3_path="$withval"
  50. fi
  51. ],[ac_id3_path=/usr])
  52. if test "$ac_id3_path" != ""; then
  53. saved_CPPFLAGS="$CPPFLAGS"
  54. CPPFLAGS="$CPPFLAGS -I$ac_id3_path/include"
  55. AC_CHECK_HEADER([id3.h], [
  56. saved_LDFLAGS="$LDFLAGS"
  57. LDFLAGS="$LDFLAGS -L$ac_id3_path/lib"
  58. AC_CHECK_LIB(id3, ID3Tag_New, [
  59. AC_SUBST(ID3_CPPFLAGS, [-I$ac_id3_path/include])
  60. AC_SUBST(ID3_LDFLAGS, [-L$ac_id3_path/lib])
  61. AC_SUBST(ID3_LIBS, [-lid3])
  62. AC_DEFINE([HAVE_ID3LIB])
  63. $1
  64. ], [
  65. :
  66. $2
  67. ])
  68. LDFLAGS="$saved_LDFLAGS"
  69. ], [
  70. AC_MSG_RESULT([not found])
  71. $2
  72. ])
  73. CPPFLAGS="$saved_CPPFLAGS"
  74. fi
  75. ])