1library-combo(7)             GNUstep System Manual            library-combo(7)
2
3
4

DESCRIPTION

6       This manual page is about cross-compilation and fat binaries. Fat bina‐
7       ries are packages that you can supply which contain more the one binary
8       of  your  program  (e.g. your application). So you can support multiple
9       platforms with a single package.
10
11       To support this your system has to be built  in  a  non-flattened  way.
12       Meaning  that  during  the installation of gnustep-make you should have
13       selected --disable-flattened and the types of library combinations  you
14       want  to support, through the --with-library-combo option. With library
15       combinations we mean the Objective-C runtime,  the  Foundation  library
16       and  the  Application  library.  For  more  details  about this see the
17       LIBRARY-COMBO section.
18
19       If you installed your GNUstep system in a non-flattened way all  system
20       dependend binaries are installed in subdirectories with cpu/os/library-
21       combo information.  That  means  for  instance  that  the  gnustep-base
22       library  will be installed in Library/Libraries/ix86/linux/gnu-gnu-gnu/
23       when you are on an Intel x86 system, running linux with the GNU runtime
24       for Objective-C and you installed GNUstep.
25
26       For  each  and  every library-combo that you want to support you should
27       create the environment through gnustep-make, because it installs a dif‐
28       ferent config.make to support its own CC, OPTFLAGS, etc. flags.
29
30   LIBRARY-COMBO
31       An important issue is to let to a package the ability to deal with var‐
32       ious libraries and configurations available now:
33
34       Objective-C runtimes
35              In the Objective-C world there are  three  major  runtimes:  the
36              NeXT  runtime,  the Apple runtime and the GNU runtime (both with
37              and without garbage collection enabled). They are  different  in
38              several respects and a program or library that works at the run‐
39              time level should be aware of them.
40
41       Foundation libraries
42              There are several Foundation libraries an  application  or  tool
43              can  be written on top of: NeXT Foundation library which runs on
44              NeXTStep/OPENSTEP systems, gnustep-base, libFoundation and Apple
45              Cocoa system.
46
47       Graphical interfaces
48              Until  now  three  libraries  provide or try to provide OpenStep
49              compliant systems: the AppKit from NeXT, gnustep-gui  and  Cocoa
50              from Apple.
51
52       If  a  program wants to work with all the possible combinations it will
53       have to provide different binaries for each  combination  because  it's
54       not possible to have a tool compiled for NeXT Foundation that runs with
55       gnustep-base or vice-versa. To summarize, a program can be compiled for
56       these combinations:
57
58       Objective-C runtime
59              nx  (for  NeXT), gnu (for GNU without garbage collection), gnugc
60              (for GNU with garbage collection), apple (for Apple)
61
62       Foundation library
63              nx (for NeXT), gnu (for gnustep-base), fd  (for  libFoundation),
64              apple (for Apple Cocoa)
65
66       GUI library
67              nx (for NeXT), gnu (for gnustep-gui), apple (for Apple Cocoa)
68
69       We'll  denote  the  fact that an application was compiled for a certain
70       combination of the above values by using the abbreviations of the  dif‐
71       ferent  subsystems  and  placing  dashes  between  them. For example an
72       application compiled for NeXT Foundation using NeXT  AppKit  will  have
73       the compile attribute nx-nx-nx. An application compiled for Apple Cocoa
74       with the GNU compiler for Objective-C gnu-apple-apple and  another  one
75       compiled  for gnustep-base using gnustep-gui under Unix will be denoted
76       by gnu-gnu-gnu. Here is a list of some of the possible combinations:
77
78          Runtime     Foundation     GUI
79            nx            nx         nx
80            nx            fd         gnu
81            gnu           gnu        gnu
82            gnu           fd         gnu
83           gnugc          gnu        gnu
84           gnugc          fd         gnu
85           apple         apple       apple
86           apple          gnu        gnu
87
88       Note that one can choose his/her own  packages  to  build;  it  is  not
89       required  to  have all the packages installed on the system. Not having
90       all of them installed limits only the ability to build  and  distribute
91       binaries for those missing combinations.
92
93
94   DIRECTORY STRUCTURE
95       For  cross-compilation in a non-flattened directory structure is recom‐
96       mended, so that you can store on the same directory structure  binaries
97       for different machines.  The standard GNUstep filesystem layout is nor‐
98       mally used when a non-flattened directory structure is being used; this
99       is  obtained  with  the  --with-layout=gnustep  option when configuring
100       gnustep-make.  The entire GNUstep installation is then  created  inside
101       /usr/GNUstep  (or another directory if you use the --prefix=...  option
102       when configuring  gnustep-make).   Directories  that  contain  binaries
103       (such  as  the Libraries directory) inside /usr/GNUstep are then set up
104       to support fat binaries as follows:
105
106       Libraries/
107         ix86/
108           linux-gnu/
109             gnu-gnu-gnu/
110                 libgnustep-base.so
111                 libgnustep-gui.so
112             gnu-fd-gnu/
113                 libFoundation.so
114                 libgnustep-gui.so
115
116       To allow the right libraries to be found, you need to source GNUstep.sh
117       before  using  GNUstep,  and  you  need to start up your application by
118       using openapp, which will locate the  right  binary  for  your  library
119       combo.
120
121   BUILDING FOR A LIBRARY-COMBO
122       The  makefile  package  will allow the user to choose between different
123       library combinations. To specify a combination you want to compile  for
124       just type:
125
126         $ make library_combo=library-combo
127
128       For instance if you want to choose to compile using the GNUstep's Foun‐
129       dation implementation and use the GNUstep GUI library  on  a  GNU/Linux
130       machine you can do like this:
131
132         $ make library_combo=gnu-gnu-gnu
133
134       If  your  project requires running configure before compiling there are
135       two issues you have to keep in mind. 'configure' is used  to  determine
136       the  existence of particular header files and/or of some specific func‐
137       tionality in the system header files. This thing  is  usually  done  by
138       creating  a  config.h  file  which  contains  a  couple of defines like
139       HAVE_... which say if the checked functionality is present or not.
140
141       Another usage of configure is to determine some specific  libraries  to
142       link  against  to and/or some specific tools. A typical GNUstep program
143       is not required to check for additional libraries because this step  is
144       done  by  the  time  the  makefile package is installed. If the project
145       still needs to check for additional libraries and/or tools, the  recom‐
146       mended way is to output a config.mak file which is included by the main
147       GNUmakefile, instead of using Makefile.in files which are  modified  by
148       configure.   The reason for not doing this is to avoid having the make‐
149       files contain target dependencies like above, this way keeping only one
150       makefile instead of several for each target machine.
151
152       The  makefile  package is written for GNU make because it provides some
153       very powerful features that save time both in writing the  package  but
154       also at runtime, when you compile a project.
155
156
157   BUILDING FOR AN ARCHITECTURE
158       In  order to build a project for multiple architectures you'll need the
159       development environment  for  the  target  machine  installed  on  your
160       machine.  This  includes  a  cross-compiler together with all the addi‐
161       tional tools like the assembler and linker, the target header files and
162       all the libraries you need.
163
164       The  GNUstep  makefile  package  should  be able to compile and link an
165       application for another machine just by typing
166
167         $ make target=target-triplet
168
169       where target-triplet is the canonical system name as reported  by  con‐
170       fig.guess.
171
172
173   USING A LIBRARY-COMBO
174       When  you  use library-combos, you must always source GNUstep.sh.  That
175       allows you to switch library paths on the fly. If you want to switch to
176       a  different  library-combo  in  your shell, and if you are using bash,
177       it's common to first source GNUstep-reset.sh to reset all  shell  vari‐
178       ables, then to source GNUstep.sh again. Let's assume we use gnu-gnu-gnu
179       as our current LIBRARY_COMBO and we want to  switch  to  gnugc-gnu-gnu,
180       then we would use:
181
182         . /usr/GNUstep/System/Library/Makefiles/GNUstep-reset.sh
183         export LIBRARY_COMBO=gnugc-gnu-gnu
184         . /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
185
186

SEE ALSO

188       debugapp(1), GNUstep(7), gnustep-config(1), openapp(1)
189
190

HISTORY

192       Work  on  gnustep-make  started in 1997 by Scott Christley <scottc@net-
193       community.com>.
194
195       Version 2.0.0 of gnustep-make introduced  many  changes  with  previous
196       releases,  which  was mainly the work of Nicola Pero <nicola.pero@meta-
197       innovation.com>
198
199

AUTHORS

201       This man-page was written by Dennis Leeuw <dleeuw@made-it.com> based on
202       the DESIGN document from the gnustep-make source tree.
203
204

CREDITS

206       The DESIGN document was written by Ovidiu Predescu.
207
208       This work could only be as is due to the notes and corrects from Nicola
209       Pero <nicola.pero@meta-innovation.com>.
210
211
213       Copyright (C) 2007 Free Software Foundation, Inc.
214
215       Copying and distribution of this file, with  or  without  modification,
216       are  permitted  in  any  medium  without royalty provided the copyright
217       notice and this notice are preserved.
218
219
220
221gnustep-make                      20/12/2007                  library-combo(7)
Impressum