From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id D44FE431FB6 for ; Mon, 25 Jun 2012 13:42:44 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 1.061 X-Spam-Level: * X-Spam-Status: No, score=1.061 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_BL_SPAMCOP_NET=1.246, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_SORBS_WEB=0.614] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VhjAPrpK3bT3 for ; Mon, 25 Jun 2012 13:42:44 -0700 (PDT) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id D7D04431FAF for ; Mon, 25 Jun 2012 13:42:43 -0700 (PDT) Received: by werj55 with SMTP id j55so3641437wer.26 for ; Mon, 25 Jun 2012 13:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=X6hLOJsWOhhBvyxEGXCGI+3zWvDOb1uiOQcr8AYYYcw=; b=Nj9Rs9twK1+5mm7lmCFT7FIl4swU6WN7iSg7i+iL9kxIlRULl2ZWkPTkO/KtyVc0qe 9H4M2xVgK9owhi9Og58d458bCUgKwaIkd9cKdTVKcKY5MtiUeqdtn3RJj6fMrYjbJM+3 Oe+Z9aMoO3f+S/Hc5axnUb8Lhy6nU+n7K0jCbwo+QBBbw9yqxfoyKGVQLfgjI29KEsyv 4qRJlHEk9pfJ+dpAgndQpxrxOqZbfw9xJqs22iQcA6d6n9RAkQUxzXVw45BAc2nTxZFM iZo4seu2sMxwVQPKOkdHjPXaaOx6HbL2iawftNNNlUF1XAY+vCkkL4UHfmJr4li/axC8 zXzQ== Received: by 10.216.144.199 with SMTP id n49mr6604139wej.25.1340656962506; Mon, 25 Jun 2012 13:42:42 -0700 (PDT) Received: from localhost ([195.24.209.21]) by mx.google.com with ESMTPS id db7sm18744596wib.6.2012.06.25.13.42.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jun 2012 13:42:41 -0700 (PDT) From: Ethan Glasser-Camp To: notmuch@notmuchmail.org Subject: [RFC PATCH 02/14] Introduce uriparser Date: Mon, 25 Jun 2012 16:41:27 -0400 Message-Id: <1340656899-5644-3-git-send-email-ethan@betacantrips.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1340656899-5644-1-git-send-email-ethan@betacantrips.com> References: <1340656899-5644-1-git-send-email-ethan@betacantrips.com> X-Mailman-Approved-At: Tue, 26 Jun 2012 03:51:54 -0700 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 20:42:45 -0000 Seeing as there is no glib-standard way to parse URIs, an external library is needed. This commit introduces another program in compat/ and a stanza in ./configure to test if uriparser is there. Signed-off-by: Ethan Glasser-Camp --- Makefile.local | 2 +- compat/have_uriparser.c | 17 +++++++++++++++++ configure | 23 ++++++++++++++++++++--- 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 compat/have_uriparser.c diff --git a/Makefile.local b/Makefile.local index a890df2..084f44e 100644 --- a/Makefile.local +++ b/Makefile.local @@ -41,7 +41,7 @@ PV_FILE=bindings/python/notmuch/version.py # Smash together user's values with our extra values FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags) FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags) -FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch $(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS) +FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch $(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS) $(URIPARSER_LDFLAGS) FINAL_NOTMUCH_LINKER = CC ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1) FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS) diff --git a/compat/have_uriparser.c b/compat/have_uriparser.c new file mode 100644 index 0000000..d79e51d --- /dev/null +++ b/compat/have_uriparser.c @@ -0,0 +1,17 @@ +#include + +int +main (int argc, char *argv[]) +{ + UriParserStateA state; + UriUriA uri; + char *uriS = NULL; + + state.uri = &uri; + if (uriParseUriA (&state, uriS) != URI_SUCCESS) { + /* Failure */ + uriFreeUriMembersA (&uri); + } + + return 0; +} diff --git a/configure b/configure index 3fad424..80aa13c 100755 --- a/configure +++ b/configure @@ -313,6 +313,19 @@ else errors=$((errors + 1)) fi +printf "Checking for uriparser... " +if ${CC} -o compat/have_uriparser "$srcdir"/compat/have_uriparser.c -luriparser > /dev/null 2>&1 +then + printf "Yes.\n" + uriparser_ldflags="-luriparser" + have_uriparser=1 +else + printf "No.\n" + have_uriparser=0 + errors=$((errors + 1)) +fi +rm -f compat/have_uriparser + printf "Checking for valgrind development files... " if pkg-config --exists valgrind; then printf "Yes.\n" @@ -431,11 +444,11 @@ case a simple command will install everything you need. For example: On Debian and similar systems: - sudo apt-get install libxapian-dev libgmime-2.6-dev libtalloc-dev + sudo apt-get install libxapian-dev libgmime-2.6-dev libtalloc-dev liburiparser-dev Or on Fedora and similar systems: - sudo yum install xapian-core-devel gmime-devel libtalloc-devel + sudo yum install xapian-core-devel gmime-devel libtalloc-devel uriparser-devel On other systems, similar commands can be used, but the details of the package names may be different. @@ -669,6 +682,9 @@ GMIME_LDFLAGS = ${gmime_ldflags} TALLOC_CFLAGS = ${talloc_cflags} TALLOC_LDFLAGS = ${talloc_ldflags} +# Flags needed to link against uriparser +URIPARSER_LDFLAGS = ${uriparser_ldflags} + # Flags needed to have linker set rpath attribute RPATH_LDFLAGS = ${rpath_ldflags} @@ -698,5 +714,6 @@ CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\ \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\ \$(VALGRIND_CFLAGS) \$(XAPIAN_CXXFLAGS) \\ -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) -CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(XAPIAN_LDFLAGS) +CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(XAPIAN_LDFLAGS) \\ + \$(URIPARSER_LDFLAGS) EOF -- 1.7.9.5