Difference between revisions of "GNUstep under Ubuntu Linux"

From GNUstepWiki
Jump to navigation Jump to search
(Updated for CMake)
(Fixed missing quote)
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