Todd Plessel wrote:
> How can I compile a Mac Universal Binary version of the library?
The following on the configure line works for me:
./configure --enable-debug \
CXXFLAGS="-arch i386 -arch ppc" \
LDFLAGS="-arch i386 -arch ppc" \
CFLAGS="-arch i386 -arch ppc"
make clean
make
That worked with 1.3.x.
Results are univ bins for libs + test programs:
# file test/cube
test/cube: Mach-O universal binary with 2 architectures
test/cube (for architecture i386): Mach-O executable i386
test/cube (for architecture ppc): Mach-O executable ppc
If that doesn't work, the tell us:
1) which version of FLTK?
2) Paste the 'Compiling Fl.cxx..' lines after *first* commenting out
the .SILENT from fltk/makeinclude, so we can see the actual compile
line and arguments (g++ ...) during the Fl.cxx build.
> CFLAGS=CXXFLAGS=-g -arch ppc -arch ppc 64 -arch i686 -arch x86_64
Hmm, a few things about the above line you're showing us:
* There surely shouldn't be a space between "ppc" and "64".
* I'm not sure about i686 or x86_64; on my OSX system 'man g++' says:
-arch arch
Compile for the specified target architecture arch. The allowable
values are i386, ppc and ppc64.
-------------------
..so unless you have extra packages installed, I don't know that
i686 or x86_64 are valid. But if they weren't, configure should
fail right away, before you even get to 'make'.
* On my OSX Tiger system, "ppc64" doesn't work, but "ppc" does.
(Maybe ppc64 works in Leopard, I don't know offhand)
* Maybe the above "CFLAGS=CXXFLAGS=.." line was meant as pseudo-code,
but just in case it wasn't, that line won't work as shown in the
configure line or a bourne shell.
For a working configure line, see my first example above.
For an equivalent set of bourne shell lines, be sure to use
'export', eg:
export CXXFLAGS="-arch ppc -arch i386"
export LDFLAGS="-arch ppc -arch i386"
export CFLAGS="-arch ppc -arch i386"
./configure --enable-debug
make clean
make
I prefer the configure line to exported environment variables,
since the env vars could unexpectedly persist when compiling
other packages in that same shell.
* Although the '-g' flag should be OK, you probably should use
"configure --enable-debug" instead of supplying "-g" in the flags
so that FLTK builds with the correct 'debug' target names for the
libs.
(This way you can have both debug and release versions of the lib)
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk