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.

131 lines
4.3 KiB

  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.65])
  4. AC_INIT([pulseaudio-module-xrdp], [0.7], [xrdp-devel@googlegroups.com])
  5. # specify config_ac.h so we don't collide with pulseaudio's config.h
  6. AC_CONFIG_HEADERS([config_ac.h])
  7. AC_CONFIG_SRCDIR([src])
  8. AC_CONFIG_AUX_DIR([build-aux])
  9. AC_CONFIG_MACRO_DIRS([m4])
  10. AM_PROG_AR
  11. AM_INIT_AUTOMAKE([-Wall foreign silent-rules])
  12. AM_SILENT_RULES([yes])
  13. PKG_PROG_PKG_CONFIG
  14. if test "x$PKG_CONFIG" = "x"; then
  15. AC_MSG_ERROR([pkg-config not found])
  16. fi
  17. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  18. dnl ------------------------------------------------------------------
  19. dnl FIND_CONFIG_H(TOP_DIRECTORY)
  20. dnl Find the config.h file under TOP_DIRECTORY
  21. dnl
  22. dnl Outputs the enclosing directory. Only the first match is returned.
  23. dnl ------------------------------------------------------------------
  24. m4_define([FIND_CONFIG_H],
  25. [find $1 -type f -maxdepth 3 -type f -name config.h | \
  26. sed -e 's#/config.h##' -e '2,$d'])
  27. # get system's pulseaudio version
  28. m4_define([pa_major], [`$PKG_CONFIG --modversion libpulse | cut -d. -f1`])
  29. m4_define([pa_minor], [`$PKG_CONFIG --modversion libpulse | cut -d. -f2`])
  30. # pulseaudio module/lib directory
  31. PA_LIBDIR=`$PKG_CONFIG --variable=libdir libpulse`
  32. PA_MODDIR=`$PKG_CONFIG --variable=modlibexecdir libpulse`
  33. PA_PREFIX=`$PKG_CONFIG --variable=prefix libpulse`
  34. # Default system-wide autostart directory from XDG autostart specification
  35. m4_define([XDG_AUTOSTART_DIR], /etc/xdg/autostart)
  36. AC_SUBST([PA_MAJOR], [pa_major])
  37. AC_SUBST([PA_MINOR], [pa_minor])
  38. AC_SUBST([PA_MAJORMINOR], [pa_major].[pa_minor])
  39. # Build shared libraries
  40. LT_INIT([shared disable-static])
  41. # Checks for programs.
  42. AC_PROG_CXX
  43. AC_PROG_AWK
  44. AC_PROG_CC
  45. AC_PROG_CPP
  46. AC_PROG_INSTALL
  47. AC_PROG_LN_S
  48. AC_PROG_MAKE_SET
  49. # Checks for libraries.
  50. PKG_CHECK_MODULES([LIBPULSE], [libpulse])
  51. m4_define([PULSE_MSG], [PULSE_DIR not specified. Follow the instructions in README.md.])
  52. # Check PULSE_DIR is specified
  53. AC_ARG_VAR([PULSE_DIR], [pulseaudio source code directory])
  54. AS_IF([test x"$PULSE_DIR" == x""],
  55. cat <<__MSG__
  56. m4_text_box([PULSE_MSG])
  57. __MSG__
  58. AC_MSG_ERROR([PULSE_DIR not specified])
  59. )
  60. # Does PULSE_DIR appear to be valid?
  61. AS_IF([test -e "$PULSE_DIR/src/pulsecore/macro.h"],,
  62. AC_MSG_WARN([PULSE_DIR may not be valid - can't find expected file]))
  63. # Look for config.h, using PULSE_CONFIG_DIR if specified
  64. AC_ARG_VAR([PULSE_CONFIG_DIR], [pulseaudio config.h source code directory (optional)])
  65. AS_IF([test x"$PULSE_CONFIG_DIR" == x""],
  66. AC_MSG_NOTICE([PULSE_CONFIG_DIR not defined])
  67. AC_MSG_CHECKING([Searching for config.h under PULSE_DIR])
  68. PULSE_CONFIG_DIR="`FIND_CONFIG_H(\"$PULSE_DIR\")`"
  69. [AS_IF([test -e "$PULSE_CONFIG_DIR/config.h" ],
  70. AC_MSG_RESULT([$PULSE_CONFIG_DIR/config.h])
  71. ,
  72. AC_MSG_RESULT([no])
  73. AC_MSG_ERROR([Can't find config.h under PULSE_DIR. Define PULSE_CONFIG_DIR?]))]
  74. ,
  75. AC_MSG_NOTICE([PULSE_CONFIG_DIR is defined])
  76. AC_MSG_CHECKING([Looking for config.h in PULSE_CONFIG_DIR])
  77. [AS_IF([test -e "$PULSE_CONFIG_DIR/config.h"],
  78. AC_MSG_RESULT([$PULSE_CONFIG_DIR/config.h])
  79. ,
  80. AC_MSG_RESULT([no])
  81. AC_MSG_ERROR([Can't find config.h in PULSE_CONFIG_DIR.]))])
  82. # use the prefix as same as pulseaudio
  83. AC_PREFIX_PROGRAM(pulseaudio)
  84. # copied from pulseaudio
  85. AC_ARG_WITH(
  86. [module-dir],
  87. [AS_HELP_STRING([--with-module-dir],
  88. [Directory where to install the modules to (defaults to `pkg-config --variable=modlibexecdir libpulse`)])],
  89. [modlibexecdir=$withval], [modlibexecdir="${PA_MODDIR}"])
  90. AC_SUBST(modlibexecdir)
  91. AC_ARG_WITH(
  92. [xdgautostart-dir],
  93. [AS_HELP_STRING([--with-xdgautostart-dir],
  94. Directory to install the desktop file (defaults to XDG_AUTOSTART_DIR))],
  95. [xdgautostartdir=$withval], [xdgautostartdir=XDG_AUTOSTART_DIR])
  96. AC_SUBST(xdgautostartdir)
  97. # Checks for header files.
  98. AC_CHECK_HEADERS([fcntl.h limits.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
  99. # Checks for typedefs, structures, and compiler characteristics.
  100. AC_TYPE_INT64_T
  101. AC_TYPE_SIZE_T
  102. AC_TYPE_UINT32_T
  103. # Checks for library functions.
  104. AC_CHECK_FUNCS([memset socket])
  105. AC_CONFIG_FILES([Makefile
  106. src/Makefile
  107. instfiles/Makefile])
  108. AC_OUTPUT