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.

162 lines
3.5 KiB

  1. AC_PREREQ(2.60)
  2. AC_INIT(libmpdclient, 2.14, musicpd-dev-team@lists.sourceforge.net)
  3. AC_CONFIG_SRCDIR([src/connection.c])
  4. AC_CONFIG_AUX_DIR(build)
  5. AM_INIT_AUTOMAKE([foreign 1.11 dist-xz subdir-objects silent-rules])
  6. AC_CONFIG_HEADERS([config.h])
  7. AC_CONFIG_MACRO_DIR([m4])
  8. AC_SUBST(MAJOR_VERSION,2)
  9. AC_SUBST(MINOR_VERSION,14)
  10. AC_SUBST(PATCH_VERSION,0)
  11. LIBMPDCLIENT_LIBTOOL_VERSION=2:14:0
  12. AC_SUBST(LIBMPDCLIENT_LIBTOOL_VERSION)
  13. # Remove the check for c++ and fortran compiler
  14. m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
  15. m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
  16. dnl Check for programs
  17. AC_PROG_CC_C99
  18. AC_PROG_INSTALL
  19. AC_PROG_LD
  20. AM_CONDITIONAL(HAVE_GNU_LD, test x$with_gnu_ld = xyes)
  21. AC_LIBTOOL_WIN32_DLL
  22. AC_PROG_LIBTOOL
  23. dnl
  24. dnl initialize variables
  25. dnl
  26. set -- $CFLAGS
  27. dnl
  28. dnl OS specific defaults
  29. dnl
  30. AC_CANONICAL_HOST
  31. case "$host_os" in
  32. mingw32* | windows*)
  33. LIBS="$LIBS -lws2_32"
  34. ;;
  35. esac
  36. dnl
  37. dnl Check for libraries
  38. dnl
  39. AC_SEARCH_LIBS([socket], [network socket])
  40. dnl
  41. dnl build options
  42. dnl
  43. AC_ARG_ENABLE(documentation,
  44. AS_HELP_STRING([--disable-documentation],
  45. [Disable API doc generation @<:@default=enabled@:>@]),,
  46. [enable_documentation=yes])
  47. if test "x$enable_documentation" = xyes; then
  48. AC_PATH_PROG(DOXYGEN, doxygen)
  49. if test x$DOXYGEN = x; then
  50. AC_MSG_ERROR([doxygen not found])
  51. fi
  52. AC_SUBST(DOXYGEN)
  53. fi
  54. AM_CONDITIONAL(DOXYGEN, test x$enable_documentation = xyes)
  55. AC_ARG_ENABLE(tcp,
  56. AS_HELP_STRING([--disable-tcp],
  57. [Disable TCP support @<:@default=enabled@:>@]),,
  58. [enable_tcp=yes])
  59. if test "x$enable_tcp" = xyes; then
  60. AC_DEFINE([ENABLE_TCP], 1, [Define to enable TCP support])
  61. AC_SEARCH_LIBS([gethostbyname], [nsl])
  62. AC_CHECK_FUNCS([getaddrinfo])
  63. AC_CHECK_FUNCS([strndup])
  64. fi
  65. AC_ARG_ENABLE(werror,
  66. AS_HELP_STRING([--enable-werror],
  67. [Treat warnings as errors @<:@default=disabled@:>@]),
  68. enable_werror=no)
  69. if test "x$enable_werror" = xyes; then
  70. AM_CFLAGS="$AM_CFLAGS -Werror -pedantic-errors"
  71. fi
  72. AC_ARG_ENABLE(debug,
  73. AS_HELP_STRING([--enable-debug],
  74. [Enable debugging @<:@default=disabled@:>@]),
  75. enable_debug=no)
  76. if test "x$enable_debug" = xno; then
  77. AM_CFLAGS="$AM_CFLAGS -DNDEBUG"
  78. fi
  79. dnl
  80. dnl CFLAGS
  81. dnl
  82. AC_SUBST(AM_CFLAGS)
  83. AC_SUBST(AM_CPPFLAGS)
  84. WANTED_CFLAGS="-Wall -W -Wextra -Wno-deprecated-declarations -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wcast-qual -Wwrite-strings"
  85. for flag in $WANTED_CFLAGS ; do
  86. AX_CHECK_COMPILER_FLAGS([$flag], [CFLAGS="$CFLAGS $flag"],)
  87. done
  88. dnl
  89. dnl Compile-time options
  90. dnl
  91. AC_ARG_WITH([default-socket],
  92. AC_HELP_STRING([--with-default-socket=PATH],
  93. [default path of the socket file @<:@/var/run/mpd/socket@:>@]),,
  94. [with_default_socket=auto])
  95. if test x$with_default_socket = xauto; then
  96. case "$host_os" in
  97. mingw32* | windows*)
  98. # no UNIX domain sockets on WIN32
  99. with_default_socket=no
  100. ;;
  101. *)
  102. with_default_socket=/var/run/mpd/socket
  103. ;;
  104. esac
  105. fi
  106. if test x$with_default_socket != xno; then
  107. AC_DEFINE_UNQUOTED([DEFAULT_SOCKET], ["$with_default_socket"],
  108. [Default UNIX socket path])
  109. fi
  110. AC_ARG_WITH([default-host],
  111. AC_HELP_STRING([--with-default-host=ARG],
  112. [default MPD host @<:@localhost@:>@]),,
  113. [with_default_host=localhost])
  114. AC_DEFINE_UNQUOTED([DEFAULT_HOST], ["$with_default_host"], [Default MPD host])
  115. AC_ARG_WITH([default-port],
  116. AC_HELP_STRING([--with-default-port=ARG],
  117. [default MPD port @<:@6600@:>@]),,
  118. [with_default_port=6600])
  119. AC_DEFINE_UNQUOTED([DEFAULT_PORT], [$with_default_port], [Default MPD port])
  120. dnl
  121. dnl Done
  122. dnl
  123. AC_OUTPUT([Makefile include/mpd/version.h libmpdclient.pc doc/doxygen.conf])