osxfuse / filesystems

Example file systems
376 stars 93 forks source link

Unable to build procfs on MacOSX10.10 #21

Open patilarpith opened 9 years ago

patilarpith commented 9 years ago

SDK: MacOSX10.10.sdk Xcode: 6.1.1

Here is the build error from make command

c++ -c -D_FILE_OFFSET_BITS=64 -O -g -I/usr/local/include/osxfuse -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -Wall  -o procfs_displays.o procfs_displays.cc
procfs_displays.cc:39:9: warning: 'kCGLPFAFullScreen' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
        kCGLPFAFullScreen,
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenGL.framework/Headers/CGLTypes.h:71:2: note: 
      'kCGLPFAFullScreen' has been explicitly marked deprecated here
        kCGLPFAFullScreen OPENGL_ENUM_DEPRECATED(10_0, 10_6)     =  54,
        ^
procfs_displays.cc:53:5: warning: 'CGLSetFullScreen' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
    CGLSetFullScreen(context);
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenGL.framework/Headers/OpenGL.h:73:17: note: 
      'CGLSetFullScreen' has been explicitly marked deprecated here
extern CGLError CGLSetFullScreen(CGLContextObj ctx) OPENGL_DEPRECATED(10_0, 10_6);
                ^
procfs_displays.cc:228:21: error: use of undeclared identifier 'CGDisplayBaseAddress'
                    CGDisplayBaseAddress(d));
                    ^
procfs_displays.cc:230:21: error: use of undeclared identifier 'CGDisplayBitsPerPixel'
                    CGDisplayBitsPerPixel(d));
                    ^
procfs_displays.cc:232:21: error: use of undeclared identifier 'CGDisplayBitsPerSample'
                    CGDisplayBitsPerSample(d));
                    ^
procfs_displays.cc:234:21: error: use of undeclared identifier 'CGDisplaySamplesPerPixel'
                    CGDisplaySamplesPerPixel(d));
                    ^
procfs_displays.cc:236:21: error: use of undeclared identifier 'CGDisplayBytesPerRow'
                    CGDisplayBytesPerRow(d));
                    ^
2 warnings and 5 errors generated.
make: *** [procfs_displays.o] Error 1

Looks like some of the display related identifier were not found. Is there a way to build procfs headless?

alexchandel commented 8 years ago

Same issue in 10.11, of course. In addition, all the HIServices functions this uses, like GetProcessForPID, GetNextProcess, GetProcessPID, and CopyProcessName, plus CFPropertyListCreateXMLData are now marked deprecated too.

For CGDisplayBaseAddress, it appears that Apple is trying to deprecate access to the raw framebuffer of a display. There's no direct replacement, but one could probably be hacked together.

For CGDisplayBitsPerPixel, CGDisplayBitsPerSample, and CGDisplaySamplesPerPixel, Apple documentation recommends CGDisplayModeCopyPixelEncoding instead, which returns a CFString, but even that is deprecated in 10.11.

For CGDisplayBytesPerRow, Apple recommends using CGDisplayCreateImage() on the displayID, and then getting the bytes per row of that.

The symbols are still there (for now), so you can just declare them yourself in procfs_displays.h. But that's not remotely supported.

But it gets even better if you're upgrading to 64-bit, because the Sequence Grabber and the entire QuickTime framework is gone, which means sequencegrab doesn't build. It might be possible to replace the Sequence Grabber usage with AVFoundation. Apple also mentions IOVideoDevice in the context of kernel programming which is intended to replace SG. I just stubbed them out; who knows what will happen if they're called.

And about half the vm_* routines and types have been renamed to machvm*.

And the Makefile is deathly old. I fixed all this and got it to build on 10.11 x86_64. I'll probably push the result to https://github.com/alexchandel/procfs once I clean it up.

alexchandel commented 8 years ago

I fork-extracted procfs to https://github.com/alexchandel/procfs and updated the build to 10.11, x86_64