On Tue, Jan 27, 2009 at 12:14 PM, Ruud Klaver <ruud at ag-projects.com> wrote: > 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 Wow, thanks! That worked. But if I do "make dep", then "make", I see this: $ make for dir in pjlib pjlib-util pjnath third_party pjmedia pjsip pjsip-apps; do \ if make -C $dir/build all; then \ true; \ else \ exit 1; \ fi; \ done make -f /Users/alexei/Development/pjproject-test/build/rules.mak APP=PJLIB app=pjlib ../lib/libpj-i386-apple-darwin9.6.0.a .pjlib-i386-apple-darwin9.6.0.depend:1: *** missing separator. Stop. make[1]: *** [pjlib] Error 2 make: *** [all] Error 1 Is that okay? Should I always use "make" and not "make dep && make" in that case? > Could you confirm that this works on PPC? Or do you want to compile for 1 > specific architecture only? My goal is to build universal binary. I just couldn't build it universal with one run, so I've been building for separate architectures and glueing binaries with lipo. I cannot test it on PPC though, and would be happy if someone will. > Ruud Klaver > AG Projects Regards, Alexei