~charlesk/appmenu-gtk/lp-788640

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
AC_PREREQ(2.59)

AC_INIT([appmenu-gtk], [0.3.92], [crussell@canonical.com])
AC_COPYRIGHT([Copyright 2012 Canonical])
AC_CONFIG_SRCDIR([src/bridge.c])
AC_CONFIG_MACRO_DIR([m4])

AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([1.9])

AM_MAINTAINER_MODE

AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_C_O
AC_STDC_HEADERS
AC_PROG_LIBTOOL
PKG_PROG_PKG_CONFIG

AC_SUBST(VERSION)

m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

###########################
# Dependencies - Gtk
###########################

gtk_api=3.0

GTK2_REQUIRED_VERSION=2.18
GTK3_REQUIRED_VERSION=3.0
DBUSMENU_REQUIRED_VERSION=0.5.90

AC_ARG_WITH(gtk2, [AS_HELP_STRING([--with-gtk2],[use 2.0 API of GTK+])],[gtk_api=2.0])

if test x$gtk_api = x2.0; then
  PKG_CHECK_MODULES(APPMENU, gtk+-2.0 >= $GTK2_REQUIRED_VERSION
                             x11
                             dbusmenu-gtk-0.4 >= $DBUSMENU_REQUIRED_VERSION)
  moduledir='$(libdir)/gtk-2.0/2.10.0/menuproxies'
  sessionfile=80appmenu
elif test x$gtk_api = x3.0; then
  PKG_CHECK_MODULES(APPMENU, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
                             dbusmenu-gtk3-0.4 >= $DBUSMENU_REQUIRED_VERSION)
  moduledir='$(libdir)/gtk-3.0/3.0.0/menuproxies'
  sessionfile=80appmenu-gtk3
else
  AC_MSG_ERROR([unknown GTK+ API: $gtk_api])
fi

AC_SUBST(APPMENU_CFLAGS)
AC_SUBST(APPMENU_LIBS)

AM_CONDITIONAL([USE_GTK3], [test "x$gtk_api" = "x3.0"])
AS_IF([test "x$gtk_api" = x3.0], [
       AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available])
     ])

AC_SUBST(moduledir)
AC_SUBST(sessionfile)

###########################
# gcov coverage reporting
###########################

m4_include([m4/gcov.m4])
AC_TDD_GCOV
AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes])
AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes])
AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes])
AC_SUBST(COVERAGE_CFLAGS)
AC_SUBST(COVERAGE_LDFLAGS)

AC_CONFIG_FILES([
Makefile
src/Makefile
])

AC_OUTPUT

###########################
# Results
###########################

AC_MSG_NOTICE([

appmenu-gtk configuration:

        Prefix:                 $prefix
        GTK+ API:               $gtk_api
	Coverage reporting:     $use_gcov
])