summaryrefslogtreecommitdiff
path: root/src/boot/efi/meson.build
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-06-22 13:38:31 +0200
committerMichael Biebl <biebl@debian.org>2018-06-22 13:38:31 +0200
commitb012e92123bdc9fa10c2f079ec5bd9313b23e21a (patch)
tree94b74f04796e0da187092db7c2487aaf30f0faf1 /src/boot/efi/meson.build
parent98393f852f2f66a74f7370aa63c07b26d610343c (diff)
downloadsystemd-b012e92123bdc9fa10c2f079ec5bd9313b23e21a.tar.gz
New upstream version 239
Diffstat (limited to 'src/boot/efi/meson.build')
-rw-r--r--src/boot/efi/meson.build36
1 files changed, 13 insertions, 23 deletions
diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
index 992a3ba4c2..8ec1fa7be4 100644
--- a/src/boot/efi/meson.build
+++ b/src/boot/efi/meson.build
@@ -1,19 +1,4 @@
# SPDX-License-Identifier: LGPL-2.1+
-#
-# Copyright 2017 Zbigniew Jędrzejewski-Szmek
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-#
-# systemd is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with systemd; If not, see <http://www.gnu.org/licenses/>.
efi_headers = files('''
console.h
@@ -50,12 +35,17 @@ stub_sources = '''
if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
efi_cc = get_option('efi-cc')
efi_ld = get_option('efi-ld')
-
efi_incdir = get_option('efi-includedir')
- have_header = (gnu_efi_arch != '' and
- cc.has_header('@0@/@1@/efibind.h'.format(efi_incdir, gnu_efi_arch)))
- if have_header and EFI_MACHINE_TYPE_NAME == ''
+ gnu_efi_path_arch = ''
+ foreach name : [gnu_efi_arch, EFI_MACHINE_TYPE_NAME]
+ if (gnu_efi_path_arch == '' and name != '' and
+ cc.has_header('@0@/@1@/efibind.h'.format(efi_incdir, name)))
+ gnu_efi_path_arch = name
+ endif
+ endforeach
+
+ if gnu_efi_path_arch != '' and EFI_MACHINE_TYPE_NAME == ''
error('gnu-efi is available, but EFI_MACHINE_TYPE_NAME is unknown')
endif
@@ -68,7 +58,7 @@ if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
endif
endif
- have_gnu_efi = have_header and efi_libdir != ''
+ have_gnu_efi = gnu_efi_path_arch != '' and efi_libdir != ''
else
have_gnu_efi = false
endif
@@ -91,7 +81,7 @@ if have_gnu_efi
objcopy = find_program('objcopy')
efi_ldsdir = get_option('efi-ldsdir')
- arch_lds = 'elf_@0@_efi.lds'.format(gnu_efi_arch)
+ arch_lds = 'elf_@0@_efi.lds'.format(gnu_efi_path_arch)
if efi_ldsdir == ''
efi_ldsdir = join_paths(efi_libdir, 'gnuefi')
cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds))
@@ -121,7 +111,7 @@ if have_gnu_efi
'-Wsign-compare',
'-Wno-missing-field-initializers',
'-isystem', efi_incdir,
- '-isystem', join_paths(efi_incdir, gnu_efi_arch),
+ '-isystem', join_paths(efi_incdir, gnu_efi_path_arch),
'-include', efi_config_h]
if efi_arch == 'x86_64'
compile_args += ['-mno-red-zone',
@@ -141,7 +131,7 @@ if have_gnu_efi
'-nostdlib',
'-znocombreloc',
'-L', efi_libdir,
- join_paths(efi_ldsdir, 'crt0-efi-@0@.o'.format(gnu_efi_arch))]
+ join_paths(efi_ldsdir, 'crt0-efi-@0@.o'.format(gnu_efi_path_arch))]
if efi_arch == 'aarch64' or efi_arch == 'arm'
# Aarch64 and ARM32 don't have an EFI capable objcopy. Use 'binary'
# instead, and add required symbols manually.