www.digitalmars.com         C & C++   DMDScript  

D.gnu - the language machine on Mac OS X 10.4

reply Peri Hankey <mpah thegreen.co.uk> writes:
I was wondering if anyone had tried to build my language machine on Mac 
OS X 10.4?

If one takes the tar.gz source for a package that builds on intel/amd 
linux, what has to be done to build it on Mac after installing  xcode 
and gdcmac? Or is it still just ./configure and make?

I don't at present have access to OS X 10.4, but I know of someone who 
might want to try the language machine on OS X and hope that I can 
steamroller a roadhump or two that might lie in his path. So if anyone 
has done this or would like to give it a try, I would be very pleased to 
know more.

Regards to all
Peri Hankey
-- 
http://languagemachine.sourceforge.net - The language machine
Feb 15 2006
parent reply Me <Me_member pathlink.com> writes:
In article <dsushi$nkn$1 digitaldaemon.com>, Peri Hankey says...
I was wondering if anyone had tried to build my language machine on Mac 
OS X 10.4?

If one takes the tar.gz source for a package that builds on intel/amd 
linux, what has to be done to build it on Mac after installing  xcode 
and gdcmac? Or is it still just ./configure and make?

there are two problems: -shared //warning urecognized option and ar cru lib/.libs/liblm.a ar: no archive members specified usage: ar -d [-TLsv] archive file ... ar -m [-TLsv] archive file ... ar -m [-abiTLsv] position archive file ... ar -p [-TLsv] archive [file ...] ar -q [-cTLsv] archive file ... ar -r [-cuTLsv] archive file ... ar -r [-abciuTLsv] position archive file ... ar -t [-TLsv] archive [file ...] ar -x [-ouTLsv] archive [file ...] make[1]: *** [lib/liblm.la] Error 1 make: *** [all] Error 2 MAKE EXITS HERE The synopsis of ar differs between gnu and apple version. Anyway what ar is supposed to do? And why do you put the libraries in an hidden directory? 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.
Feb 19 2006
parent reply Peri Hankey <mpah thegreen.co.uk> writes:
Thanks very much for responding - very helpful.

Me wrote:
 In article <dsushi$nkn$1 digitaldaemon.com>, Peri Hankey says...
 
I was wondering if anyone had tried to build my language machine on Mac 
OS X 10.4?

If one takes the tar.gz source for a package that builds on intel/amd 
linux, what has to be done to build it on Mac after installing  xcode 
and gdcmac? Or is it still just ./configure and make?

there are two problems: -shared //warning urecognized option

oops. No shared libraries? or just different options?
 
 and
 
 ar cru lib/.libs/liblm.a
 ar: no archive members specified
 usage:  ar -d [-TLsv] archive file ...
 ar -m [-TLsv] archive file ...
 ar -m [-abiTLsv] position archive file ...
 ar -p [-TLsv] archive [file ...]
 ar -q [-cTLsv] archive file ...
 ar -r [-cuTLsv] archive file ...
 ar -r [-abciuTLsv] position archive file ...
 ar -t [-TLsv] archive [file ...]
 ar -x [-ouTLsv] archive [file ...]
 make[1]: *** [lib/liblm.la] Error 1
 make: *** [all] Error 2
 MAKE EXITS HERE
 
 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.
 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
 
 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 -- http://languagemachine.sourceforge.net - The language machine
Feb 20 2006
parent reply Me <Me_member pathlink.com> writes:
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

In article <dtc54c$1e7j$1 digitaldaemon.com>,
 Peri Hankey <mpah 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.

 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

 
 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
Feb 20 2006
parent Peri Hankey <mpah thegreen.co.uk> writes:
Me wrote:
 In article <dtc54c$1e7j$1 digitaldaemon.com>,
  Peri Hankey <mpah 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

Maybe because the -shared flag didn't work, so no .so files, so apparently called without any 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:

Aha! looks useful.
 
 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
 

More to look into :(
 
 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.

Had you seen this? http://www.alanz.com/d/xcode/ I came across it this morning - might be useful?
 To use it just put it in 
 the-directory-that-was-unpacked-from-the-tarball.
 Enjoy
 

Thanks again Peri -- Peri Hankey mpah thegreen.co.uk +44-1865-300740 http://languagemachine.sourceforge.net - The language machine
Feb 20 2006