configure: change "found" to "find"
[qemu] / configure
index 3cf1cb8..e0a2874 100755 (executable)
--- a/configure
+++ b/configure
@@ -181,16 +181,21 @@ bluez=""
 brlapi=""
 curl=""
 curses=""
-build_docs=""
+docs=""
+fdt=""
+kvm=""
 nptl=""
+sdl=""
+sparse="no"
 vde=""
 vnc_tls=""
 vnc_sasl=""
+xen=""
+linux_aio=""
 
 gprof="no"
 debug_tcg="no"
 debug="no"
-sparse="no"
 strip_opt="yes"
 bigendian="no"
 mingw32="no"
@@ -212,14 +217,12 @@ guest_base=""
 uname_release=""
 io_thread="no"
 mixemu="no"
-kvm="no"
 kerneldir=""
 aix="no"
 blobs="yes"
-fdt="yes"
-sdl="yes"
-xen="yes"
 pkgversion=""
+check_utests="no"
+user_pie="no"
 
 # OS specific
 if check_define __linux__ ; then
@@ -324,6 +327,10 @@ SunOS)
     audio_drv_list="oss"
   fi
   audio_possible_drivers="oss sdl"
+# needed for CMSG_ macros in sys/socket.h
+  QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
+# needed for TIOCWIN* defines in termios.h
+  QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS"
   QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS"
   LIBS="-lsocket -lnsl -lresolv $LIBS"
 ;;
@@ -337,7 +344,6 @@ AIX)
   linux="yes"
   linux_user="yes"
   usb="linux"
-  kvm="yes"
   if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
     audio_possible_drivers="$audio_possible_drivers fmod"
   fi
@@ -407,6 +413,8 @@ for opt do
   ;;
   --disable-sdl) sdl="no"
   ;;
+  --enable-sdl) sdl="yes"
+  ;;
   --fmod-lib=*) fmod_lib="$optarg"
   ;;
   --fmod-inc=*) fmod_inc="$optarg"
@@ -449,6 +457,8 @@ for opt do
   ;;
   --disable-xen) xen="no"
   ;;
+  --enable-xen) xen="yes"
+  ;;
   --disable-brlapi) brlapi="no"
   ;;
   --enable-brlapi) brlapi="yes"
@@ -459,6 +469,8 @@ for opt do
   ;;
   --disable-kvm) kvm="no"
   ;;
+  --enable-kvm) kvm="yes"
+  ;;
   --enable-profiler) profiler="yes"
   ;;
   --enable-cocoa)
@@ -492,6 +504,10 @@ for opt do
   ;;
   --disable-guest-base) guest_base="no"
   ;;
+  --enable-user-pie) user_pie="yes"
+  ;;
+  --disable-user-pie) user_pie="no"
+  ;;
   --enable-uname-release=*) uname_release="$optarg"
   ;;
   --sparc_cpu=*)
@@ -508,12 +524,24 @@ for opt do
   ;;
   --enable-curl) curl="yes"
   ;;
+  --disable-fdt) fdt="no"
+  ;;
+  --enable-fdt) fdt="yes"
+  ;;
+  --disable-check-utests) check_utests="no"
+  ;;
+  --enable-check-utests) check_utests="yes"
+  ;;
   --disable-nptl) nptl="no"
   ;;
   --enable-nptl) nptl="yes"
   ;;
   --enable-mixemu) mixemu="yes"
   ;;
+  --disable-linux-aio) linux_aio="no"
+  ;;
+  --enable-linux-aio) linux_aio="yes"
+  ;;
   --enable-io-thread) io_thread="yes"
   ;;
   --disable-blobs) blobs="no"
@@ -522,9 +550,9 @@ for opt do
   ;;
   --with-pkgversion=*) pkgversion=" ($optarg)"
   ;;
-  --disable-docs) build_docs="no"
+  --disable-docs) docs="no"
   ;;
-  --enable-docs) build_docs="yes"
+  --enable-docs) docs="yes"
   ;;
   *) echo "ERROR: unknown option $opt"; show_help="yes"
   ;;
