add --firmwarepath to configure

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJZyjSfAAoJEEy22O7T6HE4x7gQAKfAN02JJJdLN3WT8DSg/FTc
 tbCHuNcWzbbG9Ex6oMwsz/arSV4zim5+kCRrTp3W5GsPyU7Jw0Mq49mLDK7r2iw2
 axnSTkkP2LLHF2IP0NzjsuE81vCrZL45+HiklEyfiDxVEzyIFxcQVnB3Dxf80RSA
 npnm/lnmOy8PsPVS694UP97R9/r0s71LfyDF71b/fsGpIIHcHXBQf5CFnt436gAd
 X+74s3iBKH4nH0wCEkCBocVZG6UwB7Y3iHWtFFpbJphjuLaRN26oJIfamGp0qcZu
 Pgle4WEfhr7KWrWm44gHecdSX9SvH75hrQdndVd/XAp/ChMW3t5dYDNBBxUkBC23
 O4h4xMsSMYSGQGEP3wOJGB8w4GAMQr5vO6AaEIhrhE/9U1CA+v0aWJb2VWTz96Fy
 a3EFJUsRRCgUH8dVAKpnVGPIwUsoyxbU9x2BhgYE2OFm65FlR0UnqmAQ8hVOm2hO
 eCC7EcwBBw6U1m/QPFSdZ5kIw8bpT+bEQd+cOmX5qSx+RBB7acuCeUqDeH3KyvzU
 aWqPKzye0+nHlpIo3jOWj87zRplVXyP56BSPLJzyoklKvUFD5ff7q0kyh238hqeO
 X0TriURYEW3wnSPUf8cnytm8kjHyO+GuqdYKUpyhz3lxA6XqjqSIXW6tpr9BVFpx
 ZYn/4IWLqxA1OxgjXQYn
 =sk/b
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/fw-20170926-pull-request' into staging

add --firmwarepath to configure

# gpg: Signature made Tue 26 Sep 2017 12:06:07 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/fw-20170926-pull-request:
  Add --firmwarepath to configure
  add qemu_add_data_dir()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2017-09-26 22:07:02 +01:00
commit 08df7e5577
3 changed files with 38 additions and 14 deletions

6
configure vendored
View File

@ -332,6 +332,7 @@ modules="no"
prefix="/usr/local"
mandir="\${prefix}/share/man"
datadir="\${prefix}/share"
firmwarepath="\${prefix}/share/qemu-firmware"
qemu_docdir="\${prefix}/share/doc/qemu"
bindir="\${prefix}/bin"
libdir="\${prefix}/lib"
@ -914,6 +915,8 @@ for opt do
;;
--localstatedir=*) local_statedir="$optarg"
;;
--firmwarepath=*) firmwarepath="$optarg"
;;
--sbindir=*|--sharedstatedir=*|\
--oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\
--htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*)
@ -1415,6 +1418,7 @@ Advanced options (experts only):
--libdir=PATH install libraries in PATH
--sysconfdir=PATH install config in PATH$confsuffix
--localstatedir=PATH install local state in PATH (set at runtime on win32)
--firmwarepath=PATH search PATH for firmware files
--with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix]
--enable-debug enable common debug build options
--disable-strip disable stripping binaries
@ -5275,6 +5279,7 @@ libs_softmmu="$pixman_libs $libs_softmmu"
echo "Install prefix $prefix"
echo "BIOS directory $(eval echo $qemu_datadir)"
echo "firmware path $(eval echo $firmwarepath)"
echo "binary directory $(eval echo $bindir)"
echo "library directory $(eval echo $libdir)"
echo "module directory $(eval echo $qemu_moddir)"
@ -5466,6 +5471,7 @@ echo "mandir=$mandir" >> $config_host_mak
echo "sysconfdir=$sysconfdir" >> $config_host_mak
echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
echo "qemu_datadir=$qemu_datadir" >> $config_host_mak
echo "qemu_firmwarepath=$firmwarepath" >> $config_host_mak
echo "qemu_docdir=$qemu_docdir" >> $config_host_mak
echo "qemu_moddir=$qemu_moddir" >> $config_host_mak
if test "$mingw32" = "no" ; then

View File

@ -15,7 +15,7 @@ case $line in
echo "#define QEMU_VERSION_MINOR $minor"
echo "#define QEMU_VERSION_MICRO $micro"
;;
qemu_*dir=*) # qemu-specific directory configuration
qemu_*dir=* | qemu_*path=*) # qemu-specific directory configuration
name=${line%=*}
value=${line#*=}
define_name=$(echo $name | LC_ALL=C tr '[a-z]' '[A-Z]')

44
vl.c
View File

@ -2348,6 +2348,24 @@ char *qemu_find_file(int type, const char *name)
return NULL;
}
static void qemu_add_data_dir(const char *path)
{
int i;
if (path == NULL) {
return;
}
if (data_dir_idx == ARRAY_SIZE(data_dir)) {
return;
}
for (i = 0; i < data_dir_idx; i++) {
if (strcmp(data_dir[i], path) == 0) {
return; /* duplicate */
}
}
data_dir[data_dir_idx++] = path;
}
static inline bool nonempty_str(const char *str)
{
return str && *str;
@ -3107,6 +3125,7 @@ int main(int argc, char **argv, char **envp)
Error *main_loop_err = NULL;
Error *err = NULL;
bool list_data_dirs = false;
char **dirs;
typedef struct BlockdevOptions_queue {
BlockdevOptions *bdo;
Location loc;
@ -3527,8 +3546,8 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_L:
if (is_help_option(optarg)) {
list_data_dirs = true;
} else if (data_dir_idx < ARRAY_SIZE(data_dir)) {
data_dir[data_dir_idx++] = optarg;
} else {
qemu_add_data_dir(optarg);
}
break;
case QEMU_OPTION_bios:
@ -4291,19 +4310,18 @@ int main(int argc, char **argv, char **envp)
qemu_set_log(0);
}
/* If no data_dir is specified then try to find it relative to the
executable path. */
if (data_dir_idx < ARRAY_SIZE(data_dir)) {
data_dir[data_dir_idx] = os_find_datadir();
if (data_dir[data_dir_idx] != NULL) {
data_dir_idx++;
}
}
/* If all else fails use the install path specified when building. */
if (data_dir_idx < ARRAY_SIZE(data_dir)) {
data_dir[data_dir_idx++] = CONFIG_QEMU_DATADIR;
/* add configured firmware directories */
dirs = g_strsplit(CONFIG_QEMU_FIRMWAREPATH, G_SEARCHPATH_SEPARATOR_S, 0);
for (i = 0; dirs[i] != NULL; i++) {
qemu_add_data_dir(dirs[i]);
}
/* try to find datadir relative to the executable path */
qemu_add_data_dir(os_find_datadir());
/* add the datadir specified when building */
qemu_add_data_dir(CONFIG_QEMU_DATADIR);
/* -L help lists the data directories and exits. */
if (list_data_dirs) {
for (i = 0; i < data_dir_idx; i++) {