Menu

#26 OS X build links to X11

None
closed-fixed
None
5
2016-09-10
2016-07-02
No

On OS X, 0.9.16 links to X11 libraries:

$ otool -L chromium-bsu
chromium-bsu:
    /opt/X11/lib/libGL.1.dylib (compatibility version 4.0.0, current version 4.0.0)
    /opt/X11/lib/libGLU.1.dylib (compatibility version 5.0.0, current version 5.1.0)
    /sw/lib/libftgl.2.dylib (compatibility version 4.0.0, current version 4.3.0)
    /sw/lib/fontconfig2/lib/libfontconfig.1.dylib (compatibility version 8.0.0, current version 8.2.0)
    /sw/lib/libSDL_image-1.2.0.dylib (compatibility version 9.0.0, current version 9.4.0)
    /sw/lib/libSDL-1.2.0.dylib (compatibility version 12.0.0, current version 12.4.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0)
    /sw/lib/libSDL_mixer-1.2.0.dylib (compatibility version 13.0.0, current version 13.0.0)
    /sw/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1258.1.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1404.47.0)
    /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 600.0.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1259.0.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

Version 0.9.15 did not link to X11 libraries. If I run ./configure using without-x, then the build fails to find OpenGL:

checking for GL... no
./configure: line 9461: _AX_CHECK_GL_MANUAL_HEADERS_DARWIN: command not found
checking for OpenGL headers... 
checking for a working OpenGL implementation... no
....
checking GL/glpng.h usability... yes
checking GL/glpng.h presence... yes
checking for GL/glpng.h... yes
checking glpng/glpng.h usability... no
checking glpng/glpng.h presence... no
checking for glpng/glpng.h... no
checking for pngBind in -lglpng... yes
configure: error: cannot find OpenGL (drawing system)

Notice the unresolved AX_CHECK_GL_MANUAL_HEADERS_DARWIN macro. If I replace ax_check_gl.m4 with the equivalent file from the GNU autoconf-archive, then the build links to SDL_image and runs, but has serious drawing artifacts.

Discussion

  • Hanspeter Niederstrasser

    Forgot to mention that the X11 linking program crashes at startup.

     
  • Paul Wise

    Paul Wise - 2016-07-02

    chromium-bsu itself does not use X11, just the OpenGL detection macros (ax_check_gl.m4) from autoconf-archive version 20150925-1, which is from Debian. I notice that the latest version of autoconf-archive has some fixes for macOS. I will ask for an update to autoconf-archive and make a new release.

    The rendering issues might be bug #19 but on GNU/Linux at least they are relatively minor. Could you attach a screenshot of what they look like? If you are able to compile against glpng instead then they should go away.

     
  • Hanspeter Niederstrasser

    Attached are screen shots from 0.9.15.1 and 0.9.16.

    This is what 0.9.15.1 links to:

    $ otool -L /sw/bin/chromium-bsu 
    /sw/bin/chromium-bsu:
        /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
        /sw/lib/libftgl.2.dylib (compatibility version 4.0.0, current version 4.3.0)
        /sw/lib/fontconfig2/lib/libfontconfig.1.dylib (compatibility version 8.0.0, current version 8.2.0)
        /sw/lib/libglpng.1.dylib (compatibility version 0.0.0, current version 0.0.0)
        /sw/lib/libSDL_image-1.2.0.dylib (compatibility version 9.0.0, current version 9.4.0)
        /sw/lib/libSDL-1.2.0.dylib (compatibility version 12.0.0, current version 12.4.0)
        /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0)
        /sw/lib/libSDL_mixer-1.2.0.dylib (compatibility version 13.0.0, current version 13.0.0)
        /sw/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1258.1.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
        /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1404.47.0)
        /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 600.0.0)
        /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1259.0.0)
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    

    For the record, Fink (OS X package manager) has autoconf-archive 2016.03.20. I'm going through iterations of ./configure options and m4 changes to see if I can find a combination that works and doesn't pull in the unncessecary X11.

     
  • Hanspeter Niederstrasser

    Running update: replacing ax_check_gl.x with more 2016.03.20 improves OpenGL detection (catches system frameworks and not X11 library). However, it loses the ability to find libglpng because LDFLAGS is not passed to the configure test:

    configure:11181: checking for pngBind in -lglpng
    configure:11206: gcc -o conftest    -g -O2 -I/sw/include  conftest.c -lglpng -framework OpenGL -framework GLUT -framework OpenGL -framework OpenGL  >&5
    ld: library not found for -lglpng
    

    There should be a -L/sw/lib in there, which is what happens in a

    configure:12982: checking for pngBind in -lglpng
    configure:13007: gcc -o conftest -g -O2 -I/sw/include -L/sw/lib conftest.c -lglpng -L/opt/X11/lib -lGL  >&5
    configure:13007: $? = 0
    configure:13016: result: yes
    

    So we gain the right OpenGL flags (all the -frameworks), but lose -L/sw/lib from LDFLAGS :(

     
  • Hanspeter Niederstrasser

    It seems I found a way to make the whole thing work:

    1) run autogen.sh. I don't need to copy an outside ax_check.gl.m4. The included one seems to work well.
    2) export LIBRARY_PATH=/sw/lib (LDFLAGS is ignored)
    3) ./configure --disable-sdl2
    4) make && make install

    The resulting executable links to glpng and OpenGL frameworks and has no runtime display issues (through at least 3 levels of play).

     
  • Paul Wise

    Paul Wise - 2016-08-03

    Great.

    Once Debian has updated autoconf-archive, I'll make a new release with the latest macros in the tarball and close this bug.

    Why is /sw/lib not in the standard library/include paths? I guess that is where you chose to install glpng?

    Please file a new bug about the SDL_image artifacts so we can track it separately from the build failure.

     
  • Hanspeter Niederstrasser

    /sw is the default prefix for Fink, an OS X package manager, and that is what I used to get glpng (I'm the chromium-bsu (and many other packages) maintainer for Fink). Because Fink is not an Apple product, the Apple compilers obviously do not know to search for it unless the -L/sw/lib flag is explicitly provided to the compiler (either via the compiler command or a ENVVAR)

    I'll try to reproduce the SDL_image problem file it.

     
  • Paul Wise

    Paul Wise - 2016-09-06
    • status: open --> closed-fixed
    • assigned_to: Paul Wise
    • Group: -->
     
  • Paul Wise

    Paul Wise - 2016-09-06

    I've released version 0.9.16.1, which includes the new version of the AX_CHECK_GL macro and should fix your issue with Fink.

     
  • Hanspeter Niederstrasser

    Confirmed. Thanks.

     

Log in to post a comment.