1 AC_INIT(beagled/BeagleDaemon.cs)
3 AM_INIT_AUTOMAKE(beagle, 0.0.10)
5 AM_CONFIG_HEADER(config.h)
14 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
15 if test "x$PKG_CONFIG" = "xno"; then
16 AC_MSG_ERROR([You need to install pkg-config])
19 AC_PATH_PROG(MONO, mono)
20 AC_PATH_PROG(MCS, mcs)
22 AC_MSG_CHECKING([for mono.pc])
23 if test -z `$PKG_CONFIG --variable=prefix mono`; then
24 AC_MSG_ERROR([missing the mono.pc file, usually found in the mono-devel package])
26 AC_MSG_RESULT([found])
29 # require mono 1.0.6 or newer
30 PKG_CHECK_MODULES(MONO, mono >= 1.0.6)
32 # check for various mono DLLs that we need.
33 needed_dlls="Mono.Data.SqliteClient Mono.Posix System.Runtime.Remoting System.Web System.Web.Services"
34 for i in $needed_dlls; do
35 AC_MSG_CHECKING([for $i.dll])
36 if test ! -e `$PKG_CONFIG --variable=prefix mono`/lib/mono/1.0/$i.dll; then
37 AC_MSG_ERROR([missing required mono DLL: $i.dll])
39 AC_MSG_RESULT([found])
44 AC_PATH_PROG(WSDL, wsdl)
50 AC_PROG_INTLTOOL([0.23])
51 GETTEXT_PACKAGE=beagle
52 AC_SUBST(GETTEXT_PACKAGE)
53 ALL_LINGUAS="ca da de el en_CA en_GB es hu ja nb nl no pt_BR sv zh_CN
57 # Many distros don't have a dependency on sqlite for their
58 # mono-data-sqlite packages, and the mono build process itself
59 # doesn't require it. But we do, so check for it here.
60 PKG_CHECK_MODULES(SQLITE, sqlite)
62 AC_CHECK_HEADERS(X11/extensions/scrnsaver.h,, [AC_MSG_ERROR([Unable to find scrnsaver.h. You probably need to install XFree86 development packages])])
64 dnl ******************
65 dnl Mozilla name check
66 dnl ******************
68 AC_MSG_CHECKING([which mozilla to use])
71 AC_ARG_WITH([mozilla],
72 AC_HELP_STRING([--with-mozilla@<:@=mozilla|firefox|thunderbird@:>@],
73 [Whether to use mozilla, firefox or thunderbird gtkmozembed (default: mozilla)]),
76 dnl try to autodetect: if mozilla exists, use it, else try firefox, then thunderbird
77 if test "x$MOZILLA" = "x"; then
78 if pkg-config --exists mozilla-gtkmozembed; then
80 elif pkg-config --exists firefox-gtkmozembed; then
82 elif pkg-config --exists thunderbird-gtkmozembed; then
85 AC_MSG_ERROR([unable to find gtkmozembed; this can be found in mozilla/firefox/thunderbird development packages])
87 elif test "x$with_mozilla" != "xmozilla" -a "x$with_mozilla" != "xfirefox" -a "x$with_mozilla" != "xthunderbird"; then
88 AC_MSG_ERROR([unknown mozilla name ($MOZILLA)])
93 AC_MSG_RESULT([$MOZILLA])
96 mozilla) min_version=1.6 flavour=mozilla ;;
97 firefox) min_version=0.10 flavour=toolkit ;;
98 thunderbird) min_version=0.8 flavour=toolkit ;;
101 MOZILLA_FLAVOUR=$flavour
102 AC_SUBST(MOZILLA_FLAVOUR)
103 PKG_CHECK_MODULES(MOZILLA_COMPONENT, $MOZILLA-gtkmozembed >= $min_version $MOZILLA-xpcom >= $min_version)
104 AC_SUBST(MOZILLA_COMPONENT_CFLAGS)
105 AC_SUBST(MOZILLA_COMPONENT_LIBS)
107 MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir $MOZILLA-gtkmozembed`"
108 AC_SUBST(MOZILLA_INCLUDE_ROOT)
110 MOZILLA_HOME="`$PKG_CONFIG --variable=libdir $MOZILLA-gtkmozembed`"
111 AC_SUBST(MOZILLA_HOME)
113 MOZILLA_PREFIX="`$PKG_CONFIG --variable=prefix $MOZILLA-gtkmozembed`"
114 AC_SUBST(MOZILLA_PREFIX)
118 dnl *************************************************************************
119 dnl This is from Mozilla's configure.in. They set almost all the config stuff
120 dnl they need in mozilla-config.h Except for this compiler flag, which can't
121 dnl go in mozilla-config.h So we check the flag too and now we can include
122 dnl mozilla-config.h without breaking epiphany.
123 dnl This is really gcc-only
124 dnl Do this test using CXX only since some versions of gcc
125 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
126 dnl only have short-wchar support for c++.
128 _SAVE_CXXFLAGS=$CXXFLAGS
129 _SAVE_AM_CXXFLAGS=$AM_CXXFLAGS
130 AM_CXXFLAGS="$AM_CXXFLAGS -fshort-wchar"
131 CXXFLAGS="$CXXFLAGS $AM_CXXFLAGS"
134 AC_CACHE_CHECK(for compiler -fshort-wchar option,
135 ac_cv_have_usable_wchar_option,
136 [AC_TRY_RUN([#include <stddef.h>
138 return (sizeof(wchar_t) != 2) ||
139 (wchar_t)-1 < (wchar_t) 0 ; } ],
140 ac_cv_have_usable_wchar_option="yes",
141 ac_cv_have_usable_wchar_option="no",
142 ac_cv_have_usable_wchar_option="maybe")])
144 if test "$ac_cv_have_usable_wchar_option" != "yes"; then
145 AM_CXXFLAGS=$_SAVE_AM_CXXFLAGS
148 dnl **********************************
149 dnl now tests for mozilla API variance
150 dnl **********************************
152 dnl FIXME find a m4/autoconf guru who can distill this into a nice macro
154 CXXFLAGS="$_SAVE_CXXFLAGS $AM_CXXFLAGS -I$MOZILLA_INCLUDE_ROOT -I$MOZILLA_INCLUDE_ROOT/embedstring -I$MOZILLA_INCLUDE_ROOT/content -I$MOZILLA_INCLUDE_ROOT/necko `pkg-config --cflags $MOZILLA-xpcom`"
156 dnl Changed from PRUnichar* to nsAString& in 1.8a1 and on aviary branch
158 AC_MSG_CHECKING([whether nsIFilePicker methods expect nsAString&])
161 [[#include <nsEmbedString.h>
162 #include <widget/nsIFilePicker.h>]],
164 p->SetDefaultString (nsEmbedString());]]
166 [AC_DEFINE([MOZ_NSIFILEPICKER_NSASTRING_],[1],[Define if nsIFilePicker uses nsAString&]) result=yes],
169 AC_MSG_RESULT([$result])
171 dnl Changed from char* to nsAString& in 1.8a1
173 AC_MSG_CHECKING([whether nsIMIMEInfo methods expect nsAString&])
177 [[#include <nsEmbedString.h>
178 #include <mimetype/nsIMIMEInfo.h>]],
180 p->SetDescription (nsEmbedString());]]
182 [AC_DEFINE([MOZ_NSIMIMEINFO_NSACSTRING_],[1],[Define if nsIMIMEInfo uses nsAString&]) result=yes],
185 AC_MSG_RESULT([$result])
187 dnl Firefox doesn't have this API (?)
189 AC_MSG_CHECKING([for nsIXULChromeRegistry API])
193 [[#include <nsEmbedString.h>
194 #include <nsIChromeRegistry.h>]],
195 [[nsIXULChromeRegistry *p;
196 p->SelectSkin (nsEmbedCString(), PR_FALSE);]]
198 [AC_DEFINE([MOZ_NSIXULCHROMEREGISTRY_SELECTSKIN],[1],[dummy]) result=yes],
200 AC_MSG_RESULT([$result])
202 dnl changed from nsIXULChromeRegistry in 1.8a4
204 AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/chrome/nsIChromeRegistrySea.h],
205 [AC_DEFINE([HAVE_CHROME_NSICHROMEREGISTRYSEA_H], [1], [Define if nsIChromeRegistrySea.h exists])])
207 MOZILLA_WARN_CXXFLAGS="-Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
208 AC_SUBST(MOZILLA_WARN_CXXFLAGS)
210 dnl -------------------------------------------------------
212 PKG_CHECK_MODULES(LIBGECKOGLUE, gtk+-2.0 >= 2.2 $MOZILLA-gtkmozembed)
213 AC_SUBST(LIBGECKOGLUE_CFLAGS)
214 AC_SUBST(LIBGECKOGLUE_LIBS)
216 dnl -------------------------------------------------------
218 PKG_CHECK_MODULES(BEAGLE_UI, gtk-sharp glade-sharp gecko-sharp = 0.6 gnome-sharp dbus-sharp >= 0.23.4 gconf-sharp gmime-sharp >= 2.1.13)
219 AC_SUBST(BEAGLE_UI_LIBS)
221 dnl ----------------------------------------------
223 # Gdk and Atk are needed for libtrayiconglue
224 GDK20_MINIMUM_VERSION=2.2.3
225 ATK_MINIMUM_VERSION=1.2.4
227 PKG_CHECK_MODULES(LIBTRAYICON,
228 gdk-2.0 >= $GDK20_MINIMUM_VERSION
229 atk >= $ATK_MINIMUM_VERSION)
230 AC_SUBST(LIBTRAYICON_CFLAGS)
231 AC_SUBST(LIBTRAYICON_LIBS)
233 dnl ----------------------------------------------
235 AC_ARG_ENABLE([evolution-sharp],
236 AC_HELP_STRING([--disable-evolution-sharp], [Disable evolution-sharp support (default auto)]),
237 enable_evo_sharp=$enableval,
238 enable_evo_sharp=auto)
240 EVOLUTION_SHARP_REQUIRED=0.6
241 AC_SUBST(EVO_SHARP_LIBS)
242 EVO_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix evolution-sharp`
244 PKG_CHECK_MODULES(EVO_SHARP,
245 evolution-sharp >= $EVOLUTION_SHARP_REQUIRED, \
246 have_evo_sharp_dependencies=yes,
247 have_evo_sharp_dependencies=no)
249 if test "x$have_evo_sharp_dependencies" = "xno"; then
251 dnl error out if user has explicitly requested evo-sharp
252 if test "x$enable_evo_sharp" = "xyes"; then
253 AC_MSG_ERROR([Could not find evolution-sharp])
256 enable_evo_sharp="no (missing dependencies)"
260 if test "x$enable_evo_sharp" != "xno"; then
261 enable_evo_sharp="yes"
263 enable_evo_sharp="no (disabled)"
268 AM_CONDITIONAL(ENABLE_EVO_SHARP, test "x$enable_evo_sharp" == "xyes")
270 dnl ----------------------------------------------
272 AC_ARG_ENABLE([dbus-workarounds],
273 AC_HELP_STRING ([--disable-dbus-workarounds], [Disable D-BUS Workarounds (default enabled)]),
274 use_dbus_workarounds=$enableval,
275 use_dbus_workarounds=yes)
277 dnl ----------------------------------------------
279 AC_ARG_ENABLE([network],
280 AC_HELP_STRING ([--enable-network], [Enable Network Service (default disabled)]),
281 enable_network=$enableval,
284 AM_CONDITIONAL(ENABLE_NETWORK, test "x$enable_network" = "xyes")
286 if test "x$enable_network" = "xyes"; then
287 PKG_CHECK_MODULES(RENDEZVOUS, \
289 enable_rendezvous=yes, \
290 enable_rendezvous=no)
291 AC_SUBST(RENDEZVOUS_LIBS)
293 AM_CONDITIONAL(ENABLE_RENDEZVOUS, test "x$enable_rendezvous" = "xyes")
295 RENDEZVOUS_PREFIX=`$PKG_CONFIG --variable=prefix mdnsresponder`
297 AM_CONDITIONAL(ENABLE_RENDEZVOUS, false)
301 dnl ----------------------------------------------
305 PKG_CHECK_MODULES(GSF_SHARP, gsf-sharp >= 0.2, enable_gsf_sharp=yes, enable_gsf_sharp=no)
306 AM_CONDITIONAL(ENABLE_GSF_SHARP, test "x$enable_gsf_sharp" = "xyes")
308 dnl ----------------------------------------------
309 dnl GST# is not in a usable stage as of 9.3 release, disabling it.
311 PKG_CHECK_MODULES(GST_SHARP, gst-sharp >= __DISABLE_FOR_NOW__, enable_gst_sharp=yes, enable_gst_sharp=no)
312 AM_CONDITIONAL(ENABLE_GST_SHARP, test "x$enable_gst_sharp" = "xyes")
314 dnl ----------------------------------------------
316 dnl Needed to index jpeg metadata
317 LIBEXIF_API_CHANGE=0.6.0
318 LIBEXIF_REQUIRED_MIN=0.5.7
319 LIBEXIF_REQUIRED_MAX=0.7.0
321 PKG_CHECK_MODULES(LIBEXIF, libexif >= $LIBEXIF_REQUIRED_MIN libexif < $LIBEXIF_REQUIRED_MAX)
322 PKG_CHECK_MODULES(LIBEXIF_API_CHECK, libexif >= $LIBEXIF_API_CHANGE, have_old_libexif=no, have_old_libexif=yes)
324 if test "x$have_old_libexif" = "xyes"; then
329 AC_SUBST(EXIF_SOVERSION)
331 PKG_CHECK_MODULES(BEAGLED, gmime-sharp >= 2.1.13 gtk-sharp dbus-sharp >= 0.23.4 gconf-sharp)
332 BEAGLED_LIBS="$BEAGLED_LIBS $EVO_SHARP_LIBS $GSF_SHARP_LIBS"
333 AC_SUBST(BEAGLED_LIBS)
335 PKG_CHECK_MODULES(DBUS_BROKEN, dbus-sharp >= 0.23.2 dbus-sharp < 0.30, dbus_broken=no, dbus_broken=yes)
337 DBUS_PREFIX=`$PKG_CONFIG --variable=prefix dbus-sharp`
338 GSF_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix gsf-sharp`
339 GMIME_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix gmime-sharp`
341 # Can't use AC_CHECK_HEADERS() because dbus insists on #defining
342 # DBUS_API_SUBJECT_TO_CHANGE, and that breaks the check.
343 if test ! -e "$DBUS_PREFIX/include/dbus-1.0/dbus/dbus.h"; then
344 AC_MSG_ERROR([Unable to find dbus headers. You'll need to install the dbus devel package])
347 AC_MSG_CHECKING(for older dbus API)
348 LDFLAGS_save="$LDFLAGS"
349 LDFLAGS="$LDFLAGS `pkg-config --libs dbus-1`"
350 AC_TRY_LINK_FUNC(dbus_message_iter_get_boolean,[
357 LDFLAGS="$LDFLAGS_save"
359 if test "$have_old_dbus" = "yes"; then
360 BEAGLE_DEFINES="-define:HAVE_OLD_DBUS"
365 if test "$dbus_broken" = "yes" -o "$use_dbus_workarounds" = "yes" ; then
366 BEAGLE_DEFINES="$BEAGLE_DEFINES -define:DBUS_IS_BROKEN_BROKEN_BROKEN"
369 AC_SUBST(BEAGLE_DEFINES)
371 dnl ----------------------------------------------
373 dnl Epiphany Extension
374 dnl Much of this is cut&pasted from epiphany-extensions/configure.ac
376 AC_ARG_ENABLE([epiphany-extension],
377 AC_HELP_STRING([--enable-epiphany-extension], [Enable Epiphany Extension (default auto)]),
378 enable_epiphany_extension=$enableval,
379 enable_epiphany_extension=auto)
381 EPIPHANY_REQUIRED=1.2.1
382 LIBXML_REQUIRED=2.6.0
383 LIBGLIB_REQUIRED=2.4.0
384 LIBGTK_REQUIRED=2.4.0
386 AC_SUBST(EPIPHANY_REQUIRED)
387 AC_SUBST(LIBXML_REQUIRED)
388 AC_SUBST(LIBGLIB_REQUIRED)
389 AC_SUBST(LIBGTK_REQUIRED)
391 GTK_BINARY_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
392 AC_SUBST(GTK_BINARY_VERSION)
394 dnl fixme -- combine the dependencies of only the enabled plugins
395 PKG_CHECK_MODULES(EPIPHANY_DEPENDENCY, \
396 libxml-2.0 >= $LIBXML_REQUIRED \
398 glib-2.0 >= $LIBGLIB_REQUIRED \
400 gtk+-2.0 >= $LIBGTK_REQUIRED \
401 epiphany-1.2 >= $EPIPHANY_REQUIRED,
402 have_epiphany_dependencies=yes,
403 have_epiphany_dependencies=no)
404 AC_SUBST(EPIPHANY_DEPENDENCY_CFLAGS)
405 AC_SUBST(EPIPHANY_DEPENDENCY_LIBS)
407 EPIPHANY_PREFIX="`$PKG_CONFIG --variable=prefix epiphany-1.2`"
408 AC_SUBST(EPIPHANY_PREFIX)
410 if test "x$have_epiphany_dependencies" = "xno"; then
412 dnl error out if user has explicitly requested epiphany extension
413 if test "x$enable_epiphany_extension" = "xyes"; then
414 AC_MSG_ERROR([Could not find epiphany and/or its dependencies])
417 enable_epiphany_extension="no (missing dependencies)"
421 if test "x$enable_epiphany_extension" != "xno"; then
422 enable_epiphany_extension="yes"
424 enable_epiphany_extension="no (disabled)"
429 AM_CONDITIONAL(ENABLE_EPIPHANY_EXTENSION, test "x$enable_epiphany_extension" = "xyes")
431 dnl ----------------------------------------------
433 dnl For the systeminfo glue
435 PKG_CHECK_MODULES(SYSTEMINFO_GLUE, gdk-2.0)
437 SYSTEMINFO_GLUE_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXss $X_EXTRA_LIBS"
438 AC_SUBST(SYSTEMINFO_GLUE_X_LIBS)
440 dnl ----------------------------------------------
444 PKG_CHECK_MODULES(WV1, wv-1.0, enable_wv1=yes, enable_wv1=no)
445 AM_CONDITIONAL(ENABLE_WV1, test "x$enable_wv1" = "xyes")
448 dnl ----------------------------------------------
452 PKG_CHECK_MODULES(SEARCHOMATIC, gtk+-2.0)
453 AC_SUBST(SEARCHOMATIC_CFLAGS)
454 AC_SUBST(SEARCHOMATIC_LIBS)
456 dnl ----------------------------------------------
460 PKG_CHECK_MODULES(CHOOSER_FU, gtk+-2.0)
461 AC_SUBST(CHOOSER_FU_CFLAGS)
462 AC_SUBST(CHOOSER_FU_LIBS)
464 dnl ----------------------------------------------
466 AC_ARG_ENABLE([webservices],
467 AC_HELP_STRING([--enable-webservices], [Enable WebServices (default disabled)]),
468 enable_webservices=$enableval,
469 enable_webservices=no)
471 AM_CONDITIONAL(ENABLE_WEBSERVICES, test "x$enable_webservices" = "xyes")
473 dnl ----------------------------------------------
474 dnl Prefixes for helper scripts
475 GAC_PREFIX="$DBUS_PREFIX:$EVO_SHARP_PREFIX:$GSF_SHARP_PREFIX:$GMIME_SHARP_PREFIX:$RENDEZVOUS_PREFIX"
476 dnl Remove duplicate prefixes
477 GAC_PREFIX="`echo $GAC_PREFIX | sed -e 's|:|\n|g' | sort | uniq | tr '\n' ':'`"
479 GAC_PREFIX="`echo $GAC_PREFIX | sed -e 's|::\+|:|g' -e 's|^:\+||' -e 's|:\+$||'`"
482 GNOME_PREFIX="`$PKG_CONFIG --variable=prefix libgnome-2.0`"
483 AC_SUBST(GNOME_PREFIX)
492 BeagleClient/Makefile
499 epiphany-extension/Makefile
500 mozilla-extension/Makefile
501 searchomatic/Makefile
510 D-BUS Workarounds? ${use_dbus_workarounds}
511 Evolution-Sharp? ${enable_evo_sharp}
512 gsf-sharp? ${enable_gsf_sharp}
513 gst-sharp? ${enable_gst_sharp}
514 Epiphany Extension? ${enable_epiphany_extension}
515 Mozilla Extension? yes
518 Enable Network ${enable_network}
519 Enable WebServices ${enable_webservices}"
521 if test "x$enable_network" = "xyes"; then
522 echo " Enable Rendezvous ${enable_rendezvous}"
527 if test "x$enable_epiphany_extension" = "xyes"; then
528 echo "NOTE: The Beagle Epiphany Extension Is Totally Insecure!"
529 echo " Use it at your own risk!"
532 if test "x${prefix}" != "x$EPIPHANY_PREFIX"; then
533 echo "NOTE: Epiphany seems to be installed in $EPIPHANY_PREFIX, not ${prefix}."
534 echo " Epiphany will not be able to find Beagle's Epiphany Extension"
535 echo " unless you do something like:"
536 echo " # ln -s ${prefix}/lib/epiphany/extensions/libbeagleextension.so \\"
537 echo " $EPIPHANY_PREFIX/lib/epiphany/extensions"