2 ## Solaris-specific setup using gcc
3 ## Copyright (c) 1999-2010, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## Flags for position independent code
7 SHAREDLIBCFLAGS = -fPIC
8 SHAREDLIBCXXFLAGS = -fPIC
9 SHAREDLIBCPPFLAGS = -DPIC
11 ## Commands to generate dependency files
12 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
13 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS)
15 ## These are the library specific LDFLAGS
16 LDFLAGSICUDT=-nodefaultlibs -nostdlib
18 ## Additional flags when building libraries and with threads
19 THREADSCPPFLAGS = -D_REENTRANT
21 ## Compiler switch to embed a runtime search path
22 LD_RPATH= -R'$$'ORIGIN
25 ## Compiler switch to embed a library name
26 LD_SONAME = -h $(notdir $(MIDDLE_SO_TARGET))
28 ## Shared library options
29 LD_SOOPTIONS= -Wl,-Bsymbolic
31 ## The type of assembly needed when pkgdata is used for generating shared libraries.
32 ## Only use this when not on x86 Solaris.
33 ifeq (strip $(GENCCODE_ASSEMBLY),)
34 GENCCODE_ASSEMBLY=-a sun
37 ## Shared object suffix
39 ## Non-shared intermediate object suffix
43 %.$(STATIC_O): $(srcdir)/%.c
44 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
46 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
48 %.$(STATIC_O): $(srcdir)/%.cpp
49 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
51 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
56 @echo "generating dependency information for $<"
57 @$(SHELL) -ec '$(GEN_DEPS.c) $< \
58 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
59 [ -s $@ ] || rm -f $@'
62 @echo "generating dependency information for $<"
63 @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
64 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
65 [ -s $@ ] || rm -f $@'
67 ## Versioned libraries rules
69 %.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
70 $(RM) $@ && ln -s ${<F} $@
71 %.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
72 $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
74 ## Remove shared library 's'
75 STATIC_PREFIX_WHEN_USED =
78 ## End Solaris-specific setup