targets/dri-nouveau: 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 gallium_dri_la_SOURCES += target.c
63 AM_CPPFLAGS += $(STATIC_TARGET_CPPFLAGS)
64 gallium_dri_la_LIBADD += $(STATIC_TARGET_LIB_DEPS)
65
66 else # HAVE_GALLIUM_STATIC_TARGETS
67
68 gallium_dri_la_LIBADD += \
69 $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la \
70 $(GALLIUM_PIPE_LOADER_WINSYS_LIBS) \
71 $(GALLIUM_PIPE_LOADER_LIBS)
72
73 endif # HAVE_GALLIUM_STATIC_TARGETS
74
75 if HAVE_MESA_LLVM
76 gallium_dri_la_LIBADD += $(LLVM_LIBS)
77 gallium_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
78 endif
79
80 if HAVE_COMPAT_SYMLINKS
81 # Add a link to allow setting LIBGL_DRIVERS_PATH to /lib/gallium of the build tree.
82 all-local: $(dri_LTLIBRARIES)
83 $(AM_V_GEN)link_dir=$(top_builddir)/$(LIB_DIR)/gallium; \
84 $(MKDIR_P) $${link_dir}; \
85 for i in $(MEGADRIVERS); do \
86 j=gallium_dri.so; \
87 k=$${i}_dri.so; \
88 ln -f .libs/$${j} \
89 $${link_dir}/$${k}; \
90 done
91 endif
92
93 # hardlink each megadriver instance, but don't actually have
94 # gallium_dri.so in the set of final installed files.
95 install-data-hook:
96 $(AM_V_GEN)dest_dir=$(DESTDIR)/$(dridir); \
97 for i in $(MEGADRIVERS); do \
98 j=gallium_dri.so; \
99 k=$${i}_dri.so; \
100 ln -f $${dest_dir}/$${j} \
101 $${dest_dir}/$${k}; \
102 done; \
103 $(RM) -f $$dest_dir/gallium_dri.*