the language machine on Mac OS X 10.4 - LMachine.xcodeproj.zip (1/1)

Me Me_member at pathlink.com
Mon Feb 20 06:31:23 PST 2006


In article <dtc54c$1e7j$1 at digitaldaemon.com>,
 Peri Hankey <mpah at thegreen.co.uk> wrote:

> ar cru lib/.libs/liblm.a
...
> > The synopsis of ar differs between gnu and apple version.
> 
> I'll have to find out how to deal with this - should be handled by 
> autoconf etc presumably.
> 
> > Anyway what ar is supposed to do?
> 
> ar combines object files in a library ar-chive.
yes, but it's called without input files
> > And why do you put the libraries in an hidden directory?
> 
> I hacked some existing build scripts which worked this way. You can do a 
> local non-root build and install as follows:
> 
> WHERE_TO_INSTALL=full-path-to-somewhere-you-can-write-to
> cd the-directory-that-was-unpacked-from-the-tarball
> ./configure --prefix=$WHERE_TO_INSTALL; make install
>
Good.
> > 
> > The good news are getting a working copy of lm is simple:
> > compile all sources and then link the right pieces.
> > Note: Working means executes fpCalc.
> 
> Great - but presumably these are statically linked? It looks as if I 
> need to provide an option for static linking.
>
> Thanks again.
> Peri

Those were statically linked but today I made also a dynamically linked 
version:

compiled using

gdc -fversion=Posix -fversion=darwin -fbounds-check 
-femit-templates=auto -Isrc -O3 -c -o $something.o $something.d
   
   I think options before -Isrc are not needed, but I did not test

linked using

gdc -o $somewhere/liblm.dylib -L/usr/lib/gcc40 $files_to_link -arch ppc 
-Wl,-single_module -compatibility_version 1 -current_version 1 
-install_name /usr/local/lib/liblm.dylib -dynamiclib

   for liblm.dylib
   -install_name is where dyld looks for the library that is where it 
must be installed

libtool -static -arch_only ppc -o $somewhere/liblmtcc.a -L/usr/lib/gcc40 
$files_to_link

   for liblmtcc.a [not a dynamic library]
   libtool is in the standard tool of the AppleDeveloperTools, not the 
script but probably both call ar and ranlib

gdc -o $tool_name -llm -arch ppc $files_to_link

   for lm lmn2_
   you'll get "warning multiple definitions of symbol __Dmain" but works.


important things are
 -O3 building else stops compiling lmb.d with strange assemler errors 
caused by line 15 (I suppose)
 -L/usr/lib/gcc40 else fails because doesn't find libgcc_s


I made also an Xcode project see attachments but requires a proper 
configuration of the Xcode IDE to use GDC. I used GNUDCompiler.xcplugin 
but other solutions may work.
To use it just put it in 
the-directory-that-was-unpacked-from-the-tarball.
Enjoy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: LMachine.xcodeproj.zip
Type: application/zip
Size: 9296 bytes
Desc: not available
Url : http://lists.puremagic.com/pipermail/d.gnu/attachments/20060220/c1a9a856/attachment.zip 


More information about the D.gnu mailing list