Skip to content

Instantly share code, notes, and snippets.

@rainzoo
Created July 5, 2012 19:04
Show Gist options
  • Select an option

  • Save rainzoo/3055727 to your computer and use it in GitHub Desktop.

Select an option

Save rainzoo/3055727 to your computer and use it in GitHub Desktop.

Revisions

  1. rainzoo revised this gist Jul 5, 2012. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Makefile
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,5 @@ GNUSTEP_LOCAL_HEADERS=/usr/GNUstep/Local/Library/Headers
    GNUSTEP_LOCAL_LIBRARIES=/usr/GNUstep/Local/Library/Libraries
    FLAGS = -lgnustep-base -fconstant-string-class=NSConstantString

    hello: $(CC) -o hello hello.m -I $(GNUSTEP_LOCAL_HEADERS) -L $(GNUSTEP_LOCAL_LIBRARIES) $(FLAGS)
    all: hello.m
    $(CC) -o hello hello.m -I $(GNUSTEP_LOCAL_HEADERS) -L $(GNUSTEP_LOCAL_LIBRARIES) $(FLAGS)
  2. rainzoo created this gist Jul 5, 2012.
    8 changes: 8 additions & 0 deletions Hello.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #import <Foundation/Foundation.h>

    int main (int argc, const char *argv[])
    {
    @autoreleasepool {
    NSLog(@"Hello World");
    }
    }
    6 changes: 6 additions & 0 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    CC = clang
    GNUSTEP_LOCAL_HEADERS=/usr/GNUstep/Local/Library/Headers
    GNUSTEP_LOCAL_LIBRARIES=/usr/GNUstep/Local/Library/Libraries
    FLAGS = -lgnustep-base -fconstant-string-class=NSConstantString

    hello: $(CC) -o hello hello.m -I $(GNUSTEP_LOCAL_HEADERS) -L $(GNUSTEP_LOCAL_LIBRARIES) $(FLAGS)
    57 changes: 57 additions & 0 deletions ObjectiveC_Ubuntu.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    sudo apt-get install subversion
    sudo apt-get install g++
    sudo apt-get install gobjc
    sudo apt-get install vim
    sudo apt-get install curl
    sudo apt-get install libffi-dev
    sudo apt-get install libxml2-dev
    sudo apt-get install libicu-dev
    sudo apt-get install libgnutls-dev
    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 ../projects
    svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
    cd ../../
    mkdir build
    cd build
    ../llvm/configure --enable-optimized
    make
    sudo make install
    cd ../
    curl http://www.openssl.org/source/openssl-1.0.1-beta3.tar.gz > openssl-1.0.1-beta3.tar.gz
    # Ignore the bit about openssl if you don't need a
    # recent one, I needed more recent than ubuntu's package manager provides
    tar xvfz openssl-1.0.1-beta3.tar.gz
    cd openssl-1.0.1-beta3
    ./config
    make
    sudo make install
    cd ..
    svn co http://svn.gna.org/svn/gnustep/tools/make/trunk/ gnustep-make
    svn co http://svn.gna.org/svn/gnustep/libs/base/trunk/ gnustep-base
    svn co http://svn.gna.org/svn/gnustep/libs/libobjc2/1.6/ libobjc2
    cd gnustep-make
    ./configure --prefix=/usr/GNUstep --enable-native-objc-exceptions
    --with-layout=gnustep
    --with-config-file=/usr/GNUstep/Local/Configuration/GNUstep.conf
    make
    sudo make install
    vim ~/.bashrc # Add . /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
    exit # And reopen shell
    ./configure --with-openssl-include=/usr/local/ssl/include --with-openssl-library=/usr/local/ssl/lib/ --enable-libffi --with-default-config=/usr/GNUstep/Local/Configuration/GNUstep.conf
    make
    sudo -E make install
    cd ../libobjc2
    export CC=clang
    make
    sudo -E make install
    cd ../gnustep-make
    ./configure --prefix=/usr/GNUstep --enable-native-objc-exceptions --with-layout=gnustep --with-config-file=/usr/GNUstep/Local/Configuration/GNUstep.conf
    sudo make install
    cd ../gnustep-base
    make clean
    ./configure --with-openssl-include=/usr/local/ssl/include --with-openssl-library=/usr/local/ssl/lib/ --enable-libffi
    --with-default-config=/usr/GNUstep/Local/Configuration/GNUstep.conf
    make
    sudo -E make install