debian: added Vcs-Git and Vcs-Browser control fields
[barry/progweb.git] / desktop / configure.ac
blob5591ce82f6f498c832dbbfbcd8e1651be473d3d0
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], [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 # Checks for programs.
18 AC_PROG_CC
19 AC_PROG_CXX
20 AC_PROG_MAKE_SET
21 AC_PROG_LIBTOOL
23 AC_LANG([C])
25 PKG_CHECK_MODULES([LIBGCAL], [libgcal >= 0.9.6], [],
26         [
27         LGTEMP_LDFLAGS="$LDFLAGS"
28         LDFLAGS="$LDFLAGS -lgcal"
29         AC_RUN_IFELSE(
30                 [AC_LANG_PROGRAM(
31                         [[
32 #include <stdio.h>
33 #include <string.h>
34 #include <stdlib.h>
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
41         exit(1);
43                         ]],
44                         [[
45 const char *xml = "<nothing></nothing>";
46 char *dest;
47 get_the_url(xml, strlen(xml), &dest);
48                         ]]
49                         )
50                 ],
51                 [LG_TRY_AGAIN=yes],
52                 [AC_MSG_ERROR(
54 Your copy of libgcal is older than 0.9.6, and it contains
55 this bug:
57 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597153
59 You will need to upgrade to avoid segfaults when syncing with
60 Google calendar.
62                 )],
63                 [AC_MSG_ERROR(
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.
73                 )]
74                 )
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])
79         fi
80         ]
81         )
83 AC_LANG([C++])
86 # Check for Evolution data server libraries, and allow user to disable
87 # if needed.
89 AC_ARG_WITH([evolution],
90         [AS_HELP_STRING([--with-evolution],
91         [support fancy command line editing @<:@default=check@:>@])],
92         [],
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],
98                 [
99                         AC_DEFINE([HAVE_EVOLUTION], [1],
100                                 [Define to 1 if Evolution data server libraries are available.])
101                 ],
102                 [
103                         if test "x$with_evolution" != xcheck; then
104                                 AC_MSG_FAILURE([--with-evolution was given, but test for evolution failed])
105                         fi
106                 ])
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
116         AC_MSG_WARN(dnl
119 *************************************************************************
120 WARNING:
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
149 AM_OPTIONS_WXCONFIG
150 AM_PATH_WXCONFIG([2.8.0], [], [
151         AC_MSG_ERROR([
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.
159         ])
160         ])
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)
169 AC_SUBST(imagedir)
170 AC_SUBST(xmlmap22dir)
171 AC_SUBST(xmlmap40dir)
173 # Checks for libraries.
174 AC_CHECK_LIB([pthread], [main])
176 # Checks for header files.
177 AC_HEADER_DIRENT
178 AC_HEADER_STDC
179 AC_CHECK_HEADERS([assert.h stdint.h time.h])
181 # Checks for typedefs, structures, and compiler characteristics.
182 #AC_TYPE_SIZE_T
183 AC_HEADER_TIME
184 AC_STRUCT_TM
186 # Checks for library functions.
187 AC_FUNC_CLOSEDIR_VOID
188 AC_PROG_GCC_TRADITIONAL
189 AC_FUNC_MALLOC
190 AC_FUNC_MKTIME
191 AC_FUNC_REALLOC
192 AC_FUNC_SELECT_ARGTYPES
193 AC_FUNC_STAT
194 AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul])
196 AC_CONFIG_FILES([Makefile
197                  images/Makefile
198                  src/Makefile
199                  src/0.22/Makefile
200                  src/0.40/Makefile
201                  man/Makefile])
202 AC_OUTPUT
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])],
214         [
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
218         ],
219         [])