2 ## Copyright (c) 2003-2015 IBM, Ken Foskey, and others. All rights reserved.
4 ## Aix-specific setup (for gcc)
6 ## Please note: AIX does NOT have library versioning per se (there is no 'SONAME' capability).
7 ## So, we are using 'windows' style library names, that is, libicuuc20.1.so instead of libicuuc.so.20.1
9 # When building stubdata, special considerations need to be made when building on AIX with GCC
10 BUILD_HOST_ICU=AIX_GCC
12 # Certain files don't compile in -ansi mode (e.g. umutex.c, toolutil.c, and cdatatst.c)
13 CFLAGS += -D_ALL_SOURCE
15 ## Commands to generate dependency files
16 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
17 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
20 ## We need to use the C++ linker, even when linking C programs, since
21 ## our libraries contain C++ code (C++ static init not called)
22 LINK.c= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
23 LINK.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS)
25 ## Shared library options
26 LD_SOOPTIONS= -Wl,-bsymbolic
28 ## Commands to make a shared library
29 SHLIB.c= $(AIX_PREDELETE) $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-bexpall $(LD_SOOPTIONS)
30 SHLIB.cc= $(AIX_PREDELETE) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-bexpall $(LD_SOOPTIONS)
32 ## Compiler switch to embed a runtime search path
36 ## enable the shared lib loader
37 LDFLAGS += -Wl,-bbigtoc
39 ## These are the library specific LDFLAGS
40 LDFLAGSICUDT=-nodefaultlibs -nostdlib
42 ## We need to delete things prior to linking, or else we'll get
43 ## SEVERE ERROR: output file in use .. on AIX.
44 ## But, shell script version should NOT delete target as we don't
45 ## have $@ in that context. (SH = only shell script, icu-config)
46 AIX_PREDELETE=rm -f $@ ;
49 ## Environment variable to set a runtime search path
50 LDLIBRARYPATH_ENVVAR = LIBPATH
52 ## Override Versioned target for a shared library.
53 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
54 MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
55 SHARED_OBJECT = $(notdir $(FINAL_SO_TARGET:.$(SO)=.$(SOBJ)))
56 SHARED_OBJECT_NO_VERSION = $(basename $(SO_TARGET)).$(SOBJ)
58 # The following is for Makefile.inc's use.
59 ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR)
61 # this one is for icudefs.mk's use
62 ifeq ($(ENABLE_SHARED),YES)
63 SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
66 ## Compiler switch to embed a library name. Not present on AIX.
69 ## The type of assembly needed when pkgdata is used for generating shared libraries.
70 GENCCODE_ASSEMBLY=-a xlc
72 ## Shared object suffix
74 # without the -brtl option, the library names use .a. AIX is funny that way.
78 ## Non-shared intermediate object suffix
83 ## Build archive from shared object
85 ln -f $< $(SHARED_OBJECT_NO_VERSION)
86 $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION)
87 rm -f $(SHARED_OBJECT_NO_VERSION)
89 ln -f $< $(SHARED_OBJECT_NO_VERSION)
90 $(AR) $(ARFLAGS) $@ $(SHARED_OBJECT_NO_VERSION)
91 rm -f $(SHARED_OBJECT_NO_VERSION)
93 ## Build import list from export list
95 @echo "Building an import list for $<"
96 @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@"
99 %.$(STATIC_O): $(srcdir)/%.c
100 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
102 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
104 %.$(STATIC_O): $(srcdir)/%.cpp
105 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
107 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
112 @echo "generating dependency information for $<"
113 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
114 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
115 [ -s $@ ] || rm -f $@'
118 @echo "generating dependency information for $<"
119 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
120 | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
121 [ -s $@ ] || rm -f $@'
123 ## Versioned libraries rules
124 %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
125 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
126 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
127 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
130 ## BIR - bind with internal references [so app data and icu data doesn't collide]
131 # LDflags that pkgdata will use
132 BIR_LDFLAGS= -Wl,-bE:$(NAME).map,-bnoexpall
134 # Dependencies [i.e. map files] for the final library
135 BIR_DEPS= $(NAME).map