Commit eac3026225fe7224a1e1c492482b7480df5f36ea
1 parent
7ba1e619
Add --kerneldir configure argument
This allows a user to override the default search path and also makes cross compilation work a bit nicer wrt KVM detection. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5628 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
9 additions
and
2 deletions
configure
@@ -116,6 +116,7 @@ nptl="yes" | @@ -116,6 +116,7 @@ nptl="yes" | ||
116 | mixemu="no" | 116 | mixemu="no" |
117 | bluez="yes" | 117 | bluez="yes" |
118 | kvm="yes" | 118 | kvm="yes" |
119 | +kerneldir="" | ||
119 | 120 | ||
120 | # OS specific | 121 | # OS specific |
121 | targetos=`uname -s` | 122 | targetos=`uname -s` |
@@ -359,6 +360,8 @@ for opt do | @@ -359,6 +360,8 @@ for opt do | ||
359 | ;; | 360 | ;; |
360 | --disable-aio) aio="no" | 361 | --disable-aio) aio="no" |
361 | ;; | 362 | ;; |
363 | + --kerneldir=*) kerneldir="$optarg" | ||
364 | + ;; | ||
362 | *) echo "ERROR: unknown option $opt"; show_help="yes" | 365 | *) echo "ERROR: unknown option $opt"; show_help="yes" |
363 | ;; | 366 | ;; |
364 | esac | 367 | esac |
@@ -468,6 +471,7 @@ echo " --enable-uname-release=R Return R for uname -r in usermode emulation" | @@ -468,6 +471,7 @@ echo " --enable-uname-release=R Return R for uname -r in usermode emulation" | ||
468 | echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" | 471 | echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" |
469 | echo " --disable-vde disable support for vde network" | 472 | echo " --disable-vde disable support for vde network" |
470 | echo " --disable-aio disable AIO support" | 473 | echo " --disable-aio disable AIO support" |
474 | +echo " --kerneldir=PATH look for kernel includes in PATH" | ||
471 | echo "" | 475 | echo "" |
472 | echo "NOTE: The object files are built at the place where configure is launched" | 476 | echo "NOTE: The object files are built at the place where configure is launched" |
473 | exit 1 | 477 | exit 1 |
@@ -968,8 +972,11 @@ if test "$kvm" = "yes" ; then | @@ -968,8 +972,11 @@ if test "$kvm" = "yes" ; then | ||
968 | #endif | 972 | #endif |
969 | int main(void) { return 0; } | 973 | int main(void) { return 0; } |
970 | EOF | 974 | EOF |
971 | - # FIXME make this configurable | ||
972 | - kvm_cflags=-I/lib/modules/`uname -r`/build/include | 975 | + if test "$kerneldir" != "" ; then |
976 | + kvm_cflags=-I"$kerneldir"/include | ||
977 | + else | ||
978 | + kvm_cflags="" | ||
979 | + fi | ||
973 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \ | 980 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \ |
974 | 2>/dev/null ; then | 981 | 2>/dev/null ; then |
975 | : | 982 | : |