[PATCH 3/4] Add infrastructure for building shared library on OS X.

Carl Worth cworth at cworth.org
Wed Apr 14 11:01:58 PDT 2010


On Sun, 11 Apr 2010 19:44:53 -0400, Aaron Ecay <aaronecay at gmail.com> wrote:
> This patch adds a configure check for OS X (actually Darwin),
> and sets up the Makefiles to build a proper shared library on
> that platform.
...
> -include $(subdirs:%=%/Makefile.local) Makefile.local
> +include Makefile.config $(subdirs:%=%/Makefile.local) Makefile.local

This first hunk looks unrelated to what's described in the commit
message.

It also results in Makefile.config being included from both the toplevel
Makefile and the toplevel Makefile.local, so that seems wrong.

I had wanted to keep the top-level Makefile totally generic, (so that if
a project wanted to imitate the notmuch flat-Makefile build system that
would be easy). And perhaps including Makefile.config here violates
that.

But I'd be willing to accept that if necessary---should just remove the
include of Makefile.config from Makefile.local then I think.

> +printf "Checking for Mac OS X (for shared library)... "
> +if [ `uname` = "Darwin" ] ; then
> +    printf "Yes.\n"
> +    mac_os_x=1
> +else
> +    printf "No.\n"
> +    mac_os_x=0
> +fi
> +

Instead of inventing a new mac_os_x variable, we should follow the GNU
configure conventions of build_cpu, build_vendor, build_os
variables. We're already allowing the user to assign to these by passing
a --build option to configure (though not yet doing anything with the
values).

But now that you've got something you actually do want to do with the
values, we should use those same variables. It might not even be crazy
to copy in config.guess (or pieces of it). Though, frankly, it's not
doing anything for Darwin unlike you're doing above, so you might as
well just use your own code as you have.

>  libnotmuch_c_srcs =		\
> +	$(notmuch_compat_srcs)  \
>  	$(dir)/libsha1.c	\
>  	$(dir)/message-file.c	\
>  	$(dir)/messages.c	\

This again looks like an independent fix that should be in a separate
commit.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100414/b0bce721/attachment.pgp>


More information about the notmuch mailing list