@@ -618,6 +646,7 @@ echo "  --disable-sparse         disable sparse checker (default)"
 echo "  --disable-strip          disable stripping binaries"
 echo "  --disable-werror         disable compilation abort on warning"
 echo "  --disable-sdl            disable SDL"
+echo "  --enable-sdl             enable SDL"
 echo "  --enable-cocoa           enable COCOA (Mac OS X only)"
 echo "  --audio-drv-list=LIST    set audio drivers list:"
 echo "                           Available drivers: $audio_possible_drivers"
@@ -625,6 +654,7 @@ echo "  --audio-card-list=LIST   set list of emulated audio cards [$audio_card_l
 echo "                           Available cards: $audio_possible_cards"
 echo "  --enable-mixemu          enable mixer emulation"
 echo "  --disable-xen            disable xen backend driver support"
+echo "  --enable-xen             enable xen backend driver support"
 echo "  --disable-brlapi         disable BrlAPI"
 echo "  --enable-brlapi          enable BrlAPI"
 echo "  --disable-vnc-tls        disable TLS encryption for VNC server"
@@ -635,9 +665,14 @@ echo "  --disable-curses         disable curses output"
 echo "  --enable-curses          enable curses output"
 echo "  --disable-curl           disable curl connectivity"
 echo "  --enable-curl            enable curl connectivity"
+echo "  --disable-fdt            disable fdt device tree"
+echo "  --enable-fdt             enable fdt device tree"
+echo "  --disable-check-utests   disable check unit-tests"
+echo "  --enable-check-utests    enable check unit-tests"
 echo "  --disable-bluez          disable bluez stack connectivity"
 echo "  --enable-bluez           enable bluez stack connectivity"
 echo "  --disable-kvm            disable KVM acceleration support"
+echo "  --enable-kvm             enable KVM acceleration support"
 echo "  --disable-nptl           disable usermode NPTL support"
 echo "  --enable-nptl            disable usermode NPTL support"
 echo "  --enable-system          enable all system emulation targets"
@@ -653,6 +688,8 @@ echo "  --disable-bsd-user       disable all BSD usermode emulation targets"
 echo "  --enable-guest-base      enable GUEST_BASE support for usermode"
 echo "                           emulation targets"
 echo "  --disable-guest-base     disable GUEST_BASE support"
+echo "  --enable-user-pie        build usermode emulation targets as PIE"
+echo "  --disable-user-pie       do not build usermode emulation targets as PIE"
 echo "  --fmod-lib               path to FMOD library"
 echo "  --fmod-inc               path to FMOD includes"
 echo "  --oss-lib                path to OSS library"
@@ -660,6 +697,8 @@ echo "  --enable-uname-release=R Return R for uname -r in usermode emulation"
 echo "  --sparc_cpu=V            Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
 echo "  --disable-vde            disable support for vde network"
 echo "  --enable-vde             enable support for vde network"
+echo "  --disable-linux-aio      disable Linux AIO support"
+echo "  --enable-linux-aio       enable Linux AIO support"
 echo "  --enable-io-thread       enable IO thread"
 echo "  --disable-blobs          disable installing provided firmware blobs"
 echo "  --kerneldir=PATH         look for kernel includes in PATH"
@@ -668,10 +707,6 @@ echo "NOTE: The object files are built at the place where configure is launched"
 exit 1
 fi
 
-if test ! -x "$(which cgcc 2>/dev/null)"; then
-    sparse="no"
-fi
-
 #
 # Solaris specific configure tool chain decisions
 #
@@ -772,7 +807,7 @@ feature_not_found() {
 
   echo "ERROR"
   echo "ERROR: User requested feature $feature"
-  echo "ERROR: configure was not able to found it"
+  echo "ERROR: configure was not able to find it"
   echo "ERROR"
   exit 1;
 }
@@ -860,7 +895,7 @@ fi
 ##########################################
 # xen probe
 
