]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | ## -*-makefile-*- |
f3c0d7a5 A |
2 | ## Copyright (C) 2016 and later: Unicode, Inc. and others. |
3 | ## License & terms of use: http://www.unicode.org/copyright.html | |
b75a7d8f | 4 | ## HP/UX-specific setup using aCC |
51004dcb | 5 | ## Copyright (c) 1999-2012, International Business Machines Corporation and |
b75a7d8f | 6 | ## others. All Rights Reserved. |
b75a7d8f A |
7 | |
8 | ## Commands to generate dependency files | |
9 | GEN_DEPS.c= : | |
10 | GEN_DEPS.cc= : | |
11 | ||
12 | ## Flags for position independent code | |
729e4ab9 A |
13 | SHAREDLIBCFLAGS = +Z |
14 | SHAREDLIBCXXFLAGS = +Z | |
b75a7d8f | 15 | |
374ca955 A |
16 | ## Additional flags when building libraries with threads |
17 | ## We use this instead of -mt, which isn't available in all versions of aCC | |
18 | ## Our tools won't compile with -D_POSIX_C_SOURCE=199506L | |
19 | THREADSCPPFLAGS = -D_REENTRANT -D_THREAD_SAFE | |
20 | ||
b75a7d8f | 21 | # Use Extended ANSI mode, which is useful for 64-bit numbers |
b75a7d8f | 22 | # +W ignores some warnings |
b75a7d8f A |
23 | # 740 Unsafe cast between pointers/references to incomplete classes... |
24 | # 749 This operation is non-portable and potentially unsafe. | |
25 | # (Ironically the solution to fix this warning is non-portable) | |
374ca955 A |
26 | # 823 Redundant preprocessing concatenation operation results in two valid |
27 | # preprocessing tokens. This comes from INT64_C in <inttypes.h> | |
46f4442e | 28 | # 4232 conversion to a more strictly aligned type may cause misaligned access. |
729e4ab9 | 29 | CFLAGS += -Ae +Olit=all |
51004dcb | 30 | CXXFLAGS += -AA -Wc,-ansi_for_scope,on +W740 +W749 +W823 +W4232 |
729e4ab9 A |
31 | |
32 | ifeq ($(UCLN_NO_AUTO_CLEANUP),0) | |
33 | # set up init point. | |
34 | UCLN_FINI = ucln_fini$(TARGET_STUBNAME)_$(SO_TARGET_VERSION_MAJOR)$(ICULIBSUFFIXCNAME) | |
35 | CPPFLAGS_FINI = -DUCLN_FINI=$(UCLN_FINI) | |
36 | LDFLAGS_FINI = -Wl,+fini,$(UCLN_FINI) | |
37 | ||
38 | CPPFLAGSICUUC += $(CPPFLAGS_FINI) | |
39 | LDFLAGSICUUC += $(LDFLAGS_FINI) | |
40 | CPPFLAGSICUIO += $(CPPFLAGS_FINI) | |
41 | LDFLAGSICUIO += $(LDFLAGS_FINI) | |
42 | CPPFLAGSICUI18N += $(CPPFLAGS_FINI) | |
43 | LDFLAGSICUI18N += $(LDFLAGS_FINI) | |
44 | CPPFLAGSCTESTFW += $(CPPFLAGS_FINI) | |
45 | LDFLAGSCTESTFW += $(LDFLAGS_FINI) | |
46 | ||
47 | # ICUUC, ICUIO, ICUI18N, CTESTFW | |
48 | endif | |
46f4442e A |
49 | |
50 | # -Bhidden_def Hides all symbols defined in the module. | |
51 | #LIBCFLAGS = -Bhidden_def | |
52 | #LIBCXXFLAGS = -Bhidden_def | |
b75a7d8f A |
53 | |
54 | ## Commands to compile | |
55 | COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c | |
56 | COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c | |
57 | ||
58 | ## Common 'default' path to ensure the sanity of users. Search the current | |
59 | ## directory, at least. | |
73c04bcf | 60 | LD_DEFAULTPATH= -Wl,+b,'$$'ORIGIN/ |
b75a7d8f A |
61 | |
62 | # Use SHLIB_PATH and LD_LIBRARY_PATH to locate shared libraries | |
63 | LDFLAGS += -Wl,+s $(LD_DEFAULTPATH) | |
64 | ||
65 | ## Commands to link | |
66 | ## For aCC, use the C++ linker so that __shlinit gets defined | |
67 | LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
68 | LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
69 | ||
729e4ab9 A |
70 | ## Shared library options |
71 | ## HPUX PA-risc does not recognize -Bprotected_def aC++ option. | |
72 | ## Use linker option -Wl,-B,symbolic instead. | |
73 | ifeq ($(shell uname -m),ia64) | |
4388f060 | 74 | LD_SOOPTIONS= -Bprotected_def |
729e4ab9 | 75 | else |
4388f060 | 76 | LD_SOOPTIONS= -Wl,-B,symbolic |
729e4ab9 A |
77 | endif |
78 | ||
b75a7d8f A |
79 | ## Commands to make a shared library |
80 | #SHLIB.c= $(LD) $(LDFLAGS) -b | |
729e4ab9 A |
81 | SHLIB.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) -b $(LD_SOOPTIONS) |
82 | SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -b $(LD_SOOPTIONS) | |
b75a7d8f A |
83 | |
84 | ## Compiler switch to embed a runtime search path | |
85 | LD_RPATH= -Wl,+b, | |
86 | LD_RPATH_PRE= | |
87 | ||
88 | ## Environment variable to set a runtime search path | |
89 | LDLIBRARYPATH_ENVVAR = SHLIB_PATH | |
90 | ||
91 | ## Compiler switch to embed a library name | |
374ca955 A |
92 | LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET)) |
93 | ||
94 | ## The type of assembly needed when pkgdata is used for generating shared libraries. | |
95 | # Commented out for now because the hp1 test machine runs out of memory. | |
46f4442e | 96 | #GENCCODE_ASSEMBLY=-a aCC-parisc |
b75a7d8f A |
97 | |
98 | ## Shared object suffix | |
99 | SO= sl | |
100 | ## Non-shared intermediate object suffix | |
101 | STATIC_O = o | |
102 | ||
103 | ## Compilation rules | |
104 | %.$(STATIC_O): $(srcdir)/%.c | |
105 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
106 | %.o: $(srcdir)/%.c | |
107 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
108 | ||
109 | %.$(STATIC_O): $(srcdir)/%.cpp | |
110 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
111 | %.o: $(srcdir)/%.cpp | |
112 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
113 | ||
b75a7d8f A |
114 | |
115 | ## Dependency rules | |
116 | %.d : $(srcdir)/%.c | |
117 | @echo "generating dependency information for $<" | |
118 | @$(GEN_DEPS.c) $< > $@ | |
119 | ||
120 | %.d : $(srcdir)/%.cpp | |
121 | @echo "generating dependency information for $<" | |
122 | @$(GEN_DEPS.cc) $< > $@ | |
123 | ||
124 | ## Versioned libraries rules | |
125 | ||
126 | %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) | |
374ca955 | 127 | $(RM) $@ && ln -s ${<F} $@ |
b75a7d8f | 128 | %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR) |
374ca955 | 129 | $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@ |
b75a7d8f A |
130 | |
131 | ## Install libraries as executable | |
132 | INSTALL-L=$(INSTALL_PROGRAM) | |
133 | ||
729e4ab9 A |
134 | ## Remove shared library 's' |
135 | STATIC_PREFIX_WHEN_USED = | |
136 | STATIC_PREFIX = | |
137 | ||
b75a7d8f | 138 | ## End HP/UX-specific setup |