2 ## HP/UX-specific setup using aCC
3 ## Copyright (c) 1999-2006, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## Commands to generate dependency files
10 ## Flags for position independent code
12 SHAREDLIBCXXFLAGS = +z
14 ## Additional flags when building libraries with threads
15 ## We use this instead of -mt, which isn't available in all versions of aCC
16 ## Our tools won't compile with -D_POSIX_C_SOURCE=199506L
17 THREADSCPPFLAGS = -D_REENTRANT -D_THREAD_SAFE
19 # Use Extended ANSI mode, which is useful for 64-bit numbers
20 # +Olibcalls uses intrinsic functions for strlen and others
21 # +W ignores some warnings
22 # 495 The linkage directive is ignored for an object or function...
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 CFLAGS += +Olibcalls -Ae +ESlit
29 CXXFLAGS += +Olibcalls +W495 +W740 +W749 +W823
31 ## Commands to compile
32 COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c
33 COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c
35 ## Common 'default' path to ensure the sanity of users. Search the current
36 ## directory, at least.
37 LD_DEFAULTPATH= -Wl,+b,'$$'ORIGIN/
39 # Use SHLIB_PATH and LD_LIBRARY_PATH to locate shared libraries
40 LDFLAGS += -Wl,+s $(LD_DEFAULTPATH)
43 ## For aCC, use the C++ linker so that __shlinit gets defined
44 LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS)
45 LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
47 ## Commands to make a shared library
48 #SHLIB.c= $(LD) $(LDFLAGS) -b
49 SHLIB.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) -b
50 SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -b
52 ## Compiler switch to embed a runtime search path
56 ## Environment variable to set a runtime search path
57 LDLIBRARYPATH_ENVVAR = SHLIB_PATH
59 ## Compiler switch to embed a library name
60 LD_SONAME = -Wl,+h,$(notdir $(MIDDLE_SO_TARGET))
62 ## The type of assembly needed when pkgdata is used for generating shared libraries.
63 # Commented out for now because the hp1 test machine runs out of memory.
64 #GENCCODE_ASSEMBLY=-a aCC
66 ## Shared object suffix
68 ## Non-shared intermediate object suffix
72 %.$(STATIC_O): $(srcdir)/%.c
73 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
75 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
77 %.$(STATIC_O): $(srcdir)/%.cpp
78 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
80 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
85 @echo "generating dependency information for $<"
86 @$(GEN_DEPS.c) $< > $@
89 @echo "generating dependency information for $<"
90 @$(GEN_DEPS.cc) $< > $@
92 ## Versioned libraries rules
94 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
95 $(RM) $@ && ln -s ${<F} $@
96 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
97 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
99 ## Install libraries as executable
100 INSTALL-L=$(INSTALL_PROGRAM)
102 ## End HP/UX-specific setup