-if test "$xen" = "yes" ; then
+if test "$xen" != "no" ; then
   xen_libs="-lxenstore -lxenctrl -lxenguest"
   cat > $TMPC <<EOF
 #include <xenctrl.h>
@@ -868,9 +903,26 @@ if test "$xen" = "yes" ; then
 int main(void) { xs_daemon_open(); xc_interface_open(); return 0; }
 EOF
   if compile_prog "" "$xen_libs" ; then
+    xen=yes
     libs_softmmu="$xen_libs $libs_softmmu"
   else
-    xen="no"
+    if test "$xen" = "yes" ; then
+      feature_not_found "xen"
+    fi
+    xen=no
+  fi
+fi
+
+##########################################
+# Sparse probe
+if test "$sparse" != "no" ; then
+  if test -x "$(which cgcc 2>/dev/null)"; then
+    sparse=yes
+  else
+    if test "$sparse" = "yes" ; then
+      feature_not_found "sparse"
+    fi
+    sparse=no
   fi
 fi
 
@@ -879,8 +931,7 @@ fi
 
 sdl_too_old=no
 
-if test "$sdl" = "yes" ; then
-  sdl=no
+if test "$sdl" != "no" ; then
   cat > $TMPC << EOF
 #include <SDL.h>
 #undef main /* We don't want SDL to override our main() */
@@ -911,6 +962,11 @@ EOF
         sdl=no
       fi
     fi # static link
+  else # sdl not found
+    if test "$sdl" = "yes" ; then
+      feature_not_found "sdl"
+    fi
+    sdl=no
   fi # sdl compile test
 fi
 
@@ -955,7 +1011,7 @@ fi
 
 ##########################################
 # VNC SASL detection
-if test "$vnc_sasl" = "yes" ; then
+if test "$vnc_sasl" != "no" ; then
   cat > $TMPC <<EOF
 #include <sasl/sasl.h>
 #include <stdio.h>
@@ -1175,6 +1231,26 @@ EOF
 fi # test "$curl"
 
 ##########################################
+# check framework probe
+
+if test "$check_utests" != "no" ; then
+  cat > $TMPC << EOF
+#include <check.h>
+int main(void) { suite_create("qemu test"); return 0; }
+EOF
+  check_libs=`pkg-config --libs check`
+  if compile_prog "" $check_libs ; then
+    check_utests=yes
+    libs_tools="$check_libs $libs_tools"
+  else
+    if test "$check_utests" = "yes" ; then
+      feature_not_found "check"
+    fi
+    check_utests=no
+  fi
+fi # test "$check_utests"
+
+##########################################
 # bluez support probe
 if test "$bluez" != "no" ; then
   cat > $TMPC << EOF
@@ -1196,7 +1272,7 @@ fi
 
 ##########################################
 # kvm probe
-if test "$kvm" = "yes" ; then
+if test "$kvm" != "no" ; then
     cat > $TMPC <<EOF
 #include <linux/kvm.h>
 #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
@@ -1227,20 +1303,23 @@ EOF
       kvm_cflags=""
   fi
   if compile_prog "$kvm_cflags" "" ; then
-    :
+    kvm=yes
   else
-    kvm="no";
-    if [ -x "`which awk 2>/dev/null`" ] && \
-       [ -x "`which grep 2>/dev/null`" ]; then
-      kvmerr=`LANG=C $cc $QEMU_CFLAGS -o $TMPE $kvm_cflags $TMPC 2>&1 \
+    if test "$kvm" = "yes" ; then
+      if [ -x "`which awk 2>/dev/null`" ] && \
+         [ -x "`which grep 2>/dev/null`" ]; then
+        kvmerr=`LANG=C $cc $QEMU_CFLAGS -o $TMPE $kvm_cflags $TMPC 2>&1 \
        | grep "error: " \
        | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
-      if test "$kvmerr" != "" ; then
-        kvm="no - (${kvmerr})\n\
-    NOTE: To enable KVM support, update your kernel to 2.6.29+ or install \
-recent kvm-kmod from http://sourceforge.net/projects/kvm."
+        if test "$kvmerr" != "" ; then
+          echo -e "${kvmerr}\n\
+      NOTE: To enable KVM support, update your kernel to 2.6.29+ or install \
+  recent kvm-kmod from http://sourceforge.net/projects/kvm."
+        fi
       fi
