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.3], [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])
18 # Barry Desktop Version Numbers
20 # Be sure to keep BARRY_DESKTOP_MAJOR == BARRY_MAJOR from ../configure.ac!
21 # (see desktop/src/Makefile.am for the reason)
23 BARRY_DESKTOP_LOGICAL=0
24 BARRY_DESKTOP_MAJOR=18
26 AC_DEFINE_UNQUOTED([BARRY_DESKTOP_LOGICAL], [$BARRY_DESKTOP_LOGICAL], [Logical version number])
27 AC_DEFINE_UNQUOTED([BARRY_DESKTOP_MAJOR], [$BARRY_DESKTOP_MAJOR], [Major library version number])
28 AC_DEFINE_UNQUOTED([BARRY_DESKTOP_MINOR], [$BARRY_DESKTOP_MINOR], [Minor library version number])
29 AC_DEFINE_UNQUOTED([BARRY_DESKTOP_VER_STRING],
30 ["${BARRY_DESKTOP_LOGICAL}.${BARRY_DESKTOP_MAJOR}.${BARRY_DESKTOP_MINOR}"],
31 [Full Barry Desktop version in string form])
32 AC_SUBST([BARRY_DESKTOP_LOGICAL])
33 AC_SUBST([BARRY_DESKTOP_MAJOR])
34 AC_SUBST([BARRY_DESKTOP_MINOR])
37 # Checks for programs.
46 PKG_CHECK_MODULES([LIBGCAL], [libgcal >= 0.9.6], [],
48 LGTEMP_LDFLAGS="$LDFLAGS"
49 LDFLAGS="$LDFLAGS -lgcal"
57 int get_the_url(char *data, int length, char **url);
59 void xmlCleanupParser(void)
61 // if this gets called, the libgcal we are using is broken
66 const char *xml = "<nothing></nothing>";
68 get_the_url(xml, strlen(xml), &dest);
75 Your copy of libgcal is older than 0.9.6, and it contains
78 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597153
80 You will need to upgrade to avoid segfaults when syncing with
86 Your copy of libgcal is older than 0.9.6. Since you are
87 cross-compiling it is not possible to easily check whether
88 the following bug exists in your copy or not:
90 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597153
92 Please upgrade and try again.
96 LDFLAGS="$LGTEMP_LDFLAGS"
97 if test "$LG_TRY_AGAIN" = "yes" ; then
98 AC_MSG_RESULT([found patched libgcal...])
99 PKG_CHECK_MODULES([LIBGCAL], [libgcal >= 0.9.4])
107 # Search for a GUI-style version of su. If not specified, we search for
108 # gksu (for Debian), beesu (for Fedora), and kdesu (for openSUSE),
109 # searched in the above order.
111 # User can override with the option.
114 [AS_HELP_STRING([--with-guisu=CMD],
115 [specify GUI oriented su wrapper program @<:@default: searches for gksu, beesu, or kdesu in that order@:>@])],
118 AC_MSG_NOTICE([Using user-specified GUI su wrapper: $GUISU])
121 if test -x /usr/bin/gksu ; then
123 AC_MSG_NOTICE([Found GUI su wrapper: gksu])
124 elif test -x /usr/bin/beesu ; then
126 AC_MSG_NOTICE([Found GUI su wrapper: beesu])
127 elif test -x /usr/bin/kdesu ; then
129 AC_MSG_NOTICE([Found GUI su wrapper: kdesu])
131 AC_MSG_ERROR([Unable to find a GUI oriented su wrapper.
133 This is required for modem operation, in case permissions are not
134 set on pppd properly.
136 Please specify the GUI su wrapper you wish to use with the
137 --with-guisu configure option. Note that it MUST be a GUI.
138 You cannot use the command line su.
147 # Check for Evolution data server libraries, and allow user to disable
150 AC_ARG_WITH([evolution],
151 [AS_HELP_STRING([--with-evolution],
152 [use evolution libs to help configure sync (yes,no,check) @<:@default=check@:>@])],
154 [with_evolution=check])
156 if test "x$with_evolution" != xno ; then
157 PKG_CHECK_MODULES([EVOLUTION],
158 [libebook-1.2 libecal-1.2 libedataserver-1.2],
160 AC_DEFINE([HAVE_EVOLUTION], [1],
161 [Define to 1 if Evolution data server libraries are available.])
164 if test "x$with_evolution" != xcheck; then
165 AC_MSG_FAILURE([--with-evolution was given, but test for evolution failed])
170 PKG_CHECK_MODULES([BARRY], [libbarry-18 libbarrysync-18 libbarrybackup-18])
171 PKG_CHECK_MODULES([GLIB2], [glib-2.0])
172 PKG_CHECK_MODULES([LIBXMLPP], [libxml++-2.6])
173 PKG_CHECK_MODULES([OPENSYNC22], [opensync-1.0], [], [OS22NOTFOUND=yes])
174 PKG_CHECK_MODULES([OPENSYNC40], [libopensync1], [], [OS40NOTFOUND=yes])
176 if test "$OS22NOTFOUND" = "yes" -a "$OS40NOTFOUND" = "yes" ; then
180 *************************************************************************
182 Unable to find development libraries for either opensync 0.22 or 0.4x.
183 Barry Desktop will be built without any sync support.
184 *************************************************************************
186 If this is not desired, consider adjusting the PKG_CONFIG_PATH environment
187 variable if you installed software in a non-standard prefix.
189 Alternatively, you may set the environment variables:
191 OPENSYNC22_CFLAGS and OPENSYNC22_LIBS
193 OPENSYNC40_CFLAGS and OPENSYNC40_LIBS
195 to avoid the need to call pkg-config.
197 See the pkg-config man page for more details.
201 AM_CONDITIONAL([WITH_OPENSYNC22], [test "$OS22NOTFOUND" != "yes"])
202 AM_CONDITIONAL([WITH_OPENSYNC40], [test "$OS40NOTFOUND" != "yes"])
204 # Carry the special tree build environment variables from parent configure,
205 # just in case user is doing a complete tree build with --enable-desktop
206 AC_SUBST(TREE_BUILD_CXXFLAGS)
207 AC_SUBST(TREE_BUILD_LDFLAGS)
209 # Check for wxWidgets libraries
211 AM_PATH_WXCONFIG([2.8.0], [], [
213 wxWidgets is required to build the Barry desktop,
214 but the wx-config script could not be found.
216 Please check that wx-config is in your path, that the directory
217 where wxWidgets libraries are installed (returned by the
218 'wx-config --libs' command) is in LD_LIBRARY_PATH, and that
219 wxWidgets is version 2.3.4 or above.
223 # Setup system directories, so src/Makefile.am can use them for the compile
224 # and for the image/data file installations. (image_DATA)
225 basedatadir="$datadir/barry/desktop/"
226 imagedir="$datadir/barry/desktop/images/"
227 xmlmap22dir="$datadir/barry/desktop/0.22/"
228 xmlmap40dir="$datadir/barry/desktop/0.40/"
229 AC_SUBST(basedatadir)
231 AC_SUBST(xmlmap22dir)
232 AC_SUBST(xmlmap40dir)
234 # Checks for libraries.
235 AC_CHECK_LIB([pthread], [main])
237 # Checks for header files.
240 AC_CHECK_HEADERS([assert.h stdint.h time.h])
242 # Checks for typedefs, structures, and compiler characteristics.
247 # Checks for library functions.
248 AC_FUNC_CLOSEDIR_VOID
249 AC_PROG_GCC_TRADITIONAL
253 AC_FUNC_SELECT_ARGTYPES
255 AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul])
257 AC_CONFIG_FILES([Makefile
267 # Add a special hack at the end, to let the user disable RPATH if he wants.
269 # http://wiki.debian.org/RpathIssue
270 # http://lists.debian.org/debian-devel/2003/debian-devel-200306/msg00569.html
271 # http://fedoraproject.org/wiki/Packaging:Guidelines#Removing_Rpath
273 AC_ARG_ENABLE([rpathhack],
274 [AC_HELP_STRING([--enable-rpathhack], [patch libtool to remove RPATH])],
276 AC_MSG_RESULT([patching libtool to fix HIDEOUS BREAKAGE])
277 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
278 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool