octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking for MacOS 10.5 testers


From: Ben Abbott
Subject: Re: Looking for MacOS 10.5 testers
Date: Fri, 15 Jun 2012 18:40:31 -0400

On Jun 15, 2012, at 10:52 AM, Ben Abbott wrote:

> On Jun 15, 2012, at 8:15 AM, Ben Abbott wrote:
> 
>> On Jun 15, 2012, at 12:15 AM, Alexander Hansen wrote:
>> 
>>> On 6/14/12 9:08 PM, Alexander Hansen wrote:
>>>> On 6/14/12 3:04 PM, Ben Abbott wrote:
>>>>> I've prepared at changeset which detects the presence of Carbon 
>>>>> Framework's CGDispalyBitsPerPixel, and replaces it with a new function if 
>>>>> absent.
>>>>> 
>>>>> I don't have a 10.5 box to test this on. If anyone else has a 10.5 box 
>>>>> which they use to build the default branch, I'd appreciate testing this 
>>>>> changeset.
>>>>> 
>>>>> Ben
>>>> 
>>>> I'm in the process of looking at this.  I typically don't install Octave
>>>> by hand, so it's taking a while :-) .  Plus, I'm also building an update
>>>> to gcc4.6 on the same single-processor G4 machine, so that's slowing
>>>> things down a bit.
>>> 
>>> It didn't work here:
>>> 
>>> libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I../libgnu -I../libgnu
>>> -I../libcruft/misc -I../liboctave -I../liboctave -I. -I. -I/sw/include
>>> -I/sw/include -g -O2 -DHAVE_CONFIG_H -I/sw/include
>>> -I/sw/include/freetype2 -I/sw/include -I/sw/include -Wall -W -Wshadow
>>> -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align
>>> -Wcast-qual -g -O2 -D_THREAD_SAFE -pthread -g -O2 -MT
>>> liboctinterp_la-display.lo -MD -MP -MF .deps/liboctinterp_la-display.Tpo
>>> -c display.cc  -fno-common -DPIC -o .libs/liboctinterp_la-display.o
>>> display.cc: In function 'size_t DisplayBitsPerPixel(CGDirectDisplayID)':
>>> display.cc:49: error: 'CGDisplayModeRef' was not declared in this scope
>>> display.cc:49: error: expected `;' before 'mode'
>>> display.cc:50: error: 'mode' was not declared in this scope
>>> display.cc:50: error: 'CGDisplayModeCopyPixelEncoding' was not declared
>>> in this scope
>>> display.cc:52: warning: use of old-style cast
>>> display.cc:54: warning: use of old-style cast
>>> display.cc: At global scope:
>>> display.cc:47: warning: unused parameter 'display'
>> 
>> Thanks Alex,
>> 
>> I should have looked more closely at my results. I got the syntax wrong in 
>> acinclude.m4.
>> 
>> I'll fix and try a fresh build. If all goes will I post another changeset in 
>> a few hours.
>> 
>> Ben
> 
> A second attempt is attached.
> 
> Ben
> 
> <changeset.patch>

Using the short program below (BitsPerPixel.cc) to determine if Carbon 
Framework includes the CGDisplayBitsPerPixel() function.

----------------
#include <Carbon/Carbon.h>
int main (void)
{
  CGDirectDisplayID display = CGMainDisplayID ();
  size_t depth = CGDisplayBitsPerPixel (display);
  return 0;
}
----------------

The result when linking to the MacOS 10.5 SDK, 10.6 SDK, and 10.7 SDK are 
below. Apple doesn't include the 10.5 SDK with Xcode 4, so I followed the 
instructions at http://lunokhod.org/?p=269 and installed the SDK from my 
original Snow Leopard DVD.

$ gcc -isysroot /Developer/SDKs/MacOSX10.5.sdk -c -o test.o BitsPerPixel.cc

$ gcc -isysroot /Developer/SDKs/MacOSX10.6.sdk -c -o test.o BitsPerPixel.cc
BitsPerPixel.cc: In function ‘int main()’:
BitsPerPixel.cc:5: warning: ‘CGDisplayBitsPerPixel’ is deprecated (declared at 
/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:517)
BitsPerPixel.cc:5: warning: ‘CGDisplayBitsPerPixel’ is deprecated (declared at 
/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:517)

$ gcc -isysroot /Developer/SDKs/MacOSX10.7.sdk -c -o test.o BitsPerPixel.cc
BitsPerPixel.cc: In function ‘int main()’:
BitsPerPixel.cc:5: error: ‘CGDisplayBitsPerPixel’ was not declared in this scope

The version for MacOS 10.7 (BitsPerPixel-lion.cc) is below.

----------------
#include <Carbon/Carbon.h>
size_t DisplayBitsPerPixel (CGDirectDisplayID display)
{
  CGDisplayModeRef mode = CGDisplayCopyDisplayMode (display);
  CFStringRef pixelEncoding = CGDisplayModeCopyPixelEncoding (mode);
  if (CFStringCompare (pixelEncoding, CFSTR (IO32BitDirectPixels), 0) == 0)
    return 32;
  else if (CFStringCompare (pixelEncoding, CFSTR (IO16BitDirectPixels), 0) == 0)
    return 16;
  else 
    return 8;
}
int main (void)
{
  CGDirectDisplayID display = CGMainDisplayID ();
  size_t depth = DisplayBitsPerPixel (display);

  return 0;
}
----------------

The result when linking to the MacOS 10.5 SDK, 10.6 SDK, and 10.7 SDK are below.

$ gcc -isysroot /Developer/SDKs/MacOSX10.5.sdk -c -o test.o BitsPerPixel-lion.cc
BitsPerPixel-lion.cc: In function ‘size_t 
DisplayBitsPerPixel(CGDirectDisplayID)’:
BitsPerPixel-lion.cc:4: error: ‘CGDisplayModeRef’ was not declared in this scope
BitsPerPixel-lion.cc:4: error: expected `;' before ‘mode’
BitsPerPixel-lion.cc:5: error: ‘mode’ was not declared in this scope
BitsPerPixel-lion.cc:5: error: ‘CGDisplayModeCopyPixelEncoding’ was not 
declared in this scope

$ gcc -isysroot /Developer/SDKs/MacOSX10.6.sdk -c -o test.o BitsPerPixel-lion.cc

$ gcc -isysroot /Developer/SDKs/MacOSX10.7.sdk -c -o test.o BitsPerPixel-lion.cc

Looks like my test program is able to detect the presence of 
CGDisplayBitsPerPixel and that the replacement compiles properly on 10.6 and 
10.7.

I tried to hack the configure script to building using the 10.5 SDK, but was 
not successful. So, I'd still prefer to have someone with a 10.5 install verify 
my changeset works (or tell me how to tell configure to use the 10.5 SDK).

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]