Samond Classes Library 1.2.6-STABLE build 219
Compiling and using library with the GNUstep project

Table of Contents

Since version 1.2.1 the library can be used for development of progmans for the operating systems that support Objective C and the GNUstep platform. In this section of the documentation we provide instructions for installing and using the library with the GNUstep platform. In the end of the section we provide instructions for setup GNUstep in different operating systems.


Supported platforms

Today the library supports the following operating systems:


System requirements

For compiling and using library your operating system must supports:

Also the following programs can be necessary for you:

Depending on an operating system and version of the GNUstep installation or compilation of the additional software can be demanded.

Also you must define an environment variables GNUSTEP_HEADERS_PATH, SCL_HEADERS_PATH and SCL_LIBRARY_PATH accoring to GNUstep installation guide for your operating system.


Getting source code

You can download a library source code by using one of the following methods:

If you want using a subversion then you can download current or stable version of the library by usine one of the following commands:

svn checkout https://svn.code.sf.net/p/sclmac/code/trunk sclmac
svn checkout https://svn.code.sf.net/p/sclmac/code/stable sclmac

Compilation and installation

After downloading and unpacking (if necessity) go to the directory with source code and execute a command:

gmake

If during compilation there are error or warning messages, it can mean the following:

After completion of compilation execute library installation by means of a command:

gmake install

Compatibility checking

The utility libtest is a special part of the library that executes check of compatibility of our code with architecture and operating system. This utility locates in the directory tests/libtest. Because in the intermediate versions this utility can differ from the release version, we give a source code of the utility main module:

#import <Foundation/Foundation.h>
#import <scl/scl.h>
#import "SCTestCases.h"
#import "SCTestDelegate.h"
#import "SCTestClass.h"
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
@try {
// Run all compatibility test cases
SCTestCases *testCases = [SCTestCases testCases];
[testCases runTestCases];
}
@catch (SCException *error) {
NSLog( @"%@", error.description);
NSLog( @"========================================================================");
NSLog( @"Error Code: %d", error.code);
NSLog( @"Error ID: %@", error.eid);
NSLog( @"========================================================================");
}
@catch (NSException *error) {
NSLog( @"%@", error.description);
NSLog( @"========================================================================");
NSLog( @"Error name: %@", error.name);
NSLog( @"Error reason: %@", error.reason);
NSLog( @"User info: %@", error.userInfo);
}
[pool drain];
return 0;
}

For compilation and running of the utility execute the following commands:

cd tests/libtest
gmake
obj/libtest

The utility executes sequence of tests, each of which is result of OK or FAILED. The architecture and operating system are compatible to library if results of all tests is OK. If any yesy returns FAILED value, we recommend this result to send us to the address samon.nosp@m.d@ma.nosp@m.c.com.

Results of the tests for the compatible systems can be obtained at the following links:


Using library in applications

For library use you need to execute the following actions:

Warning! If you are using other libraries, include them into the option ADDITIONAL_OBJC_LIBS.

We give the example of the GNUmakefile for the simple application consisting of several source files:

include $(GNUSTEP_MAKEFILES)/common.make
include $(SCL_HEADERS_PATH)/scl.make
TOOL_NAME = libtest
libtest_OBJCFLAGS += -Wno-objc-protocol-method-implementation
libtest_HEADERS = SCTestCases.h SCTestDelegate.h SCTestClass.h
libtest_OBJC_FILES = SCTestCases.m SCTestDelegate.m SCTestClass.m libtest.m
libtest_RESOURCE_FILES =
ADDITIONAL_OBJC_LIBS += -lscl
include $(GNUSTEP_MAKEFILES)/tool.make

GNUstep setup

Section contains the simple installation and configuration guide for the GNUstep platform and other necessary components under the tested operating systems. A completed installation guide can be obtained from a GNUstep official site. Detailed information about other components installation you can get from the operating system manual or official documentation.


FreeBSD

For installation of the GNUstep platform and the additional software on the FreeBSD we recommend to use build-in packages system, because the installation from a ports or sources takes a lot of time. To install a minimum necessary software execute the following commands:

pkg install gnustep
pkg install gmake
pkg install subversion

After completion of installation it's necessary to configure the GNUstep environment:


DragonFly BSD

For installation GNUstep on the DragonFly BSD you must execute the following commands:

pkg install clang38
pkg install gnustep
pkg install gmake
pkg install subversion

After completion of installation it's necessary to configure the GNUstep environment:


PCBSD/TrueOS

Operating system TrueOS TrueOS (previous name PCBSD) can be installed in two cases:

For setup GNUstep in the desktop version you must execute the following commands:

pkg install gnustep
pkg install gmake

