Find attached how I usually build gnustep-base and my ulib on Ubuntu


export CC="/usr/bin/clang"
export CXX="/usr/bin/clang++"
export RUNTIME_VERSION="gnustep-2.1"
export OBJCFLAGS="-fblocks"
export GNUSTEP_INSTALLATION_DOMAIN="SYSTEM"

cmake  .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOLDABI_COMPAT=OFF -DBUILD_STATIC_LIBOBJC=1  -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_INSTALL_PREFIX=/usr -DGNUSTEP_CONFIG:FILEPATH=GNUSTEP_CONFIG-NOTFOUND

On 02.05.2024 21:02, Larry Campbell wrote:
This is on Ubuntu Focal. I have two stumbling blocks:

ANNOUNCE.2.1 says:

The submodule is available from:

https://github.com/Tessil/robin-map/archive/757de82.zip
https://github.com/Tessil/robin-map/archive/757de82.tar.gz

This will extract as robin-map-757de829927489bee55ab02147484850c687b620.
You must move the contents of that directory into third_party/robin_map in the
libobjc2 tree.


However, when I follow the instructions and say "cmake .." from the Build 
directory, I get this warning:

CMake Warning at CMakeLists.txt:118 (find_package):
   By not providing "Findtsl-robin-map.cmake" in CMAKE_MODULE_PATH this
   project has asked CMake to find a package configuration file provided by
   "tsl-robin-map", but CMake did not find one.

   Could not find a package configuration file provided by "tsl-robin-map"
   with any of the following names:

     tsl-robin-mapConfig.cmake
     tsl-robin-map-config.cmake

   Add the installation prefix of "tsl-robin-map" to CMAKE_PREFIX_PATH or set
   "tsl-robin-map_DIR" to a directory containing one of the above files.  If
   "tsl-robin-map" provides a separate development package or SDK, be sure it
   has been installed.
Am I missing a step?

The second problem is that I get this warning:

CMake Warning at CMakeLists.txt:6 (message):
   WARNING: It is strongly recommended that you compile with clang

The README.md file says:

If you have gcc and clang both installed, then cmake currently defaults to
selecting gcc.  You should override this by adding `-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++` to your Objective-C flags.

But where do I put these flags? Somewhere in CMakeLists.txt? In one of the 
numerous *.cmake files?

- lc

ulib under Ubuntu-24
-----------------------------

To user ulib with Linux you need to build your own gnustep installation
The ones shipped with the distributions is not supporting automatic
reference counting because its using the old objc runtime which does not support
ARC.

Here is how to get such a installation up and running under Debian 10 (codename 
Buster)


First we need some basic tools and repository's set up

apt-get install --assume-yes \
    apt-transport-https \
    openssh-client \
    vim \
    dirmngr \
    libsctp1 \
    lksctp-tools \
    acpid \
    wget \
    telnet \
    sudo \
    locales-all \
    net-tools


wget -4 -O - http://repo.gnustep.ch/key.asc  > 
/etc/apt/trusted.gpg.d/repo.gnustep.ch.asc
wget -4 -O - http://repo.universalss7.ch/debian/key.asc  > 
/etc/apt/trusted.gpg.d/repo.universalss7.ch.asc



DEBIAN_NICKNAME="noble"


1. Install depenencies
--------------------------
(run as root or use sudo in front)

 apt-get install build-essential git subversion  \
        clang  \
        libxml2 libxml2-dev \
        libffi8 libffi-dev\
        libuuid1 uuid-dev uuid-runtime \
        libsctp1 libsctp-dev lksctp-tools \
        libavahi-core7  libavahi-core-dev\
        libavahi-client3 libavahi-client-dev\
        libavahi-common3 libavahi-common-dev libavahi-common-data \
        libgcrypt20 libgcrypt20-dev \
        libtiff6 libtiff-dev \
        libbsd0 libbsd-dev \
        util-linux-locales \
        locales-all \
        libjpeg-dev \
        libcups2-dev  \
        libcairo2-dev \
        libxt-dev \
        libgl1-mesa-dev \
        libpcap-dev \
         swig \
        libedit-dev readline-common \
        binfmt-support libtinfo6 libncurses-dev\
        bison flex m4 wget \
        libicns1    libicns-dev \
        libxslt1.1  libxslt1-dev \
        libxft2 libxft-dev \
        libflite1 flite1-dev \
        libxmu6 libxpm4 wmaker-common\
        libgnutls28-dev gnutls-bin\
        libpng-dev libpng16-16\
        libreadline8 libreadline-dev \
        libgif7 libgif-dev libwings3 libwings-dev  libwutil5 \
        libcups2-dev \
        xorg \
        libfreetype6 libfreetype-dev \
        libpango1.0-dev \
        libcairo2-dev \
        libxt-dev libssl-dev \
        libasound2-dev libjack-dev libjack0 libportaudio2 libportaudiocpp0 
portaudio19-dev \
        wmaker cmake cmake-curses-gui \
        libwraster6 libwraster-dev \
        libicu74 libicu-dev \
        ninja-build \
        gobjc gobjc-10 \
        gobjc++ gobjc++-10 \
        libpq-dev libpq5 curl libcurl4-openssl-dev libc++-15-dev gcc-12 g++-12  
