\input texinfo   @c -*-texinfo-*-
@c GNUstep installation instructions
@c %**start of header
@setfilename gnustep-howto.info
@settitle GNUstep HOWTO
@c %**end of header
@set HOWTO
@setcontentsaftertitlepage
@smallbook

@titlepage
@title GNUstep HOWTO
@subtitle Installing the GNUstep developement system

@vskip 0pt plus 1filll
@emph{This document explains how to build the different components of
the GNUstep core libraries.}

Last Update: @today{}

@page
@vskip 0pt plus 1filll
Copyright @copyright{}  1996 - 2002 Free Software Foundation, Inc.
   
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation.

@end titlepage

@ifinfo
@format
   GNUstep HOWTO
   *************

   Last Update: @today{}

   This document explains how to build the different components of the
   GNUstep core libraries and GNUstep Launchpad.

   Copyright (C) 1996 - 2002 Free Software Foundation, Inc.
   
   Permission is granted to copy, distribute and/or modify this document
   under the terms of the GNU Free Documentation License, Version 1.1 or
   any later version published by the Free Software Foundation.
@end format

@end ifinfo

@include version.texi

@node Top, Introduction, (dir), (dir)

@menu
* Introduction::                
* Preliminaries::               
* Compiling and Installing::    
* Additional Installation::     
* Tools and Applications::      
* Machine Specific::            
* Anonymous CVS::               
@end menu

@node Introduction, Preliminaries, Top, Top
@chapter Introduction

This document explains how to build the GNUstep core libraries.  The
core libraries, along with associated tools and other files provide
everything necessary for a working GNUstep system. 

In order to easily compile and debug GNUstep projects, you will need the
GNU Objective-C compiler @samp{GCC} as well as various other GNU packages.

You will need at least 80Mb of hard disk space (150Mb prefered) in order
to compile the GNUstep core libraries.  

@node Preliminaries, Compiling and Installing, Introduction, Top
@chapter Summary