+      feature_not_found "kvm"
     fi
+    kvm=no
   fi
 fi
 
@@ -1261,7 +1340,7 @@ for pthread_lib in $PTHREADLIBS_LIST; do
   fi
 done
 
-if test "$pthread" = no; then
+if test "$mingw32" != yes -a "$pthread" = no; then
   echo
   echo "Error: pthread check failed"
   echo "Make sure to have the pthread libs and headers installed."
@@ -1270,6 +1349,27 @@ if test "$pthread" = no; then
 fi
 
 ##########################################
+# linux-aio probe
+AIOLIBS=""
+
+if test "$linux_aio" != "no" ; then
+  cat > $TMPC <<EOF
+#include <libaio.h>
+#include <sys/eventfd.h>
+int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; }
+EOF
+  if compile_prog "" "-laio" ; then
+    linux_aio=yes
+    LIBS="$LIBS -laio"
+  else
+    if test "$linux_aio" = "yes" ; then
+      feature_not_found "linux AIO"
+    fi
+    linux_aio=no
+  fi
+fi
+
+##########################################
 # iovec probe
 cat > $TMPC <<EOF
 #include <sys/types.h>
@@ -1297,8 +1397,7 @@ fi
 
 ##########################################
 # fdt probe
-if test "$fdt" = "yes" ; then
-  fdt=no
+if test "$fdt" != "no" ; then
   fdt_libs="-lfdt"
   cat > $TMPC << EOF
 int main(void) { return 0; }
@@ -1306,6 +1405,11 @@ EOF
   if compile_prog "" "$fdt_libs" ; then
     fdt=yes
     libs_softmmu="$fdt_libs $libs_softmmu"
+  else
+    if test "$fdt" = "yes" ; then
+      feature_not_found "fdt"
+    fi
+    fdt=no
   fi
 fi
 
@@ -1409,16 +1513,31 @@ if compile_prog "" "" ; then
   splice=yes
 fi
 
+# check if eventfd is supported
+eventfd=no
+cat > $TMPC << EOF
+#include <sys/eventfd.h>
+
+int main(void)
+{
+    int efd = eventfd(0, 0);
+    return 0;
+}
+EOF
+if compile_prog "" "" ; then
+  eventfd=yes
+fi
+
 # Check if tools are available to build documentation.
-if test "$build_docs" != "no" ; then
+if test "$docs" != "no" ; then
   if test -x "`which texi2html 2>/dev/null`" -a \
           -x "`which pod2man 2>/dev/null`" ; then
-    build_docs=yes
+    docs=yes
   else
-    if test "$build_docs" = "yes" ; then
-      feature_not_found "build_docs"
+    if test "$docs" = "yes" ; then
+      feature_not_found "docs"
     fi
-    build_docs=no
+    docs=no
   fi
 fi
 
@@ -1477,7 +1596,7 @@ if check_linker_flags --whole-archive --no-whole-archive ; then
     arlibs_end="-Wl,--no-whole-archive"
 elif check_linker_flags -z,allextract -z,defaultextract ; then
     # Solaris ld
-    arlibs_begin"=-Wl,-z,allextract"
+    arlibs_begin="-Wl,-z,allextract"
     arlibs_end="-Wl,-z,defaultextract"
 elif check_linker_flags -all_load ; then
     # Mac OS X
@@ -1489,11 +1608,23 @@ else
     exit 1
 fi
 
-if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaries" != yes -a \
+if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
         "$aix" != "yes" ; then
     libs_softmmu="-lutil $libs_softmmu"
 fi
 
+##########################################
+# check if the compiler defines offsetof
+
+need_offsetof=yes
+cat > $TMPC << EOF
+#include <stddef.h>
+int main(void) { struct s { int f; }; return offsetof(struct s, f); }
+EOF
+if compile_prog "" "" ; then
+    need_offsetof=no
+fi
+
 # End of CC checks
 # After here, no more $cc or $ld runs
 
