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