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>
9 AC_INIT([barrydesktop], [0.18.4], [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])
17 AM_GNU_GETTEXT([external])
18 # this is the verion 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
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.
50 PKG_CHECK_MODULES([LIBGCAL], [libgcal >= 0.9.6], [],
52 LGTEMP_LDFLAGS="$LDFLAGS"
53 LDFLAGS="$LDFLAGS -lgcal"
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
70 const char *xml = "<nothing></nothing>";
72 get_the_url(xml, strlen(xml), &dest);
79 Your copy of libgcal is older than 0.9.6, and it contains
82 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597153
84 You will need to upgrade to avoid segfaults when syncing with
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.
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])
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.
118 [AS_HELP_STRING([--with-guisu=CMD],
119 [specify GUI oriented su wrapper program @<:@default: searches for gksu, beesu, or kdesu in that order@:>@])],
122 AC_MSG_NOTICE([Using user-specified GUI su wrapper: $GUISU])
125 if test -x /usr/bin/gksu ; then
127 AC_MSG_NOTICE([Found GUI su wrapper: gksu])
128 elif test -x /usr/bin/beesu ; then
130 AC_MSG_NOTICE([Found GUI su wrapper: beesu])
131 elif test -x /usr/bin/kdesu ; then
133 AC_MSG_NOTICE([Found GUI su wrapper: kdesu])
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.
151 # Check for Evolution data server libraries, and allow user to disable
154 AC_ARG_WITH([evolution],
155 [AS_HELP_STRING([--with-evolution],
156 [use evolution libs to help configure sync (yes,no,check) @<:@default=check@:>@])],
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],
164 AC_DEFINE([HAVE_EVOLUTION], [1],
165 [Define to 1 if Evolution data server libraries are available.])
168 if test "x$with_evolution" != xcheck; then
169 AC_MSG_FAILURE([--with-evolution was given, but test for evolution failed])
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
184 *************************************************************************
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
215 AM_PATH_WXCONFIG([2.8.0], [], [
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.
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)
235 AC_SUBST(xmlmap22dir)
236 AC_SUBST(xmlmap40dir)
238 # Checks for libraries.
239 AC_CHECK_LIB([pthread], [main])
241 # Checks for header files.
244 AC_CHECK_HEADERS([assert.h stdint.h time.h])
246 # Checks for typedefs, structures, and compiler characteristics.
251 # Checks for library functions.
252 AC_FUNC_CLOSEDIR_VOID
253 AC_PROG_GCC_TRADITIONAL
257 AC_FUNC_SELECT_ARGTYPES
259 AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul])
261 AC_CONFIG_FILES([Makefile
263 po-osyncwrap/Makefile.in
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])],
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