OSDN Git Service

Check for -fstack-protector
[android-x86/hardware-intel-common-vaapi.git] / src / Makefile.am
1 # Copyright (c) 2007 Intel Corporation. All Rights Reserved.
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the
5 # "Software"), to deal in the Software without restriction, including
6 # without limitation the rights to use, copy, modify, merge, publish,
7 # distribute, sub license, and/or sell copies of the Software, and to
8 # permit persons to whom the Software is furnished to do so, subject to
9 # the following conditions:
10
11 # The above copyright notice and this permission notice (including the
12 # next paragraph) shall be included in all copies or substantial portions
13 # of the Software.
14
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
18 # IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
19 # ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 SUBDIRS         = shaders
24 DIST_SUBDIRS    = $(SUBDIRS)
25 EXTRA_DIST      =
26 BUILT_SOURCES   =
27
28 AM_CPPFLAGS = \
29         -DPTHREADS              \
30         $(DRM_CFLAGS)           \
31         $(LIBVA_DEPS_CFLAGS)    \
32         -DVA_DRIVERS_PATH="\"$(LIBVA_DRIVERS_PATH)\"" \
33         $(NULL)
34
35 driver_cflags = \
36         -Wall                   \
37         -fvisibility=hidden     \
38         $(NULL)
39
40 if USE_SSP
41 driver_cflags += -fstack-protector
42 endif
43
44 driver_ldflags = \
45         -avoid-version          \
46         -no-undefined           \
47         -Wl,--no-undefined      \
48         $(NULL)
49
50 driver_libs = \
51         -lpthread -lm -ldl      \
52         $(DRM_LIBS)             \
53         $(NULL)
54
55 include Makefile.sources
56
57 # convenience library that can be linked by driver and tests
58 noinst_LTLIBRARIES              = libi965_drv_video.la
59 libi965_drv_video_la_CFLAGS     = $(driver_cflags)
60 libi965_drv_video_la_LDFLAGS    = $(driver_ldflags)
61 libi965_drv_video_la_LIBADD     = $(driver_libs)
62 libi965_drv_video_la_SOURCES    = $(source_c)
63
64 # driver module
65 i965_drv_video_la_LTLIBRARIES   = i965_drv_video.la
66 i965_drv_video_ladir            = $(LIBVA_DRIVERS_PATH)
67 i965_drv_video_la_CFLAGS        = $(driver_cflags)
68 i965_drv_video_la_LDFLAGS       = -module $(driver_ldflags)
69 i965_drv_video_la_LIBADD        = libi965_drv_video.la $(driver_libs)
70 i965_drv_video_la_SOURCES       =
71
72 noinst_HEADERS                  = $(source_h)
73
74 if USE_X11
75 source_c                        += i965_output_dri.c
76 source_h                        += i965_output_dri.h
77 endif
78
79 if USE_WAYLAND
80 source_c                        += i965_output_wayland.c
81 source_h                        += i965_output_wayland.h
82 source_h                        += $(protocol_source_h)
83 driver_cflags                   += $(WAYLAND_CLIENT_CFLAGS)
84 endif
85
86 # git version
87 VERSION_FILE                    = .VERSION
88 OLD_VERSION_FILE                = $(VERSION_FILE).old
89 NEW_VERSION_FILE                = $(VERSION_FILE).new
90 PKG_VERSION_FILE                = $(VERSION_FILE).pkg
91
92 intel_version.h: gen-version
93         $(AM_V_GEN)                                                      \
94         OV=`[ -f $(OLD_VERSION_FILE) ] && cat $(OLD_VERSION_FILE) || :`; \
95         NV=`cat $(NEW_VERSION_FILE)`;                                    \
96         if [ "$$OV" != "$$NV" -o ! -f intel_version.h ]; then            \
97                 cp -f $(NEW_VERSION_FILE) $(OLD_VERSION_FILE);           \
98                 $(SED) -e "s|\@INTEL_DRIVER_GIT_VERSION\@|$${NV}|"       \
99                         $(srcdir)/intel_version.h.in > intel_version.h;  \
100         fi
101
102 gen-version:
103         @echo $(VERSION) > $(NEW_VERSION_FILE)
104 if HAVE_GIT
105         @[ -d $(top_srcdir)/.git ] && \
106         (cd $(top_srcdir) && $(GIT) describe --tags) > $(NEW_VERSION_FILE) || :
107 endif
108         @[ -f $(srcdir)/$(PKG_VERSION_FILE) ] && \
109         cp -f $(srcdir)/$(PKG_VERSION_FILE) $(NEW_VERSION_FILE) || :
110
111 $(PKG_VERSION_FILE): $(NEW_VERSION_FILE)
112         @cp -f $< $@
113
114 BUILT_SOURCES   += intel_version.h
115 EXTRA_DIST      += Android.mk intel_version.h.in $(PKG_VERSION_FILE)
116
117 # Wayland protocol
118 if USE_WAYLAND
119 protocol_source_h = wayland-drm-client-protocol.h
120 i965_output_wayland.c: $(protocol_source_h)
121 %-client-protocol.h : %.xml
122         $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
123
124 BUILT_SOURCES += $(protocol_source_h)
125 endif
126
127 EXTRA_DIST += \
128         wayland-drm.xml         \
129         $(NULL)
130
131 CLEANFILES = $(BUILT_SOURCES)
132
133 DISTCLEANFILES = \
134         $(VERSION_FILE) \
135         $(OLD_VERSION_FILE)     \
136         $(PKG_VERSION_FILE)     \
137         $(NEW_VERSION_FILE)     \
138         $(NULL)
139
140 # Extra clean files so that maintainer-clean removes *everything*
141 MAINTAINERCLEANFILES = Makefile.in config.h.in