xref: /aosp_15_r20/external/icu/icu4c/source/config/mh-solaris (revision 0e209d3975ff4a8c132096b14b0e9364a753506e)
1*0e209d39SAndroid Build Coastguard Worker## -*-makefile-*-
2*0e209d39SAndroid Build Coastguard Worker## Copyright (C) 2016 and later: Unicode, Inc. and others.
3*0e209d39SAndroid Build Coastguard Worker## License & terms of use: http://www.unicode.org/copyright.html
4*0e209d39SAndroid Build Coastguard Worker## Solaris-specific setup using Sun's compilers
5*0e209d39SAndroid Build Coastguard Worker## Copyright (c) 1999-2010, International Business Machines Corporation and
6*0e209d39SAndroid Build Coastguard Worker## others. All Rights Reserved.
7*0e209d39SAndroid Build Coastguard Worker
8*0e209d39SAndroid Build Coastguard Worker## Flags for ICU 75+
9*0e209d39SAndroid Build Coastguard WorkerCXXFLAGS += -std=c++17
10*0e209d39SAndroid Build Coastguard WorkerCFLAGS   += -std=c11
11*0e209d39SAndroid Build Coastguard Worker
12*0e209d39SAndroid Build Coastguard Worker## Flags for position independent code
13*0e209d39SAndroid Build Coastguard WorkerSHAREDLIBCFLAGS = -KPIC
14*0e209d39SAndroid Build Coastguard WorkerSHAREDLIBCXXFLAGS = -KPIC
15*0e209d39SAndroid Build Coastguard WorkerSHAREDLIBCPPFLAGS = -DPIC
16*0e209d39SAndroid Build Coastguard Worker
17*0e209d39SAndroid Build Coastguard Worker## Commands to generate dependency files
18*0e209d39SAndroid Build Coastguard WorkerGEN_DEPS.c=  $(CC) -xM $(DEFS) $(CPPFLAGS) $(CFLAGS)
19*0e209d39SAndroid Build Coastguard WorkerGEN_DEPS.cc= $(CXX) -xM $(DEFS) $(CPPFLAGS) $(CXXFLAGS)
20*0e209d39SAndroid Build Coastguard Worker
21*0e209d39SAndroid Build Coastguard Workerifeq ($(UCLN_NO_AUTO_CLEANUP),0)
22*0e209d39SAndroid Build Coastguard Worker# set up init point.
23*0e209d39SAndroid Build Coastguard WorkerUCLN_FINI =  ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME)
24*0e209d39SAndroid Build Coastguard WorkerCPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI)
25*0e209d39SAndroid Build Coastguard WorkerLDFLAGS_FINI = -zfiniarray=$(UCLN_FINI)
26*0e209d39SAndroid Build Coastguard Worker
27*0e209d39SAndroid Build Coastguard WorkerCPPFLAGSICUUC += $(CPPFLAGS_FINI)
28*0e209d39SAndroid Build Coastguard WorkerLDFLAGSICUUC += $(LDFLAGS_FINI)
29*0e209d39SAndroid Build Coastguard WorkerCPPFLAGSICUIO += $(CPPFLAGS_FINI)
30*0e209d39SAndroid Build Coastguard WorkerLDFLAGSICUIO += $(LDFLAGS_FINI)
31*0e209d39SAndroid Build Coastguard WorkerCPPFLAGSICUI18N += $(CPPFLAGS_FINI)
32*0e209d39SAndroid Build Coastguard WorkerLDFLAGSICUI18N += $(LDFLAGS_FINI)
33*0e209d39SAndroid Build Coastguard WorkerCPPFLAGSCTESTFW += $(CPPFLAGS_FINI)
34*0e209d39SAndroid Build Coastguard WorkerLDFLAGSCTESTFW += $(LDFLAGS_FINI)
35*0e209d39SAndroid Build Coastguard Worker
36*0e209d39SAndroid Build Coastguard Worker# ICUUC, ICUIO, ICUI18N, CTESTFW
37*0e209d39SAndroid Build Coastguard Workerendif
38*0e209d39SAndroid Build Coastguard Worker
39*0e209d39SAndroid Build Coastguard Worker# -mt means 'compiles and links a multithreaded program'
40*0e209d39SAndroid Build Coastguard WorkerTHREADSCFLAGS += -mt
41*0e209d39SAndroid Build Coastguard WorkerTHREADSCXXFLAGS += -mt
42*0e209d39SAndroid Build Coastguard Worker
43*0e209d39SAndroid Build Coastguard Worker## Commands to link
44*0e209d39SAndroid Build Coastguard Worker## For Sun Workshop, use CC to link to bring in C++ runtime
45*0e209d39SAndroid Build Coastguard WorkerLINK.c=		$(CXX) $(CXXFLAGS) $(LDFLAGS)
46*0e209d39SAndroid Build Coastguard WorkerLINK.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS)
47*0e209d39SAndroid Build Coastguard Worker
48*0e209d39SAndroid Build Coastguard Worker## Commands to make a shared library
49*0e209d39SAndroid Build Coastguard WorkerSHLIB.c=	$(CC) $(CFLAGS) $(LDFLAGS) -G
50*0e209d39SAndroid Build Coastguard WorkerSHLIB.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS) -G
51*0e209d39SAndroid Build Coastguard Worker
52*0e209d39SAndroid Build Coastguard Worker## Compiler switch to embed a runtime search path
53*0e209d39SAndroid Build Coastguard WorkerLD_RPATH=       -R'$$'ORIGIN
54*0e209d39SAndroid Build Coastguard WorkerLD_RPATH_PRE=   -R
55*0e209d39SAndroid Build Coastguard Worker
56*0e209d39SAndroid Build Coastguard Worker#LIBRARY_PATH_PREFIX=/usr/lib/lwp:
57*0e209d39SAndroid Build Coastguard Worker
58*0e209d39SAndroid Build Coastguard Worker## Compiler switch to embed a library name
59*0e209d39SAndroid Build Coastguard WorkerLD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET)) $(PKGDATA_TRAILING_SPACE)
60*0e209d39SAndroid Build Coastguard Worker
61*0e209d39SAndroid Build Coastguard Worker## Shared object suffix
62*0e209d39SAndroid Build Coastguard WorkerSO=		so
63*0e209d39SAndroid Build Coastguard Worker## Non-shared intermediate object suffix
64*0e209d39SAndroid Build Coastguard WorkerSTATIC_O = o
65*0e209d39SAndroid Build Coastguard Worker
66*0e209d39SAndroid Build Coastguard Worker# This causes escapesrc to be built before other ICU targets.
67*0e209d39SAndroid Build Coastguard WorkerNEED_ESCAPING=YES
68*0e209d39SAndroid Build Coastguard Worker
69*0e209d39SAndroid Build Coastguard Worker## Compilation rules
70*0e209d39SAndroid Build Coastguard Worker%.$(STATIC_O): $(srcdir)/%.c
71*0e209d39SAndroid Build Coastguard Worker	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
72*0e209d39SAndroid Build Coastguard Worker%.o: $(srcdir)/%.c
73*0e209d39SAndroid Build Coastguard Worker	$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
74*0e209d39SAndroid Build Coastguard Worker
75*0e209d39SAndroid Build Coastguard Workerifneq ($(SKIP_ESCAPING),)
76*0e209d39SAndroid Build Coastguard Worker%.o: $(srcdir)/%.cpp
77*0e209d39SAndroid Build Coastguard Worker	$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
78*0e209d39SAndroid Build Coastguard Worker%.$(STATIC_O): $(srcdir)/%.cpp
79*0e209d39SAndroid Build Coastguard Worker	$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
80*0e209d39SAndroid Build Coastguard Workerelse
81*0e209d39SAndroid Build Coastguard Worker# convert *.cpp files to _*.cpp with \u / \U escaping
82*0e209d39SAndroid Build Coastguard WorkerCLEANFILES += _*.cpp
83*0e209d39SAndroid Build Coastguard Worker
84*0e209d39SAndroid Build Coastguard Worker# the actual escaping
85*0e209d39SAndroid Build Coastguard Worker_%.cpp: $(srcdir)/%.cpp
86*0e209d39SAndroid Build Coastguard Worker	@$(BINDIR)/escapesrc$(EXEEXT) $< $@
87*0e209d39SAndroid Build Coastguard Worker
88*0e209d39SAndroid Build Coastguard Worker# no escaping - bootstrap
89*0e209d39SAndroid Build Coastguard Worker%.$(STATIC_O): _%.cpp
90*0e209d39SAndroid Build Coastguard Worker	$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
91*0e209d39SAndroid Build Coastguard Worker%.o: _%.cpp
92*0e209d39SAndroid Build Coastguard Worker	$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
93*0e209d39SAndroid Build Coastguard Workerendif
94*0e209d39SAndroid Build Coastguard Worker
95*0e209d39SAndroid Build Coastguard Worker## Dependency rules
96*0e209d39SAndroid Build Coastguard Worker%.d : $(srcdir)/%.c
97*0e209d39SAndroid Build Coastguard Worker	@echo "generating dependency information for $<"
98*0e209d39SAndroid Build Coastguard Worker	@$(GEN_DEPS.c) $< > $@
99*0e209d39SAndroid Build Coastguard Worker
100*0e209d39SAndroid Build Coastguard Worker%.d : $(srcdir)/%.cpp
101*0e209d39SAndroid Build Coastguard Worker	@echo "generating dependency information for $<"
102*0e209d39SAndroid Build Coastguard Worker	@$(GEN_DEPS.cc) $< > $@
103*0e209d39SAndroid Build Coastguard Worker
104*0e209d39SAndroid Build Coastguard Worker## Versioned libraries rules
105*0e209d39SAndroid Build Coastguard Worker
106*0e209d39SAndroid Build Coastguard Worker%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
107*0e209d39SAndroid Build Coastguard Worker	$(RM) $@ && ln -s ${<F} $@
108*0e209d39SAndroid Build Coastguard Worker%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
109*0e209d39SAndroid Build Coastguard Worker	$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
110*0e209d39SAndroid Build Coastguard Worker
111*0e209d39SAndroid Build Coastguard Worker#
112*0e209d39SAndroid Build Coastguard Workerifeq (strip $(GENCCODE_ASSEMBLY),)
113*0e209d39SAndroid Build Coastguard WorkerBIR_LDFLAGS=  -Wl,-M,$(NAME).map -Wl,-B,symbolic -Wl,-B,eliminate
114*0e209d39SAndroid Build Coastguard WorkerBIR_DEPS=   $(NAME).map
115*0e209d39SAndroid Build Coastguard Workerendif
116*0e209d39SAndroid Build Coastguard Worker
117*0e209d39SAndroid Build Coastguard Worker## Remove shared library 's'
118*0e209d39SAndroid Build Coastguard WorkerSTATIC_PREFIX_WHEN_USED =
119*0e209d39SAndroid Build Coastguard WorkerSTATIC_PREFIX =
120*0e209d39SAndroid Build Coastguard Worker
121*0e209d39SAndroid Build Coastguard Worker## End Solaris-specific setup
122