gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] Re: GCL working on MacOS X


From: Camm Maguire
Subject: Re: [Gcl-devel] Re: GCL working on MacOS X
Date: 20 Jul 2003 13:58:47 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings, and thanks for your submission!

1) Do you know about Fink?  Is there a gcl currently in Fink?

2) Would you like to volunteer to maintain this port?  We could set
   you up as a gcl developer on savannah.

3) Is there a possibility of setting up an autobuilder for this port
   once it gets rolling?  That way binaries can be made available on
   the ftp site.  An autobuilder would simply be someone's machine
   connected to the internet with a cron job which would build new
   releases and place them in some publicly accessible place.

4)  I've committed your three files in CVS head.  

5) Comments on your patches below.

Take care,

Aurelien Chanudet <address@hidden> writes:

> Hi all,
> 
> Sorry for the delay replying, I was away for one week. The main
> difficulty in getting GCL to work on Mac OS X relates to the
> peculiarities of Mac OS X executable file format. The executable
> format on Mac OS X (named Mach-O) is based on that of NeXT but the two
> executable formats are not exactly similar. In a nutshell, I had to
> deal with two machine dependent issues :
> 
> The first one involves unexecing. I first tried out with the code in
> NeXTunixsave.c but this didn't work. As it turned out, Emacs, which
> has been ported to Mac OS X thanks to the work of Christian Swinehart,
> has unexec too and I just had to apply Christian's patches to obtain a
> working version of unexec for GCL (see attached file).
> 
> The second one involves fasloading. bfd does not seem to be supported
> on Mac OS X. dlopening, although available as a convenience, is not
> regarded as the preferred way to load code dynamically on Mac OS X.
> I'm currently working on this and I'm unable to say anything more at
> this stage.
> 
> Below is a list of the patches I've made so far. For my own
> convenience, I've inserted some -I and -L flags straight into
> o/makefile and unixport/makefile. Attached are the files
> powerpc-macosx.{h,defs} that I'm using along with the code for unexec
> grabbed from Emacs sources. I'm giving the following arguments to
> configure :
> --enable-machine=powerpc-macosx --enable-dlopen --disable-statsysbfd.
> 
> Any feedback is appreciated :-)
> 
> Aurelien
> 
> --- o/makefile.old Mon Jan 13 06:34:55 2003
> +++ o/makefile Mon Jul 14 20:00:48 2003
> @@ -9,7 +9,7 @@
>  MPDIR = ../mp
>  
>  #OFLAG = -O
> -DEFS = -I../h -I../gcl-tk
> +DEFS = -I../h -I../gcl-tk -I/sw/include
>  ODIR = .
>  GCLIB = ${ODIR}/gcllib.a
>  RANLIB=ranlib
> 

You can accomplish this with the environment variable C_INCLUDE_PATH.
In any case, too specific to your setup to be committed.

> 
> --- unixport/makefile.old Thu Mar 20 16:29:39 2003
> +++ unixport/makefile Mon Jul 14 19:57:38 2003
> @@ -17,6 +17,7 @@
>  
>  libgclp.a: $(ODIR)/gcllib.a
>         cp $< $@
> + ranlib $@
>  

Is this necessary?

>  gmpfiles: $(shell find ../$(GMPDIR) -name "*.o" |grep -v '\.lib')
>         rm -rf gmp
> @@ -80,15 +81,16 @@
>  init_%.lsp: init_%.lsp.tmp
>  
>         cat $< | sed \
> - -e "s,@LI-VERS@,(`cat ../majvers`.`cat ../minvers`) `date`,1" \
> - -e "s,@LI-MINVERS@,`cat ../minvers`,1" \
> - -e "s,@LI-MAJVERS@,`cat ../majvers`,1" \
> - -e "s,@LI-CC@,\"$(CC) -c $(FINAL_CFLAGS)\",1" \
> - -e "s,@LI-LD@,\"$(CC) -o \",1" \
> - -e "s,@LI-LD-LIBS@,\"$(LD_LIBS_PRE) -l$* $(LD_LIBS_POST)\",1" \
> - -e "s,@LI-OPT-THREE@,\"$(O3FLAGS)\",1" \
> - -e "s,@LI-OPT-TWO@,\"$(O2FLAGS)\",1" \
> - -e "s,@LI-INIT-LSP@,\"address@hidden",1" >$@
> + -e "s,@LI-VERS@,(`cat ../majvers`.`cat ../minvers`) `date`," \
> + -e "s,@LI-MINVERS@,`cat ../minvers`," \
> + -e "s,@LI-MAJVERS@,`cat ../majvers`," \
> + -e "s,@LI-CC@,\"$(CC) -c $(FINAL_CFLAGS)\"," \
> + -e "s,@LI-LD@,\"$(CC) -o \"," \
> + -e "s,@LI-LD-LIBS@,\"$(LD_LIBS_PRE) -l$* $(LD_LIBS_POST)\"," \
> + -e "s,@LI-OPT-THREE@,\"$(O3FLAGS)\"," \
> + -e "s,@LI-OPT-TWO@,\"$(O2FLAGS)\"," \
> + -e "s,@LI-INIT-LSP@,\"address@hidden"," >$@
> +# on MacOS X, `sed' chockes on the flag (`1') that terminates the
> substitution pattern
>  