@@ -1581,6 +1712,7 @@ fi
 echo "SDL support       $sdl"
 echo "curses support    $curses"
 echo "curl support      $curl"
+echo "check support     $check_utests"
 echo "mingw32 support   $mingw32"
 echo "Audio drivers     $audio_drv_list"
 echo "Extra audio cards $audio_card_list"
@@ -1593,15 +1725,17 @@ fi
 echo "xen support       $xen"
 echo "brlapi support    $brlapi"
 echo "bluez  support    $bluez"
-echo "Documentation     $build_docs"
+echo "Documentation     $docs"
 [ ! -z "$uname_release" ] && \
 echo "uname -r          $uname_release"
 echo "NPTL support      $nptl"
 echo "GUEST_BASE        $guest_base"
+echo "PIE user targets  $user_pie"
 echo "vde support       $vde"
 echo "IO thread         $io_thread"
+echo "Linux AIO support $linux_aio"
 echo "Install blobs     $blobs"
-echo -e "KVM support       $kvm"
+echo "KVM support       $kvm"
 echo "fdt support       $fdt"
 echo "preadv support    $preadv"
 
@@ -1722,7 +1856,7 @@ if [ "$source_path_used" = "yes" ]; then
   echo "VPATH=$source_path" >> $config_host_mak
 fi
 echo "TARGET_DIRS=$target_list" >> $config_host_mak
-if [ "$build_docs" = "yes" ] ; then
+if [ "$docs" = "yes" ] ; then
   echo "BUILD_DOCS=yes" >> $config_host_mak
 fi
 if test "$sdl" = "yes" ; then
@@ -1747,6 +1881,9 @@ fi
 if test "$splice" = "yes" ; then
   echo "CONFIG_SPLICE=y" >> $config_host_mak
 fi
+if test "$eventfd" = "yes" ; then
+  echo "CONFIG_EVENTFD=y" >> $config_host_mak
+fi
 if test "$inotify" = "yes" ; then
   echo "CONFIG_INOTIFY=y" >> $config_host_mak
 fi
@@ -1773,6 +1910,9 @@ fi
 if test "$io_thread" = "yes" ; then
   echo "CONFIG_IOTHREAD=y" >> $config_host_mak
 fi
+if test "$linux_aio" = "yes" ; then
+  echo "CONFIG_LINUX_AIO=y" >> $config_host_mak
+fi
 if test "$blobs" = "yes" ; then
   echo "INSTALL_BLOBS=yes" >> $config_host_mak
 fi
@@ -1785,6 +1925,9 @@ fi
 if test "$fdt" = "yes" ; then
   echo "CONFIG_FDT=y" >> $config_host_mak
 fi
+if test "$need_offsetof" = "yes" ; then
+  echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak
+fi
 
 # XXX: suppress that
 if [ "$bsd" = "yes" ] ; then
@@ -1811,6 +1954,11 @@ if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
   tools="qemu-img\$(EXESUF) $tools"
   if [ "$linux" = "yes" ] ; then
       tools="qemu-nbd\$(EXESUF) qemu-io\$(EXESUF) $tools"
+    if [ "$check_utests" = "yes" ]; then
+      tools="check-qint check-qstring check-qdict $tools"
+    fi
+  elif test "$mingw32" = "yes" ; then
+      tools="qemu-io\$(EXESUF) $tools"
   fi
 fi
 echo "TOOLS=$tools" >> $config_host_mak
@@ -1922,6 +2070,7 @@ test -f $config_h && mv $config_h ${config_h}~
 mkdir -p $target_dir
 mkdir -p $target_dir/fpu
 mkdir -p $target_dir/tcg
+mkdir -p $target_dir/ide
 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
   mkdir -p $target_dir/nwfpe
 fi
@@ -2085,15 +2234,15 @@ case "$target_arch2" in
       echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
     fi
 esac
-echo "HWLIB=../libhw$target_phys_bits/libqemuhw$target_phys_bits.a" >> $config_mak
 echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_mak
-echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
 if test "$target_bigendian" = "yes" ; then
   echo "TARGET_WORDS_BIGENDIAN=y" >> $config_mak
 fi
 if test "$target_softmmu" = "yes" ; then
   echo "CONFIG_SOFTMMU=y" >> $config_mak
   echo "LIBS+=$libs_softmmu" >> $config_mak
+  echo "HWLIB=../libhw$target_phys_bits/libqemuhw$target_phys_bits.a" >> $config_mak
+  echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
 fi
 if test "$target_user_only" = "yes" ; then
   echo "CONFIG_USER_ONLY=y" >> $config_mak
@@ -2214,6 +2363,12 @@ if test "$target_softmmu" = "yes" ; then
   esac
 fi
 
+if test "$target_user_only" = "yes" -a "$static" = "no" -a \
+       "$user_pie" = "yes" ; then
+  cflags="-fpie $cflags"
+  ldflags="-pie $ldflags"
+fi
+
 if test "$target_softmmu" = "yes" -a \( \
         "$TARGET_ARCH" = "microblaze" -o \
         "$TARGET_ARCH" = "cris" \) ; then
@@ -2235,16 +2390,6 @@ fi
 linker_script="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/\$(ARCH).ld"
 if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then
   case "$ARCH" in
-  i386)
-    if test "$gprof" = "yes" -o "$static" = "yes" ; then
-      ldflags="$linker_script $ldflags"
-    else
-      # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
-      # that the kernel ELF loader considers as an executable. I think this
-      # is the simplest way to make it self virtualizable!
-      ldflags="-Wl,-shared $ldflags"
-    fi
-    ;;
   sparc)
     # -static is used to avoid g1/g3 usage by the dynamic linker
     ldflags="$linker_script -static $ldflags"
@@ -2252,7 +2397,7 @@ if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then
   ia64)
     ldflags="-Wl,-G0 $linker_script -static $ldflags"
     ;;
-  x86_64|ppc|ppc64|s390|sparc64|alpha|arm|m68k|mips|mips64)
+  i386|x86_64|ppc|ppc64|s390|sparc64|alpha|arm|m68k|mips|mips64)
     ldflags="$linker_script $ldflags"
     ;;
   esac
@@ -2286,10 +2431,12 @@ done # for target in $targets
 # build tree in object directory if source path is different from current one
 if test "$source_path_used" = "yes" ; then
     DIRS="tests tests/cris slirp audio block pc-bios/optionrom"
+    DIRS="$DIRS roms/pcbios roms/seabios roms/vgabios"
     FILES="Makefile tests/Makefile"
     FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
     FILES="$FILES tests/test-mmap.c"
     FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps pc-bios/video.x"
+    FILES="$FILES roms/pcbios/Makefile roms/seabios/Makefile roms/vgabios/Makefile"
     for bios_file in $source_path/pc-bios/*.bin $source_path/pc-bios/*.dtb $source_path/pc-bios/openbios-*; do
         FILES="$FILES pc-bios/`basename $bios_file`"
     done
@@ -2303,6 +2450,20 @@ if test "$source_path_used" = "yes" ; then
     done
 fi
 
+# temporary config to build submodules
+for rom in seabios vgabios pcbios; do
+    config_mak=roms/$rom/config.mak
+    echo "# Automatically generated by configure - do not modify" >> $config_mak
+    echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak
+    echo "CC=$cc" >> $config_mak
+    echo "BCC=bcc" >> $config_mak
+    echo "CPP=${cross_prefix}cpp" >> $config_mak
+    echo "OBJCOPY=objcopy" >> $config_mak
+    echo "IASL=iasl" >> $config_mak
+    echo "HOST_CC=$host_cc" >> $config_mak
+    echo "LD=$ld" >> $config_mak
+done
+
 for hwlib in 32 64; do
   d=libhw$hwlib
   mkdir -p $d