GNUstep under Ubuntu Linux

From GNUstepWiki

(Difference between revisions)
Revision as of 18:12, 27 December 2012
Pakl (Talk | contribs)
Updated for CMake
← Previous diff
Revision as of 18:30, 27 December 2012
Pakl (Talk | contribs)
Fixed missing quote
Next diff →
Line 25: Line 25:
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh # Add to .bashrc . /usr/GNUstep/System/Library/Makefiles/GNUstep.sh # Add to .bashrc
-sudo aptitude install gobjc # Otherwise we get "cc1obj not found+sudo aptitude install gobjc # Otherwise we get "cc1obj not found"
cd ../../libobjc2 cd ../../libobjc2
mkdir build mkdir build

Revision as of 18:30, 27 December 2012

# 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