Hello,

finally managed to get back to libo after a few and found that cairo is needed even with --disable-cairo-canvas.

The situation is a bit more convoluted than last time so while at move all the cairo related machinery in the same place and try to make easier to follow the various cases.

I won't have a full build before monday (update: it failed, looks unrelated) so any review / test in the mean time is appreciated.

Will post a proper patch from git after i get the build sorted out.

thanks,
riccardo
diff --git a/configure.in b/configure.in
index e3943eb..085e25c 100644
--- a/configure.in
+++ b/configure.in
@@ -8763,21 +8763,6 @@ if test "$enable_split_opt_features" = "yes"; then
 fi
 AC_SUBST(SPLIT_OPT_FEATURES)
 
-if test $_os = Darwin -o $_os = WINNT; then
-    if test "$enable_cairo_canvas" = yes; then
-        AC_MSG_ERROR([The cairo canvas should not be used for this platform])
-    fi
-    enable_cairo_canvas=no
-elif test -z "$enable_cairo_canvas"; then
-    enable_cairo_canvas=yes
-fi
-
-ENABLE_CAIRO_CANVAS=""
-if test "$enable_cairo_canvas" = "yes"; then
-    ENABLE_CAIRO_CANVAS="TRUE"
-fi
-AC_SUBST(ENABLE_CAIRO_CANVAS)
-
 dnl ===================================================================
 dnl Check whether the GStreamer libraries are available.
 dnl ===================================================================
@@ -10349,58 +10334,82 @@ AC_SUBST(LIBRSVG_CFLAGS)
 AC_SUBST(LIBRSVG_LIBS)
 AC_SUBST(SYSTEM_LIBRSVG)
 
-dnl ===================================================================
-dnl Test whether to build cairo or rely on the system version
-dnl ===================================================================
+dnl ===============================================================================
+dnl Test whether to build cairo, rely on the system version or don't use it at all
+dnl ===============================================================================
 
+dnl Check and warn is cairo has been enabled by mistake
+CAIRO_BY_MISTAKE=no
+if test $_os = Darwin -o $_os = WINNT; then
+    CAIRO_BY_MISTAKE=yes
+    enable_cairo_canvas=no
+    if test $_os = WINNT; then
+        dnl We only need cairo for Windows if we
+        dnl build librsvg or directx disabled
+        if test "$ENABLE_LIBRSVG" != NO -o -z "$ENABLE_DIRECTX"; then
+            enable_cairo_canvas=yes
+            CAIRO_BY_MISTAKE=no
+        fi
+    fi
+elif test -z "$enable_cairo_canvas"; then
+    enable_cairo_canvas=yes
+fi
 
-SYSTEM_CAIRO=""
+if test "$ENABLE_LIBRSVG" != NO; then
+    enable_cairo_canvas=yes
+fi
+
+if test "$CAIRO_BY_MISTAKE" = "yes" -a "$enable_cairo_canvas" != "yes"; then
+    AC_MSG_ERROR([The cairo canvas should not be used for this platform])
+    enable_cairo_canvas=no
+fi
 
-AC_MSG_CHECKING([whether to use the system cairo])
+ENABLE_CAIRO_CANVAS=""
+if test "$enable_cairo_canvas" = "yes"; then
+    ENABLE_CAIRO_CANVAS="TRUE"
+fi
+AC_SUBST(ENABLE_CAIRO_CANVAS)
 
-if test "$with_system_cairo" = "yes"; then
-    SYSTEM_CAIRO=YES
-    AC_MSG_RESULT([yes])
 
-    PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
+SYSTEM_CAIRO=""
+if test "$enable_cairo_canvas" = "yes"; then
+    AC_MSG_CHECKING([whether to use the system cairo])
+    if test "$with_system_cairo" = "yes"; then
+        SYSTEM_CAIRO=YES
+        AC_MSG_RESULT([yes])
+
+        PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
 
-    if test "$test_xrender" = "yes"; then
-        if test "$with_system_xextensions_headers" != "no"; then
-            AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
-            AC_LANG_PUSH([C])
-            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
+        if test "$test_xrender" = "yes"; then
+            if test "$with_system_xextensions_headers" != "no"; then
+                AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
+                AC_LANG_PUSH([C])
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
 #ifdef PictStandardA8
 #else
       return fail;
 #endif
 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
 
-            AC_LANG_POP([C])
-        fi
-    fi
-    libo_MINGW_CHECK_DLL([CAIRO], [libcairo])
-    libo_MINGW_TRY_DLL([FONTCONFIG], [libfontconfig])
-    libo_MINGW_TRY_DLL([FREETYPE], [libfreetype])
-    libo_MINGW_TRY_DLL([PIXMAN], [libpixman])
-    libo_MINGW_TRY_DLL([PNG15], [libpng15])
-else
-    AC_MSG_RESULT([no])
-
-    if test $_os = WINNT; then
-        dnl We only need cairo for Windows if we
-        dnl build librsvg or directx disabled
-        if test "$ENABLE_LIBRSVG" != NO -o -z "$ENABLE_DIRECTX"; then
-            BUILD_TYPE="$BUILD_TYPE CAIRO"
+                AC_LANG_POP([C])
+            fi
         fi
+        libo_MINGW_CHECK_DLL([CAIRO], [libcairo])
+        libo_MINGW_TRY_DLL([FONTCONFIG], [libfontconfig])
+        libo_MINGW_TRY_DLL([FREETYPE], [libfreetype])
+        libo_MINGW_TRY_DLL([PIXMAN], [libpixman])
+        libo_MINGW_TRY_DLL([PNG15], [libpng15])
     else
-        if test "$enable_cairo_canvas" = "yes"; then
-            BUILD_TYPE="$BUILD_TYPE CAIRO"
-        else
-            if test "$with_system_cairo" != "yes"; then
-                if test "$ENABLE_LIBRSVG" != NO; then
-                    BUILD_TYPE="$BUILD_TYPE CAIRO"
-                fi
+        AC_MSG_RESULT([no])
+
+        if test $_os = WINNT; then
+            dnl We only need cairo for Windows if we
+            dnl build librsvg or directx disabled
+            if test "$ENABLE_LIBRSVG" != NO -o -z "$ENABLE_DIRECTX"; then
+                BUILD_TYPE="$BUILD_TYPE CAIRO"
             fi
+        else
+            BUILD_TYPE="$BUILD_TYPE CAIRO"
         fi
     fi
 fi
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to