mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
Prefer /lib/modules/$(uname -r)/ links
Preferentially use the /lib/modules/$(uname -r)/source and /lib/modules/$(uname -r)/build links. Only if neither of these links exist fallback to alternate methods for deducing which kernel to build with. This resolves the need to manually specify --with-linux= and --with-linux-obj= on Debian systems.
This commit is contained in:
parent
0d33908cdf
commit
22ccfaa8b5
@ -105,8 +105,11 @@ AC_DEFUN([SPL_AC_KERNEL], [
|
|||||||
|
|
||||||
AC_MSG_CHECKING([kernel source directory])
|
AC_MSG_CHECKING([kernel source directory])
|
||||||
if test -z "$kernelsrc"; then
|
if test -z "$kernelsrc"; then
|
||||||
headersdir="/lib/modules/$(uname -r)/build"
|
if test -e "/lib/modules/$(uname -r)/source"; then
|
||||||
if test -e "$headersdir"; then
|
headersdir="/lib/modules/$(uname -r)/source"
|
||||||
|
sourcelink=$(readlink -f "$headersdir")
|
||||||
|
elif test -e "/lib/modules/$(uname -r)/build"; then
|
||||||
|
headersdir="/lib/modules/$(uname -r)/build"
|
||||||
sourcelink=$(readlink -f "$headersdir")
|
sourcelink=$(readlink -f "$headersdir")
|
||||||
else
|
else
|
||||||
sourcelink=$(ls -1d /usr/src/kernels/* \
|
sourcelink=$(ls -1d /usr/src/kernels/* \
|
||||||
@ -132,7 +135,9 @@ AC_DEFUN([SPL_AC_KERNEL], [
|
|||||||
AC_MSG_RESULT([$kernelsrc])
|
AC_MSG_RESULT([$kernelsrc])
|
||||||
AC_MSG_CHECKING([kernel build directory])
|
AC_MSG_CHECKING([kernel build directory])
|
||||||
if test -z "$kernelbuild"; then
|
if test -z "$kernelbuild"; then
|
||||||
if test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
|
if test -e "/lib/modules/$(uname -r)/build"; then
|
||||||
|
kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
|
||||||
|
elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
|
||||||
kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
|
kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
|
||||||
elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
|
elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
|
||||||
kernelbuild=${kernelsrc}-obj/${target_cpu}/default
|
kernelbuild=${kernelsrc}-obj/${target_cpu}/default
|
||||||
|
22
configure
vendored
22
configure
vendored
@ -11676,8 +11676,11 @@ fi
|
|||||||
{ $as_echo "$as_me:$LINENO: checking kernel source directory" >&5
|
{ $as_echo "$as_me:$LINENO: checking kernel source directory" >&5
|
||||||
$as_echo_n "checking kernel source directory... " >&6; }
|
$as_echo_n "checking kernel source directory... " >&6; }
|
||||||
if test -z "$kernelsrc"; then
|
if test -z "$kernelsrc"; then
|
||||||
headersdir="/lib/modules/$(uname -r)/build"
|
if test -e "/lib/modules/$(uname -r)/source"; then
|
||||||
if test -e "$headersdir"; then
|
headersdir="/lib/modules/$(uname -r)/source"
|
||||||
|
sourcelink=$(readlink -f "$headersdir")
|
||||||
|
elif test -e "/lib/modules/$(uname -r)/build"; then
|
||||||
|
headersdir="/lib/modules/$(uname -r)/build"
|
||||||
sourcelink=$(readlink -f "$headersdir")
|
sourcelink=$(readlink -f "$headersdir")
|
||||||
else
|
else
|
||||||
sourcelink=$(ls -1d /usr/src/kernels/* \
|
sourcelink=$(ls -1d /usr/src/kernels/* \
|
||||||
@ -11711,7 +11714,9 @@ $as_echo "$kernelsrc" >&6; }
|
|||||||
{ $as_echo "$as_me:$LINENO: checking kernel build directory" >&5
|
{ $as_echo "$as_me:$LINENO: checking kernel build directory" >&5
|
||||||
$as_echo_n "checking kernel build directory... " >&6; }
|
$as_echo_n "checking kernel build directory... " >&6; }
|
||||||
if test -z "$kernelbuild"; then
|
if test -z "$kernelbuild"; then
|
||||||
if test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
|
if test -e "/lib/modules/$(uname -r)/build"; then
|
||||||
|
kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
|
||||||
|
elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
|
||||||
kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
|
kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
|
||||||
elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
|
elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
|
||||||
kernelbuild=${kernelsrc}-obj/${target_cpu}/default
|
kernelbuild=${kernelsrc}-obj/${target_cpu}/default
|
||||||
@ -15365,8 +15370,11 @@ fi
|
|||||||
{ $as_echo "$as_me:$LINENO: checking kernel source directory" >&5
|
{ $as_echo "$as_me:$LINENO: checking kernel source directory" >&5
|
||||||
$as_echo_n "checking kernel source directory... " >&6; }
|
$as_echo_n "checking kernel source directory... " >&6; }
|
||||||
if test -z "$kernelsrc"; then
|
if test -z "$kernelsrc"; then
|
||||||
headersdir="/lib/modules/$(uname -r)/build"
|
if test -e "/lib/modules/$(uname -r)/source"; then
|
||||||
if test -e "$headersdir"; then
|
headersdir="/lib/modules/$(uname -r)/source"
|
||||||
|
sourcelink=$(readlink -f "$headersdir")
|
||||||
|
elif test -e "/lib/modules/$(uname -r)/build"; then
|
||||||
|
headersdir="/lib/modules/$(uname -r)/build"
|
||||||
sourcelink=$(readlink -f "$headersdir")
|
sourcelink=$(readlink -f "$headersdir")
|
||||||
else
|
else
|
||||||
sourcelink=$(ls -1d /usr/src/kernels/* \
|
sourcelink=$(ls -1d /usr/src/kernels/* \
|
||||||
@ -15400,7 +15408,9 @@ $as_echo "$kernelsrc" >&6; }
|
|||||||
{ $as_echo "$as_me:$LINENO: checking kernel build directory" >&5
|
{ $as_echo "$as_me:$LINENO: checking kernel build directory" >&5
|
||||||
$as_echo_n "checking kernel build directory... " >&6; }
|
$as_echo_n "checking kernel build directory... " >&6; }
|
||||||
if test -z "$kernelbuild"; then
|
if test -z "$kernelbuild"; then
|
||||||
if test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
|
if test -e "/lib/modules/$(uname -r)/build"; then
|
||||||
|
kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
|
||||||
|
elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
|
||||||
kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
|
kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
|
||||||
elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
|
elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
|
||||||
kernelbuild=${kernelsrc}-obj/${target_cpu}/default
|
kernelbuild=${kernelsrc}-obj/${target_cpu}/default
|
||||||
|
Loading…
Reference in New Issue
Block a user