2 ## Copyright (C) 2016 and later: Unicode, Inc. and others.
3 ## License & terms of use: http://www.unicode.org/copyright.html
4 ## HP/UX-specific setup using aCC
5 ## Copyright (c) 1999-2012, International Business Machines Corporation and
6 ## others. All Rights Reserved.
8 ## Commands to generate dependency files
12 ## Flags for position independent code
14 SHAREDLIBCXXFLAGS = +Z
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
21 # Use Extended ANSI mode, which is useful for 64-bit numbers
22 # +W ignores some warnings
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)
26 # 823 Redundant preprocessing concatenation operation results in two valid
27 # preprocessing tokens. This comes from INT64_C in <inttypes.h>
28 # 4232 conversion to a more strictly aligned type may cause misaligned access.
29 CFLAGS += -Ae +Olit=all
30 CXXFLAGS += -AA -Wc,-ansi_for_scope,on +W740 +W749 +W823 +W4232
32 ifeq ($(UCLN_NO_AUTO_CLEANUP),0)
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)
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)
47 # ICUUC, ICUIO, ICUI18N, CTESTFW
50 # -Bhidden_def Hides all symbols defined in the module.
51 #LIBCFLAGS = -Bhidden_def
52 #LIBCXXFLAGS = -Bhidden_def
54 ## Commands to compile
55 COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c
56 COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c
58 ## Common 'default' path to ensure the sanity of users. Search the current
59 ## directory, at least.
60 LD_DEFAULTPATH= -Wl,+b,'$$'ORIGIN/
62 # Use SHLIB_PATH and LD_LIBRARY_PATH to locate shared libraries
63 LDFLAGS += -Wl,+s $(LD_DEFAULTPATH)
66 ## For aCC, use the C++ linker so that __shlinit gets defined
67 LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS)
68 LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
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)
74 LD_SOOPTIONS= -Bprotected_def
76 LD_SOOPTIONS= -Wl,-B,symbolic
79 ## Commands to make a shared library
80 #SHLIB.c= $(LD) $(LDFLAGS) -b
81 SHLIB.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) -b $(LD_SOOPTIONS)
82 SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -b $(LD_SOOPTIONS)
84 ## Compiler switch to embed a runtime search path
88 ## Environment variable to set a runtime search path
89 LDLIBRARYPATH_ENVVAR = SHLIB_PATH
91 ## Compiler switch to embed a library name
92 LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET))
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.
96 #GENCCODE_ASSEMBLY=-a aCC-parisc
98 ## Shared object suffix
100 ## Non-shared intermediate object suffix
104 %.$(STATIC_O): $(srcdir)/%.c
105 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
107 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
109 %.$(STATIC_O): $(srcdir)/%.cpp
110 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
112 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
117 @echo "generating dependency information for $<"
118 @$(GEN_DEPS.c) $< > $@
120 %.d : $(srcdir)/%.cpp
121 @echo "generating dependency information for $<"
122 @$(GEN_DEPS.cc) $< > $@
124 ## Versioned libraries rules
126 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
127 $(RM) $@ && ln -s ${<F} $@
128 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
129 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
131 ## Install libraries as executable
132 INSTALL-L=$(INSTALL_PROGRAM)
134 ## Remove shared library 's'
135 STATIC_PREFIX_WHEN_USED =
138 ## End HP/UX-specific setup