]> git.itanic.dy.fi Git - maemo-mapper/blob - configure.ac
Workaround connectivity problems in Scratchbox. Fixes: #2098.
[maemo-mapper] / configure.ac
1 #
2 # Copyright (C) 2006, 2007 John Costigan.
3 #
4 # This file is part of Maemo Mapper.
5 #
6 # Maemo Mapper is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # Maemo Mapper is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 AC_INIT(Makefile.am)
21 AM_INIT_AUTOMAKE(maemo-mapper, 2.3.1)
22
23 AC_PROG_CPP
24 AC_CONFIG_HEADERS(src/config.h)
25 AC_PROG_INSTALL
26 AC_PROG_LIBTOOL
27
28 PKG_CHECK_MODULES(GTK, gtk+-2.0)
29 AC_SUBST(GTK_LIBS)
30 AC_SUBST(GTK_CFLAGS)
31
32 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.8.4.11 gnome-vfs-module-2.0 >= 2.8.4.11)
33 AC_SUBST(GNOME_VFS_LIBS)
34 AC_SUBST(GNOME_VFS_CFLAGS)
35
36 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6.2)
37 AC_SUBST(GCONF_LIBS)
38 AC_SUBST(GCONF_CFLAGS)
39
40 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= 2.6.16)
41 AC_SUBST(LIBXML2_LIBS)
42 AC_SUBST(LIBXML2_CFLAGS)
43
44 PKG_CHECK_MODULES(SQLITE, sqlite3)
45 AC_SUBST(SQLITE_LIBS)
46 AC_SUBST(SQLITE_CFLAGS)
47
48 PKG_CHECK_MODULES(CONIC, conic)
49 AC_SUBST(CONIC_LIBS)
50 AC_SUBST(CONIC_CFLAGS)
51
52 AC_CHECK_HEADER(gdbm.h, , AC_MSG_ERROR(gdbm.h not found. Please install libgdbm-dev.))
53 AC_CHECK_LIB(gdbm, gdbm_open, , AC_MSG_ERROR(libgdbm.so not found. Please install libgdbm.), -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0)
54
55 AC_CHECK_HEADER(gpsmgr.h, , AC_MSG_ERROR(gpsmgr.h not found. Please install libgpsmgr-dev.))
56 AC_CHECK_LIB(gpsmgr, gpsmgr_start, , AC_MSG_ERROR(libgpsmgr.so not found. Please install libgpsmgr.), -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0)
57
58 AC_ARG_ENABLE(legacy, 
59         AS_HELP_STRING([--enable-legacy],[Enable building for Chinook]),
60         [case "${enableval}" in
61                 yes) HAVE_LEGACY=yes ;;
62                 no)  HAVE_LEGACY=no ;;
63                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-legacy) ;;
64         esac],
65         [HAVE_LEGACY=no])
66
67 AS_IF([test "x$HAVE_LEGACY" = xyes], 
68         [
69                 PKG_CHECK_MODULES(OSSO, libosso >= 1 libossohelp)
70                 PKG_CHECK_MODULES(HILDON, hildon-libs >= 0.9.50 hildon-fm)
71                 AC_DEFINE(LEGACY, 1, Build for OS2006/OS2007)
72         ],
73         [
74                 PKG_CHECK_MODULES(OSSO, libosso >= 1 hildon-help)
75                 PKG_CHECK_MODULES(HILDON, hildon-1 hildon-fm-2)
76                 AC_CHECK_HEADER(gps.h, , AC_MSG_ERROR(gps.h not found. Please install libgps-dev.))
77                 AC_CHECK_LIB(gps, gps_open, , AC_MSG_ERROR(libgps.so not found. Please install libgps.), -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0)
78                 AC_CHECK_HEADER(gpsbt.h, , AC_MSG_ERROR(gpsbt.h not found. Please install libgpsbt-dev.))
79                 AC_CHECK_LIB(gpsbt, gpsbt_start, , AC_MSG_ERROR(libgpsbt.so not found. Please install libgpsbt.), -lgps -lgpsmgr -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0)
80         ])
81
82 AC_SUBST(OSSO_LIBS)
83 AC_SUBST(OSSO_CFLAGS)
84
85 AC_SUBST(HILDON_LIBS)
86 AC_SUBST(HILDON_CFLAGS)
87
88
89 # Localisation
90 localedir=`$PKG_CONFIG osso-af-settings --variable=localedir`
91 AC_PROG_INTLTOOL([0.23])
92 GETTEXT_PACKAGE=$PACKAGE
93 AC_SUBST(GETTEXT_PACKAGE)
94 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "${GETTEXT_PACKAGE}", [Name of gettext package])
95 ALL_LINGUAS="en_US en_GB nl_NL it_IT bg_BG fi_FI sv_SE"
96 AM_GLIB_GNU_GETTEXT
97
98
99 # To make application visible in maemo Task Navigator it needs a Desktop
100 # file for the application.
101 # D-BUS service file is needed to be able to launch the maemo application
102 # and connect it to D-BUS services.
103 # The following line defines install directories for these files.
104 desktopentrydir=`$PKG_CONFIG osso-af-settings --variable=desktopentrydir`
105 serviceentrydir=`$PKG_CONFIG osso-af-settings --variable=dbusservicedir`
106
107 # Application pixmaps install directory
108 pixmapdir=`$PKG_CONFIG osso-af-settings --variable=hildonpixmapdir`
109
110 # Application icon install directories
111 icon_26x26dir=$datadir/icons/hicolor/26x26/hildon
112 icon_34x34dir=$datadir/icons/hicolor/34x34/hildon
113 icon_40x40dir=$datadir/icons/hicolor/40x40/hildon
114 icon_50x50dir=$datadir/icons/hicolor/50x50/hildon
115 icon_scalabledir=$datadir/icons/hicolor/scalable/hildon
116
117 # Help file install directory
118 helpfile_enusdir=$datadir/osso-help/en_US
119 AC_SUBST(helpfile_enusdir)
120 helpfile_engbdir=$datadir/osso-help/en_GB
121 AC_SUBST(helpfile_engbdir)
122 helpfile_fifidir=$datadir/osso-help/fi_FI
123 AC_SUBST(helpfile_fifidir)
124
125 # Hildon control panel plugin install directories
126 pluginlibdir=`$PKG_CONFIG hildon-control-panel --variable=plugindir`
127 plugindesktopentrydir=`$PKG_CONFIG hildon-control-panel --variable=plugindesktopentrydir`
128
129 # Define as variables in Makefiles
130 AC_SUBST(desktopentrydir)
131 AC_SUBST(serviceentrydir)
132 AC_SUBST(localedir)
133 AC_SUBST(pixmapdir)
134 AC_SUBST(icon_26x26dir)
135 AC_SUBST(icon_34x34dir)
136 AC_SUBST(icon_40x40dir)
137 AC_SUBST(icon_50x50dir)
138 AC_SUBST(icon_scalabledir)
139 AC_SUBST(pluginlibdir)
140 AC_SUBST(plugindesktopentrydir)
141
142 AC_DEFINE_UNQUOTED([LOCALEDIR], "${localedir}", [Runtime locale catalog files path])
143 AC_DEFINE_UNQUOTED([PIXMAPDIR], "${pixmapdir}", [Runtime pixmap files path])
144
145 # Produce output files
146 AC_OUTPUT(
147           Makefile \
148           src/Makefile \
149           data/Makefile \
150           data/help/Makefile \
151           po/Makefile.in \
152           po/Makefile
153 )
154