automake: ask the linker to do garbage collection
[mesa.git] / src / gallium / targets / pipe-loader / Makefile.am
1 # Copyright © 2012 Intel Corporation
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
12 # Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 # DEALINGS IN THE SOFTWARE.
22
23 include $(top_srcdir)/src/gallium/Automake.inc
24
25 AM_CPPFLAGS = \
26 $(GALLIUM_CFLAGS) \
27 -I$(top_srcdir)/include \
28 -I$(top_srcdir)/src/gallium/drivers \
29 -I$(top_srcdir)/src/gallium/winsys \
30 $(LIBDRM_CFLAGS) \
31 -DGALLIUM_RBUG \
32 -DGALLIUM_TRACE \
33 -DGALLIUM_GALAHAD
34
35 pipedir = $(libdir)/gallium-pipe
36 pipe_LTLIBRARIES =
37
38 PIPE_LIBS = \
39 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
40 $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
41 $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
42 $(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
43 -lm \
44 $(CLOCK_LIB) \
45 $(PTHREAD_LIBS) \
46 $(DLOPEN_LIBS)
47
48 AM_LDFLAGS = \
49 -module \
50 -no-undefined \
51 -avoid-version \
52 $(GC_SECTIONS) \
53 -Wl,--no-undefined \
54 -Wl,--version-script=$(top_srcdir)/src/gallium/targets/pipe-loader/pipe.link
55
56 if HAVE_MESA_LLVM
57 PIPE_LIBS += $(LLVM_LIBS)
58 AM_LDFLAGS += $(LLVM_LDFLAGS)
59 endif
60
61 if HAVE_GALLIUM_I915
62 pipe_LTLIBRARIES += pipe_i915.la
63
64 pipe_i915_la_SOURCES = pipe_i915.c
65 nodist_EXTRA_pipe_i915_la_SOURCES = dummy.cpp
66 pipe_i915_la_LIBADD = \
67 $(PIPE_LIBS) \
68 $(top_builddir)/src/gallium/winsys/i915/drm/libi915drm.la \
69 $(top_builddir)/src/gallium/drivers/i915/libi915.la \
70 $(LIBDRM_LIBS) \
71 $(INTEL_LIBS)
72
73 endif
74
75 if HAVE_GALLIUM_NOUVEAU
76 pipe_LTLIBRARIES += pipe_nouveau.la
77
78 pipe_nouveau_la_SOURCES = pipe_nouveau.c
79 nodist_EXTRA_pipe_nouveau_la_SOURCES = dummy.cpp
80 pipe_nouveau_la_LIBADD = \
81 $(PIPE_LIBS) \
82 $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
83 $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
84 $(LIBDRM_LIBS) \
85 $(NOUVEAU_LIBS)
86
87 endif
88
89 if HAVE_GALLIUM_R300
90 pipe_LTLIBRARIES += pipe_r300.la
91
92 pipe_r300_la_SOURCES = pipe_r300.c
93 nodist_EXTRA_pipe_r300_la_SOURCES = dummy.cpp
94 pipe_r300_la_LIBADD = \
95 $(PIPE_LIBS) \
96 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
97 $(top_builddir)/src/gallium/drivers/r300/libr300-helper.la \
98 $(top_builddir)/src/gallium/drivers/r300/libr300.la \
99 $(LIBDRM_LIBS) \
100 $(RADEON_LIBS)
101
102 endif
103
104 if HAVE_GALLIUM_R600
105 pipe_LTLIBRARIES += pipe_r600.la
106
107 pipe_r600_la_SOURCES = pipe_r600.c
108 nodist_EXTRA_pipe_r600_la_SOURCES = dummy.cpp
109 pipe_r600_la_LIBADD = \
110 $(PIPE_LIBS) \
111 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
112 $(top_builddir)/src/gallium/drivers/r600/libr600.la \
113 $(LIBDRM_LIBS) \
114 $(RADEON_LIBS)
115
116 endif
117
118 if HAVE_GALLIUM_RADEONSI
119 pipe_LTLIBRARIES += pipe_radeonsi.la
120
121 pipe_radeonsi_la_SOURCES = pipe_radeonsi.c
122 nodist_EXTRA_pipe_radeonsi_la_SOURCES = dummy.cpp
123 pipe_radeonsi_la_LIBADD = \
124 $(PIPE_LIBS) \
125 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
126 $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
127 $(LIBDRM_LIBS) \
128 $(RADEON_LIBS)
129
130 endif
131
132 if HAVE_GALLIUM_FREEDRENO
133 pipe_LTLIBRARIES += pipe_msm.la
134
135 pipe_msm_la_SOURCES = pipe_msm.c
136 nodist_EXTRA_pipe_msm_la_SOURCES = dummy.cpp
137 pipe_msm_la_LIBADD = \
138 $(PIPE_LIBS) \
139 $(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
140 $(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
141 $(LIBDRM_LIBS) \
142 $(FREEDRENO_LIBS)
143
144 endif
145
146 if HAVE_GALLIUM_SVGA
147 pipe_LTLIBRARIES += pipe_vmwgfx.la
148
149 pipe_vmwgfx_la_SOURCES = pipe_vmwgfx.c
150 nodist_EXTRA_pipe_vmwgfx_la_SOURCES = dummy.cpp
151
152 pipe_vmwgfx_la_LIBADD = \
153 $(PIPE_LIBS) \
154 $(top_builddir)/src/gallium/winsys/svga/drm/libsvgadrm.la \
155 $(top_builddir)/src/gallium/drivers/svga/libsvga.la \
156 $(LIBDRM_LIBS)
157
158 endif
159
160 if HAVE_GALLIUM_SOFTPIPE
161 AM_CPPFLAGS += -DGALLIUM_SOFTPIPE
162
163 pipe_LTLIBRARIES += pipe_swrast.la
164 pipe_swrast_la_SOURCES = pipe_swrast.c
165 nodist_EXTRA_pipe_swrast_la_SOURCES = dummy.cpp
166
167 pipe_swrast_la_LIBADD = \
168 $(PIPE_LIBS) \
169 $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la
170
171 if HAVE_GALLIUM_LLVMPIPE
172 AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
173
174 pipe_swrast_la_LIBADD += \
175 $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la
176 endif
177 endif