diff m4/acinclude.m4 @ 14776:0eb1b1eb2c76

Detect Carbon's CGDisplayBitsPerPixel during configure. Use it if present. Provide a replacement if it is not. * m4/acinclude.m4 (OCTAVE_CARBON_CGDISPLAYBITSPERPIXEL): New macro. * configure.ac: Use it. * display.cc: Define DisplayBitsPerPixel, and use it if CGDisplayBitsPerPixel is missing.
author Ben Abbott <bpabbott@mac.com>
date Sun, 17 Jun 2012 17:20:38 -0400
parents 295bd3efc065
children bbc825cb2ea0
line wrap: on
line diff
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
@@ -158,6 +158,25 @@
 AC_LANG_POP(C++)
 ])
 dnl
+dnl See if the Carbon Framework defines CGDisplayBitsPerPixel.
+dnl
+AC_DEFUN([OCTAVE_CARBON_CGDISPLAYBITSPERPIXEL],
+[AC_CACHE_CHECK([whether CGDisplayBitsPerPixel is defined in the Carbon Framework],
+octave_cv_carbon_cgdisplaybitsperpixel,
+[AC_LANG_PUSH(C++)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <Carbon/Carbon.h>
+]], [[
+CGDirectDisplayID display = CGMainDisplayID ();
+size_t depth = CGDisplayBitsPerPixel (display);
+]])],
+octave_cv_carbon_cgdisplaybitsperpixel=yes, octave_cv_carbon_cgdisplaybitsperpixel=no)])
+if test $octave_cv_carbon_cgdisplaybitsperpixel = yes; then
+AC_DEFINE(HAVE_CARBON_CGDISPLAYBITSPERPIXEL,1,[Define if Carbon Framework has CGDisplayBitsPerPixel])
+fi
+AC_LANG_POP(C++)
+])
+dnl
 dnl The following test is from Karl Berry's Kpathseach library.  I'm
 dnl including it here in case we someday want to make the use of
 dnl kpathsea optional.