GNUstep under Ubuntu Linux

From GNUstepWiki
Revision as of 18:30, 27 December 2012 by Pakl (talk | contribs) (Fixed missing quote)
Jump to navigation Jump to search
# Objective C 2.0 installation 
# On fresh install of Ubuntu 12.10 Server
# Patryk Laurent (http://pakl.net/)
# Dec 27, 2012

sudo aptitude install build-essential git subversion ninja cmake

svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd .. # Back to llvm directory
./configure --enable-optimized
make -j4  # Go off to prepare cup of coffee here.

export PATH=$PATH:~/llvm/Release+Asserts/bin  # Add to .bashrc
export CC=clang  # Add to .bashrc
clang -v

svn co http://svn.gna.org/svn/gnustep/modules/core
svn co http://svn.gna.org/svn/gnustep/libs/libobjc2/trunk libobjc2
cd core/make
./configure --enable-debug-by-default --with-layout=gnustep
make && sudo -E make install
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh # Add to .bashrc

sudo aptitude install gobjc   # Otherwise we get "cc1obj not found"
cd ../../libobjc2
mkdir build
cd build
cmake ..
make
sudo -E make install

cat > blocktest.m << EOF
#include <stdio.h>

int main() {
    void (^hello)(void) = ^(void) {
        printf("Hello, block!\n");
    };
    hello();
    return 0;
}
EOF

clang `gnustep-config --objc-flags` `gnustep-config --objc-libs` -fobj-arc -fobjc-nonfragile-abi -fblocks  -lobjc  blocktest.m