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], [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 # Checks for programs.
25 PKG_CHECK_MODULES([LIBGCAL], [libgcal >= 0.9.6], [],
27 LGTEMP_LDFLAGS="$LDFLAGS"
28 LDFLAGS="$LDFLAGS -lgcal"
36 int get_the_url(char *data, int length, char **url);
38 void xmlCleanupParser(void)
40 // if this gets called, the libgcal we are using is broken
45 const char *xml = "<nothing></nothing>";
47 get_the_url(xml, strlen(xml), &dest);
54 Your copy of libgcal is older than 0.9.6, and it contains
57 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597153
59 You will need to upgrade to avoid segfaults when syncing with
65 Your copy of libgcal is older than 0.9.6. Since you are
66 cross-compiling it is not possible to easily check whether
67 the following bug exists in your copy or not:
69 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597153
71 Please upgrade and try again.
75 LDFLAGS="$LGTEMP_LDFLAGS"
76 if test "$LG_TRY_AGAIN" = "yes" ; then
77 AC_MSG_RESULT([found patched libgcal...])
78 PKG_CHECK_MODULES([LIBGCAL], [libgcal >= 0.9.4])
86 # Search for a GUI-style version of su. If not specified, we search for
87 # gksu (for Debian), beesu (for Fedora), and kdesu (for openSUSE),
88 # searched in the above order.
90 # User can override with the option.
93 [AS_HELP_STRING([--with-guisu=CMD],
94 [specify GUI oriented su wrapper program @<:@default: searches for gksu, beesu, or kdesu in that order@:>@])],
97 AC_MSG_NOTICE([Using user-specified GUI su wrapper: $GUISU])
100 if test -x /usr/bin/gksu ; then
102 AC_MSG_NOTICE([Found GUI su wrapper: gksu])
103 elif test -x /usr/bin/beesu ; then
105 AC_MSG_NOTICE([Found GUI su wrapper: beesu])
106 elif test -x /usr/bin/kdesu ; then
108 AC_MSG_NOTICE([Found GUI su wrapper: kdesu])
110 AC_MSG_ERROR([Unable to find a GUI oriented su wrapper.
112 This is required for modem operation, in case permissions are not
113 set on pppd properly.
115 Please specify the GUI su wrapper you wish to use with the
116 --with-guisu configure option. Note that it MUST be a GUI.
117 You cannot use the command line su.
126 # Check for Evolution data server libraries, and allow user to disable
129 AC_ARG_WITH([evolution],
130 [AS_HELP_STRING([--with-evolution],
131 [use evolution libs to help configure sync (yes,no,check) @<:@default=check@:>@])],
133 [with_evolution=check])
135 if test "x$with_evolution" != xno ; then
136 PKG_CHECK_MODULES([EVOLUTION],
137 [libebook-1.2 libecal-1.2 libedataserver-1.2],
139 AC_DEFINE([HAVE_EVOLUTION], [1],
140 [Define to 1 if Evolution data server libraries are available.])
143 if test "x$with_evolution" != xcheck; then
144 AC_MSG_FAILURE([--with-evolution was given, but test for evolution failed])
149 PKG_CHECK_MODULES([BARRY], [libbarry-0 libbarrysync-0 libbarrybackup-0])
150 PKG_CHECK_MODULES([GLIB2], [glib-2.0])
151 PKG_CHECK_MODULES([LIBXMLPP], [libxml++-2.6])
152 PKG_CHECK_MODULES([OPENSYNC22], [opensync-1.0], [], [OS22NOTFOUND=yes])
153 PKG_CHECK_MODULES([OPENSYNC40], [libopensync1], [], [OS40NOTFOUND=yes])
155 if test "$OS22NOTFOUND" = "yes" -a "$OS40NOTFOUND" = "yes" ; then
159 *************************************************************************
161 Unable to find development libraries for either opensync 0.22 or 0.4x.
162 Barry Desktop will be built without any sync support.
163 *************************************************************************
165 If this is not desired, consider adjusting the PKG_CONFIG_PATH environment
166 variable if you installed software in a non-standard prefix.
168 Alternatively, you may set the environment variables:
170 OPENSYNC22_CFLAGS and OPENSYNC22_LIBS
172 OPENSYNC40_CFLAGS and OPENSYNC40_LIBS
174 to avoid the need to call pkg-config.
176 See the pkg-config man page for more details.
180 AM_CONDITIONAL([WITH_OPENSYNC22], [test "$OS22NOTFOUND" != "yes"])
181 AM_CONDITIONAL([WITH_OPENSYNC40], [test "$OS40NOTFOUND" != "yes"])
183 # Carry the special tree build environment variables from parent configure,
184 # just in case user is doing a complete tree build with --enable-desktop
185 AC_SUBST(TREE_BUILD_CXXFLAGS)
186 AC_SUBST(TREE_BUILD_LDFLAGS)
188 # Check for wxWidgets libraries
190 AM_PATH_WXCONFIG([2.8.0], [], [
192 wxWidgets is required to build the Barry desktop,
193 but the wx-config script could not be found.
195 Please check that wx-config is in your path, that the directory
196 where wxWidgets libraries are installed (returned by the
197 'wx-config --libs' command) is in LD_LIBRARY_PATH, and that
198 wxWidgets is version 2.3.4 or above.
202 # Setup system directories, so src/Makefile.am can use them for the compile
203 # and for the image/data file installations. (image_DATA)
204 basedatadir="$datadir/barry/desktop/"
205 imagedir="$datadir/barry/desktop/images/"
206 xmlmap22dir="$datadir/barry/desktop/0.22/"
207 xmlmap40dir="$datadir/barry/desktop/0.40/"
208 AC_SUBST(basedatadir)
210 AC_SUBST(xmlmap22dir)
211 AC_SUBST(xmlmap40dir)
213 # Checks for libraries.
214 AC_CHECK_LIB([pthread], [main])
216 # Checks for header files.
219 AC_CHECK_HEADERS([assert.h stdint.h time.h])
221 # Checks for typedefs, structures, and compiler characteristics.
226 # Checks for library functions.
227 AC_FUNC_CLOSEDIR_VOID
228 AC_PROG_GCC_TRADITIONAL
232 AC_FUNC_SELECT_ARGTYPES
234 AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul])
236 AC_CONFIG_FILES([Makefile
246 # Add a special hack at the end, to let the user disable RPATH if he wants.
248 # http://wiki.debian.org/RpathIssue
249 # http://lists.debian.org/debian-devel/2003/debian-devel-200306/msg00569.html
250 # http://fedoraproject.org/wiki/Packaging:Guidelines#Removing_Rpath
252 AC_ARG_ENABLE([rpathhack],
253 [AC_HELP_STRING([--enable-rpathhack], [patch libtool to remove RPATH])],
255 AC_MSG_RESULT([patching libtool to fix HIDEOUS BREAKAGE])
256 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
257 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool