Barry debian version 0.18.5-1
[barry.git] / desktop / configure.ac
blobbbc007e107895e8da0e263d962fa4bec450dfc3e
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 # Parts taken from the pkg.m4 file from pkg-config
5 # Copyright 2004 Scott James Remnant <scott@netsplit.com>
8 AC_PREREQ(2.61)
9 AC_INIT([barrydesktop], [0.18.5], [barry-devel@lists.sourceforge.net])
10 #AM_CONFIG_HEADER(config.h)
11 AC_CONFIG_SRCDIR([src/barrydesktop.cc])
12 AC_CONFIG_HEADERS([config.h:config.h.in])
13 AC_CONFIG_AUX_DIR([.])
14 AC_CONFIG_MACRO_DIR([m4])
15 AM_INIT_AUTOMAKE
17 AM_GNU_GETTEXT([external])
18 # this is the version of gettext, not barry
19 AM_GNU_GETTEXT_VERSION([0.18.1])
22 # Barry Desktop Version Numbers
24 # Be sure to keep BARRY_DESKTOP_MAJOR == BARRY_MAJOR from ../configure.ac!
25 # (see desktop/src/Makefile.am for the reason)
27 BARRY_DESKTOP_LOGICAL=0
28 BARRY_DESKTOP_MAJOR=18
29 BARRY_DESKTOP_MINOR=5
30 AC_DEFINE_UNQUOTED([BARRY_DESKTOP_LOGICAL], [$BARRY_DESKTOP_LOGICAL], [Logical version number])
31 AC_DEFINE_UNQUOTED([BARRY_DESKTOP_MAJOR], [$BARRY_DESKTOP_MAJOR], [Major library version number])
32 AC_DEFINE_UNQUOTED([BARRY_DESKTOP_MINOR], [$BARRY_DESKTOP_MINOR], [Minor library version number])
33 AC_DEFINE_UNQUOTED([BARRY_DESKTOP_VER_STRING],
34         ["${BARRY_DESKTOP_LOGICAL}.${BARRY_DESKTOP_MAJOR}.${BARRY_DESKTOP_MINOR}"],
35         [Full Barry Desktop version in string form])
36 AC_SUBST([BARRY_DESKTOP_LOGICAL])
37 AC_SUBST([BARRY_DESKTOP_MAJOR])
38 AC_SUBST([BARRY_DESKTOP_MINOR])
41 # Checks for programs.
43 AC_PROG_CC
44 AC_PROG_CXX
45 AC_PROG_MAKE_SET
46 AC_PROG_LIBTOOL
48 AC_LANG([C])
50 PKG_CHECK_MODULES([LIBGCAL], [libgcal >= 0.9.6], [],
51         [
52         LGTEMP_LDFLAGS="$LDFLAGS"
53         LDFLAGS="$LDFLAGS -lgcal"
54         AC_RUN_IFELSE(
55                 [AC_LANG_PROGRAM(
56                         [[
57 #include <stdio.h>
58 #include <string.h>
59 #include <stdlib.h>
61 int get_the_url(char *data, int length, char **url);
63 void xmlCleanupParser(void)
65         // if this gets called, the libgcal we are using is broken
66         exit(1);
68                         ]],
69                         [[
70 const char *xml = "<nothing></nothing>";
71 char *dest;
72 get_the_url(xml, strlen(xml), &dest);
73                         ]]
74                         )
75                 ],
76                 [LG_TRY_AGAIN=yes],
77                 [AC_MSG_ERROR(
79 Your copy of libgcal is older than 0.9.6, and it contains
80 this bug:
82 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597153
84 You will need to upgrade to avoid segfaults when syncing with
85 Google calendar.
87                 )],
88                 [AC_MSG_ERROR(
90 Your copy of libgcal is older than 0.9.6.  Since you are
91 cross-compiling it is not possible to easily check whether
92 the following bug exists in your copy or not:
94 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597153
96 Please upgrade and try again.
98                 )]
99                 )
100         LDFLAGS="$LGTEMP_LDFLAGS"
101         if test "$LG_TRY_AGAIN" = "yes" ; then
102                 AC_MSG_RESULT([found patched libgcal...])
103                 PKG_CHECK_MODULES([LIBGCAL], [libgcal >= 0.9.4])
104         fi
105         ]
106         )
108 AC_LANG([C++])
111 # Search for a GUI-style version of su.  If not specified, we search for
112 # gksu (for Debian), beesu (for Fedora), and kdesu (for openSUSE),
113 # searched in the above order.
115 # User can override with the option.
117 AC_ARG_WITH([guisu],
118         [AS_HELP_STRING([--with-guisu=CMD],
119         [specify GUI oriented su wrapper program @<:@default: searches for gksu, beesu, or kdesu in that order@:>@])],
120         [
121                 GUISU="$with_guisu"
122                 AC_MSG_NOTICE([Using user-specified GUI su wrapper: $GUISU])
123         ],
124         [
125                 if test -x /usr/bin/gksu ; then
126                         GUISU="gksu"
127                         AC_MSG_NOTICE([Found GUI su wrapper: gksu])
128                 elif test -x /usr/bin/beesu ; then
129                         GUISU="beesu"
130                         AC_MSG_NOTICE([Found GUI su wrapper: beesu])
131                 elif test -x /usr/bin/kdesu ; then
132                         GUISU="kdesu"
133                         AC_MSG_NOTICE([Found GUI su wrapper: kdesu])
134                 else
135                         AC_MSG_ERROR([Unable to find a GUI oriented su wrapper.
137         This is required for modem operation, in case permissions are not
138         set on pppd properly.
140         Please specify the GUI su wrapper you wish to use with the
141         --with-guisu configure option.  Note that it MUST be a GUI.
142         You cannot use the command line su.
144         ])
145                 fi
146         ])
148 AC_SUBST([GUISU])
151 # Check for Evolution data server libraries, and allow user to disable
152 # if needed.
154 AC_ARG_WITH([evolution],
155         [AS_HELP_STRING([--with-evolution],
156         [use evolution libs to help configure sync (yes,no,check) @<:@default=check@:>@])],
157         [],
158         [with_evolution=check])
160 if test "x$with_evolution" != xno ; then
161         PKG_CHECK_MODULES([EVOLUTION],
162                 [libebook-1.2 libecal-1.2 libedataserver-1.2],
163                 [
164                         AC_DEFINE([HAVE_EVOLUTION], [1],
165                                 [Define to 1 if Evolution data server libraries are available.])
166                 ],
167                 [
168                         if test "x$with_evolution" != xcheck; then
169                                 AC_MSG_FAILURE([--with-evolution was given, but test for evolution failed])
170                         fi
171                 ])
174 PKG_CHECK_MODULES([BARRY], [libbarry-18 libbarrysync-18 libbarrybackup-18])
175 PKG_CHECK_MODULES([GLIB2], [glib-2.0])
176 PKG_CHECK_MODULES([LIBXMLPP], [libxml++-2.6])
177 PKG_CHECK_MODULES([OPENSYNC22], [opensync-1.0], [], [OS22NOTFOUND=yes])
178 PKG_CHECK_MODULES([OPENSYNC40], [libopensync1], [], [OS40NOTFOUND=yes])
180 if test "$OS22NOTFOUND" = "yes" -a "$OS40NOTFOUND" = "yes" ; then
181         AC_MSG_WARN(dnl
184 *************************************************************************
185 WARNING:
186 Unable to find development libraries for either opensync 0.22 or 0.4x.
187 Barry Desktop will be built without any sync support.
188 *************************************************************************
190 If this is not desired, consider adjusting the PKG_CONFIG_PATH environment
191 variable if you installed software in a non-standard prefix.
193 Alternatively, you may set the environment variables:
195         OPENSYNC22_CFLAGS and OPENSYNC22_LIBS
197         OPENSYNC40_CFLAGS and OPENSYNC40_LIBS
199 to avoid the need to call pkg-config.
201 See the pkg-config man page for more details.
205 AM_CONDITIONAL([WITH_OPENSYNC22], [test "$OS22NOTFOUND" != "yes"])
206 AM_CONDITIONAL([WITH_OPENSYNC40], [test "$OS40NOTFOUND" != "yes"])
208 # Carry the special tree build environment variables from parent configure,
209 # just in case user is doing a complete tree build with --enable-desktop
210 AC_SUBST(TREE_BUILD_CXXFLAGS)
211 AC_SUBST(TREE_BUILD_LDFLAGS)
213 # Check for wxWidgets libraries
214 AM_OPTIONS_WXCONFIG
215 AM_PATH_WXCONFIG([2.8.0], [], [
216         AC_MSG_ERROR([
217         wxWidgets is required to build the Barry desktop,
218         but the wx-config script could not be found.
220         Please check that wx-config is in your path, that the directory
221         where wxWidgets libraries are installed (returned by the
222         'wx-config --libs' command) is in LD_LIBRARY_PATH, and that
223         wxWidgets is version 2.3.4 or above.
224         ])
225         ])
227 # Setup system directories, so src/Makefile.am can use them for the compile
228 # and for the image/data file installations. (image_DATA)
229 basedatadir="$datadir/barry/desktop/"
230 imagedir="$datadir/barry/desktop/images/"
231 xmlmap22dir="$datadir/barry/desktop/0.22/"
232 xmlmap40dir="$datadir/barry/desktop/0.40/"
233 AC_SUBST(basedatadir)
234 AC_SUBST(imagedir)
235 AC_SUBST(xmlmap22dir)
236 AC_SUBST(xmlmap40dir)
238 # Checks for libraries.
239 AC_CHECK_LIB([pthread], [main])
241 # Checks for header files.
242 AC_HEADER_DIRENT
243 AC_HEADER_STDC
244 AC_CHECK_HEADERS([assert.h stdint.h time.h])
246 # Checks for typedefs, structures, and compiler characteristics.
247 #AC_TYPE_SIZE_T
248 AC_HEADER_TIME
249 AC_STRUCT_TM
251 # Checks for library functions.
252 AC_FUNC_CLOSEDIR_VOID
253 AC_PROG_GCC_TRADITIONAL
254 AC_FUNC_MALLOC
255 AC_FUNC_MKTIME
256 AC_FUNC_REALLOC
257 AC_FUNC_SELECT_ARGTYPES
258 AC_FUNC_STAT
259 AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul])
261 AC_CONFIG_FILES([Makefile
262                  po/Makefile.in
263                  po-osyncwrap/Makefile.in
264                  images/Makefile
265                  src/Makefile
266                  src/0.22/Makefile
267                  src/0.40/Makefile
268                  man/Makefile])
269 AC_OUTPUT
273 # Add a special hack at the end, to let the user disable RPATH if he wants.
275 # http://wiki.debian.org/RpathIssue
276 # http://lists.debian.org/debian-devel/2003/debian-devel-200306/msg00569.html
277 # http://fedoraproject.org/wiki/Packaging:Guidelines#Removing_Rpath
279 AC_ARG_ENABLE([rpathhack],
280         [AC_HELP_STRING([--enable-rpathhack], [patch libtool to remove RPATH])],
281         [
282 AC_MSG_RESULT([patching libtool to fix HIDEOUS BREAKAGE])
283 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
284 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
285         ],
286         [])