All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] configure: actually disable 'git_update' mode with --disable-git-update
@ 2020-07-15 20:50 Dan Streetman
  2020-07-16 10:22 ` [PATCH v2] " Dan Streetman
  0 siblings, 1 reply; 15+ messages in thread
From: Dan Streetman @ 2020-07-15 20:50 UTC (permalink / raw)
  To: qemu-trivial; +Cc: Dan Streetman, Christian Ehrhardt, Rafael David Tinoco

The --disable-git-update configure param sets git_update=no, but
some later checks only look for the .git dir. This changes the
--enable-git-update to set git_update=yes but also fail if it
does not find a .git dir. Then all the later checks for the .git
dir can just be changed to a check for $git_update = "yes".

This is needed because downstream packagers, e.g. Debian, Ubuntu, etc,
also keep the source code in git, but do not want to enable the
'git_update' mode; with the current code, that's not possible even
if the downstream package specifies --disable-git-update.

Signed-off-by: Dan Streetman <ddstreet@canonical.com>
---
 configure | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/configure b/configure
index b751c853f5..fdc292b838 100755
--- a/configure
+++ b/configure
@@ -1603,7 +1603,12 @@ for opt do
   ;;
   --with-git=*) git="$optarg"
   ;;
-  --enable-git-update) git_update=yes
+  --enable-git-update)
+      git_update=yes
+      if test ! -e "$source_path/.git"; then
+          echo "ERROR: cannot --enable-git-update without .git"
+          exit 1
+      fi
   ;;
   --disable-git-update) git_update=no
   ;;
@@ -2017,7 +2022,7 @@ fi
 # Consult white-list to determine whether to enable werror
 # by default.  Only enable by default for git builds
 if test -z "$werror" ; then
-    if test -e "$source_path/.git" && \
+    if test "$git_update" = "yes" && \
         { test "$linux" = "yes" || test "$mingw32" = "yes"; }; then
         werror="yes"
     else
@@ -4418,10 +4423,10 @@ EOF
     fdt=system
   else
       # have GIT checkout, so activate dtc submodule
-      if test -e "${source_path}/.git" ; then
+      if test "$git_update" = "yes" ; then
           git_submodules="${git_submodules} dtc"
       fi
-      if test -d "${source_path}/dtc/libfdt" || test -e "${source_path}/.git" ; then
+      if test -d "${source_path}/dtc/libfdt" || test "$git_update" = "yes" ; then
           fdt=git
           mkdir -p dtc
           if [ "$pwd_is_source_path" != "y" ] ; then
@@ -5391,7 +5396,7 @@ case "$capstone" in
   "" | yes)
     if $pkg_config capstone; then
       capstone=system
-    elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then
+    elif test "$git_update" = "yes" ; then
       capstone=git
     elif test -e "${source_path}/capstone/Makefile" ; then
       capstone=internal
@@ -6447,7 +6452,7 @@ case "$slirp" in
   "" | yes)
     if $pkg_config slirp; then
       slirp=system
-    elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then
+    elif test "$git_update" = "yes" ; then
       slirp=git
     elif test -e "${source_path}/slirp/Makefile" ; then
       slirp=internal
@@ -6809,7 +6814,7 @@ if test "$cpu" = "s390x" ; then
     roms="$roms s390-ccw"
     # SLOF is required for building the s390-ccw firmware on s390x,
     # since it is using the libnet code from SLOF for network booting.
-    if test -e "${source_path}/.git" ; then
+    if test "$git_update" = "yes" ; then
       git_submodules="${git_submodules} roms/SLOF"
     fi
   fi
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-10-16 20:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-15 20:50 [PATCH] configure: actually disable 'git_update' mode with --disable-git-update Dan Streetman
2020-07-16 10:22 ` [PATCH v2] " Dan Streetman
2020-07-24  9:55   ` Michael Tokarev
2020-07-29 19:58     ` [PATCH] " Dan Streetman
2020-07-29 19:58       ` Dan Streetman
2020-09-13 18:57       ` [PATCH resend] " Dan Streetman
2020-09-13 18:57         ` Dan Streetman
2020-09-13 21:09         ` Philippe Mathieu-Daudé
2020-09-13 21:09           ` Philippe Mathieu-Daudé
2020-09-22 16:34       ` [PATCH] " Daniel P. Berrangé
2020-10-01  1:28         ` Dan Streetman
2020-10-02 13:11           ` Daniel P. Berrangé
2020-10-02 14:25             ` Peter Maydell
2020-10-02 14:44               ` Rafael David Tinoco
2020-10-16 20:51             ` Dan Streetman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.