Commit c9ec1fe474ee9085b7eaad2326ee1c688f0c2d19

Authored by bellard
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 81 fmod_lib=""
82 82 fmod_inc=""
83 83 linux="no"
  84 +kqemu="no"
  85 +kernel_path=""
84 86  
85 87 # OS specific
86 88 targetos=`uname -s`
... ... @@ -107,6 +109,9 @@ darwin="yes"
107 109 *)
108 110 oss="yes"
109 111 linux="yes"
  112 +if [ "$cpu" = "i386" ] ; then
  113 + kqemu="yes"
  114 +fi
110 115 ;;
111 116 esac
112 117  
... ... @@ -169,6 +174,10 @@ for opt do
169 174 ;;
170 175 --enable-adlib) adlib="yes"
171 176 ;;
  177 + --disable-kqemu) kqemu="no"
  178 + ;;
  179 + --kernel-path=*) kernel_path=${opt#--kernel-path=}
  180 + ;;
172 181 esac
173 182 done
174 183  
... ... @@ -193,7 +202,7 @@ if test -z "$target_list" ; then
193 202 target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu sparc64-softmmu"
194 203 # the following are Linux specific
195 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 206 fi
198 207 fi
199 208  
... ... @@ -300,6 +309,10 @@ echo " --interp-prefix=PREFIX where to find shared libraries, etc."
300 309 echo " use %M for cpu name [$interp_prefix]"
301 310 echo " --target-list=LIST set target list [$target_list]"
302 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 316 echo "Advanced options (experts only):"
304 317 echo " --source-path=PATH path of source code [$source_path]"
305 318 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
... ... @@ -333,6 +346,40 @@ docdir="$prefix/share/doc/qemu"
333 346 bindir="$prefix/bin"
334 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 383 echo "Install prefix $prefix"
337 384 echo "BIOS directory $datadir"
338 385 echo "binary directory $bindir"
... ... @@ -357,6 +404,17 @@ if test $fmod = "yes"; then
357 404 echo -n " (lib='$fmod_lib' include='$fmod_inc')"
358 405 fi
359 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 419 if test $sdl_too_old = "yes"; then
362 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 539 head $source_path/VERSION >> $config_h
482 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 549 echo "SRC_PATH=$source_path" >> $config_mak
485 550 echo "TARGET_DIRS=$target_list" >> $config_mak
486 551  
... ...