In order to compile the libraries, you need to compile and install
the following packages first (if you don't already have them):

@itemize @bullet
@item gcc (Version 2.95 or greater, 3.0.4 or greater recommended)
@item GNU make (Version 3.75 or greater)
@item gdb, if you plan to do any debugging
@end itemize

You may also need to install some of the following libraries and
packages described below. Most of these packages are optional, but some
are required.

@table @samp
@item ffcall libraries (HIGHLY RECOMMENDED)
This is a library that provides stack-frame handling for NSInvocation
and NSConnection. This library is highly recommended. The previous
builtin method for stack frame handling is no longer supported and may
be removed in the future.  ffcall is under GNU GPL. As a special
exception, if used in GNUstep or in derivate works of GNUstep, the
included parts of ffcall are under GNU LGPL.

@item libffi library (OPTIONAL)
This is a library that provides stack frame handling for NSInvocation
and NSConnection similar to ffcall. However, libffi is not as well tested
as ffcall so you should not use it unless you are familiar with 
potential problems. Use this instead of ffcall. You don't need both.

@item WindowMaker (Version >= 0.62) (OPTIONAL)
GNUstep and WindowMaker work together to provide a consistant interface.
Although it is not required, GNUstep will work much better if you use it
with the WindowMaker window manager. In addition, WindowMaker includes some
functionality that GNUstep uses that would otherwise not be available.
Get WindowMaker from @url{http://www.windowmaker.org}.

@item libxml2 (RECOMMENDED)
The libxml library (Version 2) is used to translate some of the
documentation for GNUstep and to provide suport for MacOS-X compatible
XML-based property-lists. It is recommended but not currently required.

@item The TIFF library (libtiff) (Version 3.4beta36 or greater) (REQUIRED)
The GUI library uses this to handle loading and saving TIFF images.

@item openssl (OPTIONAL)
The openssl library is used to provide support for https connections by
the NSURL and HSURLHandle classes.  This functionality is
compiled as a separate bundle since the OpenSSL license is not
compatible with GPL, and in the hopes that if someone writes an openssl
replacement, it can quickly be used by creating another bundle.

@item libiconv (OPTIONAL)
Unicode support functions (iconv) come with glibc version 2.1 or greater. If
you don't have glibc (try iconv --version), you can get the separate 
libiconv library from 
@url{http://clisp.cons.org/~haible/packages-libiconv.html}. However,
neither one is required to use GNUstep.

@item gnustep-objc package (for gcc version < 3.0 ONLY) (RECOMMENDED)
This is a special version of the Objective-C runtime that include several
bug fixes and features that were not in gcc versions previous to 3.0.
It is available at @url{ftp://ftp.gnustep.org/pub/gnustep/libs} which
compiles using the GNUstep Makefile package (so you don't have to get the
entire gcc dist). Make sure to set the THREADING variable in the GNUmakefile.
It's possible to compile the library static (make shared=no) and
just copy to the place where the gcc libobjc library is (type gcc -v to
get this location). Note you have to install gnustep-make (below) before
installing this library.

@item GDB and Objective-C patch (OPTIONAL)
GDB can be obtained from @url{ftp://ftp.gnu.org/gnu/gdb}. The patch to
make it work better with GNUstep can be obtained from
@url{ftp://ftp.gnustep.org/pub/gnustep/patches}
    
@item TeX (OPTIONAL)
You need a TeX implementation, like tetex, to compile some of the
documentation (although most of that is available on the web).
@end table

@node Compiling and Installing, Additional Installation, Preliminaries, Top
@chapter Compiling and Installing the packages

Get the following individual packages:

@itemize @bullet
@item gnustep-make
@item gnustep-base
@item gnustep-gui
@item gnustep-back
@end itemize

See @url{http://www.gnustep.org} for information on where to get these
packages. 

Make sure you install all the previously mentioned libraries first
before configuring and building GNUstep.

You should be able to install these packages as root.

For installation on specific systems, read the machine specific
instructions at the end of this document or appropriate README files in
the gnustep-make Documentation directory (such as README.MingW for Windows).

@menu
* Core Package::                
@end menu

@node Core Package,  , Compiling and Installing, Compiling and Installing
@section Installing the Core Libraries

The GNUstep packages uses the Autoconf mechanism for
configuration; it checks some host capabilties which are used by
all GNUstep software.  To configure just type:

@example
./configure
@end example

The GNUstep makefile package needs a root directory.  If the
GNUSTEP_SYSTEM_ROOT environment variable is set then configure will
determine the root directory from its value (by removing the final
/System path component from it).  You can also specify the root 
directory when you run configure with the prefix paramater; the 
following command makes /usr/local/GNUstep the root directory:

@example
./configure --prefix=/usr/local/GNUstep
@end example

If you do not have the GNUSTEP_SYSTEM_ROOT environment variable set
and you do not specify a root directory when running configure, then
configure will use /usr/GNUstep as the default root directory.

@menu
* Alternate Library Setup::     
* Individual Packages::         
@end menu

@node Alternate Library Setup, Individual Packages, Core Package, Core Package
@subsection Alternate Library Setup

Read the installation instructions in the Makefile package (make) for more
installation options. Make sure you use the same
configuration options when configuring each GNUstep library.

@node Individual Packages,  , Alternate Library Setup, Core Package
@subsection Building the Package

To build the individual packages, use this familiar set of commands for
each pacakge (add any additional options you decide upon):

@example
./configure
make
make install
@end example

Start with the Makefile Pacakge (gnustep-make). After installing
gnustep-make you need to execute GNUstep's shell configuration
script, as follows:

@example
 . /usr/GNUstep/System/Makefiles/GNUstep.sh
@end example

before proceeding any further. 

NOTE for gcc 2.X or MinGW users: Now install gnustep-objc. Before building
gnustep-objc, edit the @file{GNUmakefile} and set the @var{THREADING}
variable to the thread library used on your system (usually its posix,
but you can leave it at single if you don't need threads). At this point
you should probably re-configure, make and install gnustep-make, so it
can pick up on any threading information that gnustep-objc provides.

Now install gnustep-base, gnustep-gui and finally gnustep-back.

NOTE: If you are trying to install the packages without root permission,
you may need to change one thing in the base library. Edit the file
gnustep-base/Tools/gdomap.h to uncomment the last line and modify
the specified port number to a port which you @emph{know} is not in use on
your network.  You should only do this if absolutely necessary since
making this change will break communications with any systems where
an identical change has not been made.  Also, the standard gdomap port
is the one officially registered with IANA and is reserved for use by
gdomap - it should only be changed if you can't get your system
administrator to start the gdomap server using it.

@node Additional Installation, Tools and Applications, Compiling and Installing, Top
@chapter Additional Installation

@menu
* Environment Setup::           
* GNUstep Home::                
* Time Zone::                   
* GNUstep deamons::             
@end menu

@node Environment Setup, GNUstep Home, Additional Installation, Additional Installation
@section Environment Setup
Add the shell script @file{GNUstep.sh} located in the Makefile
package to your shell startup file (such as @file{.profile}). For instance,
if your GNUSTEP_SYSTEM_ROOT is @file{/usr/GNUstep/System},

@example
. /usr/GNUstep/System/Makefiles/GNUstep.sh
@end example

in your @file{.profile} file will work (Note the period at the beginning
of the line, and the space between the period and the following path; 
if your GNUSTEP_SYSTEM_ROOT is different, you need to replace 
@file{/usr/GNUstep/System} with your GNUSTEP_SYSTEM_ROOT).
It defines environment variables that are needed to find
GNUstep files and executables.  Users of csh need to use the
@file{GNUstep.csh} script. Read the make package @file{README} for more
info. Some systems, like GNU/Linux have an @file{/etc/profile.d}
directory where scripts can be executed automatically. If you want to
set up GNUstep for every user on your system, you can try
copying/linking the @file{GNUstep.sh} there. For csh or tcsh, try

@example
source /usr/GNUstep/System/Makefiles/GNUstep.csh
@end example

@node GNUstep Home, Time Zone, Environment Setup, Additional Installation
@section GNUstep Home

Set up your home GNUstep directory. This should be done automatically
if you don't do it. This is where user defaults are kept as well as
other user configuration files. User installed apps, libraries, etc
are also here (if the default user directory is used).

@example
cd
mkdir GNUstep
@end example

@node Time Zone, GNUstep deamons, GNUstep Home, Additional Installation
@section Time Zone

Next, set your local time zone.  There are four ways to do this, pick
one (see
@file{$GNUSTEP_SYSTEM_ROOT/Library/Libraries/Resources/gnustep-bsae/NSTimeZones/zones} for
typical time zones):

@enumerate
@item Use the defaults utility to set ``Local Time Zone'' to your local
time zone (defaults is installed with GNUstep in the Tools directory). Type
something like ``defaults write NSGlobalDomain "Local Time Zone" GB''.

@item Set the @var{GNUSTEP_TZ} environment variable.

@item Create the file @file{$GNUSTEP_SYSTEM_ROOT/Library/Libraries/Resources/gnustep-base/NSTimeZones/localtime} with the name of the local time zone in it.

@item Set the @var{TZ} environment variable (this may conflict with other
software on your system though).
@end enumerate

@node GNUstep deamons,  , Time Zone, Additional Installation
@section GNUstep deamons

Set up your system to execute some GNUstep deamons. If you don't do
this, they will be started automatically when you run your first GNUstep
app:

@itemize @bullet
@item gdomap - Put this in a system startup file, like @file{/etc/rc.local} or @file{/etc/rc.d/rc.local} (customize for your system)
@example
GNUSTEP_SYSTEM_ROOT=/usr/GNUstep/System
if [ -f $GNUSTEP_SYSTEM_ROOT/Tools/ix86/linux-gnu/gdomap ]; then
  $GNUSTEP_SYSTEM_ROOT/Tools/ix86/linux-gnu/gdomap
fi
@end example
@item gdnc - Start after sourcing @file{GNUstep.sh} (e.g. in .profile)
@item gpbs - Same as with gdnc, make sure X-Windows is running.
@end itemize

@example
if [ `gdomap -L GDNCServer | grep -c Unable` == 1 ]; then
  echo "Starting GNUstep services..."
  gdnc
  gpbs
fi
@end example


@node Tools and Applications, Machine Specific, Additional Installation, Top
@chapter Test Tools and Applications

Test programs for the base library are in @file{base/Testing}. Example
applications are located in the gstep-examples package.  To make these,
just uncompress and untar this package, cd to the appropriate
directory, and type make. You will need to install the GNUstep core libraries
first before doing this.

To run the examples. Use the openapp utility that is part of the GNUstep
makefile package (and stored in
@file{$GNUSTEP_SYSTEM_ROOT/Tools}). Usage is:

@example
openapp application [additional arguments to app]
@end example

Good Luck!

@node Machine Specific, Anonymous CVS, Tools and Applications, Top
@chapter Machine Specific Instructions

@include machines.texi


@node Anonymous CVS,  , Machine Specific, Top
@chapter Getting Libraries via Anonymous CVS

If you didn't get one of the snapshots, or if you want to be sure to
stay on the bleading edge, then you should get the libraries via CVS. Go
to @url{http://savannah.gnu.org/cvs/?group_id=99} for information on how
to get anonymous CVS access.

If you haven't already done so, change to the directory, where you
want the source to reside. To get a list of potential modules to check out,
type
@example
cvs -z3 checkout -c
@end example

For instance, to check our @file{core}, which contains all the GNUstep
code libraries:
@example
cvs -z3 checkout core
@end example

After you have checked out the source you can compile it as
usual. To update the source, go into the directory of the source tree
you want to update, for example, go into 'base', and type:

@example
cvs -z3 update -Pd
@end example

You don't have to re-checkout after you have the source, just update!

@bye
\bye
