Commit c9ec1fe474ee9085b7eaad2326ee1c688f0c2d19
1 parent
e3086fbf
kqemu support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1278 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
66 additions
and
1 deletions
configure
| @@ -81,6 +81,8 @@ fmod="no" | @@ -81,6 +81,8 @@ fmod="no" | ||
| 81 | fmod_lib="" | 81 | fmod_lib="" |
| 82 | fmod_inc="" | 82 | fmod_inc="" |
| 83 | linux="no" | 83 | linux="no" |
| 84 | +kqemu="no" | ||
| 85 | +kernel_path="" | ||
| 84 | 86 | ||
| 85 | # OS specific | 87 | # OS specific |
| 86 | targetos=`uname -s` | 88 | targetos=`uname -s` |
| @@ -107,6 +109,9 @@ darwin="yes" | @@ -107,6 +109,9 @@ darwin="yes" | ||
| 107 | *) | 109 | *) |
| 108 | oss="yes" | 110 | oss="yes" |
| 109 | linux="yes" | 111 | linux="yes" |
| 112 | +if [ "$cpu" = "i386" ] ; then | ||
| 113 | + kqemu="yes" | ||
| 114 | +fi | ||
| 110 | ;; | 115 | ;; |
| 111 | esac | 116 | esac |
| 112 | 117 | ||
| @@ -169,6 +174,10 @@ for opt do | @@ -169,6 +174,10 @@ for opt do | ||
| 169 | ;; | 174 | ;; |
| 170 | --enable-adlib) adlib="yes" | 175 | --enable-adlib) adlib="yes" |
| 171 | ;; | 176 | ;; |
| 177 | + --disable-kqemu) kqemu="no" | ||
| 178 | + ;; | ||
| 179 | + --kernel-path=*) kernel_path=${opt#--kernel-path=} | ||
| 180 | + ;; | ||
| 172 | esac | 181 | esac |
| 173 | done | 182 | done |
| 174 | 183 | ||
| @@ -193,7 +202,7 @@ if test -z "$target_list" ; then | @@ -193,7 +202,7 @@ if test -z "$target_list" ; then | ||
| 193 | target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu sparc64-softmmu" | 202 | target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu sparc64-softmmu" |
| 194 | # the following are Linux specific | 203 | # the following are Linux specific |
| 195 | if [ "$linux" = "yes" ] ; then | 204 | if [ "$linux" = "yes" ] ; then |
| 196 | - target_list="i386-user i386 arm-user armeb-user sparc-user ppc-user sparc64-user $target_list" | 205 | + target_list="i386-user arm-user armeb-user sparc-user ppc-user sparc64-user $target_list" |
| 197 | fi | 206 | fi |
| 198 | fi | 207 | fi |
| 199 | 208 | ||
| @@ -300,6 +309,10 @@ echo " --interp-prefix=PREFIX where to find shared libraries, etc." | @@ -300,6 +309,10 @@ echo " --interp-prefix=PREFIX where to find shared libraries, etc." | ||
| 300 | echo " use %M for cpu name [$interp_prefix]" | 309 | echo " use %M for cpu name [$interp_prefix]" |
| 301 | echo " --target-list=LIST set target list [$target_list]" | 310 | echo " --target-list=LIST set target list [$target_list]" |
| 302 | echo "" | 311 | echo "" |
| 312 | +echo "kqemu kernel acceleration support:" | ||
| 313 | +echo " --disable-kqemu disable kqemu build" | ||
| 314 | +echo " --kernel-path=PATH set the kernel path (configure probes it)" | ||
| 315 | +echo "" | ||
| 303 | echo "Advanced options (experts only):" | 316 | echo "Advanced options (experts only):" |
| 304 | echo " --source-path=PATH path of source code [$source_path]" | 317 | echo " --source-path=PATH path of source code [$source_path]" |
| 305 | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" | 318 | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" |
| @@ -333,6 +346,40 @@ docdir="$prefix/share/doc/qemu" | @@ -333,6 +346,40 @@ docdir="$prefix/share/doc/qemu" | ||
| 333 | bindir="$prefix/bin" | 346 | bindir="$prefix/bin" |
| 334 | fi | 347 | fi |
| 335 | 348 | ||
| 349 | +# kernel module support | ||
| 350 | +if test $kqemu = "yes" ; then | ||
| 351 | +# find the kernel path | ||
| 352 | +if test -z "$kernel_path" ; then | ||
| 353 | +kernel_version=`uname -r` | ||
| 354 | +kernel_path="/lib/modules/$kernel_version/build" | ||
| 355 | +if test '!' -d "$kernel_path/include" ; then | ||
| 356 | + kernel_path="/usr/src/linux" | ||
| 357 | + if test '!' -d "$kernel_path/include" ; then | ||
| 358 | + echo "Could not find kernel includes in /lib/modules or /usr/src/linux - cannot build the kqemu module" | ||
| 359 | + kqemu="no" | ||
| 360 | + fi | ||
| 361 | +fi | ||
| 362 | +fi | ||
| 363 | + | ||
| 364 | +if test $kqemu = "yes" ; then | ||
| 365 | + | ||
| 366 | +# test that the kernel config is present | ||
| 367 | +if test '!' -f "$kernel_path/Makefile" ; then | ||
| 368 | + echo "No .config file present in $kernel_path - kqemu cannot be built" | ||
| 369 | + kqemu="no" | ||
| 370 | +fi | ||
| 371 | + | ||
| 372 | +# find build system (2.6 or legacy) | ||
| 373 | +kbuild26="yes" | ||
| 374 | +if grep -q "PATCHLEVEL = 4" $kernel_path/Makefile ; then | ||
| 375 | +kbuild26="no" | ||
| 376 | +fi | ||
| 377 | + | ||
| 378 | +fi # kqemu | ||
| 379 | + | ||
| 380 | +fi # kqemu | ||
| 381 | + | ||
| 382 | + | ||
| 336 | echo "Install prefix $prefix" | 383 | echo "Install prefix $prefix" |
| 337 | echo "BIOS directory $datadir" | 384 | echo "BIOS directory $datadir" |
| 338 | echo "binary directory $bindir" | 385 | echo "binary directory $bindir" |
| @@ -357,6 +404,17 @@ if test $fmod = "yes"; then | @@ -357,6 +404,17 @@ if test $fmod = "yes"; then | ||
| 357 | echo -n " (lib='$fmod_lib' include='$fmod_inc')" | 404 | echo -n " (lib='$fmod_lib' include='$fmod_inc')" |
| 358 | fi | 405 | fi |
| 359 | echo "" | 406 | echo "" |
| 407 | +if test $kqemu = "yes" ; then | ||
| 408 | +echo "" | ||
| 409 | +echo "KQEMU module configuration:" | ||
| 410 | +echo "kernel sources $kernel_path" | ||
| 411 | +echo -n "kbuild type " | ||
| 412 | +if test $kbuild26 = "yes"; then | ||
| 413 | +echo "2.6" | ||
| 414 | +else | ||
| 415 | +echo "2.4" | ||
| 416 | +fi | ||
| 417 | +fi | ||
| 360 | 418 | ||
| 361 | if test $sdl_too_old = "yes"; then | 419 | if test $sdl_too_old = "yes"; then |
| 362 | echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support" | 420 | echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support" |
| @@ -481,6 +539,13 @@ echo -n "#define QEMU_VERSION \"" >> $config_h | @@ -481,6 +539,13 @@ echo -n "#define QEMU_VERSION \"" >> $config_h | ||
| 481 | head $source_path/VERSION >> $config_h | 539 | head $source_path/VERSION >> $config_h |
| 482 | echo "\"" >> $config_h | 540 | echo "\"" >> $config_h |
| 483 | 541 | ||
| 542 | +if test $kqemu = "yes" ; then | ||
| 543 | + echo "CONFIG_KQEMU=yes" >> $config_mak | ||
| 544 | + echo "KERNEL_PATH=$kernel_path" >> $config_mak | ||
| 545 | + if test $kbuild26 = "yes" ; then | ||
| 546 | + echo "CONFIG_KBUILD26=yes" >> $config_mak | ||
| 547 | + fi | ||
| 548 | +fi | ||
| 484 | echo "SRC_PATH=$source_path" >> $config_mak | 549 | echo "SRC_PATH=$source_path" >> $config_mak |
| 485 | echo "TARGET_DIRS=$target_list" >> $config_mak | 550 | echo "TARGET_DIRS=$target_list" >> $config_mak |
| 486 | 551 |