Contents of /trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 30 - (show annotations)
Fri Jul 24 19:24:42 2009 UTC (14 years, 9 months ago) by harbaum
File size: 5331 byte(s)
Fixed fremantle submenues
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 # GPXView autoconf script
5 #
6 # Copyright (C) 2008 Till Harbaum <till@harbaum.org>
7 #
8 # This file is part of GPXView.
9 #
10 # GPXView is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
14 #
15 # GPXView is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with GPXView. If not, see <http://www.gnu.org/licenses/>.
22
23 AC_PREREQ(2.61)
24 AC_INIT([GPXView],[0.7.4],[till@harbaum.org])
25 AC_CONFIG_SRCDIR([src/main.c])
26 # AC_CONFIG_HEADER([src/config.h])
27
28 PACKAGE="gpxview"
29 AC_SUBST(PACKAGE)
30
31 # Checks for programs.
32 AC_PROG_CC
33 AC_PROG_INSTALL
34 AC_PROG_LN_S
35 AC_PROG_MAKE_SET
36
37 # Checks for libraries.
38
39 # Checks for header files.
40 #AC_HEADER_STDC
41 #AC_CHECK_HEADERS([libintl.h locale.h stdlib.h string.h sys/time.h unistd.h])
42
43 # Checks for typedefs, structures, and compiler characteristics.
44 #AC_C_CONST
45 #AC_C_INLINE
46 #AC_TYPE_SIZE_T
47 #AC_HEADER_TIME
48 #AC_STRUCT_TM
49 #AC_HEADER_STDBOOL
50
51 # Checks for library functions.
52 #AC_FUNC_MALLOC
53 #AC_FUNC_MKTIME
54 #AC_FUNC_STRFTIME
55 #AC_FUNC_STRTOD
56 #AC_CHECK_FUNCS([gettimeofday localtime_r memset pow setlocale sqrt strcasecmp strchr strcspn strdup strerror strrchr strstr strtoul tzset])
57
58 # check for gnome-vfs-module-2.0
59 PKG_CHECK_MODULES([gnome_vfs_module], [gnome-vfs-module-2.0], [], [AC_MSG_ERROR([gnome-vfs-module-2.0 missing])])
60 CFLAGS="$CFLAGS $gnome_vfs_module_CFLAGS"
61 LIBS="$LIBS $gnome_vfs_module_LIBS"
62
63 # check for libxml-2.0
64 PKG_CHECK_MODULES([libxml2], [libxml-2.0], [], [AC_MSG_ERROR([libxml-2.0 missing])])
65 CFLAGS="$CFLAGS $libxml2_CFLAGS"
66 LIBS="$LIBS $libxml2_LIBS"
67
68 # check for gtkhtml-3.14
69 PKG_CHECK_MODULES([libgtkhtml3_14], [libgtkhtml-3.14], [
70 CFLAGS="$CFLAGS $libgtkhtml3_14_CFLAGS"
71 LIBS="$LIBS $libgtkhtml3_14_LIBS"
72 ], [
73 # ok, we can also live with 3.8
74 PKG_CHECK_MODULES([libgtkhtml3_8], [libgtkhtml-3.8], [
75 CFLAGS="$CFLAGS $libgtkhtml3_8_CFLAGS"
76 LIBS="$LIBS $libgtkhtml3_8_LIBS"
77 ], [AC_MSG_ERROR([libgtkhtml-3 missing])])
78 ])
79
80 # check for maemo
81 AC_MSG_CHECKING([for Maemo])
82 PKG_CHECK_EXISTS(maemo-version, [
83 MAEMO="yes"
84 AC_MSG_RESULT(yes)
85
86 PKG_CHECK_MODULES([hildon], [hildon-1], [], [AC_MSG_ERROR([hildon-1 missing])])
87 CFLAGS="$CFLAGS -DUSE_MAEMO $hildon_CFLAGS"
88 LIBS="$LIBS $hildon_LIBS"
89
90 PKG_CHECK_MODULES([osso], [libosso], [], [AC_MSG_ERROR([libosso missing])])
91 CFLAGS="$CFLAGS $osso_CFLAGS"
92 LIBS="$LIBS $osso_LIBS"
93
94 PKG_CHECK_MODULES([hildon_fm_2], [hildon-fm-2], [], [AC_MSG_ERROR([hildon-fm-2 missing])])
95 CFLAGS="$CFLAGS $hildon_fm_2_CFLAGS"
96 LIBS="$LIBS $hildon_fm_2_LIBS"
97
98 # check for sqlite3 for maemo mapper interface
99 PKG_CHECK_MODULES([sqlite3], [sqlite3], [], [AC_MSG_ERROR([sqlite3 missing])])
100 CFLAGS="$CFLAGS $sqlite3_CFLAGS"
101 LIBS="$LIBS $sqlite3_LIBS"
102
103 # check for hildon-help
104 PKG_CHECK_MODULES([hildon_help], [hildon-help], [
105 CFLAGS="-DHILDON_HELP $CFLAGS $hildon_help_CFLAGS"
106 LIBS="$LIBS $hildon_help_LIBS"
107 ], [
108 AC_MSG_NOTICE([WARNING: hildon-help missing])
109 ])
110
111 # prefer gpsbt over liblocation as we got complaints regarding liblocation
112 # stability
113 PKG_CHECK_EXISTS(gpsbt, [
114 PKG_CHECK_MODULES([gpsbt], [gpsbt], [], [])
115 CFLAGS="$CFLAGS -DENABLE_GPSBT $gpsbt_CFLAGS"
116 LIBS="$LIBS $gpsbt_LIBS"
117 ], [
118 AC_MSG_NOTICE([gpsbt not found, trying liblocation])
119
120 PKG_CHECK_EXISTS(liblocation, [
121 PKG_CHECK_MODULES([liblocation], [liblocation], [], [])
122 CFLAGS="$CFLAGS -DENABLE_LIBLOCATION $liblocation_CFLAGS"
123 LIBS="$LIBS $liblocation_LIBS"
124 ], [
125 AC_MSG_NOTICE([WARNING: No liblocation nor gpsbt found, disabling gps auto start!])
126 ])
127 ])
128
129 PKG_CHECK_EXISTS(tablet-browser-interface, [
130 CFLAGS="$CFLAGS -DENABLE_BROWSER_INTERFACE"
131 ], [AC_MSG_NOTICE([WARNING: No tablet-browser-interface found, disabling microb interface!])])
132
133 PKG_CHECK_EXISTS(maemo-version, [
134 VERSION=`pkg-config --modversion maemo-version`
135 AC_MSG_NOTICE([Configuring for Maemo $VERSION])
136 CFLAGS="$CFLAGS -DMAEMO_VERSION=\\\"$VERSION\\\""
137 MAJOR=`echo $VERSION | cut -b1 -`
138 CFLAGS="$CFLAGS -DMAEMO_VERSION_MAJOR=$MAJOR"
139 ], [
140 AC_MSG_ERROR([maemo-version not found])
141 ])
142
143 # maemo uses dbus for ipc with maemo mapper
144 EXTRA_OBJS="mm_poi.o dbus.o"
145 AC_SUBST(EXTRA_OBJS)
146
147 INSTALL_PLATTFORM="install-maemo"
148 AC_SUBST(INSTALL_PLATTFORM)
149
150 ], [
151 AC_MSG_RESULT(no)
152
153 # check for gtk+-2.0
154 PKG_CHECK_MODULES([gtk], [gtk+-2.0], [], [AC_MSG_ERROR([gtk+-2.0 missing!])])
155 CFLAGS="$CFLAGS $gtk_CFLAGS"
156 LIBS="$LIBS $gtk_LIBS"
157
158 # non-maemo device use gnome to call the web browser
159 PKG_CHECK_MODULES([gnome2], [libgnome-2.0], [], [AC_MSG_ERROR([libgnome-2.0 missing])])
160 CFLAGS="$CFLAGS $gnome2_CFLAGS -DENABLE_BROWSER_INTERFACE"
161 LIBS="$LIBS $gnome2_LIBS"
162
163 INSTALL_PLATTFORM="install-debian"
164 AC_SUBST(INSTALL_PLATTFORM)
165 ])
166
167
168 AC_CONFIG_FILES([Makefile src/Makefile data/Makefile])
169
170 AC_OUTPUT