targets/(r300|r600|radeonsi)/dri: Convert to static/shared pipe-drivers
[mesa.git] / src / gallium / targets / dri / Makefile.am
1 include $(top_srcdir)/src/gallium/Automake.inc
2
3 AM_CFLAGS = \
4 $(GALLIUM_TARGET_CFLAGS)
5
6 AM_CPPFLAGS = \
7 -DGALLIUM_GALAHAD \
8 -DGALLIUM_NOOP \
9 -DGALLIUM_RBUG \
10 -DGALLIUM_TRACE
11
12 dridir = $(DRI_DRIVER_INSTALL_DIR)
13 dri_LTLIBRARIES = gallium_dri.la
14
15 nodist_EXTRA_gallium_dri_la_SOURCES = dummy.cpp
16 gallium_dri_la_SOURCES =
17
18 gallium_dri_la_LDFLAGS = \
19 -shared \
20 -shrext .so \
21 -module \
22 -avoid-version \
23 -Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn \
24 $(GC_SECTIONS)
25
26 if HAVE_LD_VERSION_SCRIPT
27 gallium_dri_la_LDFLAGS += \
28 -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri/dri.sym
29 endif # HAVE_LD_VERSION_SCRIPT
30
31 # XXX: Fold libdridrm/libdrisw as drivers become megadriver (__dri*DriverExtension) aware
32 gallium_dri_la_LIBADD = \
33 $(top_builddir)/src/mesa/libmesagallium.la \
34 $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
35 $(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm_s.la \
36 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
37 $(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
38 $(top_builddir)/src/gallium/drivers/noop/libnoop.la \
39 $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
40 $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
41 $(SELINUX_LIBS) \
42 $(EXPAT_LIBS) \
43 $(LIBDRM_LIBS) \
44 $(GALLIUM_COMMON_LIB_DEPS)
45
46 if HAVE_GALLIUM_STATIC_TARGETS
47
48 MEGADRIVERS =
49 STATIC_TARGET_CPPFLAGS =
50 STATIC_TARGET_LIB_DEPS = \
51 $(top_builddir)/src/loader/libloader.la
52
53 if HAVE_GALLIUM_NOUVEAU
54 MEGADRIVERS += nouveau
55 STATIC_TARGET_CPPFLAGS += -DGALLIUM_NOUVEAU
56 STATIC_TARGET_LIB_DEPS += \
57 $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
58 $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
59 $(NOUVEAU_LIBS)
60 endif
61
62 if NEED_RADEON_DRM_WINSYS
63 STATIC_TARGET_LIB_DEPS += \
64 $(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la
65 endif
66
67 if HAVE_GALLIUM_RADEON_COMMON
68 STATIC_TARGET_LIB_DEPS += \
69 $(top_builddir)/src/gallium/drivers/radeon/libradeon.la
70 endif
71
72 if HAVE_GALLIUM_R300
73 MEGADRIVERS += r300
74 STATIC_TARGET_CPPFLAGS += -DGALLIUM_R300
75 STATIC_TARGET_LIB_DEPS += \
76 $(top_builddir)/src/gallium/drivers/r300/libr300.la \
77 $(RADEON_LIBS)
78 endif
79
80 if HAVE_GALLIUM_R600
81 MEGADRIVERS += r600
82 STATIC_TARGET_CPPFLAGS += -DGALLIUM_R600
83 STATIC_TARGET_LIB_DEPS += \
84 $(top_builddir)/src/gallium/drivers/r600/libr600.la \
85 $(RADEON_LIBS)
86 endif
87
88 if HAVE_GALLIUM_RADEONSI
89 MEGADRIVERS += radeonsi
90 STATIC_TARGET_CPPFLAGS += -DGALLIUM_RADEONSI
91 STATIC_TARGET_LIB_DEPS += \
92 $(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
93 $(RADEON_LIBS)
94 endif
95 gallium_dri_la_SOURCES += target.c
96 AM_CPPFLAGS += $(STATIC_TARGET_CPPFLAGS)
97 gallium_dri_la_LIBADD += $(STATIC_TARGET_LIB_DEPS)
98
99 else # HAVE_GALLIUM_STATIC_TARGETS
100
101 gallium_dri_la_LIBADD += \
102 $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
103 $(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
104 $(GALLIUM_PIPE_LOADER_LIBS)
105
106 endif # HAVE_GALLIUM_STATIC_TARGETS
107
108 if HAVE_MESA_LLVM
109 gallium_dri_la_LIBADD += $(LLVM_LIBS)
110 gallium_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
111 endif
112
113 if HAVE_COMPAT_SYMLINKS
114 # Add a link to allow setting LIBGL_DRIVERS_PATH to /lib/gallium of the build tree.
115 all-local: $(dri_LTLIBRARIES)
116 $(AM_V_GEN)link_dir=$(top_builddir)/$(LIB_DIR)/gallium; \
117 $(MKDIR_P) $${link_dir}; \
118 for i in $(MEGADRIVERS); do \
119 j=gallium_dri.so; \
120 k=$${i}_dri.so; \
121 ln -f .libs/$${j} \
122 $${link_dir}/$${k}; \
123 done
124 endif
125
126 # hardlink each megadriver instance, but don't actually have
127 # gallium_dri.so in the set of final installed files.
128 install-data-hook:
129 $(AM_V_GEN)dest_dir=$(DESTDIR)/$(dridir); \
130 for i in $(MEGADRIVERS); do \
131 j=gallium_dri.so; \
132 k=$${i}_dri.so; \
133 ln -f $${dest_dir}/$${j} \
134 $${dest_dir}/$${k}; \
135 done; \
136 $(RM) -f $$dest_dir/gallium_dri.*