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 # Check for Evolution data server libraries, and allow user to disable
89 AC_ARG_WITH([evolution],
90 [AS_HELP_STRING([--with-evolution],
91 [support fancy command line editing @<:@default=check@:>@])],
93 [with_evolution=check])
95 if test "x$with_evolution" != xno ; then
96 PKG_CHECK_MODULES([EVOLUTION],
97 [libebook-1.2 libecal-1.2 libedataserver-1.2],
99 AC_DEFINE([HAVE_EVOLUTION], [1],
100 [Define to 1 if Evolution data server libraries are available.])
103 if test "x$with_evolution" != xcheck; then
104 AC_MSG_FAILURE([--with-evolution was given, but test for evolution failed])
109 PKG_CHECK_MODULES([BARRY], [libbarry-0 libbarrysync-0 libbarrybackup-0])
110 PKG_CHECK_MODULES([GLIB2], [glib-2.0])
111 PKG_CHECK_MODULES([LIBXMLPP], [libxml++-2.6])
112 PKG_CHECK_MODULES([OPENSYNC22], [opensync-1.0], [], [OS22NOTFOUND=yes])
113 PKG_CHECK_MODULES([OPENSYNC40], [libopensync1], [], [OS40NOTFOUND=yes])
115 if test "$OS22NOTFOUND" = "yes" -a "$OS40NOTFOUND" = "yes" ; then
119 *************************************************************************
121 Unable to find development libraries for either opensync 0.22 or 0.4x.
122 Barry Desktop will be built without any sync support.
123 *************************************************************************
125 If this is not desired, consider adjusting the PKG_CONFIG_PATH environment
126 variable if you installed software in a non-standard prefix.
128 Alternatively, you may set the environment variables:
130 OPENSYNC22_CFLAGS and OPENSYNC22_LIBS
132 OPENSYNC40_CFLAGS and OPENSYNC40_LIBS
134 to avoid the need to call pkg-config.
136 See the pkg-config man page for more details.
140 AM_CONDITIONAL([WITH_OPENSYNC22], [test "$OS22NOTFOUND" != "yes"])
141 AM_CONDITIONAL([WITH_OPENSYNC40], [test "$OS40NOTFOUND" != "yes"])
143 # Carry the special tree build environment variables from parent configure,
144 # just in case user is doing a complete tree build with --enable-desktop
145 AC_SUBST(TREE_BUILD_CXXFLAGS)
146 AC_SUBST(TREE_BUILD_LDFLAGS)
148 # Check for wxWidgets libraries
150 AM_PATH_WXCONFIG([2.8.0], [], [
152 wxWidgets is required to build the Barry desktop,
153 but the wx-config script could not be found.
155 Please check that wx-config is in your path, that the directory
156 where wxWidgets libraries are installed (returned by the
157 'wx-config --libs' command) is in LD_LIBRARY_PATH, and that
158 wxWidgets is version 2.3.4 or above.
162 # Setup system directories, so src/Makefile.am can use them for the compile
163 # and for the image/data file installations. (image_DATA)
164 basedatadir="$datadir/barry/desktop/"
165 imagedir="$datadir/barry/desktop/images/"
166 xmlmap22dir="$datadir/barry/desktop/0.22/"
167 xmlmap40dir="$datadir/barry/desktop/0.40/"
168 AC_SUBST(basedatadir)
170 AC_SUBST(xmlmap22dir)
171 AC_SUBST(xmlmap40dir)
173 # Checks for libraries.
174 AC_CHECK_LIB([pthread], [main])
176 # Checks for header files.
179 AC_CHECK_HEADERS([assert.h stdint.h time.h])
181 # Checks for typedefs, structures, and compiler characteristics.
186 # Checks for library functions.
187 AC_FUNC_CLOSEDIR_VOID
188 AC_PROG_GCC_TRADITIONAL
192 AC_FUNC_SELECT_ARGTYPES
194 AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul])
196 AC_CONFIG_FILES([Makefile
206 # Add a special hack at the end, to let the user disable RPATH if he wants.
208 # http://wiki.debian.org/RpathIssue
209 # http://lists.debian.org/debian-devel/2003/debian-devel-200306/msg00569.html
210 # http://fedoraproject.org/wiki/Packaging:Guidelines#Removing_Rpath
212 AC_ARG_ENABLE([rpathhack],
213 [AC_HELP_STRING([--enable-rpathhack], [patch libtool to remove RPATH])],
215 AC_MSG_RESULT([patching libtool to fix HIDEOUS BREAKAGE])
216 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
217 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool