Allow disabling fdt, tasn1 and x11

This allows building a more minimal, self-contained QEMU distribution.

Change-Id: Idaba5d00cb2be2710cf63262584257f7c337479f
diff --git a/configure b/configure
index b8fee6c..7c40ce2 100755
--- a/configure
+++ b/configure
@@ -484,6 +484,8 @@
 debug_mutex="no"
 libpmem=""
 libudev="no"
+tasn1="yes"
+x11=""
 
 # cross compilers defaults, can be overridden with --cross-cc-ARCH
 cross_cc_aarch64="aarch64-linux-gnu-gcc"
@@ -1035,7 +1037,9 @@
   ;;
   --disable-sdl) sdl="no"
   ;;
-  --enable-sdl) sdl="yes"
+  --enable-sdl) sdl="system"
+  ;;
+  --enable-sdl=*) sdl="$optarg"
   ;;
   --with-sdlabi=*) sdlabi="$optarg"
   ;;
@@ -1220,6 +1224,10 @@
   ;;
   --enable-fdt) fdt="yes"
   ;;
+  --with-system-fdt) fdt="system"
+  ;;
+  --without-system-fdt) fdt="internal"
+  ;;
   --disable-linux-aio) linux_aio="no"
   ;;
   --enable-linux-aio) linux_aio="yes"
@@ -1280,6 +1288,10 @@
   ;;
   --enable-rbd) rbd="yes"
   ;;
+  --disable-x11) x11="no"
+  ;;
+  --enable-x11) x11="yes"
+  ;;
   --disable-xfsctl) xfs="no"
   ;;
   --enable-xfsctl) xfs="yes"
@@ -1491,6 +1503,10 @@
   ;;
   --disable-libpmem) libpmem=no
   ;;
+  --disable-tasn1) tasn1="no"
+  ;;
+  --enable-tasn1) tasn1="yes"
+  ;;
   *)
       echo "ERROR: unknown option $opt"
       echo "Try '$0 --help' for more information"
@@ -2673,10 +2689,14 @@
 
 ##########################################
 # X11 probe
-if $pkg_config --exists "x11"; then
-    have_x11=yes
-    x11_cflags=$($pkg_config --cflags x11)
-    x11_libs=$($pkg_config --libs x11)
+if test "$x11" != "no"; then
+  have_x11=yes
+  x11_cflags=
+  x11_libs=-lX11
+  if $pkg_config --exists "x11"; then
+      x11_cflags=$($pkg_config --cflags x11)
+      x11_libs=$($pkg_config --libs x11)
+  fi
 fi
 
 ##########################################
@@ -2840,14 +2860,15 @@
 ##########################################
 # libtasn1 - only for the TLS creds/session test suite
 
-tasn1=yes
 tasn1_cflags=""
 tasn1_libs=""
-if $pkg_config --exists "libtasn1"; then
-    tasn1_cflags=$($pkg_config --cflags libtasn1)
-    tasn1_libs=$($pkg_config --libs libtasn1)
-else
-    tasn1=no
+if test "$tasn1" = "yes" ; then
+    if $pkg_config --exists "libtasn1"; then
+        tasn1_cflags=$($pkg_config --cflags libtasn1)
+        tasn1_libs=$($pkg_config --libs libtasn1)
+    else
+        tasn1=no
+    fi
 fi