aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in57
1 files changed, 56 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index d2669f79d8..73d9c157a2 100644
--- a/configure.in
+++ b/configure.in
@@ -1293,6 +1293,52 @@ case $CFLAGS in
;;
esac
+
+dnl **************************
+dnl Check for X libs and -lX11
+dnl **************************
+
+PKG_CHECK_MODULES(X, x11, :, [
+# pkg-config modules not found (only present since X11R7 aka Xorg); use
+# old-style detection
+AC_PATH_XTRA
+# X found
+if test x$no_x != xyes ; then
+ evolution_save_cflags="$CFLAGS"
+ evolution_save_libs="$LIBS"
+ CFLAGS="$X_CFLAGS"
+ LIBS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
+ AC_CHECK_LIB(X11, XFree, :, AC_MSG_ERROR([libX11 not found]))
+ CFLAGS="$evolution_save_cflags"
+ LIBS="$evolution_save_libs"
+ X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
+fi
+])
+
+dnl *************************
+dnl Check for the Gtk backend
+dnl if it's X11, we -lX11
+dnl *************************
+
+evolution_save_cflags="$CFLAGS"
+# pull in the CFLAGS to locate gdkconfig.h
+CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
+AC_COMPILE_IFELSE([
+#include <gdkconfig.h>
+
+int main(void) {
+#ifndef GDK_WINDOWING_X11
+#error GDK_WINDOWING_X11 not defined
+#endif
+ return 0;
+}
+],
+ GDK_BACKEND_X11=yes,
+ GDK_BACKEND_X11=no)
+
+CFLAGS="$evolution_save_cflags"
+
+
AM_PATH_ORBIT2(2.9.8)
AC_MSG_CHECKING(for CORBA include paths)
@@ -1388,7 +1434,16 @@ EVO_SET_COMPILE_FLAGS(E_NAME, libgnomeui-2.0 libbonoboui-2.0)
AC_SUBST(E_NAME_CFLAGS)
AC_SUBST(E_NAME_LIBS)
-EVO_SET_COMPILE_FLAGS(E_UTIL, libbonoboui-2.0 libglade-2.0 libgnomeui-2.0 libedataserver-$EDS_PACKAGE libedataserverui-$EDS_PACKAGE $mozilla_nspr $mono_package, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS)
+# If Gtk/Gdk is built against X11, e-util uses some
+# X11-specific code so link with X11.
+if test "x$GDK_BACKEND_X11" = "xyes"; then
+ E_UTIL_X11_CFLAGS="$X_CFLAGS"
+ E_UTIL_X11_LIBS="$X_LIBS"
+else
+ E_UTIL_X11_CFLAGS=""
+ E_UTIL_X11_LIBS=""
+fi
+EVO_SET_COMPILE_FLAGS(E_UTIL, libbonoboui-2.0 libglade-2.0 libgnomeui-2.0 libedataserver-$EDS_PACKAGE libedataserverui-$EDS_PACKAGE $mozilla_nspr $mono_package, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS $E_UTIL_X11_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS $E_UTIL_X11_LIBS)
AC_SUBST(E_UTIL_CFLAGS)
AC_SUBST(E_UTIL_LIBS)