Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 9CA9E431FC1 for ; Sat, 5 Jun 2010 04:05:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham 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 b+z8dwVI-Coc for ; Sat, 5 Jun 2010 04:05:37 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) by olra.theworths.org (Postfix) with ESMTP id 488554196F3 for ; Sat, 5 Jun 2010 04:05:28 -0700 (PDT) Received: by mail-bw0-f53.google.com with SMTP id 12so685083bwz.26 for ; Sat, 05 Jun 2010 04:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=fYtbZ4EKxYlcOEeDKzYFQFPakPI9Co4SGNTs0nUFdYo=; b=mo6mhReiCYr9/3b2Um1AK5VdXrH9hW9grQ8XkflJ4wPATmmapnr09O6AqZ2qbw8h6r hqZL/W3rTJY1dhWx1ji1Q8HR18sPq+38/DeTAVkv5Vaw4zqbYk5Xw4BkOosXj5UHvomA /M5DtKu+dsU/cnE70TbA7px0NYne5CvKH5PxA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=X0HXPvyfZI7KLLVUJfY/6jtrzEThsv3Vvb1NPvx2lBk7p21HEqlQgzUgoOZERm1IYN grJhscRBpGp9EuKU0JltA2efhA1630qNqu5i3m7QIlBSJE07Y07eecEkxp6+OhvtNV8t +gTyBli5XcF6M2xWq/fFUrSlOou5iCgybopq4= Received: by 10.204.81.153 with SMTP id x25mr4817539bkk.36.1275735927975; Sat, 05 Jun 2010 04:05:27 -0700 (PDT) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id v2sm9557898bkz.19.2010.06.05.04.05.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 05 Jun 2010 04:05:27 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH 2/3] build: fix DSO dependencies Date: Sat, 5 Jun 2010 14:05:14 +0300 Message-Id: <1275735915-22650-3-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1275735915-22650-1-git-send-email-felipe.contreras@gmail.com> References: <1275735915-22650-1-git-send-email-felipe.contreras@gmail.com> 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: Sat, 05 Jun 2010 11:05:50 -0000 At least on Fedora 13, this doesn't link; the linker finds the dependencies, and aborts saying we should include them. /usr/bin/ld: gmime-filter-reply.o: undefined reference to symbol 'g_mime_filter_set_size' /usr/bin/ld: note: 'g_mime_filter_set_size' is defined in DSO /usr/lib/libgmime-2.6.so.0 so try adding it to the linker command line /usr/lib/libgmime-2.6.so.0: could not read symbols: Invalid operation We do need to link at least to what we really use, the linker resolves the dependencies of our dependencies at loading time. So let's only specify what we use directly. For more information, see: https://fedoraproject.org/wiki/UnderstandingDSOLinkChange Signed-off-by: Felipe Contreras --- NOTE: I'm not sure about using $(CC) as a linker in !linux platforms, but if that doesn't work, there's already an 'ifeq' that checks for that so it can be moved there. Makefile.local | 3 --- configure | 11 +++++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Makefile.local b/Makefile.local index bc61a3c..cc8b23b 100644 --- a/Makefile.local +++ b/Makefile.local @@ -33,10 +33,7 @@ FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags) FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch FINAL_NOTMUCH_LINKER = CC -ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1) FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS) -FINAL_NOTMUCH_LINKER = CXX -endif ifeq ($(PLATFORM),LINUX) ifeq ($(LIBDIR_IN_LDCONFIG),0) FINAL_NOTMUCH_LDFLAGS += -Wl,--enable-new-dtags -Wl,-rpath,$(libdir) diff --git a/configure b/configure index 1eb4785..ff775f0 100755 --- a/configure +++ b/configure @@ -255,7 +255,11 @@ for gmimepc in gmime-2.6 gmime-2.4; do printf "Yes ($gmimepc).\n" have_gmime=1 gmime_cflags=$(pkg-config --cflags $gmimepc) - gmime_ldflags=$(pkg-config --libs $gmimepc) + if [ $linker_resolves_library_dependencies = "1" ]; then + gmime_ldflags="-lgmime-2.6 -lgobject-2.0 -lglib-2.0" + else + gmime_ldflags=$(pkg-config --libs $gmimepc) + fi fi done if [ "$have_gmime" = "0" ]; then @@ -481,11 +485,6 @@ HAVE_STRCASESTR = ${have_strcasestr} # Supported platforms (so far) are: LINUX, MACOSX, SOLARIS PLATFORM = ${platform} -# Whether the linker will automatically resolve the dependency of one -# library on another (if not, then linking a binary requires linking -# directly against both) -LINKER_RESOLVES_LIBRARY_DEPENDENCIES = ${linker_resolves_library_dependencies} - # Flags needed to compile and link against Xapian XAPIAN_CXXFLAGS = ${xapian_cxxflags} XAPIAN_LDFLAGS = ${xapian_ldflags} -- 1.7.0.1