Dear Maurice
Date: Wed, 21 Nov 2012 19:28:34 +0100 From: Maurice Lombardi Maurice.Lombardi@ujf-grenoble.fr Subject: Re: addition of a Mac OS X / X11 target to GRX To: grx@gnu.de Message-ID: 50AD1D52.5070804@ujf-grenoble.fr Content-Type: text/plain; charset=ISO-8859-1; format=flowed
By the way, if symlinks to it are added as I explained in my last message is it necessary to give all names inside the dylib for this to work ?
Adriaan already answered that.
The comma after "-install_name" needs to be a blank in macosx.diff:
- $(CC) $(LDOPT) -dynamiclib -install_name,$(libdir)/$(notdir $(GRX20SHna)) -headerpad_max_install_names -o $(GRX20SHna) $(LO) $(ADDON_LIBS) $(X11LIBS) + $(CC) $(LDOPT) -dynamiclib -install_name $(libdir)/$(notdir $(GRX20SHna)) -headerpad_max_install_names -o $(GRX20SHna) $(LO) $(ADDON_LIBS) $(X11LIBS)
As such the install_name is what most expect and is fine. In case fink reviewers want a change, I will deal with this within the package description.
I also tried the fat options. In general, they work. However, when I did -arch ppc, 2 small glitches showed up:
1) src/include/grx20.h, line 112: there is one unmatched ")" at the end of the line:
-#if defined(unix) || defined(__unix) || defined(__unix__) || defined(_AIX) || (defined(__APPLE__) && defined(__MACH__)) ) +#if defined(unix) || defined(__unix) || defined(__unix__) || defined(_AIX) || (defined(__APPLE__) && defined(__MACH__))
2) src/fonts/fdv_raw.c: error: fhdr has no member length. I think it is a leftover from earlier and therefore I simply deleted line 53:
- _GR_swap32u(&fhdr.length);
-arch ppc64 compiled, but there is an error during link, because of missing libraries. If I recall correctly, it is not supported on 10.6 and i would have to try on 10.5. I am not sure, whether it is worth to put more work into this.
I started to have a look at the pascal headers and examples using freepascal. I needed some additional defines in grx.pas for fpc, but it is not too bad. I think no extra version for fpc is needed and a first version is ready. Right now, I am at the examples. With a small mod, the first example compiled, but I think it did not work 100%. I need more tests on this. I noticed that some examples use the gpc unit. I have to check for a replacement.
A common issue in several examples is the use of binary numbers. fpc does not have the same way as gpc. My first fix is this:
{$ifdef fpc} c := GrAllocColor(c and %11100000,(c and %11100) shl 3, (c and %11) shl 6); {$else} c := GrAllocColor(c and 2#11100000,(c and 2#11100) shl 3, (c and 2#11) shl 6); {$endif}
It would be nice, if gpc could handle % for binary numbers. Maybe the makefile for the examples needs an extension for examples that work with gpc only.
Michael