Your 'sed' doesn't take a third argument?


>  saved_%:raw_% $(RSYM) init_%.lsp \
>                 $(CMPDIR)/cmpmain.lsp \
> @@ -108,7 +110,9 @@
>  
>  libgcl.a: $(FIRST_FILE) $(OBJS) sys_gcl.o $(LAST_FILE) gmpfiles
> bfdfiles
>         rm -rf $@
> - ar rs $@ $(filter %.o,$^) $(shell find gmp bfd -name "*.o")
> +# `ar rs' doesnt work on MacOS X for such a long file list (dont know
> what the issue is)
> +# this one is Apple's libtool, not to be confused with GNU libtool
> (shipped as glibtool)
> + libtool -static -o $@ $(filter %.o,$^) $(shell find gmp bfd -name
> "*.o")
>  

Perhaps it might be better to break the .o files up into a groups and
loop over the ar rs?  What is the max length yours can handle?  Not
sure we should depend on libtool.  Could make a configure option, but
these are already crowded.

>  libxgcl.a: libgcl.a
>         ln -snf $< $@
> @@ -123,7 +127,7 @@
>  
>  raw_%: lib%.a libgclp.a $(SYSTEM_OBJS) $(EXTRAS)
>         $(CC) -o raw_$*$(EXE) $(filter %.o,$^) \
> - -L. $(EXTRA_LD_LIBS) $(LD_LIBS_PRE) -l$* $(LD_LIBS_POST)
> + -L. -L/sw/lib $(EXTRA_LD_LIBS) $(LD_LIBS_PRE) -l$* $(LD_LIBS_POST)
>  

Again, for your specific setup, at least with gcc, you can accomplish
this with the environment variable LIBRARY_PATH.

>  clean:
>         rm -rf saved_*$(EXE) raw_*$(EXE) *.o core a.out $(RSYM) \
> 
> 
> --- usig.c.old Tue Feb 18 03:32:03 2003
> +++ usig.c Mon Jul 14 19:59:29 2003
> @@ -127,7 +127,7 @@
>      sigprocmask( SIG_UNBLOCK,&set,0);
>    }
>  #else
> - current_mask = sigblock(0);
> + int current_mask = sigblock(0);
>    return sigsetmask(~(sigmask(SIGIO))&~(sigmask(SIGUSR1)) &
> current_mask);
>  #endif
>  }
> 
> 

Done.  Thanks!

> --- unixtime.c.old Sat Feb 15 01:38:28 2003
> +++ unixtime.c Mon Jul 14 20:40:07 2003
> @@ -71,8 +71,10 @@
>  #include <sys/times.h>
>  #endif
>  #include <sys/time.h>
> +#ifndef DARWIN
>  static struct timeb beginning;
> -#endif
> +#endif /* DARWIN */
> +#endif /* BSD */
>  
>  #ifdef ATT
>  #include <sys/times.h>
> @@ -213,7 +215,12 @@
>  init_unixtime(void)
>  {
>  #ifdef BSD
> +#ifndef DARWIN
> +/* On MacOS X, ftime is obsoleted by gettimeofday. It is available
> from the
> + compatibility library, libcompat. But I don't have libcompat on my
> box.
> + Besides, there seems to be no need for `beginning' when `BSD' is
> defined. */
>         ftime(&beginning);
> +#endif /* DARWIN */
>  #endif
>  #ifdef ATT
>         beginning = time(0);
> 

Done equivalent.  Thanks!

Take care,

> 
> 
>  
> 
>  
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]