unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [rfc] autotools compatibility and Hurd as platform
@ 2012-03-03 16:40 Justus Winter
  2012-03-03 16:40 ` [PATCH 1/2] Add GNU as a valid platform Justus Winter
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Justus Winter @ 2012-03-03 16:40 UTC (permalink / raw)
  To: notmuch

I made two tiny patches to enable notmuch to be built on the Hurd, the
first one is straight forward, it just adds GNU as a platform and
reuses the settings for Linux.

The second one deals with the problem that the value passed as an
argument to --build is not a triple but a tuple:

% dpkg-architecture -qDEB_HOST_GNU_TYPE
i486-gnu

notmuchs configure script expects the arguments for --host and --build
to be triple but autotools is much more forgiving here. It does so by
canonicalizing the values using some serious voodoo in
/usr/share/misc/config.sub.

The patch reuses config.sub to canonicalize the arguments, but this
introduces a build dependency on autotools and probably worse, it uses
autotools internals and the path to config.sub has to be hardcoded.

Since this might be not desirable we might also just drop the code
that parses the --host and --build options since we're not using them
anyway.

With these two patches notmuch builds fine and works on the Hurd, the
testsuite is running fine (modulo one test, but that might be broken,
haven't checked on linux) and the python bindings are fine too (I've
been successfully running afew to tag some mails).

Cheers,
Justus

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

* [PATCH 1/2] Add GNU as a valid platform
  2012-03-03 16:40 [rfc] autotools compatibility and Hurd as platform Justus Winter
@ 2012-03-03 16:40 ` Justus Winter
  2012-03-03 16:40 ` [PATCH 2/2] Use autotools config.sub for --host and --build parsing Justus Winter
  2012-03-05  2:20 ` [rfc] autotools compatibility and Hurd as platform David Bremner
  2 siblings, 0 replies; 8+ messages in thread
From: Justus Winter @ 2012-03-03 16:40 UTC (permalink / raw)
  To: notmuch

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
---
 configure |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 8b85b9d..77203ed 100755
--- a/configure
+++ b/configure
@@ -362,9 +362,9 @@ elif [ $uname = "SunOS" ] ; then
     printf "Solaris.\n"
     platform=SOLARIS
     linker_resolves_library_dependencies=0
-elif [ $uname = "Linux" ] ; then
-    printf "Linux\n"
-    platform=LINUX
+elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then
+    printf "$uname\n"
+    platform="$uname"
     linker_resolves_library_dependencies=1
 
     printf "Checking for $libdir_expanded in ldconfig... "
-- 
1.7.9.1

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

* [PATCH 2/2] Use autotools config.sub for --host and --build parsing
  2012-03-03 16:40 [rfc] autotools compatibility and Hurd as platform Justus Winter
  2012-03-03 16:40 ` [PATCH 1/2] Add GNU as a valid platform Justus Winter
@ 2012-03-03 16:40 ` Justus Winter
  2012-03-05  2:20 ` [rfc] autotools compatibility and Hurd as platform David Bremner
  2 siblings, 0 replies; 8+ messages in thread
From: Justus Winter @ 2012-03-03 16:40 UTC (permalink / raw)
  To: notmuch

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

Signed-off-by: Justus Winter <4winter@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@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

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

* Re: [rfc] autotools compatibility and Hurd as platform
  2012-03-03 16:40 [rfc] autotools compatibility and Hurd as platform Justus Winter
  2012-03-03 16:40 ` [PATCH 1/2] Add GNU as a valid platform Justus Winter
  2012-03-03 16:40 ` [PATCH 2/2] Use autotools config.sub for --host and --build parsing Justus Winter
@ 2012-03-05  2:20 ` David Bremner
  2012-03-05 10:23   ` [PATCH 1/2] Add GNU as a valid platform Justus Winter
  2 siblings, 1 reply; 8+ messages in thread
From: David Bremner @ 2012-03-05  2:20 UTC (permalink / raw)
  To: Justus Winter, notmuch

On Sat,  3 Mar 2012 17:40:21 +0100, Justus Winter <4winter@informatik.uni-hamburg.de> wrote:

> The patch reuses config.sub to canonicalize the arguments, but this
> introduces a build dependency on autotools and probably worse, it uses
> autotools internals and the path to config.sub has to be hardcoded.
> 
> Since this might be not desirable we might also just drop the code
> that parses the --host and --build options since we're not using them
> anyway.

The second solution sounds better to me. The only issue we might
encounter is dealing with multi-arch installation properly. But I guess
we don't do that now anyway, so no real loss.

d

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

* [PATCH 1/2] Add GNU as a valid platform
  2012-03-05  2:20 ` [rfc] autotools compatibility and Hurd as platform David Bremner