libstdc++6 \
        libmariadb-dev-compat libzmq5 libzmq3-dev mold






Download the sourcecode of gnustep and dependencies
---------------------------------------------------

    mkdir gnustep
    cd gnustep
    wget  http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz
    git clone https://github.com/apple/swift-corelibs-libdispatch
    git clone https://github.com/gnustep/scripts
    git clone https://github.com/gnustep/make
    git clone https://github.com/gnustep/libobjc2
    git clone https://github.com/gnustep/base
    git clone https://github.com/gnustep/corebase
    git clone https://github.com/gnustep/gui
    git clone https://github.com/gnustep/back
    ./scripts/install-dependencies-linux





Build  libiconv
-----------------

#   Note libiconv does not build if the compiler is set to clang or the linker 
to lld.

    wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz
    tar -xvzf libiconv-1.17.tar.gz
    cd libiconv-1.17
    CC=gcc LDFLAGS="-fuse-ld=gold" CXX="gcc++" CFLAGS="-fPIC" CPPFLAGS="-fPIC" 
./configure --enable-static --enable-dynamic
    make
    make install
    ./libtool --finish /usr/local/lib
    cd ..

# optional:
        make check

3. Setting some defaults
------------------------------------------------

export CC="/usr/bin/clang"
export CXX="/usr/bin/clang++"
export PREFIX="/usr"
export 
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${PREFIX}/bin"
export PKG_CONFIG_PATH="/usr/lib/pkgconfig/:/usr/local/lib/pkgconfig/"
export RUNTIME_VERSION="gnustep-2.1"
export OBJCFLAGS="-fblocks"
export CFLAGS="-I ${PREFIX}/include"
export LDFLAGS="-fuse-ld=gold"
export GNUSTEP_INSTALLATION_DOMAIN="SYSTEM"

mkdir -p ${PREFIX}/lib
mkdir -p ${PREFIX}/etc
mkdir -p ${PREFIX}/bin

    cd swift-corelibs-libdispatch
    mkdir build
    cd build
    cmake  -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} 
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
    make
    make install
#make test


5. install libobjc2 runtime

    cd libobjc2
    git submodule init
    git submodule update
    mkdir Build
    cd Build
/usr/bin/cmake  .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOLDABI_COMPAT=OFF 
-DBUILD_STATIC_LIBOBJC=1  -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} 
-DCMAKE_INSTALL_PREFIX=/usr  -DGNUSTEP_CONFIG:FILEPATH=GNUSTEP_CONFIG-NOTFOUND
    make
    make install

#make test
#usually fails on these:
#        19 - AssociatedObject_legacy (Subprocess aborted)
#        20 - AssociatedObject_legacy_optimised (Subprocess aborted)
# we dont care about backwards compatibility to libobjc1 anymore so its ok

    cd ..
    ldconfig


6. install gnustep-make

    cd make

    ./configure \
            --with-layout=gnustep \
            --disable-importing-config-file \
            --enable-native-objc-exceptions \
            --enable-objc-arc \
            --enable-install-ld-so-conf \
            --with-library-combo=ng-gnu-gnu \
            --with-config-file=/etc/GNUstep/GNUstep.conf \
            --with-user-config-file='.GNUstep.conf' \
            --with-user-defaults-dir='GNUstep/Library/Defaults' \
            --with-objc-lib-flag="-l:libobjc.so.4.6"

    make install
    source /etc/GNUstep/GNUstep.conf
    cd ..

        export PATH=/usr/GNUstep/System/Tools:$PATH

7. install gnustep-base


    cd base
    ./configure --with-config-file=/etc/GNUstep/GNUstep.conf \
        --with-libiconv-include=/usr/local/include \
        --with-libiconv-library=/usr/local/lib \
        --enable-pass-arguments \
        --enable-zeroconf \
        --enable-icu \
        --enable-libdispatch \
        --enable-nsurlsession

    make -j20
    make install
    ldconfig
#make check
    cd ..

(for debug version use "make debug=yes" instead of "make")


8. install gnustep-corebase

    cd corebase
    ./configure
    make -j8
    make install
    ldconfig
    cd ..


9.  If you want X11 GUI support in GnuStep install gnustep-gui

    cd gui
    ./configure
    make -j8
    make install
    ldconfig
    cd ..

10. install gnustep-back


    cd back
    source /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
    ./configure
    make -j8
    make install
    cd ..


11. install zeromq

        git clone https://github.com/zeromq/libzmq.git
        cd libzmq
        ./autogen.sh
        ./configure CFLAGS=-fPIC CXXFLAGS=-fPIC --enable-static --disable-shared
        make -j20
        make install

11. ulib
    git clone http://github.com/andreasfink/ulib
    cd ulib
    ./configure
    make
    make install
    ldconfig
    cd ..

12. webserver sample application
    git clone http://github.com/andreasfink/webserver
    cd webserver
    ./configure
    make
    make install



  • T... Larry Campbell
    • ... Andreas Fink via Discussion list for the GNUstep programming environment
    • ... Andreas Fink via Discussion list for the GNUstep programming environment

Reply via email to