~indicator-applet-developers/indicator-power/trunk.13.04

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Javier Jardón
  • Date: 2011-06-24 14:25:17 UTC
  • Revision ID: javier.jardon@codethink.co.uk-20110624142517-hxdxemekbssnbl2r
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_INIT([indicator-power],
 
2
        [0.0.1],
 
3
        [http://bugs.launchpad.net/indicator-power],
 
4
        [indicator-power],
 
5
        [http://launchpad.net/indicator-power])
 
6
 
 
7
AC_PREREQ([2.64])
 
8
 
 
9
AC_CONFIG_HEADERS([config.h])
 
10
AC_CONFIG_SRCDIR([configure.ac])
 
11
AC_CONFIG_MACRO_DIR([m4])
 
12
AC_CONFIG_AUX_DIR([build-aux])
 
13
 
 
14
AM_INIT_AUTOMAKE([1.11 -Wall foreign subdir-objects no-dist-gzip dist-xz])
 
15
AM_MAINTAINER_MODE([enable])
 
16
 
 
17
AM_SILENT_RULES([yes])
 
18
 
 
19
# Check for programs
 
20
AC_PROG_CC
 
21
AM_PROG_CC_C_O
 
22
AM_PROG_VALAC([0.12])
 
23
 
 
24
# Initialize libtool
 
25
LT_PREREQ([2.2.6])
 
26
LT_INIT
 
27
 
 
28
 
 
29
###########################
 
30
# Dependencies
 
31
###########################
 
32
 
 
33
GLIB_REQUIRED_VERSION=2.28
 
34
GIO_UNIX_REQUIRED_VERSION=2.28
 
35
GTK_REQUIRED_VERSION=2.24
 
36
GTK3_REQUIRED_VERSION=3.0
 
37
INDICATOR_DISPLAY_OBJECTS=0.2
 
38
INDICATOR_REQUIRED_VERSION=0.3.0
 
39
DBUSMENUGLIB_REQUIRED_VERSION=0.4
 
40
DBUSMENUGTK_REQUIRED_VERSION=0.4
 
41
 
 
42
PKG_CHECK_MODULES([POWERSERVICE],[
 
43
        dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION
 
44
        glib-2.0 >= $GLIB_REQUIRED_VERSION
 
45
        indicator3 >= $INDICATOR_REQUIRED_VERSION
 
46
        gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
 
47
])
 
48
 
 
49
AC_ARG_WITH([gtk],
 
50
            [AS_HELP_STRING([--with-gtk],
 
51
                            [Which version of gtk to use for the indicator @<:@default=3@:>@])],
 
52
            [],
 
53
            [with_gtk=3])
 
54
 
 
55
AS_IF([test "x$with_gtk" = x3],
 
56
      [PKG_CHECK_MODULES([INDICATOR],[
 
57
                          gtk+-3.0 >= $GTK3_REQUIRED_VERSION
 
58
                          indicator3 >= $INDICATOR_REQUIRED_VERSION
 
59
                          libido3-0.1 >= $INDICATOR_DISPLAY_OBJECTS
 
60
                          dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION])],
 
61
      [test "x$with_gtk" = x2],
 
62
      [PKG_CHECK_MODULES([INDICATOR],[
 
63
                          gtk+-2.0 >= $GTK_REQUIRED_VERSION
 
64
                          indicator >= $INDICATOR_REQUIRED_VERSION
 
65
                          libido-0.1 >= $INDICATOR_DISPLAY_OBJECTS
 
66
                          dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION])],
 
67
      [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])]
 
68
)
 
69
AC_SUBST(INDICATOR_CFLAGS)
 
70
AC_SUBST(INDICATOR_LIBS)
 
71
 
 
72
###########################
 
73
# Check to see if we're local
 
74
###########################
 
75
 
 
76
with_localinstall="no"
 
77
AC_ARG_ENABLE([localinstall],
 
78
              [AS_HELP_STRING([--enable-localinstall],
 
79
                              [install all of the files localy instead of system directories (for distcheck)])],
 
80
              [with_localinstall=$enableval],
 
81
              [with_localinstall=no])
 
82
 
 
83
###########################
 
84
# Indicator Info
 
85
###########################
 
86
 
 
87
if test "x$with_localinstall" = "xyes"; then
 
88
        INDICATORDIR="${libdir}/indicators/3/"
 
89
        INDICATORICONSDIR="${datadir}/indicator-applet/icons/"
 
90
elif test "x$with_gtk" = x2; then
 
91
        INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator`
 
92
        INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator`
 
93
else
 
94
        INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3`
 
95
        INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator3`
 
96
fi
 
97
AC_SUBST(INDICATORDIR)
 
98
AC_SUBST(INDICATORICONSDIR)
 
99
 
 
100
###########################
 
101
# DBus Service Info
 
102
###########################
 
103
 
 
104
if test "x$with_localinstall" = "xyes"; then
 
105
        DBUSSERVICEDIR="${datadir}/dbus-1/services/"
 
106
else
 
107
        DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`
 
108
fi
 
109
AC_SUBST(DBUSSERVICEDIR)
 
110
 
 
111
##############################
 
112
# Custom Junk
 
113
##############################
 
114
 
 
115
AC_DEFUN([AC_DEFINE_PATH], [
 
116
        test "x$prefix" = xNONE && prefix="$ac_default_prefix"
 
117
        test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
118
        ac_define_path=`eval echo [$]$2`
 
119
        ac_define_path=`eval echo [$]ac_define_path`
 
120
        $1="$ac_define_path"
 
121
        AC_SUBST($1)
 
122
        ifelse($3, ,
 
123
                AC_DEFINE_UNQUOTED($1, "$ac_define_path"),
 
124
                AC_DEFINE_UNQUOTED($1, "$ac_define_path", $3))
 
125
])
 
126
 
 
127
###########################
 
128
# Internationalization
 
129
###########################
 
130
 
 
131
IT_PROG_INTLTOOL([0.41.0])
 
132
 
 
133
AM_GNU_GETTEXT([external])
 
134
AM_GNU_GETTEXT_VERSION([0.17])
 
135
 
 
136
AC_SUBST([GETTEXT_PACKAGE],[PACKAGE_TARNAME])
 
137
AC_DEFINE([GETTEXT_PACKAGE],[PACKAGE_TARNAME],[Define to the gettext package name.])
 
138
 
 
139
###########################
 
140
# Files
 
141
###########################
 
142
 
 
143
AC_CONFIG_FILES([
 
144
Makefile
 
145
po/Makefile.in
 
146
])
 
147
AC_OUTPUT
 
148
 
 
149
###########################
 
150
# Results
 
151
###########################
 
152
 
 
153
AC_MSG_NOTICE([
 
154
 
 
155
Me Indicator Configuration:
 
156
 
 
157
        Prefix:        $prefix
 
158
        GTK:           $with_gtk
 
159
])