source: mainline/meson/part/tools/meson.build@ 0350033

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 0350033 was 145a13b, checked in by Petr Pavlu <setup@…>, 5 years ago

Fix generating a boot image for grub-efi with mkisofs

A boot ISO image for grub-efi is currently generated using the
genisoimage-specific option '—efi-boot <grub_image>'. This is accepted
by genisoimage and 'xorriso -as genisoimage' but not by mkisofs:

/usr/bin/mkisofs -J -r -input-charset utf-8 -V HelenOS-CD —efi-boot boot/grub/efi.img -o boot/grub/image.iso boot/grub/grub_dist
Bad Option '—efi-boot' (error -1 BADFLAG).

When mkisofs is selected during the configure time, run the build
command with the equivalent options '-eltorito-platform efi
-eltorito-boot <grub_image> -no-emul-boot'.

  • Property mode set to 100644
File size: 3.7 KB
Line 
1#
2# Copyright (c) 2019 Jiří Zárevúcky
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8#
9# - Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# - Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution.
14# - The name of the author may not be used to endorse or promote products
15# derived from this software without specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28
29# Find all the programs and tools used by meson.
30# Whenever you use an external command anywhere,
31# first find and assign it to a variable here. Don't use its name directly.
32# This way it's obvious what programs are used, and for some we can use
33# the same argument list everywhere.
34
35_tools_dir = meson.source_root() / 'tools'
36
37basename = find_program('basename')
38cc = meson.get_compiler('c')
39config_py = find_program(_tools_dir / 'config.py')
40cp = find_program('cp')
41dirname = find_program('dirname')
42doxygen = find_program('doxygen', required: false)
43find = find_program('find')
44grep = find_program('grep')
45mkarray = find_program(_tools_dir / 'mkarray_for_meson.sh')
46mkext4 = find_program(_tools_dir / 'mkext4.py')
47mkfat = find_program(_tools_dir / 'mkfat.py')
48mkuimage = find_program(_tools_dir / 'mkuimage.py')
49objcopy = find_program('objcopy')
50objdump = find_program('objdump')
51patch = find_program('patch')
52sed = find_program('sed')
53unzip = find_program('unzip')
54which = find_program('which')
55cpc = find_program(_tools_dir / 'cc.sh')
56cppcheck = find_program('cppcheck', required: false)
57
58sh = [ find_program('sh'), '-u', '-e' ]
59if debug_shell_scripts
60 sh += '-x'
61endif
62
63genisoimage = find_program('genisoimage', required: false)
64if genisoimage.found()
65 genisoimage_type = 'genisoimage'
66else
67 genisoimage = find_program('mkisofs', required: false)
68 if genisoimage.found()
69 genisoimage_type = 'mkisofs'
70 else
71 xorriso = find_program('xorriso', required: false)
72 if xorriso.found()
73 genisoimage = [ xorriso, '-as', 'genisoimage' ]
74 genisoimage_type = 'genisoimage'
75 else
76 error('Need genisoimage, mkisofs or xorriso.')
77 endif
78 endif
79endif
80
81
82autocheck = generator(find_program(_tools_dir / 'autocheck.awk'),
83 arguments: [ '@INPUT@' ],
84 output: '@PLAINNAME@.check.c',
85 capture: true,
86)
87
88# TODO: bug in Meson
89#gzip = generator(find_program('gzip'),
90# arguments: [ '--no-name', '-9', '--stdout', '@INPUT@' ],
91# output: '@PLAINNAME@.gz',
92# capture: true,
93#)
94
95gzip = [ find_program('gzip'), '--no-name', '-9', '--stdout', '@INPUT@' ]
96
97# Tar's arguments make sure that the archive is reproducible.
98tar = [
99 find_program('tar'),
100 '-c',
101 '-f', '@OUTPUT@',
102 '--mtime=1970-01-01 00:00:00Z',
103 '--group=0',
104 '--owner=0',
105 '--numeric-owner',
106 '--mode=go=rX,u+rw,a-s',
107 '--no-acls',
108 '--no-selinux',
109 '--no-xattrs',
110 '--format=ustar',
111 '--transform', 's:@OUTDIR@/::',
112 '@INPUT@',
113]
Note: See TracBrowser for help on using the repository browser.