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.
 
 
 
 
 
 

200 lines
5.6 KiB

  1. AC_PREREQ(2.60)
  2. AC_INIT([mate-media],
  3. [1.14.1],
  4. [http://www.mate-desktop.org/])
  5. AC_CONFIG_AUX_DIR([build-aux])
  6. AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-xz tar-pax foreign check-news])
  7. AM_MAINTAINER_MODE
  8. AC_CONFIG_HEADERS([config.h])
  9. AC_CONFIG_MACRO_DIR([m4])
  10. IT_PROG_INTLTOOL([0.35.0])
  11. # Checks for programs.
  12. AC_PROG_CC
  13. AM_PROG_CC_C_O
  14. AC_PROG_INSTALL
  15. AC_PROG_LN_S
  16. AC_PROG_MAKE_SET
  17. AM_PROG_LIBTOOL
  18. # Checks for header files.
  19. AC_HEADER_STDC
  20. AC_CHECK_HEADERS([string.h math.h])
  21. # Checks for typedefs, structures, and compiler characteristics.
  22. AC_C_CONST
  23. AC_C_INLINE
  24. AC_TYPE_OFF_T
  25. AC_TYPE_SIZE_T
  26. GLIB_REQUIRED_VERSION=2.36.0
  27. GIO_REQUIRED_VERSION=2.36.0
  28. CANBERRA_REQUIRED_VERSION=0.13
  29. MATE_MIXER_REQUIRED_VERSION=1.9.1
  30. MATE_DESKTOP_REQUIRED_VERSION=1.9.3
  31. dnl=======================================================================
  32. dnl Support multiple GTK versions
  33. dnl=======================================================================
  34. AC_MSG_CHECKING([which gtk+ version to compile against])
  35. AC_ARG_WITH([gtk],
  36. [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])],
  37. [case "$with_gtk" in
  38. 2.0|3.0) ;;
  39. *) AC_MSG_ERROR([invalid gtk version specified]) ;;
  40. esac],
  41. [with_gtk=2.0])
  42. AC_MSG_RESULT([$with_gtk])
  43. case "$with_gtk" in
  44. 2.0) GTK_API_VERSION=2.0
  45. GTK_REQUIRED_VERSION=2.24.0
  46. CANBERRA_API_VERSION=
  47. UNIQUE_API_VERSION=1.0
  48. ;;
  49. 3.0) GTK_API_VERSION=3.0
  50. GTK_REQUIRED_VERSION=3.0.0
  51. CANBERRA_API_VERSION=3
  52. UNIQUE_API_VERSION=3.0
  53. ;;
  54. esac
  55. AC_SUBST(GTK_API_VERSION)
  56. dnl=======================================================================
  57. dnl Check for the volume control modules
  58. dnl=======================================================================
  59. PKG_CHECK_MODULES(VOLUME_CONTROL,
  60. gobject-2.0 >= $GLIB_REQUIRED_VERSION
  61. gtk+-$GTK_API_VERSION >= $GTK_REQUIRED_VERSION
  62. gio-2.0 >= $GIO_REQUIRED_VERSION
  63. libcanberra-gtk$CANBERRA_API_VERSION >= $CANBERRA_REQUIRED_VERSION
  64. unique-$UNIQUE_API_VERSION
  65. libxml-2.0
  66. mate-desktop-2.0 >= $MATE_DESKTOP_REQUIRED_VERSION
  67. libmatemixer >= $MATE_MIXER_REQUIRED_VERSION
  68. )
  69. AC_SUBST(VOLUME_CONTROL_CFLAGS)
  70. AC_SUBST(VOLUME_CONTROL_LIBS)
  71. dnl=======================================================================
  72. dnl GLib
  73. dnl=======================================================================
  74. GLIB_GSETTINGS
  75. dnl=======================================================================
  76. dnl i18n
  77. dnl=======================================================================
  78. GETTEXT_PACKAGE=mate-media
  79. AC_SUBST(GETTEXT_PACKAGE)
  80. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the Gettext package name])
  81. AM_GLIB_GNU_GETTEXT
  82. dnl ---------------------------------------------------------------------------
  83. dnl - Finish
  84. dnl ---------------------------------------------------------------------------
  85. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  86. MATE_MAINTAINER_MODE_DEFINES
  87. MATE_COMPILE_WARNINGS([maximum])
  88. MATE_CXX_WARNINGS
  89. AC_ARG_ENABLE(deprecated,
  90. [AS_HELP_STRING([--enable-deprecated],
  91. [warn about deprecated usages [default=no]])],,
  92. [enable_deprecated=no])
  93. if test "x$enable_deprecated" = "xyes"; then
  94. DISABLE_DEPRECATED=""
  95. AC_SUBST(DISABLE_DEPRECATED)
  96. fi
  97. # Turn on the additional warnings last, so warnings don't affect other tests.
  98. AC_ARG_ENABLE(more-warnings,
  99. [AC_HELP_STRING([--enable-more-warnings],
  100. [Maximum compiler warnings])],
  101. set_more_warnings="$enableval",[
  102. if test -d $srcdir/.git; then
  103. set_more_warnings=yes
  104. else
  105. set_more_warnings=no
  106. fi
  107. ])
  108. AC_MSG_CHECKING(for more warnings)
  109. if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
  110. AC_MSG_RESULT(yes)
  111. CFLAGS="\
  112. -Wall \
  113. -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
  114. -Wnested-externs -Wpointer-arith \
  115. -Wcast-align -Wsign-compare \
  116. $CFLAGS"
  117. for option in -Wno-unused-parameter -Wno-strict-aliasing -Wno-sign-compare; do
  118. SAVE_CFLAGS="$CFLAGS"
  119. CFLAGS="$CFLAGS $option"
  120. AC_MSG_CHECKING([whether gcc understands $option])
  121. AC_TRY_COMPILE([], [],
  122. has_option=yes,
  123. has_option=no,)
  124. if test $has_option = no; then
  125. CFLAGS="$SAVE_CFLAGS"
  126. fi
  127. AC_MSG_RESULT($has_option)
  128. unset has_option
  129. unset SAVE_CFLAGS
  130. done
  131. unset option
  132. else
  133. AC_MSG_RESULT(no)
  134. fi
  135. AC_SUBST(CFLAGS)
  136. AC_CONFIG_FILES([
  137. Makefile
  138. data/Makefile
  139. data/mate-volume-control.desktop.in
  140. data/icons/Makefile
  141. data/icons/16x16/Makefile
  142. data/icons/16x16/status/Makefile
  143. data/icons/22x22/Makefile
  144. data/icons/22x22/status/Makefile
  145. data/icons/24x24/Makefile
  146. data/icons/24x24/status/Makefile
  147. data/icons/32x32/Makefile
  148. data/icons/32x32/status/Makefile
  149. data/icons/scalable/Makefile
  150. data/icons/scalable/devices/Makefile
  151. data/icons/scalable/status/Makefile
  152. data/sounds/Makefile
  153. man/Makefile
  154. po/Makefile.in
  155. mate-volume-control/Makefile
  156. ])
  157. AC_OUTPUT
  158. echo "
  159. ${PACKAGE} ${VERSION}
  160. ==========
  161. Prefix: ${prefix}
  162. Source code location: ${srcdir}
  163. Compiler: ${CC}
  164. CFLAGS: ${CFLAGS}
  165. GTK+ API version: ${GTK_API_VERSION}
  166. "