If you install GNUstep for a server version execute the following commanfs:

pkg install subversion
pkg install gnustep
pkg install gmake

After completion of installation it's necessary to configure the GNUstep environment:


OpenBSD

Before installing a GNUstep platform on the operating system OpenBSD you must define an environment variable PKG_PATH that defines a path to a packages repository.

In these examples it is necessary to specify the following parameters:

X.X - OpenBSD verson number (6.1 for example)
YYYY - system architecture, such as i386 or x86_64

For isntallation execute the following commands:

pkg_add subversion
pkg_add gmake
pkg_add gnustep-make
pkg_add gnustep-base
pkg_add gnustep-gui
pkg_add gnustep-back
pkg_add llvm
mkdir -p /usr/local/Local/Library
ln -s /usr/local/include /usr/local/Local/Library/Headers
ln -s /usr/local/lib /usr/local/Local/Library/Libraries

After completion of installation it's necessary to configure the GNUstep environment:


NetBSD

Originally in an operating system NetBSD we planned to use GNUstep from packets as a part of system, however during testing was clarified that this version of a platform is cut strongly down - into its composition doesn't enter Objective C 2.0 therefore a row of necessary functions doesn't work. It this regard installation of the platform needs to be main from its cource codes.

Before installing you must define an environment variable PKG_PATH that defines a path to a packages repository:

In these examples it is necessary to specify the following parameters:

XXXX - system architecture, such as i386 or x86_64
Y.Y - NetBSD verson number (7.1 for example)

Before platform installation you must install the following required packages:

pkg_add gmake
pkg_add subversion
pkg_add fetch
pkg_add libiconv
pkg_add libxslt
pkg_add gnutls
pkg_add icu
pkg_add jpeg
pkg_add tiff
pkg_add clang

For platform installation you must configure environment variables CC and LD_LIBRARY_PATH:

Attention! If you need to specify some paths to the variable LD_LIBRARY_PATH, then a path /usr/local/lib must be specified as a first path, otherwise there can be problems with an executable files linking.

You must build from a source codes the following GNUstep components:

gnustep-make
libobjc2
gnustep-base
gnustep-gui
gnustep-back

Attention! After compiling and installing a libobjc2 library you must reconfigure and reinstall a gnustep-make package.

We give an example of downloading and building of these components:

fetch ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-make-2.7.0.tar.gz
tar -xvzf gnustep-make-2.7.0.tar.gz
cd gnustep-make-2.7.0
./configure
gmake install
cd ..
fetch https://github.com/gnustep/libobjc2/archive/v1.8.1.tar.gz
tar -xvzf v1.8.1.tar.gz
cd libobjc2-1.8.1
gmake
gmake install
cd gnustep-make-2.7.0
./configure
gmake install
cd ..
fetch ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-base-1.25.0.tar.gz
tar -xvzf gnustep-base-1.25.0.tar.gz
cd gnustep-base-1.25.0
./configure
gmake
gmake install
cd ..
fetch ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-gui-0.25.1.tar.gz
tar -xvzf gnustep-gui-0.25.1.tar.gz
cd gnustep-gui-0.25.1
./configure
gmake
gmake install
cd ..
fetch ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-back-0.25.1.tar.gz
tar -xvzf gnustep-back-0.25.1.tar.gz
cd gnustep-back-0.25.1
./configure
gmake
gmake install
cd ..

After completion of installation it's necessary to configure the GNUstep environment:


Debian Linux

For setup GNUstep in the operating system Debian Linux download one of the following scripts:

This script downloads and installs all necessary packages.

After completion of installation it's necessary to configure the GNUstep environment:


Fedora Linux

For setup GNUstep in the operating system Fedora Linux download and execute one of the following scripts:

This script downloads and installs all necessary packages.

After completion of installation it's necessary to configure the GNUstep environment:


Arch Linux

For setup GNUstep in the operating system Arch Linux download and execute the following script:

This script downloads and installs all necessary packages.

After completion of installation it's necessary to configure the GNUstep environment:


Red Hat Enterprise Server

For setup GNUstep in the operating system Red Hat Enterprise Server download and execute the following script:

This script downloads and installs all necessary packages.

After completion of installation it's necessary to configure the GNUstep environment:

x


Oracle Linux

For setup GNUstep in the operating system Oracle Linux download and execute one of the following scripts:

This script downloads and installs all necessary packages.

After completion of installation it's necessary to configure the GNUstep environment:


Ubuntu Linux

For setup GNUstep in the operating system Ubuntu download one of the following scripts:

This script downloads and installs all necessary packages.

After completion of installation it's necessary to configure the GNUstep environment: