f9d348284521c30ec038f684bfcde701ea103647
[mesa.git] / src / gallium / targets / dri / Makefile.am
1 include $(top_srcdir)/src/gallium/Automake.inc
2
3 AM_CFLAGS = \
4 -I$(top_srcdir)/src/mapi \
5 -I$(top_srcdir)/src/mesa \
6 -I$(top_srcdir)/src/mesa/drivers/dri/common \
7 -I$(top_srcdir)/src/gallium/state_trackers/dri/common \
8 $(GALLIUM_TARGET_CFLAGS)
9
10 AM_CPPFLAGS = \
11 -DGALLIUM_GALAHAD \
12 -DGALLIUM_NOOP \
13 -DGALLIUM_RBUG \
14 -DGALLIUM_TRACE
15
16 if HAVE_GALLIUM_NOUVEAU
17 AM_CPPFLAGS += \
18 -DDRI_TARGET
19 endif
20
21 dridir = $(DRI_DRIVER_INSTALL_DIR)
22 dri_LTLIBRARIES = gallium_dri.la
23
24 nodist_EXTRA_gallium_dri_la_SOURCES = dummy.cpp
25 gallium_dri_la_SOURCES =
26
27 gallium_dri_la_LDFLAGS = \
28 -shared \
29 -shrext .so \
30 -module \
31 -avoid-version \
32 -Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn \
33 $(GC_SECTIONS)
34
35 if HAVE_LD_VERSION_SCRIPT
36 gallium_dri_la_LDFLAGS += \
37 -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri/dri.sym
38 endif # HAVE_LD_VERSION_SCRIPT
39
40 # XXX: Fold libdridrm/libdrisw as drivers become megadriver (__dri*DriverExtension) aware
41 gallium_dri_la_LIBADD = \
42 $(top_builddir)/src/mesa/libmesagallium.la \
43 $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
44 $(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \
45 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
46 $(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
47 $(top_builddir)/src/gallium/drivers/noop/libnoop.la \
48 $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
49 $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
50 $(SELINUX_LIBS) \
51 $(EXPAT_LIBS) \
52 $(LIBDRM_LIBS) \
53 $(GALLIUM_COMMON_LIB_DEPS)
54
55 if HAVE_GALLIUM_STATIC_TARGETS
56
57 # XXX: Temporary allow duplicated symbols, as the loader pulls in xmlconfig.c
58 # which already provides driParse* and driQuery* amongst others.
59 # Remove this hack as we come up with a cleaner solution.
60 gallium_dri_la_LDFLAGS += \
61 -Wl,--allow-multiple-definition
62
63 MEGADRIVERS =
64 STATIC_TARGET_CPPFLAGS =
65 STATIC_TARGET_LIB_DEPS = \
66 $(top_builddir)/src/loader/libloader.la
67
68 if HAVE_GALLIUM_I915
69 MEGADRIVERS += i915
70 STATIC_TARGET_CPPFLAGS += -DGALLIUM_I915
71 STATIC_TARGET_LIB_DEPS += \
72 $(top_builddir)/src/gallium/winsys/i915/drm/libi915drm.la \
73 $(top_builddir)/src/gallium/drivers/i915/libi915.la \
74 $(INTEL_LIBS)
75 endif
76
77 if HAVE_GALLIUM_ILO
78 MEGADRIVERS += ilo
79 STATIC_TARGET_CPPFLAGS += -DGALLIUM_ILO
80 STATIC_TARGET_LIB_DEPS += \
81 $(top_builddir)/src/gallium/winsys/intel/drm/libintelwinsys.la \
82 $(top_builddir)/src/gallium/drivers/ilo/libilo.la \
83 $(INTEL_LIBS)
84 endif
85
86 if HAVE_GALLIUM_NOUVEAU
87 MEGADRIVERS += nouveau
88 STATIC_TARGET_CPPFLAGS += -DGALLIUM_NOUVEAU
89 STATIC_TARGET_LIB_DEPS += \
90 $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
91 $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
92 $(NOUVEAU_LIBS)
93 endif
94
95 if NEED_RADEON_DRM_WINSYS
96 STATIC_TARGET_LIB_DEPS += \
97 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
98 endif
99
100 if HAVE_GALLIUM_RADEON_COMMON
101 STATIC_TARGET_LIB_DEPS += \
102 $(top_builddir)/src/gallium/drivers/radeon/libradeon.la
103 endif
104
105 if HAVE_GALLIUM_R300
106 MEGADRIVERS += r300
107 STATIC_TARGET_CPPFLAGS += -DGALLIUM_R300
108 STATIC_TARGET_LIB_DEPS += \
109 $(top_builddir)/src/gallium/drivers/r300/libr300.la \
110 $(RADEON_LIBS)
111 endif
112
113 if HAVE_GALLIUM_R600
114 MEGADRIVERS += r600
115 STATIC_TARGET_CPPFLAGS += -DGALLIUM_R600
116 STATIC_TARGET_LIB_DEPS += \
117 $(top_builddir)/src/gallium/drivers/r600/libr600.la \
118 $(RADEON_LIBS)
119 endif
120
121 if HAVE_GALLIUM_RADEONSI
122 MEGADRIVERS += radeonsi
123 STATIC_TARGET_CPPFLAGS += -DGALLIUM_RADEONSI
124 STATIC_TARGET_LIB_DEPS += \
125 $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
126 $(RADEON_LIBS)
127 endif
128
129 if HAVE_GALLIUM_SVGA
130 MEGADRIVERS += vmwgfx
131 STATIC_TARGET_CPPFLAGS += -DGALLIUM_VMWGFX
132 STATIC_TARGET_LIB_DEPS += \
133 $(top_builddir)/src/gallium/winsys/svga/drm/libsvgadrm.la \
134 $(top_builddir)/src/gallium/drivers/svga/libsvga.la
135 endif
136
137 if HAVE_GALLIUM_FREEDRENO
138 MEGADRIVERS += freedreno
139 STATIC_TARGET_CPPFLAGS += -DGALLIUM_FREEDRENO
140 STATIC_TARGET_LIB_DEPS += \
141 $(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
142 $(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
143 $(FREEDRENO_LIBS)
144
145 endif
146
147 gallium_dri_la_SOURCES += target.c
148 AM_CPPFLAGS += $(STATIC_TARGET_CPPFLAGS)
149 gallium_dri_la_LIBADD += $(STATIC_TARGET_LIB_DEPS)
150
151 else # HAVE_GALLIUM_STATIC_TARGETS
152
153 gallium_dri_la_LIBADD += \
154 $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
155 $(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
156 $(GALLIUM_PIPE_LOADER_LIBS)
157
158 endif # HAVE_GALLIUM_STATIC_TARGETS
159
160 if HAVE_MESA_LLVM
161 gallium_dri_la_LIBADD += $(LLVM_LIBS)
162 gallium_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
163 endif
164
165 if HAVE_COMPAT_SYMLINKS
166 # Add a link to allow setting LIBGL_DRIVERS_PATH to /lib/gallium of the build tree.
167 all-local: $(dri_LTLIBRARIES)
168 $(AM_V_GEN)link_dir=$(top_builddir)/$(LIB_DIR)/gallium; \
169 $(MKDIR_P) $${link_dir}; \
170 for i in $(MEGADRIVERS); do \
171 j=gallium_dri.so; \
172 k=$${i}_dri.so; \
173 ln -f .libs/$${j} \
174 $${link_dir}/$${k}; \
175 done
176 endif
177
178 # hardlink each megadriver instance, but don't actually have
179 # gallium_dri.so in the set of final installed files.
180 install-data-hook:
181 $(AM_V_GEN)dest_dir=$(DESTDIR)/$(dridir); \
182 for i in $(MEGADRIVERS); do \
183 j=gallium_dri.so; \
184 k=$${i}_dri.so; \
185 ln -f $${dest_dir}/$${j} \
186 $${dest_dir}/$${k}; \
187 done; \
188 $(RM) -f $$dest_dir/gallium_dri.*