JDK-8005491 : [macosx] Builds requires X11 headers (and libs?)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • Submitted: 2012-12-26
  • Updated: 2014-06-06
  • Resolved: 2014-06-06
Related Reports
Duplicate :  
Duplicate :  
Description
I've upgraded to OS X 10.8. An error is reported when compiling BufImgSurfaceData.c. The included files somehow #include an X11 header file, and the build fails since Apple no longer supports X11 on OS X 10.8. I'm currently downloading the XQuartz package to remedy this issue, however, I think that in the long term JDK should not require X11 headers/libs to build on OS X. I'm using the "old" build system. The error is as follows: 

/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-gcc  -Os   -fno-strict-aliasing -fPIC -W -Wall  -Wno-unused -Wno-parentheses -pipe -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN -F/System/Library/Frameworks/JavaVM.framework/Frameworks -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES -DMLIB_NO_LIBSUNMATH  -DNDEBUG -DARCH='"x86_64"' -Dx86_64 -D_ALLBSD_SOURCE -DRELEASE='"1.8.0-internal"' -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -DMACOSX -D_LP64=1 -I. -I../../../build/macosx-x86_64/tmp/sun/sun.awt/awt/CClassHeaders -I../../../src/closed/share/javavm/export -I../../../src/solaris/javavm/export -I../../../src/share/javavm/export -I../../../src/share/native/common -I../../../src/solaris/native/common -I../../../src/share/native/sun/awt -I../../../src/solaris/native/sun/awt   -DTHIS_FILE='"BufImgSurfaceData.c"' -I../../../src/share/native/sun/awt/debug -I../../../src/share/native/sun/awt/../font -I../../../src/solaris/native/sun/awt/../font -I../../../src/share/native/sun/awt/image -I../../../src/share/native/sun/awt/image/cvutils -I../../../src/share/native/sun/awt/shell -I../../../src/share/native/sun/awt/medialib -I../../../src/solaris/native/sun/awt/medialib -I../../../src/share/native/sun/awt/../java2d -I../../../src/solaris/native/sun/awt/../java2d -I../../../src/share/native/sun/awt/../java2d/loops -I../../../src/share/native/sun/awt/../java2d/pipe -I../../../src/share/native/sun/awt/../java2d/opengl -I../../../src/solaris/native/sun/awt/../java2d/opengl -I../../../src/solaris/native/sun/awt/../java2d/x11 -I../../../src/share/native/sun/awt/../dc/doe -I../../../src/share/native/sun/awt/../dc/path -I../../../src/solaris/native/sun/awt/../jdga -I../../../src/solaris/native/sun/awt   -c -o ../../../build/macosx-x86_64/tmp/sun/sun.awt/awt/obj64/BufImgSurfaceData.o  ../../../src/share/native/sun/awt/image/BufImgSurfaceData.c
In file included from ../../../src/share/native/sun/awt/../java2d/pipe/Region.h:34,
                 from ../../../src/share/native/sun/awt/../java2d/pipe/Region.c:30:
../../../src/solaris/native/sun/awt/utility/rect.h:31:22: error: X11/Xlib.h: No such file or directory
In file included from ../../../src/share/native/sun/awt/../java2d/pipe/Region.h:34,
                 from ../../../src/share/native/sun/awt/../java2d/pipe/Region.c:30:
../../../src/solaris/native/sun/awt/utility/rect.h:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'RECT_T'
../../../src/solaris/native/sun/awt/utility/rect.h:51: error: expected declaration specifiers or '...' before 'RECT_T'
In file included from ../../../src/share/native/sun/awt/../java2d/pipe/Region.c:30:
../../../src/share/native/sun/awt/../java2d/pipe/Region.h:211: error: expected declaration specifiers or '...' before 'RECT_T'
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:243: error: expected declaration specifiers or '...' before 'RECT_T'
../../../src/share/native/sun/awt/../java2d/pipe/Region.c: In function 'RegionToYXBandedRectangles':
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:254: error: 'pRect' undeclared (first use in this function)
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:254: error: (Each undeclared identifier is reported only once
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:254: error: for each function it appears in.)
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:263: warning: comparison between signed and unsigned
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:264: error: 'RECT_T' undeclared (first use in this function)
../../../src/share/native/sun/awt/../java2d/pipe/Region.c:264: error: expected expression before ')' token
make[3]: *** [../../../build/macosx-x86_64/tmp/sun/sun.awt/awt/obj64/Region.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from ../../../src/solaris/native/sun/awt/color.h:28,
                 from ../../../src/solaris/native/sun/awt/img_util_md.h:26,
                 from ../../../src/share/native/sun/awt/image/BufImgSurfaceData.c:31:
../../../src/solaris/native/sun/awt/awt.h:38:27: error: X11/Intrinsic.h: No such file or directory
In file included from ../../../src/solaris/native/sun/awt/color.h:28,
                 from ../../../src/solaris/native/sun/awt/img_util_md.h:26,
                 from ../../../src/share/native/sun/awt/image/BufImgSurfaceData.c:31:
../../../src/solaris/native/sun/awt/awt.h:100: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
../../../src/solaris/native/sun/awt/awt.h:101: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'awt_ModLockIsShiftLock'
In file included from ../../../src/solaris/native/sun/awt/img_util_md.h:26,
                 from ../../../src/share/native/sun/awt/image/BufImgSurfaceData.c:31:
../../../src/solaris/native/sun/awt/color.h:34: error: expected specifier-qualifier-list before 'XPixmapFormatValues'
In file included from ../../../src/share/native/sun/awt/image/BufImgSurfaceData.c:31:
../../../src/solaris/native/sun/awt/img_util_md.h:32: error: expected specifier-qualifier-list before 'XID'
make[3]: *** [../../../build/macosx-x86_64/tmp/sun/sun.awt/awt/obj64/BufImgSurfaceData.o] Error 1
make[2]: *** [library_parallel_compile] Error 2
make[1]: *** [all] Error 1
make: *** [all] Error 1

Comments
The fix here :- http://cr.openjdk.java.net/~ddehaven/8003900/jdk.1/ for the one of the related bugs updates rect.h and color.h and so this should now all be resolved. Closing as a duplicate.
06-06-2014

Indeed, those issues are closely related. I just thought that we could remove the AWT XToolkit, and then clean up all the other X11 traces from 2D code with a separate issue. If making all these changes at once is preferable, please feel free to close all the issues as duplicates of one another, leaving just one bug open. Please make sure to add a comment to the open bug indicating that we want to remove all dependencies on X11 completely, for both run- and compile-time. I agree with postponing this work until the new build is in place.
27-12-2012

If necessary I can work with whoever is going to remove the AWT XToolkit but it seems likely that this isn't a fix that can be done in two parts. It may need to be handled by one person at one time. We also may need to hold off doing this until after the new build is in place. That isn't to say we'd only fix it for the new build, rather that it has been requested that build changes in general be limited during this transition.
26-12-2012

I know that you are �� big fun of the removal x11 from macosx. But how many bugs we should create for it? https://jbs.oracle.com/bugs/browse/JDK-8003900 requested by you https://jbs.oracle.com/bugs/browse/JDK-8001338 assigned to me by you And this one?
26-12-2012

Thanks for the info. However, I believe that we could try and eliminate the requirement since we don't (should not) use Xlib on the Mac.
26-12-2012

1 Prerequisites to build On OS X Mountain Lion: XQuartz 2 If you are building on Mountain Lion you must also define the path to the X11 includes: export CPATH="/usr/X11/include" This useful info is in our FAQ. https://wikis.oracle.com/display/OpenJDK/Mac+OS+X+Port
26-12-2012