desktop: CalEditDlg: fixed dialog title bar
[barry.git] / desktop / configure.ac
blobc7b28d0a11b0241425c2c03e6f975fd8779a9537
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.1], [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_ERROR(dnl
118 Unable to find development libraries for either opensync 0.22 or 0.4x.
120 Consider adjusting the PKG_CONFIG_PATH environment variable if you
121 installed software in a non-standard prefix.
123 Alternatively, you may set the environment variables:
125         OPENSYNC22_CFLAGS and OPENSYNC22_LIBS
127         OPENSYNC40_CFLAGS and OPENSYNC40_LIBS
129 to avoid the need to call pkg-config.
131 See the pkg-config man page for more details.
135 AM_CONDITIONAL([WITH_OPENSYNC22], [test "$OS22NOTFOUND" != "yes"])
136 AM_CONDITIONAL([WITH_OPENSYNC40], [test "$OS40NOTFOUND" != "yes"])
138 # Carry the special tree build environment variables from parent configure,
139 # just in case user is doing a complete tree build with --enable-desktop
140 AC_SUBST(TREE_BUILD_CXXFLAGS)
141 AC_SUBST(TREE_BUILD_LDFLAGS)
143 # Check for wxWidgets libraries
144 AM_OPTIONS_WXCONFIG
145 AM_PATH_WXCONFIG([2.8.0], [], [
146         AC_MSG_ERROR([
147         wxWidgets is required to build the Barry desktop,
148         but the wx-config script could not be found.
150         Please check that wx-config is in your path, that the directory
151         where wxWidgets libraries are installed (returned by the
152         'wx-config --libs' command) is in LD_LIBRARY_PATH, and that
153         wxWidgets is version 2.3.4 or above.
154         ])
155         ])
157 # Setup system directories, so src/Makefile.am can use them for the compile
158 # and for the image/data file installations. (image_DATA)
159 basedatadir="$datadir/barry/desktop/"
160 imagedir="$datadir/barry/desktop/images/"
161 xmlmap22dir="$datadir/barry/desktop/0.22/"
162 xmlmap40dir="$datadir/barry/desktop/0.40/"
163 AC_SUBST(basedatadir)
164 AC_SUBST(imagedir)
165 AC_SUBST(xmlmap22dir)
166 AC_SUBST(xmlmap40dir)
168 # Checks for libraries.
169 AC_CHECK_LIB([pthread], [main])
171 # Checks for header files.
172 AC_HEADER_DIRENT
173 AC_HEADER_STDC
174 AC_CHECK_HEADERS([assert.h stdint.h time.h])
176 # Checks for typedefs, structures, and compiler characteristics.
177 #AC_TYPE_SIZE_T
178 AC_HEADER_TIME
179 AC_STRUCT_TM
181 # Checks for library functions.
182 AC_FUNC_CLOSEDIR_VOID
183 AC_PROG_GCC_TRADITIONAL
184 AC_FUNC_MALLOC
185 AC_FUNC_MKTIME
186 AC_FUNC_REALLOC
187 AC_FUNC_SELECT_ARGTYPES
188 AC_FUNC_STAT
189 AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul])
191 AC_CONFIG_FILES([Makefile
192                  images/Makefile
193                  src/Makefile
194                  src/0.22/Makefile
195                  src/0.40/Makefile
196                  man/Makefile])
197 AC_OUTPUT
201 # Add a special hack at the end, to let the user disable RPATH if he wants.
203 # http://wiki.debian.org/RpathIssue
204 # http://lists.debian.org/debian-devel/2003/debian-devel-200306/msg00569.html
205 # http://fedoraproject.org/wiki/Packaging:Guidelines#Removing_Rpath
207 AC_ARG_ENABLE([rpathhack],
208         [AC_HELP_STRING([--enable-rpathhack], [patch libtool to remove RPATH])],
209         [
210 AC_MSG_RESULT([patching libtool to fix HIDEOUS BREAKAGE])
211 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
212 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
213         ],
214         [])