-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Macos: m4 changes #15523
Open
andrewc12
wants to merge
1
commit into
openzfs:master
Choose a base branch
from
andrewc12:mac-m4
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Macos: m4 changes #15523
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
dnl # | ||
dnl # macOS - attempt to find kernel headers. This is expected to | ||
dnl # only run on mac platforms (using xcrun command) to iterate | ||
dnl # through versions of xcode, and xnu kernel source locations | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MACOS_HEADERS], [ | ||
AM_COND_IF([BUILD_MACOS], [ | ||
AC_MSG_CHECKING([macOS kernel source directory]) | ||
AS_IF([test -z "$kernelsrc"], [ | ||
system_major_version=`sw_vers -productVersion | $AWK -F '.' '{ print $[]1 "." $[]2 }'` | ||
AS_IF([test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${system_major_version}.sdk/System/Library/Frameworks/Kernel.framework/Headers"], [ | ||
kernelsrc="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${system_major_version}.sdk/System/Library/Frameworks/Kernel.framework"]) | ||
]) | ||
AS_IF([test -z "$kernelsrc"], [ | ||
AS_IF([test -d "/System/Library/Frameworks/Kernel.framework/Headers"], [ | ||
kernelsrc="/System/Library/Frameworks/Kernel.framework"]) | ||
]) | ||
AS_IF([test -z "$kernelsrc"], [ | ||
tmpdir=`xcrun --show-sdk-path` | ||
AS_IF([test -d "$tmpdir/System/Library/Frameworks/Kernel.framework/Headers"], [ | ||
kernelsrc="$tmpdir/System/Library/Frameworks/Kernel.framework"]) | ||
]) | ||
AS_IF([test -z "$kernelsrc"], [ | ||
AS_IF([test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Kernel.framework"], [ | ||
kernelsrc="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Kernel.framework"]) | ||
]) | ||
AS_IF([test -z "$kernelsrc"], [ | ||
AS_IF([test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Kernel.framework"], [ | ||
kernelsrc="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Kernel.framework"]) | ||
]) | ||
AS_IF([test -z "$kernelsrc"], [ | ||
AS_IF([test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Kernel.framework"], [ | ||
kernelsrc="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Kernel.framework"]) | ||
]) | ||
|
||
AC_MSG_RESULT([$kernelsrc]) | ||
|
||
AC_MSG_CHECKING([macOS kernel build directory]) | ||
AS_IF([test -z "$kernelbuild"], [ | ||
kernelbuild=${kernelsrc} | ||
]) | ||
]) | ||
AC_MSG_RESULT([$kernelbuild]) | ||
|
||
AC_ARG_WITH([kernel-modprefix], | ||
AS_HELP_STRING([--with-kernel-modprefix=PATH], | ||
[Path to kernel module prefix]), | ||
[KERNEL_MODPREFIX="$withval"]) | ||
AC_MSG_CHECKING([macOS kernel module prefix]) | ||
AS_IF([test -z "$KERNEL_MODPREFIX"], [ | ||
KERNEL_MODPREFIX="/Library/Extensions" | ||
]) | ||
AC_MSG_RESULT([$KERNEL_MODPREFIX]) | ||
AC_DEFINE_UNQUOTED([KERNEL_MODPREFIX], | ||
["$KERNEL_MODPREFIX"], | ||
[Path where the kernel module is installed.] | ||
) | ||
|
||
AC_MSG_CHECKING([macOS kernel source version]) | ||
utsrelease1=$kernelbuild/Headers/libkern/version.h | ||
AS_IF([test -r $utsrelease1 && fgrep -q OSRELEASE $utsrelease1], [ | ||
kernverfile=libkern/version.h ]) | ||
|
||
AS_IF([test "$kernverfile"], [ | ||
kernsrcver=`(echo "#include <$kernverfile>"; | ||
echo "kernsrcver=OSRELEASE") | | ||
cpp -I$kernelbuild/Headers | | ||
grep "^kernsrcver=" | cut -d \" -f 2` | ||
|
||
AS_IF([test -z "$kernsrcver"], [ | ||
AC_MSG_RESULT([Not found]) | ||
AC_MSG_ERROR([*** Cannot determine kernel version.]) | ||
]) | ||
AC_MSG_RESULT([$kernsrcver]) | ||
]) | ||
|
||
AC_MSG_CHECKING([mach_kernel]) | ||
AS_IF([test -z "$machkernel"], [ | ||
AS_IF([test -e "/System/Library/Kernels/kernel"], [ | ||
machkernel="/System/Library/Kernels/kernel" ] ) | ||
AS_IF([test -e "/mach_kernel"], [ | ||
machkernel="/mach_kernel" ] ) | ||
AS_IF([test ! -f "$machkernel"], [ | ||
AC_MSG_ERROR([ | ||
*** mach_kernel file not found. For 10.9 and prior, this should be | ||
*** '/mach_kernel' and for 10.10 and following, this should be | ||
*** '/System/Library/Kernels/kernel']) | ||
]) | ||
]) | ||
AC_MSG_RESULT($machkernel) | ||
|
||
|
||
dnl More Generic names: | ||
MACH_KERNEL=${machkernel} | ||
KERNEL_HEADERS=${kernelsrc} | ||
KERNEL_VERSION=${kernsrcver} | ||
AC_SUBST(KERNEL_HEADERS) | ||
AC_SUBST(KERNEL_MODPREFIX) | ||
AC_SUBST(KERNEL_VERSION) | ||
AC_SUBST(MACH_KERNEL) | ||
]) | ||
]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
|
||
AC_DEFUN([ZFS_AC_MACOS_IMPURE_ENABLE], [ | ||
AC_ARG_ENABLE(macos_impure, | ||
AS_HELP_STRING([--enable-macos-impure], | ||
[Use XNU Private.exports [[default: no]]]), | ||
[CPPFLAGS="$CPPFLAGS -DMACOS_IMPURE"], | ||
[]) | ||
]) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra tailing slash?