[Mono-osx] Building libgdiplus on OS X

Lee V.Andrus landrus2 at by-rite.net
Wed Jun 3 16:23:26 EDT 2009

I figured out the rest of how to build libgdiplus from the Subversion  
repository.  The problem below was not a failure to find the "m4"  
macros for the packages I cited--but a total failure to expand  
"AC_DEFUN()" macros in "libgdiplus/cairo/configure.in" caused by the  
lack of a "libtoolize" command.  Installing the Gnu libtool package  
fixed that.

Then I had to fix another couple of problems.  Making "libgdiplus/ 
cairo/src" was aborted by several error messages from "../libtool".   
Removing environment variables ACLOCAL_FLAGS="-I /usr/local/share/ 
aclocal" and ACLOCAL_PATH="/usr/local/share/aclocal" fixed that, but  
cause a check for "/usr/share/aclocal/pkg.m4" to abort "libgdiplus/ 
cairo/autogen.sh".  That check does not allow for the influence of a  
"dirlist" file on aclocal or the fact that ACLOCAL_FLAGS might not  
include "-I /tHE/dIR/cONTAINING/pKG.M4/".  I compromised by exporting  
ACLOCAL_FLAGS="-W all", which does nothing because it is the default  
for that option.

I should also mention some things I had already done.  I use "/usr/ 
local" as my "prefix".  Most of build utilities (including aclocal) I  
use are those in "/usr/bin", courtesy of Apple.  Because file "/usr/ 
share/aclocal/dirlist" contains the lines "
", aclocal also looks in those directories--making ACLOCAL_FLAGS="-I / 
usr/local/share/aclocal" redundant.  And any definition of environment  
variable DYLD_LIBRARY_PATH that in any way even includes "/usr/local/ 
lib" (as recommended in http://mono-project.com/Compiling_Mono_on_OSX)  
aborts several build tools or running a Mono assembly in a Terminal  
window with the error message:

   dyld: Symbol not found: __cg_png_create_info_struct
     Referenced from: /System/Library/Frameworks/ 
     Expected in: /usr/local/lib/libPng.dylib

   Trace/BPT trap

That dylib does not exist.  When I installed the libpng package, it  
created files and links with name matching "libpng*.dylib" instead.   
One of them differs from the "expected" only in the case of the "P".

> Lee V.Andrus landrus2 at by-rite.net
> Mon Jun 1 15:17:31 EDT 2009
> I have had the same problem with building the latest source from the  
> Subversion repository.  The utility "aclocal" cannot find several  
> ".m4" files containing the definitions of macros referenced by  
> "configure.in" that are supposed to enable "configure" to determine  
> if various packages are present.  So the raw text of some  
> "PKG_CHECK_MODULES" macro references wind up in "configure", where  
> they do no good.  Various methods can be used to tell aclocal where  
> additional files are, including defining environment variable  
> ACLOCAL_FLAGS="-I /another/folder/containing/m4/files" when running  
> "autogen.sh" or putting the folder pathnames in file "/usr/share/ 
> aclocal/dirlist", one per line.  type "info aclocal" in a Terminal  
> window for more info on aclocal.  Unfortunately, I have not been  
> able to find the missing ".m4" files for "xlib", "xlib_xrender",  
> "xcb", "png", "glitz", "GLITZ_AGL", "GLITZ_EGL", "GLITZ_GLX",  
> "GLITZ_WGL", "directfb", "FONTCONFIG", "FREETYPE", "POPPLER", and  
> "LIBRSVG".  And that is after I installed the "fontconfig" and  
> "freetype" packages.  Does anyone know where they can be found?
>> Alex Shulgin alexander.shulgin at yessoftware.com
>> Mon Jun 1 08:53:18 EDT 2009
>> Hi,
>> I had to built libgdiplus on OS X recently and must admit that this  
>> was
>> quite an experience.
>> So I'd love to see clear instructions from developers how is one
>> supposed to do that.  Also, if someone is trying to build it now or
>> later this might save him some time.
>> ...
>> I've also tried to build libgdiplus from trunk, but couldn't get past
>> configure step.
>> Yes, autogen.sh provided in trunk has --with-cairo=internal option  
>> (so I
>> don't need to hide installed cairo.pc), but configure fails at random
>> places while trying to locate dependencies (BASE_DEPENDENCIES, GTK,
>> etc.).  Setting ACLOCAL_PATH to current mono installation didn't  
>> help me
>> with this problem.
>> ...
>> --
>> Regards,
>> Alex

More information about the Mono-osx mailing list