Re: [notmuch] [PATCH 2/2] Build and link against notmuch shared library

Subject: Re: [notmuch] [PATCH 2/2] Build and link against notmuch shared library

Date: Thu, 04 Mar 2010 09:25:45 +0100

To: Ben Gamari, notmuch@notmuchmail.org, cworth@cworth.org

Cc:

From: Sebastian Spaeth


>  notmuch_client_modules = $(notmuch_client_srcs:.c=.o)
> -notmuch: $(notmuch_client_modules) lib/notmuch.a
> -	$(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -o $@
> +notmuch: $(notmuch_client_modules) lib/libnotmuch.so
> +	$(call quiet,CC,$(LDFLAGS)) -lnotmuch $(filter-out lib/libnotmuch.so,$^) $(FINAL_LDFLAGS) -o $@

I just tried out this patch to compile notmuch as a shared library and
while producing lib/libnotmuch.so.1 it fails to find notmuch later:

CC 	notmuch
/usr/bin/ld: cannot find -lnotmuch

Aso it creates libnotmuch.so.1 in lib but seems to try symlinking it in
the "compat" dir which fails and produces a dead symlink.

CXX 	lib/libnotmuch.so.1
ln -sf compat/libnotmuch.so.1 compat/libnotmuch.so

Is more needed than this patch? Also, *I* think it would be nice to
support --static or --shared as options to --configure. But that is a
minor thing, probably.

Sebastian

Thread: