~mhr3/unity-lens-applications/bug-850714

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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
AC_INIT(unity-lens-applications, 0.4.10, https://launchpad.net/unity-lens-applications)
AC_COPYRIGHT([Copyright 2010-2011 Canonical])
AM_INIT_AUTOMAKE([1.11])

#############################################
# Silent build rules
#############################################
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

AC_PREREQ(2.59)

AC_CONFIG_HEADERS([config.h])

#############################################
# Init the other things we depend on
#############################################
AM_MAINTAINER_MODE
AM_PROG_VALAC([0.11.3])
AS_IF([test -z "$VALAC"], [AC_MSG_ERROR(["No valac compiler found."])])
AC_PROG_CC
AM_PROG_CC_C_O
AC_HEADER_STDC
AC_LANG([C++])

LT_INIT
AC_CONFIG_MACRO_DIR([m4])

#############################################
# Gettext
#############################################
GETTEXT_PACKAGE="$PACKAGE"
AC_SUBST(GETTEXT_PACKAGE)
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [gettext domain])
AM_GLIB_GNU_GETTEXT

# AM_GNOME_GETTEXT above substs $DATADIRNAME
# this is the directory where the *.{mo,gmo} files are installed
localedir='${prefix}/${DATADIRNAME}/locale'
AC_SUBST(localedir)

IT_PROG_INTLTOOL([0.40.0])

AC_DEFINE_UNQUOTED(LOCALE_DIR, "${PREFIX}/${DATADIRNAME}/locale",[Locale directory])
AC_DEFINE_UNQUOTED(DATADIR, "${PREFIX}/${DATADIRNAME}",[Data directory])
AC_DEFINE_UNQUOTED(PREFIXDIR, "${PREFIX}",[Prefix directory])

######################################################
# intltool rule for generating translated .lens file
######################################################
INTLTOOL_LENS_RULE='%.lens: %.lens.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
AC_SUBST(INTLTOOL_LENS_RULE)

#############################################
# Check for module and library dependancies
#############################################
GLIB_REQUIRED=2.27
PKG_CHECK_MODULES(LENS_DAEMON,
                  glib-2.0 >= $GLIB_REQUIRED
                  gobject-2.0 >= $GLIB_REQUIRED
                  gio-2.0 >= $GLIB_REQUIRED
                  gio-unix-2.0 >= $GLIB_REQUIRED
                  gconf-2.0
                  gee-1.0
                  dee-1.0 >= 0.5.16
                  zeitgeist-1.0 >= 0.3.8
                  unity >= 4.0.5
                  libgnome-menu)

AC_SUBST(LENS_DAEMON_CFLAGS)
AC_SUBST(LENS_DAEMON_LIBS)

AC_CHECK_HEADER(db.h, [],
                AC_MSG_FAILURE([Unable to find db.h. Please install the package libdb4.8-dev]))

AC_CHECK_HEADER(xapian.h, [],
                AC_MSG_FAILURE([Unable to find xapian.h. Please install the package libxapian-dev]))


#############################################
# local install for distcheck and stand-alone running
#############################################
with_localinstall="no"
AC_ARG_ENABLE(localinstall,
              AS_HELP_STRING([--enable-localinstall],
                             [Install all of the files locally instead of in system directories (for distcheck)]),
              with_localinstall=$enableval,
              with_localinstall=no)

AM_CONDITIONAL([HAVE_LOCALINSTALL], [test "x$with_localinstall" = "xyes"])

#############################################
# Expand variables needed for config.vala
#############################################
AS_AC_EXPAND(PREFIX, $prefix)
AC_SUBST(PREFIX)

AS_AC_EXPAND(DATADIR, $datarootdir)
AC_SUBST(DATADIR)

#############################################
# look for dbus service dir
#############################################
if test "x$with_localinstall" = "xyes"; then
	DBUSSERVICEDIR="${datadir}/dbus-1/services/"
else
	DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`
fi
AC_SUBST(DBUSSERVICEDIR)

#############################################
# Create the Makefiles
#############################################
AC_CONFIG_FILES([
  Makefile
  applications.lens.in
  commands.lens.in
  data/Makefile
  data/X-Unity-All-Applications.directory
  data/unity-lens-applications.menu
  src/Makefile
  src/config.vala
  po/Makefile.in
])
AC_OUTPUT

dnl Output the results
AC_MSG_NOTICE([

  Unity Applications Lens Daemon $VERSION
  ------------------------------------

  Prefix         : ${prefix}
  Sysconfdir     : ${sysconfdir}
  
  Local install  : ${with_localinstall}

  Extra CFlags   : ${CPPFLAGS} $MAINTAINER_CFLAGS
  Extra ValaFlags: ${CPPFLAGS} $MAINTAINER_VALAFLAGS
])