@ 2012-03-05 10:23   ` Justus Winter
  2012-03-05 10:23     ` [PATCH 2/2] Do not try to parse the options for --build and --host arguments Justus Winter
                       ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Justus Winter @ 2012-03-05 10:23 UTC (permalink / raw)
  To: notmuch

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
---
 configure |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 8b85b9d..77203ed 100755
--- a/configure
+++ b/configure
@@ -362,9 +362,9 @@ elif [ $uname = "SunOS" ] ; then
     printf "Solaris.\n"
     platform=SOLARIS
     linker_resolves_library_dependencies=0
-elif [ $uname = "Linux" ] ; then
-    printf "Linux\n"
-    platform=LINUX
+elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then
+    printf "$uname\n"
+    platform="$uname"
     linker_resolves_library_dependencies=1
 
     printf "Checking for $libdir_expanded in ldconfig... "
-- 
1.7.9.1

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

* [PATCH 2/2] Do not try to parse the options for --build and --host arguments
  2012-03-05 10:23   ` [PATCH 1/2] Add GNU as a valid platform Justus Winter
@ 2012-03-05 10:23     ` Justus Winter
  2012-03-18 15:38     ` [PATCH 1/2] Add GNU as a valid platform David Bremner
  2012-03-20 11:20     ` David Bremner
  2 siblings, 0 replies; 8+ messages in thread
From: Justus Winter @ 2012-03-05 10:23 UTC (permalink / raw)
  To: notmuch

Formerly the code assumed the arguments to be triples and threw an
error if this was not the case. But those arguments are only there for
compatibility with autotools and are not used within the build system,
so just dropping the code parsing these values makes the build system
more robust.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
---
 configure |   32 ++------------------------------
 1 files changed, 2 insertions(+), 30 deletions(-)

diff --git a/configure b/configure
index 77203ed..ca30482 100755
--- a/configure
+++ b/configure
@@ -171,37 +171,9 @@ 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
-	build_cpu=${build_option%%-*}
-	build_option=${build_option#*-}
-	build_vendor=${build_option%%-*}
-	build_os=${build_option#*-}
+	true
     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
-	host_cpu=${host_option%%-*}
-	host_option=${host_option#*-}
-	host_vendor=${host_option%%-*}
-	host_os=${host_option#*-}
+	true
     elif [ "${option%%=*}" = '--infodir' ] ; then
 	true
     elif [ "${option%%=*}" = '--datadir' ] ; then
-- 
1.7.9.1

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

* Re: [PATCH 1/2] Add GNU as a valid platform
  2012-03-05 10:23   ` [PATCH 1/2] Add GNU as a valid platform Justus Winter
  2012-03-05 10:23     ` [PATCH 2/2] Do not try to parse the options for --build and --host arguments Justus Winter
@ 2012-03-18 15:38     ` David Bremner
  2012-03-20 11:20     ` David Bremner
  2 siblings, 0 replies; 8+ messages in thread
From: David Bremner @ 2012-03-18 15:38 UTC (permalink / raw)
  To: Justus Winter, notmuch

On Mon,  5 Mar 2012 11:23:43 +0100, Justus Winter <4winter@informatik.uni-hamburg.de> wrote:
> Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
> ---
>  configure |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

These two patches do indeed seem to fix the build on hurd, so barring
objections I'll push 'em after a bit. 

There are a few emacs test failures, probably to do with either sockets
or dtach.

d

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

* Re: [PATCH 1/2] Add GNU as a valid platform
  2012-03-05 10:23   ` [PATCH 1/2] Add GNU as a valid platform Justus Winter
  2012-03-05 10:23     ` [PATCH 2/2] Do not try to parse the options for --build and --host arguments Justus Winter
  2012-03-18 15:38     ` [PATCH 1/2] Add GNU as a valid platform David Bremner
@ 2012-03-20 11:20     ` David Bremner
  2 siblings, 0 replies; 8+ messages in thread
From: David Bremner @ 2012-03-20 11:20 UTC (permalink / raw)
  To: Justus Winter, notmuch

On Mon,  5 Mar 2012 11:23:43 +0100, Justus Winter <4winter@informatik.uni-hamburg.de> wrote:
> Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
> ---
>  configure |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

pushed both.

d

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

end of thread, other threads:[~2012-03-20 11:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-03 16:40 [rfc] autotools compatibility and Hurd as platform Justus Winter
2012-03-03 16:40 ` [PATCH 1/2] Add GNU as a valid platform Justus Winter
2012-03-03 16:40 ` [PATCH 2/2] Use autotools config.sub for --host and --build parsing Justus Winter
2012-03-05  2:20 ` [rfc] autotools compatibility and Hurd as platform David Bremner
2012-03-05 10:23   ` [PATCH 1/2] Add GNU as a valid platform Justus Winter
2012-03-05 10:23     ` [PATCH 2/2] Do not try to parse the options for --build and --host arguments Justus Winter
2012-03-18 15:38     ` [PATCH 1/2] Add GNU as a valid platform David Bremner
2012-03-20 11:20     ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).