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.
 
 
 
 

532 lines
16 KiB

  1. AC_PREREQ(2.50)
  2. m4_define([muffin_major_version], [3])
  3. m4_define([muffin_minor_version], [0])
  4. m4_define([muffin_micro_version], [5])
  5. m4_define([muffin_version],
  6. [muffin_major_version.muffin_minor_version.muffin_micro_version])
  7. m4_define([muffin_plugin_api_version], [3])
  8. AC_INIT([muffin], [muffin_version],
  9. [https://github.com/linuxmint/muffin/issues])
  10. AC_CONFIG_SRCDIR(src/core/display.c)
  11. AC_CONFIG_HEADERS(config.h)
  12. AC_CONFIG_MACRO_DIR(m4)
  13. AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar subdir-objects])
  14. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
  15. AM_MAINTAINER_MODE([enable])
  16. MUFFIN_MAJOR_VERSION=muffin_major_version
  17. MUFFIN_MINOR_VERSION=muffin_minor_version
  18. MUFFIN_MICRO_VERSION=muffin_micro_version
  19. MUFFIN_PLUGIN_API_VERSION=muffin_plugin_api_version
  20. AC_SUBST(MUFFIN_MAJOR_VERSION)
  21. AC_SUBST(MUFFIN_MINOR_VERSION)
  22. AC_SUBST(MUFFIN_MICRO_VERSION)
  23. AC_SUBST(MUFFIN_PLUGIN_API_VERSION)
  24. MUFFIN_PLUGIN_DIR="$libdir/$PACKAGE/plugins"
  25. AC_SUBST(MUFFIN_PLUGIN_DIR)
  26. # Honor aclocal flags
  27. AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")
  28. GETTEXT_PACKAGE=muffin
  29. AC_SUBST(GETTEXT_PACKAGE)
  30. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Name of default gettext domain])
  31. IT_PROG_INTLTOOL([0.34.90])
  32. AC_PROG_CC
  33. AM_PROG_CC_C_O
  34. AC_ISC_POSIX
  35. AC_HEADER_STDC
  36. AC_LIBTOOL_WIN32_DLL
  37. AM_PROG_LIBTOOL
  38. # Sets GLIB_GENMARSHAL and GLIB_MKENUMS
  39. AM_PATH_GLIB_2_0()
  40. #### Integer sizes
  41. AC_CHECK_SIZEOF(char)
  42. AC_CHECK_SIZEOF(short)
  43. AC_CHECK_SIZEOF(long)
  44. AC_CHECK_SIZEOF(int)
  45. AC_CHECK_SIZEOF(void *)
  46. AC_CHECK_SIZEOF(long long)
  47. AC_CHECK_SIZEOF(__int64)
  48. ## byte order
  49. AC_C_BIGENDIAN
  50. #### Usability of visibility attributes
  51. gl_VISIBILITY
  52. AC_DEFINE(LOCAL_SYMBOL, [], [attribute of the non-exported symbols])
  53. AC_DEFINE(API_EXPORTED, [], [attribute of the symbols exported in the API])
  54. if test $HAVE_VISIBILITY = 1; then
  55. AC_DEFINE(LOCAL_SYMBOL, [__attribute__ ((visibility ("hidden")))])
  56. AC_DEFINE(API_EXPORTED, [__attribute__ ((visibility ("default")))])
  57. fi
  58. CANBERRA_GTK=libcanberra-gtk3
  59. CANBERRA_GTK_VERSION=0.26
  60. CLUTTER_PACKAGE=clutter-1.0
  61. MUFFIN_PC_MODULES="
  62. gtk+-3.0 >= 3.9.12
  63. gio-2.0 >= 2.25.10
  64. pango >= 1.14.0
  65. cairo >= 1.10.0
  66. cinnamon-desktop >= 2.4.0
  67. xcomposite >= 0.3 xfixes xrender xdamage
  68. $CLUTTER_PACKAGE >= 1.14.3
  69. cogl-1.0 >= 1.13.3
  70. gl
  71. "
  72. GLIB_GSETTINGS
  73. AC_ARG_ENABLE(verbose-mode,
  74. AC_HELP_STRING([--disable-verbose-mode],
  75. [disable muffin's ability to do verbose logging, for embedded/size-sensitive custom builds]),,
  76. enable_verbose_mode=yes)
  77. if test x$enable_verbose_mode = xyes; then
  78. AC_DEFINE(WITH_VERBOSE_MODE,1,[Build with verbose mode support])
  79. fi
  80. AC_ARG_ENABLE([gtk-doc],
  81. AC_HELP_STRING([--enable-gtk-doc],
  82. [use gtk-doc to build documentation [[default=yes]]]),,
  83. enable_gtk_doc=yes)
  84. AC_ARG_ENABLE(sm,
  85. AC_HELP_STRING([--disable-sm],
  86. [disable muffin's session management support, for embedded/size-sensitive custom non-GNOME builds]),,
  87. enable_sm=auto)
  88. AC_ARG_ENABLE(startup-notification,
  89. AC_HELP_STRING([--disable-startup-notification],
  90. [disable muffin's startup notification support, for embedded/size-sensitive custom non-GNOME builds]),,
  91. enable_startup_notification=auto)
  92. AC_ARG_WITH(libcanberra,
  93. AC_HELP_STRING([--without-libcanberra],
  94. [disable the use of libcanberra for playing sounds]),,
  95. with_libcanberra=auto)
  96. AC_ARG_ENABLE(xsync,
  97. AC_HELP_STRING([--disable-xsync],
  98. [disable muffin's use of the XSync extension]),,
  99. enable_xsync=auto)
  100. AC_ARG_ENABLE(shape,
  101. AC_HELP_STRING([--disable-shape],
  102. [disable muffin's use of the shaped window extension]),,
  103. enable_shape=auto)
  104. ## try definining HAVE_BACKTRACE
  105. AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
  106. AM_GLIB_GNU_GETTEXT
  107. ## here we get the flags we'll actually use
  108. PKG_CHECK_MODULES(ALL, glib-2.0 >= 2.37.3)
  109. PKG_CHECK_MODULES(MUFFIN_MESSAGE, gtk+-3.0)
  110. PKG_CHECK_MODULES(MUFFIN_WINDOW_DEMO, gtk+-3.0)
  111. # Unconditionally use this dir to avoid a circular dep with gnomecc
  112. GNOME_KEYBINDINGS_KEYSDIR="${datadir}/gnome-control-center/keybindings"
  113. AC_SUBST(GNOME_KEYBINDINGS_KEYSDIR)
  114. STARTUP_NOTIFICATION_VERSION=0.7
  115. AC_MSG_CHECKING([Startup notification library >= $STARTUP_NOTIFICATION_VERSION])
  116. if $PKG_CONFIG --atleast-version $STARTUP_NOTIFICATION_VERSION libstartup-notification-1.0; then
  117. have_startup_notification=yes
  118. else
  119. have_startup_notification=no
  120. fi
  121. AC_MSG_RESULT($have_startup_notification)
  122. if test x$enable_startup_notification = xyes; then
  123. have_startup_notification=yes
  124. echo "startup-notification support forced on"
  125. elif test x$enable_startup_notification = xauto; then
  126. true
  127. else
  128. have_startup_notification=no
  129. fi
  130. if test x$have_startup_notification = xyes; then
  131. echo "Building with libstartup-notification"
  132. MUFFIN_PC_MODULES="$MUFFIN_PC_MODULES libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION"
  133. AC_DEFINE(HAVE_STARTUP_NOTIFICATION, , [Building with startup notification support])
  134. else
  135. echo "Building without libstartup-notification"
  136. fi
  137. have_libcanberra=no
  138. AC_MSG_CHECKING([libcanberra-gtk])
  139. if test x$with_libcanberra = xno ; then
  140. AC_MSG_RESULT([disabled])
  141. else
  142. if $PKG_CONFIG --exists $CANBERRA_GTK '>=' $CANBERRA_GTK_VERSION; then
  143. have_libcanberra=yes
  144. AC_MSG_RESULT(yes)
  145. MUFFIN_PC_MODULES="$MUFFIN_PC_MODULES $CANBERRA_GTK"
  146. AC_DEFINE([HAVE_LIBCANBERRA], 1, [Building with libcanberra for playing sounds])
  147. else
  148. AC_MSG_RESULT(no)
  149. if test x$with_libcanberra = xyes ; then
  150. AC_MSG_ERROR([libcanberra forced and libcanberra-gtk was not found])
  151. fi
  152. fi
  153. fi
  154. INTROSPECTION_VERSION=0.9.2
  155. GOBJECT_INTROSPECTION_CHECK([$INTROSPECTION_VERSION])
  156. if test x$found_introspection != xno; then
  157. AC_DEFINE(HAVE_INTROSPECTION, 1, [Define if GObject introspection is available])
  158. MUFFIN_PC_MODULES="$MUFFIN_PC_MODULES gobject-introspection-1.0"
  159. # Since we don't make any guarantees about stability and we don't support
  160. # parallel install, there's no real reason to change directories, filenames,
  161. # etc. as we change the Muffin tarball version. Note that this must match
  162. # api_version in src/Makefile.am
  163. # This is set to a magic number which is different from the API which
  164. # Mutter uses. Otherwise there will be dependency conflicts in RPM
  165. # based distributions that automatically resolve typelib file dependencies.
  166. META_GIR=Meta_Muffin_0_gir
  167. # META_GIR=[Meta_]muffin_major_version[_]muffin_minor_version[_gir]
  168. AC_SUBST(META_GIR)
  169. fi
  170. AC_MSG_CHECKING([Xcursor])
  171. if $PKG_CONFIG xcursor; then
  172. have_xcursor=yes
  173. else
  174. have_xcursor=no
  175. fi
  176. AC_MSG_RESULT($have_xcursor)
  177. if test x$have_xcursor = xyes; then
  178. echo "Building with Xcursor"
  179. MUFFIN_PC_MODULES="$MUFFIN_PC_MODULES xcursor"
  180. AC_DEFINE(HAVE_XCURSOR, , [Building with Xcursor support])
  181. fi
  182. PKG_CHECK_MODULES(MUFFIN, $MUFFIN_PC_MODULES)
  183. # This is used for plugins
  184. AC_SUBST(CLUTTER_PACKAGE)
  185. PKG_CHECK_MODULES(CLUTTER, $CLUTTER_PACKAGE)
  186. AC_PATH_XTRA
  187. ALL_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
  188. # Check for Xinerama extension (Solaris impl or Xfree impl)
  189. muffin_save_cppflags="$CPPFLAGS"
  190. CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  191. AC_ARG_ENABLE(xinerama,
  192. AC_HELP_STRING([--disable-xinerama],
  193. [disable muffin's use of the Xinerama extension]),
  194. try_xinerama=$enable_xinerama,try_xinerama=yes)
  195. use_solaris_xinerama=no
  196. use_xfree_xinerama=no
  197. if test "${try_xinerama}" != no; then
  198. case "$host" in
  199. *-*-solaris*)
  200. # Check for solaris
  201. use_solaris_xinerama=yes
  202. AC_CHECK_LIB(Xext, XineramaGetInfo,
  203. use_solaris_xinerama=yes, use_solaris_xinerama=no,
  204. $ALL_X_LIBS)
  205. if test "x$use_solaris_xinerama" = "xyes"; then
  206. AC_CHECK_HEADER(X11/extensions/xinerama.h,
  207. if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
  208. X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
  209. fi
  210. AC_DEFINE(HAVE_SOLARIS_XINERAMA, , [Have Solaris-style Xinerama])
  211. AC_DEFINE(HAVE_XINERAMA, , [Have some version of Xinerama]),
  212. use_solaris_xinerama=no,
  213. [#include <X11/Xlib.h>])
  214. fi
  215. AC_MSG_CHECKING(for Xinerama support on Solaris)
  216. AC_MSG_RESULT($use_solaris_xinerama);
  217. ;;
  218. *)
  219. # Check for XFree
  220. use_xfree_xinerama=yes
  221. AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
  222. [AC_CHECK_HEADER(X11/extensions/Xinerama.h,
  223. X_EXTRA_LIBS="-lXinerama $X_EXTRA_LIBS"
  224. if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
  225. X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
  226. fi
  227. AC_DEFINE(HAVE_XFREE_XINERAMA, , [Have XFree86-style Xinerama])
  228. AC_DEFINE(HAVE_XINERAMA,, [Have some version of Xinerama]),
  229. use_xfree_xinerama=no,
  230. [#include <X11/Xlib.h>])],
  231. use_xfree_xinerama=no, -lXext $ALL_X_LIBS)
  232. AC_MSG_CHECKING(for Xinerama support on XFree86)
  233. AC_MSG_RESULT($use_xfree_xinerama);
  234. ;;
  235. esac
  236. fi
  237. CPPFLAGS="$muffin_save_cppflags"
  238. SHAPE_LIBS=
  239. found_shape=no
  240. AC_CHECK_LIB(Xext, XShapeQueryExtension,
  241. [AC_CHECK_HEADER(X11/extensions/shape.h,
  242. SHAPE_LIBS=-lXext found_shape=yes)],
  243. , $ALL_X_LIBS)
  244. if test x$enable_shape = xno; then
  245. found_shape=no
  246. fi
  247. if test x$enable_shape = xyes; then
  248. if test "$found_shape" = "no"; then
  249. AC_MSG_ERROR([--enable-shape forced and Shape not found])
  250. exit 1
  251. fi
  252. fi
  253. if test "x$found_shape" = "xyes"; then
  254. AC_DEFINE(HAVE_SHAPE, , [Have the shape extension library])
  255. fi
  256. found_xkb=no
  257. AC_CHECK_LIB(X11, XkbQueryExtension,
  258. [AC_CHECK_HEADER(X11/XKBlib.h,
  259. found_xkb=yes)],
  260. , $ALL_X_LIBS)
  261. if test "x$found_xkb" = "xyes"; then
  262. AC_DEFINE(HAVE_XKB, , [Have keyboard extension library])
  263. fi
  264. RANDR_LIBS=
  265. found_randr=no
  266. AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
  267. [AC_CHECK_HEADER(X11/extensions/Xrandr.h,
  268. RANDR_LIBS=-lXrandr found_randr=yes,,
  269. [#include <X11/Xlib.h>])],
  270. , -lXrender -lXext $ALL_X_LIBS)
  271. if test "x$found_randr" = "xyes"; then
  272. AC_DEFINE(HAVE_RANDR, , [Have the Xrandr extension library])
  273. fi
  274. XSYNC_LIBS=
  275. found_xsync=no
  276. AC_CHECK_LIB(Xext, XSyncQueryExtension,
  277. [AC_CHECK_HEADER(X11/extensions/sync.h,
  278. found_xsync=yes,,
  279. [#include <X11/Xlib.h>])],
  280. , $ALL_X_LIBS)
  281. if test x$enable_xsync = xno; then
  282. found_xsync=no
  283. fi
  284. if test x$enable_xsync = xyes; then
  285. if test "$found_xsync" = "no"; then
  286. AC_MSG_ERROR([--enable-xsync forced and XSync not found])
  287. exit 1
  288. fi
  289. fi
  290. if test "x$found_xsync" = "xyes"; then
  291. XSYNC_LIBS=-lXext
  292. AC_DEFINE(HAVE_XSYNC, , [Have the Xsync extension library])
  293. fi
  294. MUFFIN_LIBS="$MUFFIN_LIBS $XSYNC_LIBS $RANDR_LIBS $SHAPE_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lm"
  295. MUFFIN_MESSAGE_LIBS="$MUFFIN_MESSAGE_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
  296. MUFFIN_WINDOW_DEMO_LIBS="$MUFFIN_WINDOW_DEMO_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lm"
  297. MUFFIN_PROPS_LIBS="$MUFFIN_PROPS_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
  298. found_sm=no
  299. case "$MUFFIN_LIBS" in
  300. *-lSM*)
  301. found_sm=yes
  302. ;;
  303. *)
  304. AC_CHECK_LIB(SM, SmcSaveYourselfDone,
  305. [AC_CHECK_HEADERS(X11/SM/SMlib.h,
  306. MUFFIN_LIBS="-lSM -lICE $MUFFIN_LIBS" found_sm=yes)],
  307. , $MUFFIN_LIBS)
  308. ;;
  309. esac
  310. if test x$enable_sm = xno; then
  311. found_sm=no
  312. fi
  313. if test x$enable_sm = xyes; then
  314. if test "$found_sm" = "no"; then
  315. AC_MSG_ERROR([--enable-sm forced and -lSM not found])
  316. exit 1
  317. fi
  318. fi
  319. if test "$found_sm" = "yes"; then
  320. AC_DEFINE(HAVE_SM, , [Building with SM support])
  321. fi
  322. AM_CONDITIONAL(HAVE_SM, test "$found_sm" = "yes")
  323. HOST_ALIAS=$host_alias
  324. AC_SUBST(HOST_ALIAS)
  325. AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
  326. if test x"$GDK_PIXBUF_CSOURCE" = xno; then
  327. AC_MSG_ERROR([gdk-pixbuf-csource executable not found in your path - should be installed with GTK])
  328. fi
  329. AC_SUBST(GDK_PIXBUF_CSOURCE)
  330. AC_PATH_PROG(ZENITY, zenity, no)
  331. if test x"$ZENITY" = xno; then
  332. AC_MSG_ERROR([zenity not found in your path - needed for dialogs])
  333. fi
  334. AC_ARG_ENABLE(debug,
  335. [ --enable-debug enable debugging],,
  336. enable_debug=no)
  337. if test "x$enable_debug" = "xyes"; then
  338. CFLAGS="$CFLAGS -g -O"
  339. fi
  340. # Use gnome-doc-utils:
  341. GNOME_DOC_INIT([0.8.0])
  342. GTK_DOC_CHECK([1.15], [--flavour no-tmpl])
  343. AC_CHECK_DECL([GL_EXT_x11_sync_object],
  344. [],
  345. [AC_MSG_ERROR([GL_EXT_x11_sync_object definition not found, please update your GL headers])],
  346. [#include <GL/glx.h>])
  347. #### Warnings (last since -Werror can disturb other tests)
  348. # Stay command-line compatible with the gnome-common configure option. Here
  349. # minimum/yes/maximum are the same, however.
  350. AC_ARG_ENABLE(compile_warnings,
  351. AS_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],[Turn on compiler warnings]),,
  352. enable_compile_warnings=yes)
  353. changequote(,)dnl
  354. if test "$enable_compile_warnings" != no ; then
  355. if test "x$GCC" = "xyes"; then
  356. case " $CFLAGS " in
  357. *[\ \ ]-Wall[\ \ ]*) ;;
  358. *) CFLAGS="$CFLAGS -Wall" ;;
  359. esac
  360. # case " $CFLAGS " in
  361. # *[\ \ ]-Wshadow[\ \ ]*) ;;
  362. # *) CFLAGS="$CFLAGS -Wshadow" ;;
  363. # esac
  364. case " $CFLAGS " in
  365. *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
  366. *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
  367. esac
  368. case " $CFLAGS " in
  369. *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
  370. *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
  371. esac
  372. case " $CFLAGS " in
  373. *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
  374. *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
  375. esac
  376. case " $CFLAGS " in
  377. *[\ \ ]-Wnested-externs[\ \ ]*) ;;
  378. *) CFLAGS="$CFLAGS -Wnested-externs" ;;
  379. esac
  380. case " $CFLAGS " in
  381. *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
  382. *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
  383. esac
  384. case " $CFLAGS " in
  385. *[\ \ ]-Wsign-compare[\ \ ]*) ;;
  386. *) CFLAGS="$CFLAGS -Wsign-compare" ;;
  387. esac
  388. if test "$enable_compile_warnings" = error; then
  389. case " $CFLAGS " in
  390. *[\ \ ]-Werror[\ \ ]*) ;;
  391. *) CFLAGS="$CFLAGS -Werror -Wno-error=deprecated-declarations" ;;
  392. esac
  393. fi
  394. fi
  395. fi
  396. changequote([,])dnl
  397. AC_CONFIG_FILES([
  398. Makefile
  399. data/Makefile
  400. doc/Makefile
  401. doc/man/Makefile
  402. doc/reference/Makefile
  403. doc/reference/muffin-docs.sgml
  404. src/Makefile
  405. src/wm-tester/Makefile
  406. src/libmuffin.pc
  407. src/muffin-plugins.pc
  408. src/tools/Makefile
  409. src/compositor/plugins/Makefile
  410. po/Makefile.in
  411. ])
  412. AC_OUTPUT
  413. if test x$enable_verbose_mode = xno; then
  414. echo "*** WARNING WARNING WARNING WARNING WARNING"
  415. echo "*** Building without verbose mode"
  416. echo "*** This means there's no way to debug muffin problems."
  417. echo "*** Please build normal desktop versions of muffin"
  418. echo "*** with verbose mode enabled so users can use it when they report bugs."
  419. fi
  420. dnl ==========================================================================
  421. echo "
  422. muffin-$VERSION
  423. prefix: ${prefix}
  424. source code location: ${srcdir}
  425. compiler: ${CC}
  426. XFree86 Xinerama: ${use_xfree_xinerama}
  427. Solaris Xinerama: ${use_solaris_xinerama}
  428. Startup notification: ${have_startup_notification}
  429. libcanberra: ${have_libcanberra}
  430. Introspection: ${found_introspection}
  431. Session management: ${found_sm}
  432. Shape extension: ${found_shape}
  433. Xsync: ${found_xsync}
  434. Xcursor: ${have_xcursor}
  435. "