Add --with-pkgversion.
Allows distributors to identify their builds without needing to hack the
sources.

Signed-off-by: Paul Brook <[email protected]>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7036 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/configure b/configure
index 853541d..0ea24c2 100755
--- a/configure
+++ b/configure
@@ -190,6 +190,7 @@
 blobs="yes"
 fdt="yes"
 sdl_x11="no"
+pkgversion=""
 
 # OS specific
 if check_define __linux__ ; then
@@ -470,6 +471,8 @@
   ;;
   --kerneldir=*) kerneldir="$optarg"
   ;;
+  --with-pkgversion=*) pkgversion=" ($optarg)"
+  ;;
   *) echo "ERROR: unknown option $opt"; show_help="yes"
   ;;
   esac
@@ -1479,6 +1482,8 @@
 echo "VERSION=$qemu_version" >>$config_mak
 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
 
+echo "#define QEMU_PKGVERSION \"$pkgversion\"" >> $config_h
+
 echo "SRC_PATH=$source_path" >> $config_mak
 if [ "$source_path_used" = "yes" ]; then
   echo "VPATH=$source_path" >> $config_mak
diff --git a/linux-user/main.c b/linux-user/main.c
index 3b9dfc7..dd0058c 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2202,7 +2202,7 @@
 
 static void usage(void)
 {
-    printf("qemu-" TARGET_ARCH " version " QEMU_VERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"
+    printf("qemu-" TARGET_ARCH " version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"
            "usage: qemu-" TARGET_ARCH " [options] program [arguments...]\n"
            "Linux CPU emulator (compiled for %s emulation)\n"
            "\n"
diff --git a/monitor.c b/monitor.c
index ca1c11c..e764b5d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -273,7 +273,7 @@
 
 static void do_info_version(Monitor *mon)
 {
-    monitor_printf(mon, "%s\n", QEMU_VERSION);
+    monitor_printf(mon, "%s\n", QEMU_VERSION QEMU_PKGVERSION);
 }
 
 static void do_info_name(Monitor *mon)
diff --git a/vl.c b/vl.c
index e444f9c..ddbcc6c 100644
--- a/vl.c
+++ b/vl.c
@@ -3942,7 +3942,7 @@
 
 static void version(void)
 {
-    printf("QEMU PC emulator version " QEMU_VERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n");
+    printf("QEMU PC emulator version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n");
 }
 
 static void help(int exitcode)