meson: make cpp invocations cross-compilation friendly
This implementation assumes that the arguments in compiler.cmd_array() don't contain any spaces. Since we are only interested in compilation on Linux, I think this is a safe assumption. Solution suggested by Nirbheek Chauhan.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
cpp -dM -include sys/socket.h - </dev/null | \
|
||||
$1 -E -dM -include sys/socket.h - </dev/null | \
|
||||
grep -Ev 'AF_UNSPEC|AF_MAX' | \
|
||||
awk '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $2; }'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
cpp -dM -include net/if_arp.h - </dev/null | \
|
||||
$1 -dM -include net/if_arp.h - </dev/null | \
|
||||
awk '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $2; }' | \
|
||||
sed -e 's/ARPHRD_//'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
cpp -dM -include linux/capability.h -include "$1" -include "$2" - </dev/null | \
|
||||
$1 -dM -include linux/capability.h -include "$2" -include "$3" - </dev/null | \
|
||||
awk '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $2; }' | \
|
||||
grep -v CAP_LAST_CAP
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
cpp -dM -include errno.h - </dev/null | \
|
||||
$1 -dM -include errno.h - </dev/null | \
|
||||
awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }'
|
||||
|
||||
@@ -206,28 +206,28 @@ generate_af_list = find_program('generate-af-list.sh')
|
||||
af_list_txt = custom_target(
|
||||
'af-list.txt',
|
||||
output : 'af-list.txt',
|
||||
command : [generate_af_list],
|
||||
command : [generate_af_list, cpp],
|
||||
capture : true)
|
||||
|
||||
generate_arphrd_list = find_program('generate-arphrd-list.sh')
|
||||
arphrd_list_txt = custom_target(
|
||||
'arphrd-list.txt',
|
||||
output : 'arphrd-list.txt',
|
||||
command : [generate_arphrd_list],
|
||||
command : [generate_arphrd_list, cpp],
|
||||
capture : true)
|
||||
|
||||
generate_cap_list = find_program('generate-cap-list.sh')
|
||||
cap_list_txt = custom_target(
|
||||
'cap-list.txt',
|
||||
output : 'cap-list.txt',
|
||||
command : [generate_cap_list, config_h, missing_h],
|
||||
command : [generate_cap_list, cpp, config_h, missing_h],
|
||||
capture : true)
|
||||
|
||||
generate_errno_list = find_program('generate-errno-list.sh')
|
||||
errno_list_txt = custom_target(
|
||||
'errno-list.txt',
|
||||
output : 'errno-list.txt',
|
||||
command : [generate_errno_list],
|
||||
command : [generate_errno_list, cpp],
|
||||
capture : true)
|
||||
|
||||
generated_gperf_headers = []
|
||||
|
||||
Reference in New Issue
Block a user