List Info

Thread: Compiling Objective-C sources under Mac OS X




Compiling Objective-C sources under Mac OS X
user name
2006-08-30 00:01:14
Steve <rev_benny_hinn <at> yahoo.com> writes:

> I've tried registering .m files with the
darwin.compile.c generator, 
> but when bjam runs I get a large number of complaints
from g++ - 
> it appears to think that SDLMain.m is a c++ file as
opposed to 
> an Objective-C file.  I think I should be using gcc
instead, 
> but am not sure how to write the appropriate jam code.


Think I've managed to get this working.  I hadn't noticed
that you can 
use the '-x' flag to tell g++ which language it's
compiling.

I added the following lines to darwin.jam:

#
------------------------------------------------------------
# BEGIN Insertion into darwin.jam
#
------------------------------------------------------------

type.register M : m ;

generators.register-c-compiler darwin.compile.m 
  : M : OBJ : <toolset>darwin ;

rule compile.m
  { LANG on $(<) = "-x objective-c" ; }

actions compile.m
  { "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS)
$(USER_OPTIONS) -D$(DEFINES)
-I"$(INCLUDES)" -c -o "$(<)"
"$(>)" }

#
------------------------------------------------------------
# END Insertion into darwin.jam
#
------------------------------------------------------------


Can anyone tell me if I've done this correctly?


Cheers,
Steve

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Compiling Objective-C sources under Mac OS X
user name
2006-08-30 06:32:59
On Wednesday 30 August 2006 04:01, Steve wrote:
> Steve <rev_benny_hinn <at> yahoo.com>
writes:
> > I've tried registering .m files with the
darwin.compile.c generator,
> > but when bjam runs I get a large number of
complaints from g++ -
> > it appears to think that SDLMain.m is a c++ file
as opposed to
> > an Objective-C file.  I think I should be using
gcc instead,
> > but am not sure how to write the appropriate jam
code.
>
> Think I've managed to get this working.  I hadn't
noticed that you can
> use the '-x' flag to tell g++ which language it's
compiling.
>
> I added the following lines to darwin.jam:
>
> #
------------------------------------------------------------
> # BEGIN Insertion into darwin.jam
> #
------------------------------------------------------------
>
> type.register M : m ;
>
> generators.register-c-compiler darwin.compile.m
>
>   : M : OBJ : <toolset>darwin ;
>
> rule compile.m
>   { LANG on $(<) = "-x objective-c" ; }
>
> actions compile.m
>   { "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS)
$(USER_OPTIONS) -D$(DEFINES)
> -I"$(INCLUDES)" -c -o "$(<)"
"$(>)" }
>
> #
------------------------------------------------------------
> # END Insertion into darwin.jam
> #
------------------------------------------------------------
>
>
> Can anyone tell me if I've done this 

Hi Steeve,
I think this is just fine. Would you like me to add this to
mainline?
 
If so, the preferred way is to send a patch. The hacking.txt
file describes 
the submission details. Note that our preferred coding style
puts braces on a 
line by themself.  Ah, and I'd also need your full name to
properly give you 
credit in changelog.

If you have no time for sending a patch, let me know and
we'll integrate the 
changes ourself.


-- 
Vladimir Prus
http://vladimir_pru
s.blogspot.com
Boost.Build V2: http://boost.org/boost-
build2
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )