Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta: prevent linux_kernel_headers from being set to /usr/include #1082

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,28 @@ if not disable_linux_option
if not import('fs').is_dir(get_option('linux_kernel_headers'))
error('linux_kernel_headers is not set to a valid path')
endif

cc_search_path = run_command(meson.get_compiler('cpp', native: true), '-E', '-Wp,-v', '-xc', '/dev/null', check: true).stderr()
search_paths = []

search_started = false
foreach line : cc_search_path.strip().splitlines()
if not search_started and line == '#include <...> search starts here:'
search_started = true
continue
elif search_started and line == 'End of search list.'
search_started = false
elif search_started
search_paths += line.strip()
endif
endforeach

foreach path : search_paths
if fs.is_samepath(get_option('linux_kernel_headers'), path)
warning('Please install Linux kernel headers to a directory using \'make headers_install\'.')
error('Using system include paths for \'linux_kernel_headers\' is unsupported!')
endif
endforeach
endif

rtld_include_dirs += include_directories('options/linux/include')
Expand Down
Loading