101e04c3fSmrg# Copyright © 2017 Intel Corporation
201e04c3fSmrg
301e04c3fSmrg# Permission is hereby granted, free of charge, to any person obtaining a copy
401e04c3fSmrg# of this software and associated documentation files (the "Software"), to deal
501e04c3fSmrg# in the Software without restriction, including without limitation the rights
601e04c3fSmrg# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
701e04c3fSmrg# copies of the Software, and to permit persons to whom the Software is
801e04c3fSmrg# furnished to do so, subject to the following conditions:
901e04c3fSmrg
1001e04c3fSmrg# The above copyright notice and this permission notice shall be included in
1101e04c3fSmrg# all copies or substantial portions of the Software.
1201e04c3fSmrg
1301e04c3fSmrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1401e04c3fSmrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1501e04c3fSmrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1601e04c3fSmrg# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1701e04c3fSmrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1801e04c3fSmrg# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1901e04c3fSmrg# SOFTWARE.
2001e04c3fSmrg
2101e04c3fSmrgfiles_addrlib = files(
22ed98bd31Smaya  'inc/addrinterface.h',
23ed98bd31Smaya  'inc/addrtypes.h',
24ed98bd31Smaya  'src/addrinterface.cpp',
25ed98bd31Smaya  'src/core/addrcommon.h',
26ed98bd31Smaya  'src/core/addrelemlib.cpp',
27ed98bd31Smaya  'src/core/addrelemlib.h',
28ed98bd31Smaya  'src/core/addrlib.cpp',
29ed98bd31Smaya  'src/core/addrlib.h',
30ed98bd31Smaya  'src/core/addrlib1.cpp',
31ed98bd31Smaya  'src/core/addrlib1.h',
32ed98bd31Smaya  'src/core/addrlib2.cpp',
33ed98bd31Smaya  'src/core/addrlib2.h',
34ed98bd31Smaya  'src/core/addrobject.cpp',
35ed98bd31Smaya  'src/core/addrobject.h',
36ed98bd31Smaya  'src/core/coord.cpp',
37ed98bd31Smaya  'src/core/coord.h',
38ed98bd31Smaya  'src/gfx9/gfx9addrlib.cpp',
39ed98bd31Smaya  'src/gfx9/gfx9addrlib.h',
407ec681f3Smrg  'src/gfx10/gfx10addrlib.cpp',
417ec681f3Smrg  'src/gfx10/gfx10addrlib.h',
427ec681f3Smrg  'src/gfx10/gfx10SwizzlePattern.h',
43ed98bd31Smaya  'src/amdgpu_asic_addr.h',
447ec681f3Smrg  'src/chip/gfx10/gfx10_gb_reg.h',
45ed98bd31Smaya  'src/chip/gfx9/gfx9_gb_reg.h',
46ed98bd31Smaya  'src/chip/r800/si_gb_reg.h',
47ed98bd31Smaya  'src/r800/ciaddrlib.cpp',
48ed98bd31Smaya  'src/r800/ciaddrlib.h',
49ed98bd31Smaya  'src/r800/egbaddrlib.cpp',
50ed98bd31Smaya  'src/r800/egbaddrlib.h',
51ed98bd31Smaya  'src/r800/siaddrlib.cpp',
52ed98bd31Smaya  'src/r800/siaddrlib.h',
5301e04c3fSmrg)
5401e04c3fSmrg
557ec681f3Smrg# Skip the addrlib definition of ADDR_FASTCALL so as not to use regparm.
567ec681f3Smrgcpp_args_addrlib = ['-DADDR_FASTCALL=']
577ec681f3Smrg
587ec681f3Smrgif host_machine.endian() == 'little'
597ec681f3Smrg  cpp_args_addrlib += '-DLITTLEENDIAN_CPU'
607ec681f3Smrgelse
617ec681f3Smrg  cpp_args_addrlib += '-DBIGENDIAN_CPU'
627ec681f3Smrgendif
637ec681f3Smrg
647ec681f3Smrgforeach w : ['-Wno-unused-variable', '-Wno-unused-local-typedefs',
657ec681f3Smrg             '-Wno-unused-but-set-variable', '-Wno-maybe-uninitialized']
667ec681f3Smrg  if cpp.has_argument(w)
677ec681f3Smrg    cpp_args_addrlib += w
687ec681f3Smrg  endif
697ec681f3Smrgendforeach
707ec681f3Smrg
7101e04c3fSmrglibamdgpu_addrlib = static_library(
7201e04c3fSmrg  'addrlib',
7301e04c3fSmrg  files_addrlib,
7401e04c3fSmrg  include_directories : [
7501e04c3fSmrg    include_directories(
76ed98bd31Smaya      'inc', 'src', 'src/core', 'src/chip/gfx9', 'src/chip/r800',
777ec681f3Smrg      'src/chip/gfx10',
7801e04c3fSmrg    ),
797ec681f3Smrg    inc_amd_common, inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux,
8001e04c3fSmrg  ],
817ec681f3Smrg  cpp_args : cpp_args_addrlib,
827ec681f3Smrg  gnu_symbol_visibility : 'hidden',
8301e04c3fSmrg)
84