Building for both i386 and ppc on Intel Mac

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alexei,

On 27 Jan 2009, at 09:41, Benny Prijono wrote:

> On Thu, Jan 22, 2009 at 10:08 AM, Alexei Kuznetsov  
> <eofster at gmail.com> wrote:
> Hi,
>
> One of the mailing list subscribers sent me a message with proper
> ./configure parameters for cross-compiling for PowerPC Macs being on
> Intel Mac:
>
> ./configure --host=powerpc-apple-darwin9 --build=powerpc
>
> By I still have to manually modify rules.mak (in the quote) when I
> switch the build system back and forth.
>
>
> Did you mean patching the RANLIB thing? Actually what is the value  
> of $(RANLIB) there? Normally "ranlib" shouldn't need other  
> parameters than the archive filename.
>
>
> Can you suggest something to automate this? Of course I could just
> apply patches in some script, but is there a right way by adding some
> .mak file or something else just for cross-compilation for ppc?
>
>
> Apart from the suspicious ranlib, I think this should have been  
> supported by existing script.
>
> cheers
>  Benny
>
>
> Alexei
>
> On Tue, Jan 20, 2009 at 9:17 PM, Alexei Kuznetsov  
> <eofster at gmail.com> wrote:
> > Hi,
> >
> > I'm on Intel Mac and trying to build pjproject-1.0.1 for both i386  
> and
> > ppc platforms.
> >
> > Building for i386 is okay with ./configure && make dep && make.
> >
> > When I'm trying to configure for ppc, I'm getting this:
> > $ ./configure --host=powerpc-apple-darwin9 CFLAGS="-arch ppc"
> > aconfigure: WARNING: you should use --build, --host, --target
> > checking build system type... powerpc-unknown-none
> > checking host system type... powerpc-apple-darwin9
> > checking target system type... powerpc-unknown-none
> > checking for powerpc-apple-darwin9-gcc... powerpc-apple-darwin9-gcc
> > checking for C compiler default output file name... aconfigure:  
> error:
> > C compiler cannot create executables
> > See `config.log' for more details.
> >
> > If I change configure to acounfigure with the same parameters,
> > configuration runs to the end
> > $ ./configure --host=powerpc-apple-darwin9 CFLAGS="-arch ppc"
> >
> > Then I run "make dep", and then "make" which stops with that:
> > ranlib: file: ../lib/libpj-powerpc-apple-darwin9.a(pool_dbg.o) has  
> no symbols
> > powerpc-apple-darwin9-ranlib ../lib/libpj-powerpc-apple-darwin9.a
> > make[2]: powerpc-apple-darwin9-ranlib: Command not found
> > make[2]: *** [../lib/libpj-powerpc-apple-darwin9.a] Error 127
> > make[1]: *** [pjlib] Error 2
> > make: *** [all] Error 1
> >
> > Then I'm editing build/rules.mak file as follows (changing one  
> line):
> > $ svn diff
> > Index: build/rules.mak
> > ===================================================================
> > --- build/rules.mak     (revision 2412)
> > +++ build/rules.mak     (working copy)
> > @@ -77,7 +77,7 @@
> >  $(LIB): $(OBJDIRS) $(OBJS) $($(APP)_EXTRA_DEP)
> >        if test ! -d $(LIBDIR); then $(subst @@,$(subst
> > /,$(HOST_PSEP),$(LIBDIR)),$(HOST_MKDIR)); fi
> >        $(AR) $(LIB) $(OBJS)
> > -       $(RANLIB) $(LIB)
> > +       $(RANLIB) -o $(LIB) $(OBJS)
> >
> >  $(EXE): $(OBJDIRS) $(OBJS) $($(APP)_EXTRA_DEP)
> >        if test ! -d $(BINDIR); then $(subst @@,$(subst
> > /,$(HOST_PSEP),$(BINDIR)),$(HOST_MKDIR)); fi
> >
> >
> > And "make" runs till the end.
> >
> > Am I doing something wrong? Or what can I do not to edit rules.mak
> > file evey time I'm switching the build system from i386 to ppc and
> > vice versa?
> >
> > Best regards,
> > Alexei
> >

This is what I've been doing to make a universal binary on i386 OS X:

CFLAGS="-arch ppc -arch i386" ./configure
make

Could you confirm that this works on PPC? Or do you want to compile  
for 1 specific architecture only?

Ruud Klaver
AG Projects



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux