qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 46/46] Generate config-host.h from config-host.mak


From: Juan Quintela
Subject: [Qemu-devel] [PATCH 46/46] Generate config-host.h from config-host.mak
Date: Fri, 24 Jul 2009 20:30:46 +0200

Signed-off-by: Juan Quintela <address@hidden>
---
 configure     |   78 +++++++++++++++++++-------------------------------------
 create_config |   45 ++++++++++++++++++++++++++++++--
 2 files changed, 69 insertions(+), 54 deletions(-)

diff --git a/configure b/configure
index 1aa9d05..aa53703 100755
--- a/configure
+++ b/configure
@@ -1486,9 +1486,8 @@ echo "# Automatically generated by configure - do not 
modify" > $config_host_mak
 printf "# Configured with:" >> $config_host_mak
 printf " '%s'" "$0" "$@" >> $config_host_mak
 echo >> $config_host_mak
-echo "/* Automatically generated by configure - do not modify */" > 
$config_host_h

-echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_host_h
+echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak

 case "$cpu" in
   
i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|sparc|sparc64)
@@ -1503,26 +1502,21 @@ case "$cpu" in
   ;;
 esac
 echo "ARCH=$ARCH" >> $config_host_mak
-arch_name=`echo $ARCH | tr '[:lower:]' '[:upper:]'`
-echo "#define HOST_$arch_name 1" >> $config_host_h
-
 if test "$debug_tcg" = "yes" ; then
-  echo "#define CONFIG_DEBUG_TCG 1" >> $config_host_h
+  echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
 fi
 if test "$debug" = "yes" ; then
-  echo "#define CONFIG_DEBUG_EXEC 1" >> $config_host_h
+  echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak
 fi
 if test "$strip_opt" = "yes" ; then
   echo "STRIP_OPT=-s" >> $config_host_mak
 fi
 if test "$bigendian" = "yes" ; then
   echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak
-  echo "#define HOST_WORDS_BIGENDIAN 1" >> $config_host_h
 fi
-echo "#define HOST_LONG_BITS $hostlongbits" >> $config_host_h
+echo "HOST_LONG_BITS=$hostlongbits" >> $config_host_mak
 if test "$mingw32" = "yes" ; then
   echo "CONFIG_WIN32=y" >> $config_host_mak
-  echo "#define CONFIG_WIN32 1" >> $config_host_h
 else
   echo "CONFIG_POSIX=y" >> $config_host_mak
   cat > $TMPC << EOF
@@ -1530,7 +1524,7 @@ else
 int main(void) { return bswap_32(0); }
 EOF
   if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
-    echo "#define CONFIG_BYTESWAP_H 1" >> $config_host_h
+    echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak
   fi
   cat > $TMPC << EOF
 #include <sys/endian.h>
@@ -1539,58 +1533,48 @@ EOF
 int main(void) { return bswap32(0); }
 EOF
   if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
-    echo "#define CONFIG_MACHINE_BSWAP_H 1" >> $config_host_h
+    echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak
   fi
 fi

 if test "$darwin" = "yes" ; then
   echo "CONFIG_DARWIN=y" >> $config_host_mak
-  echo "#define CONFIG_DARWIN 1" >> $config_host_h
 fi

 if test "$aix" = "yes" ; then
   echo "CONFIG_AIX=y" >> $config_host_mak
-  echo "#define CONFIG_AIX 1" >> $config_host_h
 fi

 if test "$solaris" = "yes" ; then
   echo "CONFIG_SOLARIS=y" >> $config_host_mak
-  echo "#define CONFIG_SOLARIS 1" >> $config_host_h
-  echo "#define CONFIG_SOLARIS_VERSION $solarisrev" >> $config_host_h
+  echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak
   if test "$needs_libsunmath" = "yes" ; then
     echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak
-    echo "#define CONFIG_NEEDS_LIBSUNMATH 1" >> $config_host_h
   fi
 fi
 if test -n "$sparc_cpu"; then
   echo "CONFIG__sparc_${sparc_cpu}__=y" >> $config_host_mak
-  echo "#define __sparc_${sparc_cpu}__ 1" >> $config_host_h
 fi
 if test "$gprof" = "yes" ; then
   echo "CONFIG_GPROF=y" >> $config_host_mak
-  echo "#define CONFIG_GPROF 1" >> $config_host_h
 fi
 if test "$static" = "yes" ; then
   echo "CONFIG_STATIC=y" >> $config_host_mak
-  echo "#define CONFIG_STATIC 1" >> $config_host_h
   LDFLAGS="$LDFLAGS -static"
 fi
 if test $profiler = "yes" ; then
-  echo "#define CONFIG_PROFILER 1" >> $config_host_h
+  echo "CONFIG_PROFILER=y" >> $config_host_mak
 fi
 if test "$slirp" = "yes" ; then
   echo "CONFIG_SLIRP=y" >> $config_host_mak
-  echo "#define CONFIG_SLIRP 1" >> $config_host_h
 fi
 if test "$vde" = "yes" ; then
   echo "CONFIG_VDE=y" >> $config_host_mak
-  echo "#define CONFIG_VDE 1" >> $config_host_h
   echo "VDE_LIBS=$vde_libs" >> $config_host_mak
 fi
 for card in $audio_card_list; do
     def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
     echo "$def=y" >> $config_host_mak
-    echo "#define $def 1" >> $config_host_h
 done
 for drv in $audio_drv_list; do
     def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
@@ -1604,29 +1588,23 @@ for drv in $audio_drv_list; do
 done
 if test "$mixemu" = "yes" ; then
   echo "CONFIG_MIXEMU=y" >> $config_host_mak
-  echo "#define CONFIG_MIXEMU 1" >> $config_host_h
 fi
 if test "$vnc_tls" = "yes" ; then
   echo "CONFIG_VNC_TLS=y" >> $config_host_mak
   echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak
   echo "VNC_TLS_LIBS=$vnc_tls_libs" >> $config_host_mak
-  echo "#define CONFIG_VNC_TLS 1" >> $config_host_h
 fi
 if test "$vnc_sasl" = "yes" ; then
   echo "CONFIG_VNC_SASL=y" >> $config_host_mak
   echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak
   echo "VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_host_mak
-  echo "#define CONFIG_VNC_SASL 1" >> $config_host_h
 fi
 if test "$fnmatch" = "yes" ; then
-  echo "#define CONFIG_FNMATCH 1" >> $config_host_h
+  echo "CONFIG_FNMATCH=y" >> $config_host_mak
 fi
 qemu_version=`head $source_path/VERSION`
 echo "VERSION=$qemu_version" >>$config_host_mak
-echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_host_h
-
-echo "#define QEMU_PKGVERSION \"$pkgversion\"" >> $config_host_h
-
+echo "PKGVERSION=$pkgversion" >>$config_host_mak
 echo "SRC_PATH=$source_path" >> $config_host_mak
 if [ "$source_path_used" = "yes" ]; then
   echo "VPATH=$source_path" >> $config_host_mak
@@ -1636,84 +1614,75 @@ if [ "$build_docs" = "yes" ] ; then
   echo "BUILD_DOCS=yes" >> $config_host_mak
 fi
 if test "$sdl" = "yes" ; then
-  echo "#define CONFIG_SDL 1" >> $config_host_h
   echo "CONFIG_SDL=y" >> $config_host_mak
   echo "SDL_LIBS=$sdl_libs" >> $config_host_mak
   echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak
 fi
 if test "$cocoa" = "yes" ; then
-  echo "#define CONFIG_COCOA 1" >> $config_host_h
   echo "CONFIG_COCOA=y" >> $config_host_mak
 fi
 if test "$curses" = "yes" ; then
-  echo "#define CONFIG_CURSES 1" >> $config_host_h
   echo "CONFIG_CURSES=y" >> $config_host_mak
   echo "CURSES_LIBS=$curses_libs" >> $config_host_mak
 fi
 if test "$atfile" = "yes" ; then
-  echo "#define CONFIG_ATFILE 1" >> $config_host_h
+  echo "CONFIG_ATFILE=y" >> $config_host_mak
 fi
 if test "$utimens" = "yes" ; then
-  echo "#define CONFIG_UTIMENSAT 1" >> $config_host_h
+  echo "CONFIG_UTIMENSAT=y" >> $config_host_mak
 fi
 if test "$pipe2" = "yes" ; then
-  echo "#define CONFIG_PIPE2 1" >> $config_host_h
+  echo "CONFIG_PIPE2=y" >> $config_host_mak
 fi
 if test "$splice" = "yes" ; then
-  echo "#define CONFIG_SPLICE 1" >> $config_host_h
+  echo "CONFIG_SPLICE=y" >> $config_host_mak
 fi
 if test "$inotify" = "yes" ; then
-  echo "#define CONFIG_INOTIFY 1" >> $config_host_h
+  echo "CONFIG_INOTIFY=y" >> $config_host_mak
 fi
 if test "$curl" = "yes" ; then
   echo "CONFIG_CURL=y" >> $config_host_mak
   echo "CURL_LIBS=$curl_libs" >> $config_host_mak
-  echo "#define CONFIG_CURL 1" >> $config_host_h
 fi
 if test "$brlapi" = "yes" ; then
   echo "CONFIG_BRLAPI=y" >> $config_host_mak
-  echo "#define CONFIG_BRLAPI 1" >> $config_host_h
   echo "BRLAPI_LIBS=$brlapi_libs" >> $config_host_mak
 fi
 if test "$bluez" = "yes" ; then
   echo "CONFIG_BLUEZ=y" >> $config_host_mak
   echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
   echo "BLUEZ_LIBS=$bluez_libs" >> $config_host_mak
-  echo "#define CONFIG_BLUEZ 1" >> $config_host_h
 fi
 if test "$xen" = "yes" ; then
   echo "CONFIG_XEN=y" >> $config_host_mak
   echo "XEN_LIBS=$xen_libs" >> $config_host_mak
 fi
 if test "$aio" = "yes" ; then
-  echo "#define CONFIG_AIO 1" >> $config_host_h
   echo "CONFIG_AIO=y" >> $config_host_mak
 fi
 if test "$io_thread" = "yes" ; then
   echo "CONFIG_IOTHREAD=y" >> $config_host_mak
-  echo "#define CONFIG_IOTHREAD 1" >> $config_host_h
 fi
 if test "$blobs" = "yes" ; then
   echo "INSTALL_BLOBS=yes" >> $config_host_mak
 fi
 if test "$iovec" = "yes" ; then
-  echo "#define CONFIG_IOVEC 1" >> $config_host_h
+  echo "CONFIG_IOVEC=y" >> $config_host_mak
 fi
 if test "$preadv" = "yes" ; then
-  echo "#define CONFIG_PREADV 1" >> $config_host_h
+  echo "CONFIG_PREADV=y" >> $config_host_mak
 fi
 if test "$fdt" = "yes" ; then
   echo "CONFIG_FDT=y" >> $config_host_mak
-  echo "#define CONFIG_FDT 1" >> $config_host_h
   echo "FDT_LIBS=$fdt_libs" >> $config_host_mak
 fi

 # XXX: suppress that
 if [ "$bsd" = "yes" ] ; then
-  echo "#define CONFIG_BSD 1" >> $config_host_h
+  echo "CONFIG_BSD=y" >> $config_host_mak
 fi

-echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_host_h
+echo "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak

 # USB host support
 case "$usb" in
@@ -1800,6 +1769,10 @@ echo "EXESUF=$EXESUF" >> $config_host_mak
 echo "PTHREADLIBS=$PTHREADLIBS" >> $config_host_mak
 echo "CLOCKLIBS=$CLOCKLIBS" >> $config_host_mak

+echo "/* Automatically generated by configure - do not modify */" > 
$config_host_h
+
+$source_path/create_config < $config_host_mak >> $config_host_h
+
 if test -f ${config_host_h}~ ; then
   if cmp -s $config_host_h ${config_host_h}~ ; then
     mv ${config_host_h}~ $config_host_h
@@ -2066,7 +2039,10 @@ if test "$target_bsd_user" = "yes" ; then
   echo "CONFIG_BSD_USER=y" >> $config_mak
 fi

-$source_path/create_config < $config_mak > $config_h
+echo "/* Automatically generated by configure - do not modify */" > $config_h
+echo "#include \"../config-host.h\"" >> $config_h
+
+$source_path/create_config < $config_mak >> $config_h

 if test -f ${config_h}~ ; then
   if cmp -s $config_h ${config_h}~ ; then
diff --git a/create_config b/create_config
index 8b7b365..ed83e02 100755
--- a/create_config
+++ b/create_config
@@ -1,11 +1,27 @@
 #!/bin/sh

-echo "/* Automatically generated by configure - do not modify */"
-echo "#include \"../config-host.h\""
-
 while read line; do

 case $line in
+ VERSION=*) # configuration
+    version=${line#*=}
+    echo "#define QEMU_VERSION \"$version\""
+    ;;
+ PKGVERSION=*) # configuration
+    pkgversion=${line#*=}
+    echo "#define QEMU_PKGVERSION \"$pkgversion\""
+    ;;
+ ARCH=*) # configuration
+    arch=${line#*=}
+    arch_name=`echo $arch | tr '[:lower:]' '[:upper:]'`
+    echo "#define HOST_$arch_name 1"
+    ;;
+ CONFIG__sparc_*=y) # configuration
+    name=${line%=*}
+    name=${name#CONFIG}
+    value=${line#*=}
+    echo "#define $name $value"
+    ;;
  CONFIG_*=y) # configuration
     name=${line%=*}
     echo "#define $name 1"
@@ -15,6 +31,26 @@ case $line in
     value=${line#*=}
     echo "#define $name $value"
     ;;
+ ARCH=*) # configuration
+    arch=${line#*=}
+    arch_name=`echo $arch | tr '[:lower:]' '[:upper:]'`
+    echo "#define HOST_$arch_name 1"
+    ;;
+ HOST_USB=*)
+    # do nothing
+    ;;
+ HOST_CC=*)
+    # do nothing
+    ;;
+ HOST_*=y) # configuration
+    name=${line%=*}
+    echo "#define $name 1"
+    ;;
+ HOST_*=*) # configuration
+    name=${line%=*}
+    value=${line#*=}
+    echo "#define $name $value"
+    ;;
  TARGET_ARCH=*) # configuration
     target_arch=${line#*=}
     arch_name=`echo $target_arch | tr '[:lower:]' '[:upper:]'`
@@ -37,6 +73,9 @@ case $line in
  TARGET_ARCH2=*)
     # do nothing
     ;;
+ TARGET_DIRS=*)
+    # do nothing
+    ;;
  TARGET_*=y) # configuration
     name=${line%=*}
     echo "#define $name 1"
-- 
1.6.2.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]