diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 101 |
1 files changed, 68 insertions, 33 deletions
diff --git a/configure.ac b/configure.ac index 67b68e2..928a169 100644 --- a/configure.ac +++ b/configure.ac @@ -47,6 +47,18 @@ AC_CHECK_LIB(z, compress, [have_libz="no (requires zlib http://www.gzip.org/zlib/)"])], [have_libz="no (requires zlib http://www.gzip.org/zlib/)"]) +save_LIBS="$LIBS" +AC_CHECK_LIB(lzo2, lzo2a_decompress, + [AC_CHECK_HEADER(lzo/lzo2a.h, [ + have_lzo=yes + AC_DEFINE(HAVE_LZO, 1, [Define to 1 if you have lzo available]) + lzo_LIBS="-llzo2" + ], + [have_lzo="no (requires lzpo http://www.oberhumer.com/opensource/lzo/)"])], + [have_lzo="no (requires lzpo http://www.oberhumer.com/opensource/lzo/)"]) +AC_SUBST(lzo_LIBS) +LIBS="$save_LIBS" + AC_CHECK_LIB(dl, dlsym, [have_dlsym=yes; have_dl=yes], [have_dlsym=no; have_dl=no]) @@ -65,8 +77,7 @@ dnl =========================================================================== CAIRO_ENABLE_SURFACE_BACKEND(xlib, Xlib, auto, [ xlib_REQUIRES="x11 xext" PKG_CHECK_MODULES(xlib, $xlib_REQUIRES, , - [AC_MSG_RESULT(no) - xlib_REQUIRES="" + [xlib_REQUIRES="" AC_PATH_XTRA if test "x$no_x" = xyes; then use_xlib="no (requires X development libraries)" @@ -74,6 +85,42 @@ CAIRO_ENABLE_SURFACE_BACKEND(xlib, Xlib, auto, [ xlib_NONPKGCONFIG_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" xlib_NONPKGCONFIG_CFLAGS=$X_CFLAGS fi]) + + AC_CHECK_HEADER(sys/ipc.h) + AC_CHECK_HEADER(sys/shm.h) + + if test "$ac_cv_header_sys_ipc_h" = "yes" -a "$ac_cv_header_sys_shm_h" = "yes"; then + AC_MSG_CHECKING(whether shmctl IPC_RMID allowes subsequent attaches) + AC_TRY_RUN([ + #include <sys/types.h> + #include <sys/ipc.h> + #include <sys/shm.h> + int main() + { + char *shmaddr; + int id = shmget (IPC_PRIVATE, 4, IPC_CREAT | 0600); + if (id == -1) return 2; + shmaddr = shmat (id, 0, 0); + shmctl (id, IPC_RMID, 0); + if ((char*) shmat (id, 0, 0) == (char*) -1) { + shmdt (shmaddr); + return 1; + } + shmdt (shmaddr); + shmdt (shmaddr); + return 0; + } + ], + AC_DEFINE(IPC_RMID_DEFERRED_RELEASE, 1, + [Define to 1 if shared memory segments are released deferred.]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no), + AC_MSG_RESULT(assuming no)) + fi + + AC_CHECK_HEADERS([X11/extensions/XShm.h X11/extensions/shmproto.h X11/extensions/shmstr.h], [], [], + [#include <X11/Xlibint.h> + #include <X11/Xproto.h>]) ]) CAIRO_ENABLE_SURFACE_BACKEND(xlib_xrender, Xlib Xrender, auto, [ @@ -84,13 +131,13 @@ CAIRO_ENABLE_SURFACE_BACKEND(xlib_xrender, Xlib Xrender, auto, [ xlib_xrender_BASE=cairo-xlib xlib_xrender_REQUIRES="xrender >= 0.6" PKG_CHECK_MODULES(xlib_xrender, $xlib_xrender_REQUIRES, , - [AC_MSG_RESULT(no) - xlib_xrender_REQUIRES="" + [xlib_xrender_REQUIRES="" old_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $xlib_CFLAGS $xlib_NONPKGCONFIG_CFLAGS" AC_CHECK_HEADER(X11/extensions/Xrender.h, [xlib_xrender_NONPKGCONFIG_LIBS="-lXrender"], - [use_xlib_xrender="no (requires $xlib_xrender_REQUIRES http://freedesktop.org/Software/xlibs)"]) + [use_xlib_xrender="no (requires $xlib_xrender_REQUIRES http://freedesktop.org/Software/xlibs)"], + [#include <X11/X.h>]) CPPFLAGS=$old_CPPFLAGS ]) @@ -110,16 +157,14 @@ dnl =========================================================================== CAIRO_ENABLE_SURFACE_BACKEND(xcb, XCB, auto, [ xcb_REQUIRES="xcb >= 1.6 xcb-render >= 1.6" PKG_CHECK_MODULES(xcb, $xcb_REQUIRES, , - [AC_MSG_RESULT(no) - use_xcb="no (requires $xcb_REQUIRES http://xcb.freedesktop.org)"]) + [use_xcb="no (requires $xcb_REQUIRES http://xcb.freedesktop.org)"]) ]) CAIRO_ENABLE_FUNCTIONS(xlib_xcb, Xlib/XCB, no, [ if test "x$use_xcb" = "xyes" -a "x$use_xlib" = "xyes"; then xlib_xcb_REQUIRES="x11-xcb" PKG_CHECK_MODULES(xlib_xcb, $xlib_xcb_REQUIRES, , - [AC_MSG_RESULT(no) - use_xlib_xcb="no (requires $xlib_xcb_REQUIRES http://xcb.freedesktop.org)"]) + [use_xlib_xcb="no (requires $xlib_xcb_REQUIRES http://xcb.freedesktop.org)"]) else use_xlib_xcb="no (requires both --enable-xlib and --enable-xcb)" fi @@ -129,8 +174,7 @@ CAIRO_ENABLE_FUNCTIONS(xcb_shm, XCB/SHM, auto, [ if test "x$use_xcb" = "xyes"; then xcb_shm_REQUIRES="xcb-shm" PKG_CHECK_MODULES(xcb_shm, $xcb_shm_REQUIRES, , - [AC_MSG_RESULT(no) - use_xcb_shm="no (requires $xcb_shm http://xcb.freedesktop.org)"]) + [use_xcb_shm="no (requires $xcb_shm http://xcb.freedesktop.org)"]) else use_xcb_shm="no (requires --enable-xcb)" fi @@ -141,8 +185,7 @@ dnl =========================================================================== CAIRO_ENABLE_SURFACE_BACKEND(qt, Qt, no, [ qt_REQUIRES="QtGui >= 4.4.0" PKG_CHECK_MODULES(qt, $qt_REQUIRES, , - [AC_MSG_RESULT(no) - qt_REQUIRES="" + [qt_REQUIRES="" use_qt="no (requires Qt4 development libraries)" ]) ]) @@ -250,8 +293,8 @@ dnl =========================================================================== CAIRO_ENABLE_SURFACE_BACKEND(drm, DRM, no, [ drm_REQUIRES="libudev >= 136" - PKG_CHECK_MODULES(drm, $drm_REQUIRES, , [AC_MSG_RESULT(no) - use_drm="no (requires $drm_REQUIRES, udev is available from git://git.kernel.org/pub/scm/linux/hotplug/udev.git)"]) + PKG_CHECK_MODULES(drm, $drm_REQUIRES, , + [use_drm="no (requires $drm_REQUIRES, udev is available from git://git.kernel.org/pub/scm/linux/hotplug/udev.git)"]) ]) CAIRO_ENABLE_SURFACE_BACKEND(gallium, Gallium3D, no, [ @@ -290,7 +333,7 @@ CAIRO_ENABLE_FUNCTIONS(png, PNG, yes, [ fi if test "x$use_png" = "xyes" ; then - PKG_CHECK_MODULES(png, $png_REQUIRES, , AC_MSG_RESULT(no)) + PKG_CHECK_MODULES(png, $png_REQUIRES, , : ) else AC_MSG_WARN([Could not find libpng in the pkg-config search path]) fi @@ -344,7 +387,7 @@ dnl =========================================================================== CAIRO_ENABLE_SURFACE_BACKEND(directfb, directfb, no, [ directfb_REQUIRES=directfb - PKG_CHECK_MODULES(directfb, $directfb_REQUIRES, , AC_MSG_RESULT(no) + PKG_CHECK_MODULES(directfb, $directfb_REQUIRES, , [use_directfb="no (requires $directfb_REQUIRES http://www.directfb.org)"]) ]) @@ -447,8 +490,7 @@ CAIRO_ENABLE_FONT_BACKEND(ft, FreeType, auto, [ PKG_CHECK_MODULES(FREETYPE, freetype2 >= $FREETYPE_MIN_VERSION, [freetype_pkgconfig=yes], - [AC_MSG_RESULT(no) - freetype_pkgconfig=no]) + [freetype_pkgconfig=no]) if test "x$freetype_pkgconfig" = "xyes"; then ft_REQUIRES="freetype2 >= $FREETYPE_MIN_VERSION $ft_REQUIRES" @@ -482,7 +524,7 @@ CAIRO_ENABLE_FONT_BACKEND(fc, Fontconfig, auto, [ if test "x$use_fc" = "xyes"; then fc_REQUIRES="fontconfig >= $FONTCONFIG_MIN_VERSION" PKG_CHECK_MODULES(FONTCONFIG, $fc_REQUIRES,, - [AC_MSG_RESULT(no); use_fc="no (requires $fc_REQUIRES)"]) + [use_fc="no (requires $fc_REQUIRES)"]) fi fc_CFLAGS="$FONTCONFIG_CFLAGS" fc_LIBS="$FONTCONFIG_LIBS" @@ -493,15 +535,8 @@ if test "x$use_ft" = "xyes"; then _save_cflags="$CFLAGS" LIBS="$LIBS $ft_LIBS" CFLAGS="$CFLAGS $ft_CFLAGS" - AC_CHECK_MEMBER(FT_Bitmap_Size.y_ppem, - HAVE_FT_BITMAP_SIZE_Y_PPEM=1, - HAVE_FT_BITMAP_SIZE_Y_PPEM=0, - [#include <ft2build.h> - #include FT_FREETYPE_H]) - AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,$HAVE_FT_BITMAP_SIZE_Y_PPEM, - [FT_Bitmap_Size structure includes y_ppem field]) - AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_GlyphSlot_Oblique FT_Load_Sfnt_Table FT_Library_SetLcdFilter) + AC_CHECK_FUNCS(FT_Get_X11_Font_Format FT_GlyphSlot_Embolden FT_GlyphSlot_Oblique FT_Load_Sfnt_Table FT_Library_SetLcdFilter) LIBS="$_save_libs" CFLAGS="$_save_cflags" @@ -620,8 +655,8 @@ dnl =========================================================================== CAIRO_ENABLE_SURFACE_BACKEND(image, image, always, [ pixman_REQUIRES="pixman-1 >= 0.22.0" - PKG_CHECK_MODULES(pixman, $pixman_REQUIRES, , [AC_MSG_RESULT(no) - use_image="no (requires $pixman_REQUIRES http://cairographics.org/releases/)"]) + PKG_CHECK_MODULES(pixman, $pixman_REQUIRES, , + [use_image="no (requires $pixman_REQUIRES http://cairographics.org/releases/)"]) image_REQUIRES=$pixman_REQUIRES image_CFLAGS=$pixman_CFLAGS image_LIBS=$pixman_LIBS @@ -668,13 +703,13 @@ dnl Build gobject integration library CAIRO_ENABLE_FUNCTIONS(gobject, gobject, auto, [ gobject_REQUIRES="gobject-2.0 glib-2.0" - PKG_CHECK_MODULES(GOBJECT, $gobject_REQUIRES, , [AC_MSG_RESULT(no) - use_gobject="no (requires $gobject_REQUIRES http://download.gnome.org/pub/GNOME/sources/glib/)"]) + PKG_CHECK_MODULES(GOBJECT, $gobject_REQUIRES, , + [use_gobject="no (requires $gobject_REQUIRES http://download.gnome.org/pub/GNOME/sources/glib/)"]) gobject_NONPKGCONFIG_EXTRA_LIBS="-L\${libdir} -lcairo-gobject" ]) dnl I'm too lazy to fix the caching properly if test "x$use_gobject" = "xyes"; then - PKG_CHECK_MODULES(GOBJECT, $gobject_REQUIRES) + PKG_CHECK_MODULES(GOBJECT, $gobject_REQUIRES, : ) fi dnl =========================================================================== |