This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Objective-C and Cygwin (at WIN32)


          Hello!
    Christopher noticed here 
<http://sources.redhat.com/ml/cygwin/2001-09/msg01224.html> and I'd like 
to share my experience in building gcc with Objective-C support.

    Besides of changes for objc itself I had to make some additional 
work to compile gcc. This changes are listed below for them who are 
interested in it.

    1. First I got installed the latest distro of cygwin. And downloaded
    gcc-2.95.3 sources from http://gcc.gnu.org
    2. Patched windef.h line 123
            -#ifndef XFree86Server
            +#if !defined(XFree86Server) && !defined(IN_GCC)
        My comment: line 122 comment shows the unclear status of
    following code.
    3. got gthr-win32.h from gcc-3.0.1 distro into gcc directory. It
    fits OK :-)
    4. (in short) $(GCC_SRC)/configure --prefix=/usr
    --enable-threads=win32 --enable-languages=c,c++,objc && make
    bootstrap && make install

After building 2.95.3 I also tried 3.0.1 version and tested them with 
testsuite of gcc-3.0.1
Here are results of tests for built 2.95.3 and 3.0.1 compilers along 
with the latest version of MinGW compiler (2.95.3-6 (mingw special) ):
testname    MinGW 2.95.3-6    Cygwin 2.95.3    Cygwin 3.0.1
bf-20       -                    -                +
class-10    -                    +                +
class-11    -                    +                +
class-14    -                    +                +
formal_protocol-6    -           -                -
object_is_class    -             -                +
object_is_meta_class    -        -                +
    Other tests passed ok.

    I also succeded with compilation of libobjc as shared lib (DLL). For 
this purpose I got several files from gnustep-objc 
<ftp://ftp.gnustep.org/pub/gnustep/libs/gnustep-objc-1.0.1.tar.gz> 
(particulary GNUmakefile and whole "config" dir), added "NXConstStr.m" 
to libobjc_OBJC_FILES list (GNUmakefile line 63) and built with make 
shared=yes. (This needs gnustep-make be installed). Tests yielded 
similar results as with static libobjc.a. Additionaly I had to add 
several lines to libobjc.def:
****
objc_condition_allocate
objc_condition_deallocate
objc_condition_wait
objc_condition_broadcast
objc_set_thread_callback
__objc_msg_forward
objc_layout_structure
objc_layout_structure_next_member
objc_layout_finish_structure
objc_layout_structure_get_info
****
Note: __objc_msg_forward ONLY for gcc-3.0.1

    The only negative result I obtained is GNUstep. I stuck with 
gnustep-base. It is compiled ok but has runtime error for every app 
using Foundation lib. But it seems like gnustep's problem as GCC's 
testsuite passes allright.


I hope this is enough for returning Obj-C back again in Cygwin.
Regards, Ildar.


P.S. Here are steps (for those who are interested) I did to compile GCC. 
They are more like dirty hacks but still:
4. do ../gcc-2.95.3/configure --prefix=/usr --enable-threads=win32 
--enable-languages=c,c++,objc
5. gcc/Makefile:620
        -INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config 
-I$(srcdir)/../include
        +INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config 
-I$(srcdir)/../include -I/usr/include/w32api
6. i686-pc-cygwin32\libobjc\Makefile:76
        -  -I$(srcdir)/$(MULTISRCTOP)../include
        +  -I$(srcdir)/$(MULTISRCTOP)../include -I/usr/include/w32api



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]