[PATCH 2/2] Use autotools config.sub for --host and --build parsing

Justus Winter 4winter at informatik.uni-hamburg.de
Sat Mar 3 08:40:23 PST 2012


This introduces a build dependency on autotools, update debian/control
accordingly.

Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de>
---
 configure      |   28 ++++++----------------------
 debian/control |    1 +
 2 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/configure b/configure
index 77203ed..182bd12 100755
--- a/configure
+++ b/configure
@@ -171,33 +171,17 @@ for option; do
     elif [ "${option}" = '--without-zsh-completion' ] ; then
 	WITH_ZSH=0
     elif [ "${option%%=*}" = '--build' ] ; then
-	build_option="${option#*=}"
-	case ${build_option} in
-	    *-*-*) ;;
-	    *)
-		echo "Unrecognized value for --build option: ${build_option}"
-		echo "Should be: <cpu>-<vendor>-<os>"
-		echo "See:"
-		echo "	$0 --help"
-		echo ""
-		exit 1
-	esac
+	if ! build_option="`/usr/share/misc/config.sub "${option#*=}"`" ; then
+	    exit 1
+	fi
 	build_cpu=${build_option%%-*}
 	build_option=${build_option#*-}
 	build_vendor=${build_option%%-*}
 	build_os=${build_option#*-}
     elif [ "${option%%=*}" = '--host' ] ; then
-	host_option="${option#*=}"
-	case ${host_option} in
-	    *-*-*) ;;
-	    *)
-		echo "Unrecognized value for --host option: ${host_option}"
-		echo "Should be: <cpu>-<vendor>-<os>"
-		echo "See:"
-		echo "	$0 --help"
-		echo ""
-		exit 1
-	esac
+	if ! host_option="`/usr/share/misc/config.sub "${option#*=}"`" ; then
+	    exit 1
+	fi
 	host_cpu=${host_option%%-*}
 	host_option=${host_option#*-}
 	host_vendor=${host_option%%-*}
diff --git a/debian/control b/debian/control
index b60790e..bfb5f01 100644
--- a/debian/control
+++ b/debian/control
@@ -8,6 +8,7 @@ Uploaders:
  David Bremner <bremner at debian.org>
 Build-Depends:
  debhelper (>= 7.0.50~),
+ autotools-dev,
  pkg-config,
  libxapian-dev,
  libgmime-2.6-dev | libgmime-2.4-dev,
-- 
1.7.9.1



More information about the notmuch mailing list