aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2017-09-29 11:11:56 +0100
committerGerd Hoffmann <kraxel@redhat.com>2017-10-16 14:46:44 +0200
commitaef45d51d1204f3335fb99de6658e0c5612c2b67 (patch)
tree3dd65cf0fd7f685cfd245e6f14f591f53de24126 /configure
parentf90ea7ba7c5ae7010ee0ce062207ae42530f57d6 (diff)
downloadqemu-aef45d51d1204f3335fb99de6658e0c5612c2b67.zip
qemu-aef45d51d1204f3335fb99de6658e0c5612c2b67.tar.gz
qemu-aef45d51d1204f3335fb99de6658e0c5612c2b67.tar.bz2
build: automatically handle GIT submodule checkout for dtc
Currently if DTC is required by configure and not available in the host OS install, we exit with an error message telling the user to checkout a git submodule or install the library. This introduces automatic handling of the git submodule checkout process and enables it for dtc. This only runs if building from GIT, so users of release tarballs still need the system library install. The current state of the git checkout is stashed in .git-submodule-status, and a helper program is used to determine if this state matches the desired submodule state. A dependency against 'Makefile' ensures that the submodule state is refreshed at the start of the build process Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170929101201.21039-2-berrange@redhat.com [ kraxel: use /bin/sh not bash for scripts/git-submodule.sh ] [ kraxel: fix Makefile dependencies ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> [fixup] Makefile dep
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure46
1 files changed, 26 insertions, 20 deletions
diff --git a/configure b/configure
index 6587e80..38f1710 100755
--- a/configure
+++ b/configure
@@ -264,6 +264,7 @@ cc_i386=i386-pc-linux-gnu-gcc
libs_qga=""
debug_info="yes"
stack_protector=""
+git_submodules=""
# Don't accept a target_list environment variable.
unset target_list
@@ -3584,27 +3585,30 @@ EOF
if compile_prog "" "$fdt_libs" ; then
# system DTC is good - use it
fdt=yes
- elif test -d ${source_path}/dtc/libfdt ; then
- # have submodule DTC - use it
- fdt=yes
- dtc_internal="yes"
- mkdir -p dtc
- if [ "$pwd_is_source_path" != "y" ] ; then
- symlink "$source_path/dtc/Makefile" "dtc/Makefile"
- symlink "$source_path/dtc/scripts" "dtc/scripts"
- fi
- fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt"
- fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs"
- elif test "$fdt" = "yes" ; then
- # have neither and want - prompt for system/submodule install
- error_exit "DTC (libfdt) version >= 1.4.2 not present. Your options:" \
- " (1) Preferred: Install the DTC (libfdt) devel package" \
- " (2) Fetch the DTC submodule, using:" \
- " git submodule update --init dtc"
else
- # don't have and don't want
- fdt_libs=
- fdt=no
+ # have GIT checkout, so activate dtc submodule
+ if test -e "${source_path}/.git" ; then
+ git_submodules="${git_submodules} dtc"
+ fi
+ if test -d "${source_path}/dtc/libfdt" || test -e "${source_path}/.git" ; then
+ fdt=yes
+ dtc_internal="yes"
+ mkdir -p dtc
+ if [ "$pwd_is_source_path" != "y" ] ; then
+ symlink "$source_path/dtc/Makefile" "dtc/Makefile"
+ symlink "$source_path/dtc/scripts" "dtc/scripts"
+ fi
+ fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt"
+ fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs"
+ elif test "$fdt" = "yes" ; then
+ # Not a git build & no libfdt found, prompt for system install
+ error_exit "DTC (libfdt) version >= 1.4.2 not present." \
+ "Please install the DTC (libfdt) devel package"
+ else
+ # don't have and don't want
+ fdt_libs=
+ fdt=no
+ fi
fi
fi
@@ -5295,6 +5299,7 @@ echo "local state directory queried at runtime"
echo "Windows SDK $win_sdk"
fi
echo "Source path $source_path"
+echo "GIT submodules $git_submodules"
echo "C compiler $cc"
echo "Host C compiler $host_cc"
echo "C++ compiler $cxx"
@@ -5483,6 +5488,7 @@ echo "extra_cxxflags=$EXTRA_CXXFLAGS" >> $config_host_mak
echo "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak
echo "qemu_localedir=$qemu_localedir" >> $config_host_mak
echo "libs_softmmu=$libs_softmmu" >> $config_host_mak
+echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
echo "ARCH=$ARCH" >> $config_host_mak