PPC: Fail configure when libfdt is not available
authorAlexander Graf <agraf@suse.de>
Tue, 18 Oct 2011 00:10:36 +0000 (02:10 +0200)
committerAlexander Graf <agraf@suse.de>
Sun, 30 Oct 2011 19:03:26 +0000 (20:03 +0100)
We have several targets in the PPC tree now that basically require libfdt
to function properly, namely the pseries and the e500 targets. This dependency
will rather increase than decrease in the future, so I want to make sure
that people building shiny new 1.0 actually have libfdt installed to get
rid of a few ifdefs in the code.

Warning: This patch will likely make configure fail for people who don't
select their own --target-list, but don't have libfdt development packages
installed. However, we really need this new dependency to move on.

Signed-off-by: Alexander Graf <agraf@suse.de>
---

v1 -> v2:

  - no paranthesis
  - no fdt check for config_pseries
  - add . in error message

configure

index f8dd4db..18537e8 100755 (executable)
--- a/configure
+++ b/configure
@@ -3422,7 +3422,16 @@ case "$target_arch2" in
       fi
     fi
 esac
-if test "$target_arch2" = "ppc64" -a "$fdt" = "yes"; then
+if test "$fdt" != "yes" && test "$target_arch2" = "ppc" -o \
+        "$target_arch2" = "ppc64" -o "$target_arch2" = "ppcemb"; then
+  echo
+  echo "Error: libfdt missing"
+  echo "The PowerPC target requires libfdt to work properly."
+  echo "Please make sure to have it and its development packages installed."
+  echo
+  exit 1
+fi
+if test "$target_arch2" = "ppc64"; then
   echo "CONFIG_PSERIES=y" >> $config_target_mak
 fi
 if test "$target_bigendian" = "yes" ; then