automake: ask the linker to do garbage collection
[mesa.git] / src / gallium / targets / gbm / 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 gbmdir = $(libdir)/gbm
26
27 AM_CPPFLAGS = \
28 -I$(top_srcdir)/include \
29 -I$(top_srcdir)/src/gallium/state_trackers/gbm \
30 -I$(top_srcdir)/src/gbm/main \
31 -I$(top_srcdir)/src/gallium/winsys \
32 $(GALLIUM_PIPE_LOADER_DEFINES) \
33 -DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\"
34
35 AM_CFLAGS = \
36 $(GALLIUM_CFLAGS) \
37 $(VISIBILITY_CFLAGS) \
38 $(LIBDRM_CFLAGS)
39
40 gbm_LTLIBRARIES = gbm_gallium_drm.la
41
42 nodist_EXTRA_gbm_gallium_drm_la_SOURCES = dummy.cpp
43 gbm_gallium_drm_la_SOURCES = gbm.c
44
45 gbm_gallium_drm_la_LIBADD = \
46 $(GALLIUM_PIPE_LOADER_CLIENT_LIBS) \
47 $(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader_client.la \
48 $(top_builddir)/src/gallium/winsys/sw/null/libws_null.la \
49 $(top_builddir)/src/gallium/state_trackers/gbm/libgbm.la \
50 $(top_builddir)/src/gallium/auxiliary/libgallium.la \
51 $(LIBDRM_LIBS) \
52 -lm \
53 $(CLOCK_LIB) \
54 $(PTHREAD_LIBS) \
55 $(DLOPEN_LIBS)
56
57 if HAVE_DRI
58 gbm_gallium_drm_la_LIBADD += \
59 $(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la
60 endif
61
62 if NEED_PIPE_LOADER_XLIB
63 gbm_gallium_drm_la_LIBADD += \
64 $(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la \
65 -lX11 -lXext -lXfixes \
66 $(LIBDRM_LIBS)
67 endif
68
69 gbm_gallium_drm_la_LDFLAGS = \
70 -module \
71 -no-undefined \
72 -avoid-version \
73 $(GC_SECTIONS) \
74 -Wl,--no-undefined
75
76 if HAVE_MESA_LLVM
77 gbm_gallium_drm_la_LIBADD += $(LLVM_LIBS)
78 gbm_gallium_drm_la_LDFLAGS += $(LLVM_LDFLAGS)
79 endif
80
81 TESTS = gallium-gbm-symbols-check