~mefrio-g/+junk/indicator-session-pantheon-shutdown

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: cody at elementaryos
  • Date: 2012-12-10 00:13:38 UTC
  • Revision ID: cody@elementaryos.org-20121210001338-379sxx4jo6r003d6
Initial import, version 0.3.96-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
AC_INIT(src/indicator-session.c)
 
3
 
 
4
AC_PREREQ(2.53)
 
5
 
 
6
AM_CONFIG_HEADER(config.h)
 
7
AM_INIT_AUTOMAKE(indicator-session, 0.3.96)
 
8
 
 
9
AM_MAINTAINER_MODE
 
10
 
 
11
GLIB_GSETTINGS
 
12
 
 
13
IT_PROG_INTLTOOL([0.35.0])
 
14
 
 
15
AC_ISC_POSIX
 
16
AC_PROG_CC
 
17
AM_PROG_CC_C_O
 
18
AC_STDC_HEADERS
 
19
AC_PROG_LIBTOOL
 
20
 
 
21
AC_SUBST(VERSION)
 
22
AC_CONFIG_MACRO_DIR([m4])
 
23
 
 
24
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 
25
 
 
26
###########################
 
27
# Dependencies 
 
28
###########################
 
29
 
 
30
GTK_REQUIRED_VERSION=2.12
 
31
GTK3_REQUIRED_VERSION=3.0
 
32
INDICATOR_REQUIRED_VERSION=0.3.19
 
33
DBUSMENUGTK_REQUIRED_VERSION=0.5.90
 
34
POLKIT_REQUIRED_VERSION=0.92
 
35
 
 
36
AC_ARG_WITH([gtk],
 
37
  [AS_HELP_STRING([--with-gtk],
 
38
    [Which version of gtk to use for the indicator @<:@default=3@:>@])],
 
39
  [],
 
40
  [with_gtk=3])
 
41
 
 
42
AS_IF([test "x$with_gtk" = x3],
 
43
        [PKG_CHECK_MODULES(APPLET, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
 
44
                                   indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION
 
45
                                   dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION)
 
46
        ],
 
47
      [test "x$with_gtk" = x2],
 
48
         [PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
 
49
                                    indicator-0.4 >= $INDICATOR_REQUIRED_VERSION
 
50
                                    dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION)
 
51
        ],
 
52
      [AC_MSG_FAILURE([Value for --with-indicator-gtk was neither 2 nor 3])]
 
53
)
 
54
 
 
55
AC_SUBST(APPLET_CFLAGS)
 
56
AC_SUBST(APPLET_LIBS)
 
57
 
 
58
DBUSMENUGLIB_REQUIRED_VERSION=0.1.1
 
59
 
 
60
AS_IF([test "x$with_gtk" = x3],
 
61
    [PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION
 
62
                                       dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION
 
63
                                       dbus-glib-1
 
64
                                       gio-unix-2.0
 
65
                                       indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION
 
66
                                       packagekit-glib2)
 
67
    ],
 
68
    [test "x$with_gtk" = x2],
 
69
    [PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION
 
70
                                       dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION
 
71
                                       dbus-glib-1
 
72
                                       gio-unix-2.0
 
73
                                       indicator-0.4 >= $INDICATOR_REQUIRED_VERSION
 
74
                                       packagekit-glib2)
 
75
    ]
 
76
)
 
77
 
 
78
AC_SUBST(SESSIONERVICE_CFLAGS)
 
79
AC_SUBST(SESSIONERVICE_LIBS)
 
80
 
 
81
PKG_CHECK_MODULES(GUDEV, gudev-1.0, has_gudev=true, has_gudev=false)
 
82
AC_SUBST(GUDEV_CFLAGS)
 
83
AC_SUBST(GUDEV_LIBS)
 
84
 
 
85
AM_CONDITIONAL([USE_GTK3], [test "x$with_gtk" = "x3"])
 
86
AS_IF([test "x$with_gtk" = x3], [
 
87
       AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available])
 
88
     ])
 
89
 
 
90
###########################
 
91
# GTK Logout Helper
 
92
###########################
 
93
 
 
94
AC_ARG_ENABLE([gtklogouthelper],
 
95
            AS_HELP_STRING([--enable-gtklogouthelper], [enable GTK Logout Helper]),,
 
96
            enable_gtklogouthelper=auto)
 
97
 
 
98
if test x"$enable_gtklogouthelper" != x"no" ; then
 
99
   AS_IF([test "x$with_gtk" = x3],
 
100
       [PKG_CHECK_MODULES(GTKLOGOUTHELPER, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
 
101
                                           polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
 
102
                                           [have_gtklogouthelper=yes],
 
103
                                           [have_gtklogouthelper=no])
 
104
       ],
 
105
       [test "x$with_gtk" = x2],
 
106
       [PKG_CHECK_MODULES(GTKLOGOUTHELPER, gtk+-2.0 >= $GTK_REQUIRED_VERSION
 
107
                                           polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
 
108
                                           [have_gtklogouthelper=yes],
 
109
                                           [have_gtklogouthelper=no])
 
110
       ]
 
111
   )
 
112
   if test x${have_gtklogouthelper} = xyes; then
 
113
      AC_DEFINE(HAVE_GTKLOGOUTHELPER, 1, [Define to 1 to enable GTK Logout Helper])
 
114
   fi
 
115
   if test x${enable_gtklogouthelper} = xyes && test x${have_gtklogouthelper} = xno; then
 
116
     AC_MSG_ERROR([GTK Logout Helper configured but polkit-gobject not found])
 
117
   fi
 
118
else
 
119
   have_gtklogouthelper=no
 
