Contents of /trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 37 - (hide annotations)
Fri Jul 31 11:17:08 2009 UTC (14 years, 9 months ago) by harbaum
File size: 5848 byte(s)
Minor dependency adjustments
1 harbaum 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 harbaum 37 AC_INIT([GPXView],[0.7.5],[till@harbaum.org])
25 harbaum 1 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 harbaum 32 # check for libsoup
68     PKG_CHECK_MODULES([libsoup24], [libsoup-2.4], [
69     EXTRA_OBJS="$EXTRA_OBJS converter.o osm-gps-map.o map-tool.o"
70     CFLAGS="$CFLAGS $libsoup24_CFLAGS -DENABLE_OSM_GPS_MAP"
71     LIBS="$LIBS $libsoup24_LIBS"
72     ], [
73     PKG_CHECK_MODULES([libsoup22], [libsoup-2.2], [
74     EXTRA_OBJS="$EXTRA_OBJS converter.o osm-gps-map.o map-tool.o"
75     CFLAGS="$CFLAGS $libsoup22_CFLAGS -DLIBSOUP22 -DENABLE_OSM_GPS_MAP"
76     LIBS="$LIBS $libsoup22_LIBS"
77     ], [
78     AC_MSG_NOTICE([WARNING: libsoup-2.4/2.2 missing, disabling internal map])
79     ])
80     ])
81 harbaum 1
82     # check for gtkhtml-3.14
83     PKG_CHECK_MODULES([libgtkhtml3_14], [libgtkhtml-3.14], [
84     CFLAGS="$CFLAGS $libgtkhtml3_14_CFLAGS"
85     LIBS="$LIBS $libgtkhtml3_14_LIBS"
86     ], [
87     # ok, we can also live with 3.8
88     PKG_CHECK_MODULES([libgtkhtml3_8], [libgtkhtml-3.8], [
89     CFLAGS="$CFLAGS $libgtkhtml3_8_CFLAGS"
90     LIBS="$LIBS $libgtkhtml3_8_LIBS"
91     ], [AC_MSG_ERROR([libgtkhtml-3 missing])])
92     ])
93    
94     # check for maemo
95     AC_MSG_CHECKING([for Maemo])
96     PKG_CHECK_EXISTS(maemo-version, [
97     MAEMO="yes"
98     AC_MSG_RESULT(yes)
99    
100     PKG_CHECK_MODULES([hildon], [hildon-1], [], [AC_MSG_ERROR([hildon-1 missing])])
101     CFLAGS="$CFLAGS -DUSE_MAEMO $hildon_CFLAGS"
102     LIBS="$LIBS $hildon_LIBS"
103    
104     PKG_CHECK_MODULES([osso], [libosso], [], [AC_MSG_ERROR([libosso missing])])
105     CFLAGS="$CFLAGS $osso_CFLAGS"
106     LIBS="$LIBS $osso_LIBS"
107    
108     PKG_CHECK_MODULES([hildon_fm_2], [hildon-fm-2], [], [AC_MSG_ERROR([hildon-fm-2 missing])])
109     CFLAGS="$CFLAGS $hildon_fm_2_CFLAGS"
110     LIBS="$LIBS $hildon_fm_2_LIBS"
111    
112     # check for sqlite3 for maemo mapper interface
113     PKG_CHECK_MODULES([sqlite3], [sqlite3], [], [AC_MSG_ERROR([sqlite3 missing])])
114     CFLAGS="$CFLAGS $sqlite3_CFLAGS"
115     LIBS="$LIBS $sqlite3_LIBS"
116    
117     # check for hildon-help
118     PKG_CHECK_MODULES([hildon_help], [hildon-help], [
119     CFLAGS="-DHILDON_HELP $CFLAGS $hildon_help_CFLAGS"
120     LIBS="$LIBS $hildon_help_LIBS"
121     ], [
122     AC_MSG_NOTICE([WARNING: hildon-help missing])
123     ])
124    
125     # prefer gpsbt over liblocation as we got complaints regarding liblocation
126     # stability
127 harbaum 9 PKG_CHECK_EXISTS(gpsbt, [
128     PKG_CHECK_MODULES([gpsbt], [gpsbt], [], [])
129     CFLAGS="$CFLAGS -DENABLE_GPSBT $gpsbt_CFLAGS"
130     LIBS="$LIBS $gpsbt_LIBS"
131     ], [
132 harbaum 1 AC_MSG_NOTICE([gpsbt not found, trying liblocation])
133    
134     PKG_CHECK_EXISTS(liblocation, [
135     PKG_CHECK_MODULES([liblocation], [liblocation], [], [])
136     CFLAGS="$CFLAGS -DENABLE_LIBLOCATION $liblocation_CFLAGS"
137     LIBS="$LIBS $liblocation_LIBS"
138     ], [
139     AC_MSG_NOTICE([WARNING: No liblocation nor gpsbt found, disabling gps auto start!])
140     ])
141 harbaum 9 ])
142 harbaum 1
143     PKG_CHECK_EXISTS(tablet-browser-interface, [
144     CFLAGS="$CFLAGS -DENABLE_BROWSER_INTERFACE"
145     ], [AC_MSG_NOTICE([WARNING: No tablet-browser-interface found, disabling microb interface!])])
146    
147     PKG_CHECK_EXISTS(maemo-version, [
148     VERSION=`pkg-config --modversion maemo-version`
149     AC_MSG_NOTICE([Configuring for Maemo $VERSION])
150     CFLAGS="$CFLAGS -DMAEMO_VERSION=\\\"$VERSION\\\""
151     MAJOR=`echo $VERSION | cut -b1 -`
152     CFLAGS="$CFLAGS -DMAEMO_VERSION_MAJOR=$MAJOR"
153     ], [
154     AC_MSG_ERROR([maemo-version not found])
155     ])
156    
157     # maemo uses dbus for ipc with maemo mapper
158 harbaum 36 EXTRA_OBJS="$EXTRA_OBJS mm_poi.o dbus.o"
159 harbaum 1
160     INSTALL_PLATTFORM="install-maemo"
161    
162     ], [
163     AC_MSG_RESULT(no)
164    
165     # check for gtk+-2.0
166     PKG_CHECK_MODULES([gtk], [gtk+-2.0], [], [AC_MSG_ERROR([gtk+-2.0 missing!])])
167     CFLAGS="$CFLAGS $gtk_CFLAGS"
168     LIBS="$LIBS $gtk_LIBS"
169    
170     # non-maemo device use gnome to call the web browser
171     PKG_CHECK_MODULES([gnome2], [libgnome-2.0], [], [AC_MSG_ERROR([libgnome-2.0 missing])])
172     CFLAGS="$CFLAGS $gnome2_CFLAGS -DENABLE_BROWSER_INTERFACE"
173     LIBS="$LIBS $gnome2_LIBS"
174    
175     INSTALL_PLATTFORM="install-debian"
176     ])
177    
178 harbaum 36 AC_SUBST(EXTRA_OBJS)
179     AC_SUBST(INSTALL_PLATTFORM)
180 harbaum 1 AC_CONFIG_FILES([Makefile src/Makefile data/Makefile])
181    
182     AC_OUTPUT