]> err.no Git - sope/blob - gnustep-make/target.make
added -increaseSequence
[sope] / gnustep-make / target.make
1 #
2 #   target.make
3 #
4 #   Determine target specific settings
5 #
6 #   Copyright (C) 1997 Free Software Foundation, Inc.
7 #
8 #   Author:  Scott Christley <scottc@net-community.com>
9 #   Author:  Ovidiu Predescu <ovidiu@net-community.com>
10 #
11 #   This file is part of the GNUstep Makefile Package.
12 #
13 #   This library is free software; you can redistribute it and/or
14 #   modify it under the terms of the GNU General Public License
15 #   as published by the Free Software Foundation; either version 2
16 #   of the License, or (at your option) any later version.
17 #   
18 #   You should have received a copy of the GNU General Public
19 #   License along with this library; see the file COPYING.LIB.
20 #   If not, write to the Free Software Foundation,
21 #   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23 # This file should not contain any conditional based on the value of
24 # the 'shared' variable, because we have not set it up yet when this
25 # file is processed!
26
27 #
28 # Host and target specific settings
29 #
30 ifeq ($(findstring solaris, $(GNUSTEP_TARGET_OS)), solaris)
31 X_INCLUDES := $(X_INCLUDES)/X11
32 endif
33
34 #
35 # Target specific libraries
36 #
37 TARGET_SYSTEM_LIBS = $(CONFIG_SYSTEM_LIBS) -lm
38 ifneq ("$(objc_threaded)","")
39   INTERNAL_CFLAGS = -D_REENTRANT
40   INTERNAL_OBJCFLAGS = -D_REENTRANT
41   AUXILIARY_OBJC_LIBS += $(objc_threaded)
42 ifeq ($(shared), no)
43   TARGET_SYSTEM_LIBS += $(objc_threaded)
44 endif
45 endif
46
47 ifeq ($(findstring mingw32, $(GNUSTEP_TARGET_OS)), mingw32)
48   TARGET_SYSTEM_LIBS := $(CONFIG_SYSTEM_LIBS) \
49         -lws2_32 -ladvapi32 -lcomctl32 -luser32 -lcomdlg32 \
50         -lmpr -lnetapi32 -lm -I. # the -I is a dummy to avoid -lm^M
51 endif
52 ifeq ($(findstring cygwin, $(GNUSTEP_TARGET_OS)), cygwin)
53   TARGET_SYSTEM_LIBS := $(CONFIG_SYSTEM_LIBS) -lm -I. 
54 endif
55 ifeq ($(findstring solaris, $(GNUSTEP_TARGET_OS)), solaris)
56   TARGET_SYSTEM_LIBS := $(CONFIG_SYSTEM_LIBS) -lsocket -lnsl -lm
57 endif
58 ifeq ($(findstring sysv4.2, $(GNUSTEP_TARGET_OS)), sysv4.2)
59   TARGET_SYSTEM_LIBS := $(CONFIG_SYSTEM_LIBS) -lsocket -lnsl -lm
60 endif
61
62 #
63 # Specific settings for building shared libraries, static libraries,
64 # and bundles on various systems
65 #
66
67 #
68 # For each target, a few target-specific variables need to be set.
69 #
70 # The first one is SHARED_LIB_LINK_CMD - which should be set to the
71 # command(s) to use to link a shared library on that platform.  Please
72 # note that the variables (stuff like $(CC)) in it are not expanded
73 # until SHARED_LIB_LINK_CMD is actually used (STATIC_LIB_LINK_CMD is
74 # the equivalent variable, used for static libraries).
75 #
76 # SHARED_LIB_LINK_CMD will be used to link standard shared libraries,
77 # and frameworks.  It should use the following variables (which are set
78 # by library.make or framework.make before executing
79 # SHARED_LIB_LINK_CMD) to refer to what it needs to link (please note
80 # that STATIC_LIB_LINK_CMD will also use these variables with similar
81 # meanings; but not all of them, as noted):
82 #
83 #  LIB_LINK_OBJ_DIR: where the newly created library should be. 
84 #    Usually GNUSTEP_OBJ_DIR for libraries, and FRAMEWORK_LIBRARY_DIR_NAME 
85 #    for frameworks.
86 #  LIB_LINK_VERSION_FILE: the final file to create, having full
87 #     version information: typically `libgnustep-base.so.1.5.3' for shared
88 #     libraries, and `libgnustep-base.a' for static libraries.
89 #  LIB_LINK_SONAME_FILE: this is only used for shared libraries; it 
90 #    should be passed in the -Wl,-soname argument of most linkers when 
91 #    building the LIB_LINK_VERSION_FILE. Typically `libgnustep-base.so.1' 
92 #    (but might also be `libgnustep-base.so.1.0' if INTERFACE_VERSION
93 #    has been manually changed when using library.make).  On many
94 #    platforms, it's appropriate/standard to also create this file as
95 #    a symlink to LIB_LINK_VERSION_FILE.  If LIB_LINK_VERSION_FILE is
96 #    the same as LIB_LINK_SONAME_FILE, then the symlink should not be
97 #    created.
98 #  LIB_LINK_FILE: this is only used for shared libraries; it should
99 #    be created as a symlink to LIB_LINK_VERSION_FILE (or to 
100 #    LIB_LINK_SONAME_FILE if it's created on that platform).
101 #    Typically `libgnustep-base.so'.
102 #  LIB_LINK_INSTALL_NAME: on some platforms, when a shared library is
103 #    linked, a default install name of the library is hardcoded into
104 #    the library.  This is that name.
105 #
106 # AFTER_INSTALL_SHARED_LIB_CMD provides commands to be executed after
107 # installation (at least for libraries, not for frameworks at the
108 # moment), and is supposed to setup symlinks properly in the
109 # installation directory.  It uses the same variables, except for
110 # LIB_LINK_INSTALL_DIR which is the full final path to where the
111 # library (and symlinks) is going to be installed.
112 #
113 # AFTER_INSTALL_STATIC_LIB_CMD is similar.
114 #
115
116 # For frameworks on unusual platforms, you might also need to set
117 # EXTRACT_CLASS_NAMES_COMMAND.  This should be a command which is
118 # evaluated on $(object_file) and returns a list of classes
119 # implemented in the object_file.  Our default command is the
120 # following (you can override it with another one in your target's
121 # section if you need), which runs 'nm' on the object file, and
122 # retrieve all symbols of the form __objc_class_name_NSObject which
123 # are not 'U' (undefined) ... an __objc_class_name_NSObject is defined
124 # in the module implementing the class, and referenced by all other
125 # modules needing to use the class.  So if we have an
126 # __objc_class_name_XXX which is not 'U' (which would be a reference
127 # to a class implemented elsewhere), it must be a class implemented in
128 # this module.
129 #
130 # The 'sed' command parses a set of lines, and extracts lines starting
131 # with __objc_class_name_XXXX Y, where XXXX is a string of characters
132 # from A-Za-z_. and Y is not 'U'.  It then replaces the whole line
133 # with XXXX, and prints the result. '-n' disables automatic printing
134 # for portability, so we are sure we only print what we want on all
135 # platforms.
136 EXTRACT_CLASS_NAMES_COMMAND = nm -Pg $$object_file | sed -n -e '/^__objc_class_name_[A-Za-z_.]* [^U]/ {s/^__objc_class_name_\([A-Za-z_.]*\) [^U].*/\1/p;}'
137
138 #
139 # This is the generic version - if the target is not in the following list,
140 # this setup will be used.  It the target does not override variables here
141 # with its own version, these generic definitions will be used.
142 #
143 HAVE_SHARED_LIBS = no
144 STATIC_LIB_LINK_CMD = \
145         $(AR) $(ARFLAGS) $(AROUT)$(LIB_LINK_OBJ_DIR)/$(LIB_LINK_VERSION_FILE) $^;\
146         $(RANLIB) $(LIB_LINK_OBJ_DIR)/$(LIB_LINK_VERSION_FILE)
147 AFTER_INSTALL_STATIC_LIB_CMD = \
148         (cd $(LIB_LINK_INSTALL_DIR); \
149         $(RANLIB) $(LIB_LINK_VERSION_FILE))
150 SHARED_LIB_LINK_CMD =
151 SHARED_CFLAGS =
152 SHARED_LIBEXT =
153 AFTER_INSTALL_SHARED_LIB_CMD = \
154         (cd $(LIB_LINK_INSTALL_DIR); \
155          rm -f $(LIB_LINK_FILE); \
156          $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
157 AFTER_INSTALL_SHARED_LIB_CHOWN = \
158         (cd $(LIB_LINK_INSTALL_DIR); \
159         chown $(CHOWN_TO) $(LIB_LINK_FILE))
160 HAVE_BUNDLES = no
161
162 ####################################################
163 #
164 # Start of system specific settings
165 #
166 ####################################################
167
168 ####################################################
169 #
170 # MacOSX-Server 1.0
171 #
172 ifeq ($(findstring rhapsody5, $(GNUSTEP_TARGET_OS)), rhapsody5)
173 ifeq ($(OBJC_RUNTIME_LIB), apple)
174 HAVE_BUNDLES     = yes
175 endif
176
177 HAVE_SHARED_LIBS = yes
178 SHARED_LIBEXT    = .dylib
179
180 ifeq ($(FOUNDATION_LIB), apple)
181   # Use the NeXT compiler
182   CC = cc
183   OBJC_COMPILER = NeXT
184   ifneq ($(arch),)
185     ARCH_FLAGS = $(foreach a, $(arch), -arch $(a))
186     INTERNAL_OBJCFLAGS += $(ARCH_FLAGS)
187     INTERNAL_CFLAGS    += $(ARCH_FLAGS)
188     INTERNAL_LDFLAGS   += $(ARCH_FLAGS)
189   endif
190 endif
191
192 TARGET_LIB_DIR = \
193     Library/Libraries/$(GNUSTEP_TARGET_LDIR)
194
195 ifneq ($(OBJC_COMPILER), NeXT)
196 SHARED_LIB_LINK_CMD     = \
197         $(CC) $(SHARED_LD_PREFLAGS) \
198                 -dynamiclib $(ARCH_FLAGS) -dynamic \
199                 -compatibility_version 1 -current_version 1 \
200                 -install_name $(GNUSTEP_SYSTEM_ROOT)/$(TARGET_LIB_DIR)/$(LIB_LINK_FILE) \
201                 $(ALL_LDFLAGS) -o $@ \
202                 -framework Foundation \
203                 -framework System \
204                 $(INTERNAL_LIBRARIES_DEPEND_UPON) $(LIBRARIES_FOUNDATION_DEPEND_UPON) \
205                 -lobjc -lgcc $^ $(SHARED_LD_POSTFLAGS); \
206         (cd $(LIB_LINK_OBJ_DIR); rm -f $(LIB_LINK_FILE); \
207           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
208 else # OBJC_COMPILER=NeXT
209 SHARED_LIB_LINK_CMD     = \
210         $(CC) $(SHARED_LD_PREFLAGS) \
211                 -dynamiclib $(ARCH_FLAGS) -dynamic \
212                 -compatibility_version 1 -current_version 1 \
213                 -read_only_relocs warning -undefined warning \
214                 -install_name $(GNUSTEP_SYSTEM_ROOT)/$(TARGET_LIB_DIR)/$(LIB_LINK_FILE) \
215                 $(ALL_LDFLAGS) -o $@ \
216                 $(INTERNAL_LIBRARIES_DEPEND_UPON) $(LIBRARIES_FOUNDATION_DEPEND_UPON) \
217                 -framework Foundation \
218                 $^ $(SHARED_LD_POSTFLAGS); \
219         (cd $(LIB_LINK_OBJ_DIR); rm -f $(LIB_LINK_FILE); \
220           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
221 endif # OBJC_COMPILER
222
223 OBJ_MERGE_CMD = \
224         $(CC) -nostdlib -r -d $(ALL_LDFLAGS) -o $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) $^ ;
225
226 STATIC_LIB_LINK_CMD     = \
227         /usr/bin/libtool $(STATIC_LD_PREFLAGS) -static $(ARCH_FLAGS) $(ALL_LDFLAGS) -o $@ $^ \
228         $(STATIC_LD_POSTFLAGS)
229
230 # This doesn't work with 4.1, what about others?
231 #ADDITIONAL_LDFLAGS += -Wl,-read_only_relocs,suppress
232
233 AFTER_INSTALL_STATIC_LIB_CMD =
234
235 SHARED_CFLAGS   += -dynamic
236 SHARED_LIBEXT   = .dylib
237
238 BUNDLE_LD       =  $(CC)
239 BUNDLE_LDFLAGS  += -bundle -undefined suppress $(ARCH_FLAGS)
240 endif
241 #
242 # end MacOSX-Server 1.0
243 #
244 ####################################################
245
246 ####################################################
247 #
248 # MacOSX 10.[12], darwin[567]
249 #
250 ifeq ($(findstring darwin, $(GNUSTEP_TARGET_OS)), darwin)
251 ifeq ($(OBJC_RUNTIME_LIB), apple)
252   HAVE_BUNDLES     = yes
253   # Set flags to ignore the MacOSX headers
254   ifneq ($(FOUNDATION_LIB), apple)
255     INTERNAL_OBJCFLAGS += -no-cpp-precomp -nostdinc -I/usr/include
256   endif
257 endif
258
259 HAVE_SHARED_LIBS = yes
260 SHARED_LIBEXT    = .dylib
261
262 # The output of nm is slightly different on Darwin, it doesn't support -P
263 EXTRACT_CLASS_NAMES_COMMAND = nm  -g $$object_file | sed -n -e '/[^U] ___objc_class_name_/ {s/[0-9a-f]* [^U] ___objc_class_name_//p;}'
264
265 ifeq ($(FOUNDATION_LIB), apple)
266   ifneq ($(arch),)
267     ARCH_FLAGS = $(foreach a, $(arch), -arch $(a))
268     INTERNAL_OBJCFLAGS += $(ARCH_FLAGS)
269     INTERNAL_CFLAGS    += $(ARCH_FLAGS)
270     INTERNAL_LDFLAGS   += $(ARCH_FLAGS)
271   endif
272 endif
273
274 # The developer should set this explicitly
275 #DYLIB_COMPATIBILITY_VERSION = -compatibility_version $(VERSION)
276 DYLIB_CURRENT_VERSION       = -current_version $(VERSION)
277
278 # Remove empty dirs from the compiler/linker flags (ie, remove -Idir and 
279 # -Ldir flags where dir is empty).
280 REMOVE_EMPTY_DIRS = yes
281
282 ifeq ($(FOUNDATION_LIB), apple)
283 DYLIB_DEF_FRAMEWORKS += -framework Foundation
284 endif
285
286
287 ifeq ($(CC_BUNDLE), no)
288 # GNU compiler
289 SHARED_LD_PREFLAGS += -noall_load -read_only_relocs warning \
290         -flat_namespace -undefined warning
291 # Useful flag: -Wl,-single_module.  This flag only
292 # works starting with 10.3. libs w/ffcall don't link on darwin/ix86 without it.
293 ifeq ($(findstring darwin7, $(GNUSTEP_TARGET_OS)), darwin7)
294   SHARED_LD_PREFLAGS += -single_module
295 endif
296 SHARED_LIB_LINK_CMD     = \
297         /usr/bin/libtool \
298                 $(SHARED_LD_PREFLAGS) \
299                 $(ARCH_FLAGS) -dynamic  \
300                 $(DYLIB_COMPATIBILITY_VERSION)          \
301                 $(DYLIB_CURRENT_VERSION)                \
302                 -install_name $(LIB_LINK_INSTALL_NAME)  \
303                 $(ALL_LDFLAGS) -o $@                                    \
304                 $(DYLIB_DEF_FRAMEWORKS)                 \
305                 $^ $(INTERNAL_LIBRARIES_DEPEND_UPON) $(LIBRARIES_FOUNDATION_DEPEND_UPON) \
306                 $(SHARED_LD_POSTFLAGS); \
307         (cd $(LIB_LINK_OBJ_DIR); \
308           rm -f $(LIB_LINK_FILE); \
309           if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
310             rm -f $(LIB_LINK_SONAME_FILE);\
311             $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
312           fi; \
313           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
314
315 BUNDLE_LD       =  /usr/bin/ld
316 BUNDLE_LDFLAGS  += -bundle  -flat_namespace -undefined suppress /usr/lib/bundle1.o
317
318 else 
319 # Apple Compiler
320
321 #DYLIB_EXTRA_FLAGS    = -read_only_relocs warning -undefined warning -fno-common
322 DYLIB_EXTRA_FLAGS    = -flat_namespace -undefined warning 
323 # Useful optimization flag: -Wl,-single_module.  This flag only
324 # works starting with 10.3.
325 ifeq ($(findstring darwin7, $(GNUSTEP_TARGET_OS)), darwin7)
326   DYLIB_EXTRA_FLAGS    += -Wl,-single_module
327 endif
328
329 SHARED_LIB_LINK_CMD     = \
330         $(CC) $(SHARED_LD_PREFLAGS) \
331                 -dynamiclib $(ARCH_FLAGS) \
332                 $(DYLIB_COMPATIBILITY_VERSION)          \
333                 $(DYLIB_CURRENT_VERSION)                \
334                 -install_name $(LIB_LINK_INSTALL_NAME)  \
335                 $(DYLIB_EXTRA_FLAGS)                    \
336                 $(ALL_LDFLAGS) -o $@                                    \
337                 $(INTERNAL_LIBRARIES_DEPEND_UPON) $(LIBRARIES_FOUNDATION_DEPEND_UPON) \
338                 $^ $(SHARED_LD_POSTFLAGS); \
339         (cd $(LIB_LINK_OBJ_DIR); \
340           rm -f $(LIB_LINK_FILE); \
341           if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
342             rm -f $(LIB_LINK_SONAME_FILE);\
343             $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
344           fi; \
345           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
346
347 SHARED_CFLAGS   += -dynamic
348
349 BUNDLE_LD       =  $(CC)
350 BUNDLE_LDFLAGS  += -bundle -undefined error $(ARCH_FLAGS)
351
352 endif # CC_TYPE
353
354 AFTER_INSTALL_SHARED_LIB_CMD = \
355         (cd $(LIB_LINK_INSTALL_DIR); \
356          rm -f $(LIB_LINK_FILE); \
357          if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
358             rm -f $(LIB_LINK_SONAME_FILE);\
359            $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
360          fi; \
361          $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE) )
362
363 OBJ_MERGE_CMD = \
364         $(CC) -nostdlib -r -d $(ALL_LDFLAGS) -o $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) $^ ;
365
366 STATIC_LIB_LINK_CMD     = \
367         /usr/bin/libtool $(STATIC_LD_PREFLAGS) -static $(ARCH_FLAGS) $(ALL_LDFLAGS) -o $@ $^ \
368         $(STATIC_LD_POSTFLAGS)
369
370 AFTER_INSTALL_STATIC_LIB_CMD = \
371         (cd $(LIB_LINK_INSTALL_DIR); \
372         $(RANLIB) $(LIB_LINK_VERSION_FILE))
373
374 SHARED_CFLAGS   += -fno-common
375
376 endif
377 #
378 # end MacOSX 10.2, darwin6
379 #
380 ####################################################
381
382 ####################################################
383 #
384 # OpenStep 4.x
385 #
386 ifeq ($(GNUSTEP_TARGET_OS), nextstep4)
387 ifeq ($(OBJC_RUNTIME_LIB), nx)
388   HAVE_BUNDLES  = yes
389   OBJC_COMPILER = NeXT
390 endif
391
392 HAVE_SHARED_LIBS = yes
393
394 ifeq ($(FOUNDATION_LIB), nx)
395   # Use the NeXT compiler
396   CC = cc
397   ifneq ($(arch),)
398     ARCH_FLAGS = $(foreach a, $(arch), -arch $(a))
399     INTERNAL_OBJCFLAGS += $(ARCH_FLAGS)
400     INTERNAL_CFLAGS += $(ARCH_FLAGS)
401     INTERNAL_LDFLAGS += $(ARCH_FLAGS)
402   endif
403 endif
404
405 TARGET_LIB_DIR = \
406     Library/Libraries/$(GNUSTEP_TARGET_LDIR)
407
408 ifneq ($(OBJC_COMPILER), NeXT)
409 SHARED_LIB_LINK_CMD     = \
410         /bin/libtool $(SHARED_LD_PREFLAGS) \
411                 -dynamic -read_only_relocs suppress $(ARCH_FLAGS) \
412                 -install_name $(GNUSTEP_SYSTEM_ROOT)/$(TARGET_LIB_DIR)/$(LIB_LINK_FILE) \
413                 $(ALL_LDFLAGS) -o $@ \
414                 -framework System \
415                 $(INTERNAL_LIBRARIES_DEPEND_UPON) $(LIBRARIES_FOUNDATION_DEPEND_UPON) \
416                 -lobjc -lgcc $^ $(SHARED_LD_POSTFLAGS); \
417         (cd $(LIB_LINK_OBJ_DIR); rm -f $(LIB_LINK_FILE); \
418           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
419 else
420 SHARED_LIB_LINK_CMD     = \
421         /bin/libtool $(SHARED_LD_PREFLAGS) \
422                 -dynamic -read_only_relocs suppress $(ARCH_FLAGS) \
423                 -install_name $(GNUSTEP_SYSTEM_ROOT)/$(TARGET_LIB_DIR)/$(LIB_LINK_FILE) \
424                 $(ALL_LDFLAGS) $@ \
425                 -framework System \
426                 $(INTERNAL_LIBRARIES_DEPEND_UPON) \
427                 $(LIBRARIES_FOUNDATION_DEPEND_UPON) $^ \
428                 $(SHARED_LD_POSTFLAGS); \
429         (cd $(LIB_LINK_OBJ_DIR); rm -f $(LIB_LINK_FILE); \
430           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
431 endif
432
433 STATIC_LIB_LINK_CMD     = \
434         /bin/libtool $(STATIC_LD_PREFLAGS) -static $(ARCH_FLAGS) $(ALL_LDFLAGS) -o $@ $^ \
435         $(STATIC_LD_POSTFLAGS)
436
437 # This doesn't work with 4.1, what about others?
438 #ADDITIONAL_LDFLAGS += -Wl,-read_only_relocs,suppress
439
440 AFTER_INSTALL_STATIC_LIB_CMD =
441
442 SHARED_CFLAGS   += -dynamic
443 SHARED_LIBEXT   = .a
444
445 BUNDLE_LD       = ld
446 BUNDLE_LDFLAGS  += -r $(ARCH_FLAGS)
447 endif
448 #
449 # end OpenStep 4.x
450 #
451 ####################################################
452
453 ####################################################
454 #
455 # NEXTSTEP 3.x
456 #
457 ifeq ($(GNUSTEP_TARGET_OS), nextstep3)
458 ifeq ($(OBJC_RUNTIME_LIB), nx)
459   HAVE_BUNDLES            = yes
460   OBJC_COMPILER = NeXT
461 endif
462
463 HAVE_SHARED_LIBS        = yes
464
465 ifeq ($(FOUNDATION_LIB), nx)
466   # Use the NeXT compiler
467   CC = cc
468   ifneq ($(arch),)
469     ARCH_FLAGS = $(foreach a, $(arch), -arch $(a))
470     INTERNAL_OBJCFLAGS += $(ARCH_FLAGS)
471     INTERNAL_CFLAGS += $(ARCH_FLAGS)
472     INTERNAL_LDFLAGS += $(ARCH_FLAGS)
473   endif
474 endif
475
476 TARGET_LIB_DIR = \
477     Library/Libraries/$(GNUSTEP_TARGET_LDIR)
478
479 ifneq ($(OBJC_COMPILER), NeXT)
480 SHARED_LIB_LINK_CMD     = \
481         /bin/libtool $(SHARED_LD_PREFLAGS) -dynamic -read_only_relocs suppress \
482                  $(ARCH_FLAGS) $(ALL_LDFLAGS) -o $@ -framework System \
483                 $(INTERNAL_LIBRARIES_DEPEND_UPON) -lobjc -lgcc -undefined warning $^ \
484                 $(SHARED_LD_POSTFLAGS); \
485         (cd $(LIB_LINK_OBJ_DIR); rm -f $(LIB_LINK_FILE); \
486           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
487 else
488 SHARED_LIB_LINK_CMD     = \
489         /bin/libtool $(SHARED_LD_PREFLAGS) \
490                 -dynamic -read_only_relocs suppress $(ARCH_FLAGS) $(ALL_LDFLAGS) -o $@ \
491                 -framework System \
492                 $(INTERNAL_LIBRARIES_DEPEND_UPON) $^ \
493                 $(SHARED_LD_POSTFLAGS); \
494         (cd $(LIB_LINK_OBJ_DIR); rm -f $(LIB_LINK_FILE); \
495           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
496 endif
497
498 STATIC_LIB_LINK_CMD     = \
499         /bin/libtool $(STATIC_LD_PREFLAGS) \
500         -static $(ARCH_FLAGS) $(ALL_LDFLAGS) -o $@ $^ $(STATIC_LD_POSTFLAGS)
501
502 ADDITIONAL_LDFLAGS += -Wl,-read_only_relocs,suppress
503
504 AFTER_INSTALL_STATIC_LIB_CMD =
505
506 SHARED_CFLAGS   += -dynamic
507 SHARED_LIBEXT   = .a
508
509 BUNDLE_LD       = ld
510 BUNDLE_LDFLAGS  += -r $(ARCH_FLAGS)
511 endif
512 #
513 # end NEXTSTEP 3.x
514 #
515 ####################################################
516
517 ####################################################
518 #
519 # Linux ELF or GNU/Hurd
520 #
521 # The following ifeq matches both 'linux-gnu' (which is GNU/Linux ELF)
522 # and 'gnu0.3' (I've been told GNUSTEP_TARGET_OS is 'gnu0.3' on
523 # GNU/Hurd at the moment).  We want the same code in both cases.
524 ifeq ($(findstring gnu, $(GNUSTEP_TARGET_OS)), gnu)
525 HAVE_SHARED_LIBS        = yes
526 SHARED_LIB_LINK_CMD     = \
527         $(CC) $(SHARED_LD_PREFLAGS) -shared -Wl,-soname,$(LIB_LINK_SONAME_FILE) \
528            $(ALL_LDFLAGS) -o $(LIB_LINK_OBJ_DIR)/$(LIB_LINK_VERSION_FILE) $^ \
529            $(INTERNAL_LIBRARIES_DEPEND_UPON) \
530            $(SHARED_LD_POSTFLAGS);\
531         (cd $(LIB_LINK_OBJ_DIR); \
532           rm -f $(LIB_LINK_FILE); \
533           if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
534             rm -f $(LIB_LINK_SONAME_FILE);\
535             $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
536           fi; \
537           $(LN_S) $(LIB_LINK_SONAME_FILE) $(LIB_LINK_FILE); \
538         )
539 AFTER_INSTALL_SHARED_LIB_CMD = \
540         (cd $(LIB_LINK_INSTALL_DIR); \
541           rm -f $(LIB_LINK_FILE); \
542           if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
543             rm -f $(LIB_LINK_SONAME_FILE);\
544             $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
545           fi; \
546           $(LN_S) $(LIB_LINK_SONAME_FILE) $(LIB_LINK_FILE); \
547         )
548 AFTER_INSTALL_SHARED_LIB_CHOWN = \
549         (cd $(LIB_LINK_INSTALL_DIR); \
550         chown $(CHOWN_TO) $(LIB_LINK_SONAME_FILE); \
551         chown $(CHOWN_TO) $(LIB_LINK_FILE))
552
553 OBJ_MERGE_CMD           = \
554         $(CC) -nostdlib -r $(ALL_LDFLAGS) -o $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) $^ ;
555
556 SHARED_CFLAGS      += -fPIC
557 SHARED_LIBEXT      =  .so
558
559 HAVE_BUNDLES       =  yes
560 BUNDLE_LD          =  $(CC)
561 BUNDLE_LDFLAGS     += -shared
562 ADDITIONAL_LDFLAGS += -rdynamic
563 STATIC_LDFLAGS += -static
564
565 endif
566 #
567 # end Linux ELF
568 #
569 ####################################################
570
571 ####################################################
572 #
573 # FreeBSD a.out (2.2.x)
574 #
575 ifeq ($(findstring freebsdaout, $(GNUSTEP_TARGET_OS)), freebsdaout)
576 freebsdaout = yes
577
578 HAVE_SHARED_LIBS        = no
579 SHARED_LIB_LINK_CMD = \
580         $(CC) -shared -Wl,-soname,$(LIB_LINK_VERSION_FILE) \
581            $(ALL_LDFLAGS) -o $(LIB_LINK_OBJ_DIR)/$(LIB_LINK_VERSION_FILE) $^ /usr/lib/c++rt0.o;\
582         (cd $(LIB_LINK_OBJ_DIR); \
583           rm -f $(LIB_LINK_FILE); \
584           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
585
586 SHARED_CFLAGS   += -fPIC
587 SHARED_LIBEXT   = .so
588
589 HAVE_BUNDLES    = yes
590 BUNDLE_LD       = $(CC)
591 BUNDLE_LDFLAGS  += -shared
592 ADDITIONAL_LDFLAGS += -rdynamic
593 STATIC_LDFLAGS += -static
594 endif
595 #
596 # end FreeBSD A.out
597 #
598 ####################################################
599
600 ####################################################
601 #
602 # FreeBSD ELF
603 #
604 ifeq ($(findstring freebsd, $(GNUSTEP_TARGET_OS)), freebsd)
605 ifneq ($(freebsdaout), yes)
606 HAVE_SHARED_LIBS        = yes
607 SHARED_LIB_LINK_CMD = \
608         $(CC) -shared -Wl,-soname,$(LIB_LINK_SONAME_FILE) \
609            $(ALL_LDFLAGS) -o $(LIB_LINK_OBJ_DIR)/$(LIB_LINK_VERSION_FILE) $^ \
610            $(INTERNAL_LIBRARIES_DEPEND_UPON) \
611            $(SHARED_LD_POSTFLAGS);\
612         (cd $(LIB_LINK_OBJ_DIR); \
613           rm -f $(LIB_LINK_FILE); \
614           if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
615             rm -f $(LIB_LINK_SONAME_FILE);\
616             $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
617           fi; \
618           $(LN_S) $(LIB_LINK_SONAME_FILE) $(LIB_LINK_FILE))
619 AFTER_INSTALL_SHARED_LIB_CMD = \
620         (cd $(LIB_LINK_INSTALL_DIR); \
621           rm -f $(LIB_LINK_FILE); \
622           if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
623             rm -f $(LIB_LINK_SONAME_FILE);\
624             $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
625           fi; \
626           $(LN_S) $(LIB_LINK_SONAME_FILE) $(LIB_LINK_FILE); \
627         )
628 AFTER_INSTALL_SHARED_LIB_CHOWN = \
629         (cd $(LIB_LINK_INSTALL_DIR); \
630         chown $(CHOWN_TO) $(LIB_LINK_SONAME_FILE); \
631         chown $(CHOWN_TO) $(LIB_LINK_FILE))
632 OBJ_MERGE_CMD           = \
633         $(CC) -nostdlib -r $(ALL_LDFLAGS) -o $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) $^ ;
634
635 SHARED_CFLAGS   += -fPIC
636 SHARED_LIBEXT   = .so
637
638 HAVE_BUNDLES    = yes
639 BUNDLE_LD       = $(CC)
640 BUNDLE_LDFLAGS  += -shared
641 ADDITIONAL_LDFLAGS += -rdynamic
642 STATIC_LDFLAGS += -static
643 endif
644 endif
645 #
646 # end FreeBSD
647 #
648 ####################################################
649
650 ####################################################
651 #
652 # NetBSD
653 #
654 ifeq ($(findstring netbsd, $(GNUSTEP_TARGET_OS)), netbsd)
655 # This is disabled temporarily, because I don't know exactly how
656 # to link shared libs. Everything seems to link correctly now but
657 # constructor functions in the shared lib failed to get called
658 # when the lib is loaded in. I don't know why. ASF.
659 HAVE_SHARED_LIBS        = no
660 SHARED_LD               = ld
661 SHARED_LIB_LINK_CMD     = \
662         $(SHARED_LD) -x -Bshareable -Bforcearchive \
663            $(ALL_LDFLAGS) -o $(LIB_LINK_OBJ_DIR)/$(LIB_LINK_VERSION_FILE) $^ /usr/lib/c++rt0.o;\
664         (cd $(LIB_LINK_OBJ_DIR); \
665           rm -f $(LIB_LINK_FILE); \
666           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
667
668 SHARED_CFLAGS   += -shared -fpic
669 SHARED_LIBEXT   = .so
670
671 HAVE_BUNDLES    = yes
672 BUNDLE_LD       = $(CC)
673 BUNDLE_LDFLAGS  += -shared -fpic
674 #ADDITIONAL_LDFLAGS += -rdynamic
675 STATIC_LDFLAGS += -static
676 endif
677 #
678 # end NetBSD
679 #
680 ####################################################
681
682 ####################################################
683 #
684 # NetBSD ELF
685 #
686 ifeq ($(findstring netbsdelf, $(GNUSTEP_TARGET_OS)), netbsdelf)
687 HAVE_SHARED_LIBS    = yes
688 SHARED_LD_POSTFLAGS = -Wl,-R/usr/pkg/lib -L/usr/pkg/lib
689 SHARED_LIB_LINK_CMD = \
690         $(CC) -shared -Wl,-soname,$(LIB_LINK_VERSION_FILE) \
691               $(ALL_LDFLAGS) -o $(LIB_LINK_OBJ_DIR)/$(LIB_LINK_VERSION_FILE) \
692                  $^ $(INTERNAL_LIBRARIES_DEPEND_UPON) \
693                  $(SHARED_LD_POSTFLAGS); \
694         (cd $(LIB_LINK_OBJ_DIR); \
695           rm -f $(LIB_LINK_FILE); \
696           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
697 OBJ_MERGE_CMD           = \
698         $(CC) -nostdlib -r $(ALL_LDFLAGS) -o $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) $^ ;
699
700 SHARED_CFLAGS   += -fPIC
701 SHARED_LIBEXT   = .so
702
703 HAVE_BUNDLES    = yes
704 BUNDLE_LD       = $(CC)
705 BUNDLE_LDFLAGS  += -shared
706 ADDITIONAL_LDFLAGS += -rdynamic -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -Wl,-R/usr/X11R6/lib -L/usr/X11R6/lib
707 ADDITIONAL_INCLUDE_DIRS += -I/usr/pkg/include
708 STATIC_LDFLAGS += -static
709 endif
710 #
711 # end NetBSD
712 #
713 ####################################################
714
715 ####################################################
716 #
717 # OpenBSD 3.x (though set for 3.3)
718 #
719 ifeq ($(findstring openbsd, $(GNUSTEP_TARGET_OS)), openbsd)
720 # This is disabled temporarily, because I don't know exactly how
721 # to link shared libs. Everything seems to link correctly now but
722 # constructor functions in the shared lib failed to get called
723 # when the lib is loaded in. I don't know why. ASF.
724 HAVE_SHARED_LIBS        = yes
725 SHARED_LIB_LINK_CMD = \
726         $(CC) -shared -Wl,-soname,$(LIB_LINK_SONAME_FILE) \
727            $(ALL_LDFLAGS) -o $(LIB_LINK_OBJ_DIR)/$(LIB_LINK_VERSION_FILE) $^ \
728            $(INTERNAL_LIBRARIES_DEPEND_UPON) \
729            $(SHARED_LD_POSTFLAGS);\
730         (cd $(LIB_LINK_OBJ_DIR); \
731           rm -f $(LIB_LINK_FILE); \
732           if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
733             rm -f $(LIB_LINK_SONAME_FILE);\
734             $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
735           fi; \
736           $(LN_S) $(LIB_LINK_SONAME_FILE) $(LIB_LINK_FILE))
737 AFTER_INSTALL_SHARED_LIB_CMD = \
738         (cd $(LIB_LINK_INSTALL_DIR); \
739           rm -f $(LIB_LINK_FILE); \
740           if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
741             rm -f $(LIB_LINK_SONAME_FILE);\
742             $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
743           fi; \
744           $(LN_S) $(LIB_LINK_SONAME_FILE) $(LIB_LINK_FILE); \
745         )
746
747 OBJ_MERGE_CMD           = \
748         $(CC) -nostdlib -r $(ALL_LDFLAGS) -o $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) $^ ;
749
750 SHARED_CFLAGS   += -fPIC
751 SHARED_LIBEXT   = .so
752
753 HAVE_BUNDLES    = yes
754 BUNDLE_LD       = $(CC)
755 BUNDLE_LDFLAGS  += -shared -fPIC
756 #ADDITIONAL_LDFLAGS += -rdynamic
757 STATIC_LDFLAGS += -static
758 endif
759 #
760 # end OpenBSD 3.x
761 #
762 ####################################################
763
764 ####################################################
765 #
766 # OSF
767 #
768 ifeq ($(findstring osf, $(GNUSTEP_TARGET_OS)), osf)
769 HAVE_SHARED_LIBS        = yes
770 SHARED_LIB_LINK_CMD = \
771         $(CC) -shared -Wl,-soname,$(LIB_LINK_VERSION_FILE) \
772            $(ALL_LDFLAGS) -o $(LIB_LINK_OBJ_DIR)/$(LIB_LINK_VERSION_FILE) $^ ;\
773         (cd $(LIB_LINK_OBJ_DIR); \
774           rm -f $(LIB_LINK_FILE); \
775           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
776 OBJ_MERGE_CMD           = \
777         $(CC) -nostdlib -r $(ALL_LDFLAGS) -o $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) $^ ;
778
779 SHARED_CFLAGS   += -fPIC
780 SHARED_LIBEXT   = .so
781
782 HAVE_BUNDLES    = yes
783 BUNDLE_LD       = $(CC)
784 BUNDLE_LDFLAGS  += -shared
785 ADDITIONAL_LDFLAGS += -rdynamic
786 STATIC_LDFLAGS += -static
787 # Newer gcc's don't define this in Objective-C programs:
788 AUXILIARY_CPPFLAGS += -D__LANGUAGES_C__
789 endif
790 #
791 # end OSF
792 #
793 ####################################################
794
795 ####################################################
796 #
797 # IRIX
798 #
799 ifeq ($(findstring irix, $(GNUSTEP_TARGET_OS)), irix)
800 HAVE_SHARED_LIBS        = yes
801
802 SHARED_LIB_LINK_CMD     = \
803         $(CC) $(SHARED_LD_PREFLAGS) -shared -Wl,-soname,$(LIB_LINK_SONAME_FILE) \
804            $(ALL_LDFLAGS) -o $(LIB_LINK_OBJ_DIR)/$(LIB_LINK_VERSION_FILE) $^ \
805            -Wl,-rpath,$(LIB_LINK_INSTALL_DIR) \
806            $(INTERNAL_LIBRARIES_DEPEND_UPON) \
807            $(SHARED_LD_POSTFLAGS);\
808         (cd $(LIB_LINK_OBJ_DIR); \
809           rm -f $(LIB_LINK_FILE); \
810           if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
811             rm -f $(LIB_LINK_SONAME_FILE);\
812             $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
813           fi; \
814           $(LN_S) $(LIB_LINK_SONAME_FILE) $(LIB_LINK_FILE); \
815         )
816 AFTER_INSTALL_SHARED_LIB_CMD = \
817         (cd $(LIB_LINK_INSTALL_DIR); \
818           rm -f $(LIB_LINK_FILE); \
819           if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
820             rm -f $(LIB_LINK_SONAME_FILE);\
821             $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
822           fi; \
823           $(LN_S) $(LIB_LINK_SONAME_FILE) $(LIB_LINK_FILE); \
824         )
825 AFTER_INSTALL_SHARED_LIB_CHOWN = \
826         (cd $(LIB_LINK_INSTALL_DIR); \
827         chown $(CHOWN_TO) $(LIB_LINK_SONAME_FILE); \
828         chown $(CHOWN_TO) $(LIB_LINK_FILE))
829
830 SHARED_CFLAGS     += -fPIC
831 SHARED_LIBEXT   = .so
832
833 OBJ_MERGE_CMD           = \
834         /usr/bin/ld -r $(ALL_LDFLAGS) -o $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) $^ ;
835
836 ADDITIONAL_LDFLAGS +=
837 STATIC_LDFLAGS +=
838
839 HAVE_BUNDLES    = yes
840 BUNDLE_LD       = $(CC)
841 BUNDLE_LDFLAGS  += -shared
842 endif
843
844 # end IRIX
845 #
846 ####################################################
847
848 ####################################################
849 #
850 # Mingw32
851 #
852 ifeq ($(findstring mingw32, $(GNUSTEP_TARGET_OS)), mingw32)
853 shared = yes
854 HAVE_SHARED_LIBS = yes
855 BUILD_DLL        = yes
856 WITH_DLL         = yes
857 SHARED_LIBEXT    = .a
858 DLL_LIBEXT       = .dll
859 DLLTOOL          = dlltool
860 DLLWRAP          = dllwrap
861 #SHARED_CFLAGS   += 
862
863 OBJ_MERGE_CMD = \
864         $(CC) -nostdlib -r $(ALL_LDFLAGS) -o $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) $^ ;
865
866 HAVE_BUNDLES   = yes
867 BUNDLE_LD      = $(CC)
868 BUNDLE_LDFLAGS += -nodefaultlibs -Xlinker -r
869 endif
870
871 # end Mingw32
872 #
873 ####################################################
874
875 ####################################################
876 #
877 # Cygwin
878 #
879 ifeq ($(findstring cygwin, $(GNUSTEP_TARGET_OS)), cygwin)
880 shared = yes
881 HAVE_SHARED_LIBS = yes
882 BUILD_DLL        = yes
883 WITH_DLL         = yes
884 SHARED_LIBEXT    = .a
885 DLL_LIBEXT       = .dll
886 DLLTOOL          = dlltool
887 DLLWRAP          = dllwrap
888 #SHARED_CFLAGS   += 
889
890 OBJ_MERGE_CMD = \
891         $(CC) -nostdlib -r $(ALL_LDFLAGS) -o $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) $^ ;
892
893 HAVE_BUNDLES   = yes
894 BUNDLE_LD      = $(CC)
895 BUNDLE_LDFLAGS += -nodefaultlibs -Xlinker -r
896 endif
897
898 # end Cygwin
899 #
900 ####################################################
901
902
903 ####################################################
904 #
905 # Solaris
906 #
907 ifeq ($(findstring solaris, $(GNUSTEP_TARGET_OS)), solaris)
908 HAVE_SHARED_LIBS        = yes
909 SHARED_LIB_LINK_CMD     = \
910         $(CC) $(SHARED_LD_PREFLAGS) -G -Wl,-h,$(LIB_LINK_SONAME_FILE) \
911            $(ALL_LDFLAGS) -o $(LIB_LINK_OBJ_DIR)/$(LIB_LINK_VERSION_FILE) $^ \
912            $(INTERNAL_LIBRARIES_DEPEND_UPON) \
913            $(SHARED_LD_POSTFLAGS);\
914         (cd $(LIB_LINK_OBJ_DIR); \
915           rm -f $(LIB_LINK_FILE); \
916           if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
917             rm -f $(LIB_LINK_SONAME_FILE);\
918             $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
919           fi; \
920           $(LN_S) $(LIB_LINK_SONAME_FILE) $(LIB_LINK_FILE); \
921         )
922 AFTER_INSTALL_SHARED_LIB_CMD = \
923         (cd $(LIB_LINK_INSTALL_DIR); \
924           rm -f $(LIB_LINK_FILE); \
925           if [ "$(LIB_LINK_SONAME_FILE)" != "$(LIB_LINK_VERSION_FILE)" ]; then\
926             rm -f $(LIB_LINK_SONAME_FILE);\
927             $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_SONAME_FILE); \
928           fi; \
929           $(LN_S) $(LIB_LINK_SONAME_FILE) $(LIB_LINK_FILE); \
930         )
931 AFTER_INSTALL_SHARED_LIB_CHOWN = \
932         (cd $(LIB_LINK_INSTALL_DIR); \
933         chown $(CHOWN_TO) $(LIB_LINK_SONAME_FILE); \
934         chown $(CHOWN_TO) $(LIB_LINK_FILE))
935
936 OBJ_MERGE_CMD           = \
937         $(CC) -nostdlib -r $(ALL_LDFLAGS) -o $(GNUSTEP_OBJ_DIR)/$(SUBPROJECT_PRODUCT) $^ ;
938
939 SHARED_CFLAGS     += -fpic -fPIC
940 SHARED_LIBEXT   = .so
941
942 HAVE_BUNDLES    = yes
943 BUNDLE_LD       = $(CC)
944 BUNDLE_LDFLAGS  = -shared -mimpure-text
945 #BUNDLE_LDFLAGS  = -nodefaultlibs -Xlinker -r
946 endif
947
948 # end Solaris
949 #
950 ####################################################
951
952
953 ####################################################
954 #
955 # Unixware
956 #
957 ifeq ($(findstring sysv4.2, $(GNUSTEP_TARGET_OS)), sysv4.2)
958 HAVE_SHARED_LIBS        = yes
959 SHARED_LIB_LINK_CMD     = \
960         $(CC) $(SHARED_LD_PREFLAGS) -shared $(ALL_LDFLAGS) -o $(LIB_LINK_VERSION_FILE) $^ \
961           $(SHARED_LD_POSTFLAGS);\
962         mv $(LIB_LINK_VERSION_FILE) $(LIB_LINK_OBJ_DIR);\
963         (cd $(LIB_LINK_OBJ_DIR); \
964           rm -f $(LIB_LINK_FILE); \
965           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
966
967 SHARED_CFLAGS     += -fpic -fPIC
968 SHARED_LIBEXT   = .so
969
970 HAVE_BUNDLES    = yes
971 BUNDLE_LD       = $(CC)
972 #BUNDLE_LDFLAGS  += -shared -mimpure-text
973 BUNDLE_LDFLAGS  += -nodefaultlibs -Xlinker -r
974 endif
975
976 # end Unixware
977 #
978 ####################################################
979
980
981 ####################################################
982 #
983 # HP-UX 
984 #
985 ifeq ($(findstring hpux, $(GNUSTEP_TARGET_OS)), hpux)
986 HAVE_SHARED_LIBS        = yes
987 SHARED_LIB_LINK_CMD     = \
988         (cd $(LIB_LINK_OBJ_DIR); \
989           $(CC) $(SHARED_LD_PREFLAGS) \
990             -v $(SHARED_CFLAGS) -shared \
991             $(ALL_LDFLAGS) -o $(LIB_LINK_VERSION_FILE) `ls -1 *\.o */*\.o` \
992             $(SHARED_LD_POSTFLAGS) ;\
993           rm -f $(LIB_LINK_FILE); \
994           $(LN_S) $(LIB_LINK_VERSION_FILE) $(LIB_LINK_FILE))
995
996 ifeq ($(CC), cc)
997 SHARED_CFLAGS   += +z
998 else
999 SHARED_CFLAGS   += -fPIC
1000 endif
1001
1002 ifeq ($(GNUSTEP_HOST_CPU), ia64)
1003 SHARED_LIBEXT   = .so
1004 else
1005 SHARED_LIBEXT   = .sl
1006 endif
1007
1008 HAVE_BUNDLES    = yes
1009 BUNDLE_LD       = $(CC)
1010 BUNDLE_LDFLAGS  += -nodefaultlibs -Xlinker -r
1011 ADDITIONAL_LDFLAGS += -Xlinker +s
1012 STATIC_LDFLAGS += -static
1013 endif
1014
1015 # end HP-UX
1016 #
1017 ####################################################