120
fi
 
121
AM_CONDITIONAL(BUILD_GTKLOGOUTHELPER, test x${have_gtklogouthelper} = xyes)
 
122
 
 
123
AC_SUBST(GTKLOGOUTHELPER_CFLAGS)
 
124
AC_SUBST(GTKLOGOUTHELPER_LIBS)
 
125
 
 
126
###########################
 
127
# APT support
 
128
###########################
 
129
AC_ARG_ENABLE([apt],
 
130
        AC_HELP_STRING([--disable-apt], [disable APT support]),,
 
131
        [enable_apt=yes])
 
132
AM_CONDITIONAL([BUILD_APT], [test "x$enable_apt" != "xno"])
 
133
 
 
134
if test "x$enable_apt" != "xno"; then
 
135
   AC_DEFINE(HAVE_APT, 1, [Define to 1 to enable APT support])
 
136
fi
 
137
 
 
138
###########################
 
139
# Check to see if we're local
 
140
###########################
 
141
 
 
142
with_localinstall="no"
 
143
AC_ARG_ENABLE(localinstall, AS_HELP_STRING([--enable-localinstall], [install all of the files localy instead of system directories (for distcheck)]), with_localinstall=$enableval, with_localinstall=no)
 
144
 
 
145
###########################
 
146
# Indicator Info
 
147
###########################
 
148
 
 
149
if test "x$with_localinstall" = "xyes"; then
 
150
        INDICATORDIR="${libdir}/indicators/2/"
 
151
        INDICATORICONSDIR="${datadir}/indicator-applet/icons/"
 
152
elif test "x$with_gtk" = x2; then
 
153
        INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator-0.4`
 
154
        INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator-0.4`
 
155
else
 
156
        INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3-0.4`
 
157
        INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator3-0.4`
 
158
fi
 
159
AC_SUBST(INDICATORDIR)
 
160
AC_SUBST(INDICATORICONSDIR)
 
161
 
 
162
###########################
 
163
# DBus Service Info
 
164
###########################
 
165
 
 
166
if test "x$with_localinstall" = "xyes"; then
 
167
        DBUSSERVICEDIR="${datadir}/dbus-1/services/"
 
168
else
 
169
        DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`
 
170
fi
 
171
AC_SUBST(DBUSSERVICEDIR)
 
172
 
 
173
##############################
 
174
# Custom Junk
 
175
##############################
 
176
 
 
177
AC_DEFUN([AC_DEFINE_PATH], [
 
178
        test "x$prefix" = xNONE && prefix="$ac_default_prefix"
 
179
        test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
180
        ac_define_path=`eval echo [$]$2`
 
181
        ac_define_path=`eval echo [$]ac_define_path`
 
182
        $1="$ac_define_path"
 
183
        AC_SUBST($1)
 
184
        ifelse($3, ,
 
185
                AC_DEFINE_UNQUOTED($1, "$ac_define_path"),
 
186
                AC_DEFINE_UNQUOTED($1, "$ac_define_path", $3))
 
187
])
 
188
 
 
189
###########################
 
190
# Internationalization
 
191
###########################
 
192
 
 
193
GETTEXT_PACKAGE=indicator-session
 
194
AC_SUBST(GETTEXT_PACKAGE)
 
195
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the default get text domain])
 
196
AC_DEFINE_PATH(GNOMELOCALEDIR, "${datadir}/locale", [locale directory])
 
197
 
 
198
AM_GLIB_GNU_GETTEXT
 
199
 
 
200
###########################
 
201
# gcov coverage reporting
 
202
###########################
 
203
 
 
204
m4_include([m4/gcov.m4])
 
205
AC_TDD_GCOV
 
206
AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes])
 
207
AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes])
 
208
AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes])
 
209
AC_SUBST(COVERAGE_CFLAGS)
 
210
AC_SUBST(COVERAGE_LDFLAGS)
 
211
 
 
212
###########################
 
213
# Files
 
214
###########################
 
215
 
 
216
AM_CONDITIONAL([HAS_GUDEV], [test "x$has_gudev" = "xtrue"])
 
217
 
 
218
AC_CONFIG_FILES([
 
219
Makefile
 
220
src/Makefile
 
221
data/Makefile
 
222
data/icons/Makefile
 
223
data/icons/16x16/Makefile
 
224
data/icons/16x16/actions/Makefile
 
225
data/icons/16x16/status/Makefile
 
226
data/icons/22x22/Makefile
 
227
data/icons/22x22/actions/Makefile
 
228
data/icons/22x22/status/Makefile
 
229
data/icons/24x24/Makefile
 
230
data/icons/24x24/actions/Makefile
 
231
data/icons/24x24/status/Makefile
 
232
data/icons/32x32/Makefile
 
233
data/icons/32x32/actions/Makefile
 
234
data/icons/32x32/status/Makefile
 
235
data/icons/scalable/Makefile
 
236
data/icons/scalable/actions/Makefile
 
237
data/icons/scalable/status/Makefile
 
238
data/extra-sessions/Makefile
 
239
po/Makefile.in
 
240
])
 
241
 
 
242
AC_OUTPUT
 
243
 
 
244
###########################
 
245
# Results
 
246
###########################
 
247
 
 
248
AC_MSG_NOTICE([
 
249
 
 
250
SUS Indicator Configuration:
 
251
 
 
252
        Prefix:             $prefix
 
253
        Indicator Dir:      $INDICATORDIR
 
254
        Indicator GTK:      $with_gtk
 
255
        Logout Helper:      $have_gtklogouthelper
 
256
        APT support:        $enable_apt
 
257
        Coverage reporting: $use_gcov
 
258
])