Monday, January 20, 2014

Compiling objective-c 2.0 with Foundation on Freebsd 9.1

This was harder than xubuntu, so here is the corresponding how to.

1. Install necessary packages
pkg_add -r subversion
pkg_add -r libffi
pkg_add -r libicu
pkg_add -r nano

2. Install libobjc2
cd ~
mkdir tempSetup
svn co svn:// libobjc2
cd libobjc2
setenv CC /usr/bin/clang
setenv CXX /usr/bin/clang++

3. Install gnustep tools
cd ..
svn co svn:// make
cd make
./configure -enable-debug-by-default
gmake install

Note the output for the next step:

Creating system tools directory: /usr/local/bin
Creating makefile directories in: /usr/local/share/GNUstep/Makefiles
Installing GNUstep configuration file in /usr/local/etc/GNUstep/GNUstep.conf
Installing gnustep-make support software
Installing makefiles
Installing Test Framework scripts
Installing Test Framework support files

Installing (and compressing) manpages

chmod 755 ./usr/local/share/GNUstep/Makefiles/GNUstep.csh
echo ./usr/local/share/GNUstep/Makefiles/GNUstep.csh >> ~/.profile

4. Install gnustep base
cd ..
svn co svn:// base
cd base
./configure --disable-mixedabi CC=/usr/bin/clang CXX=/usr/bin/clang++
gmake install

5. Make a test program
cd ~
mkdir testapp
cd testapp
nano test.m
#import <Foundation/Foundation.h>
int main(int argc, const char *argv[])
   return 0;
exit nano and save

6. Create the makefile

nano GNUmakefile


include $(GNUSTEP_MAKEFILES)/common.make

TOOL_NAME = test
test_OBJC_FILES = test.m

include $(GNUSTEP_MAKEFILES)/tool.make

exit nano and save

11. Make and run the test
cd obj


No comments:

Post a Comment