[Mesa-dev] [PATCH 8/9] automake: convert libglapi

Eric Anholt eric at anholt.net
Wed Jul 11 08:20:53 PDT 2012


Jon TURNEY <jon.turney at dronecode.org.uk> writes:
> +libglapi_la_CPPFLAGS = \
> +        $(DEFINES) \
> +	-I$(top_srcdir)/include \
> +	-I$(top_srcdir)/src/mapi \
> +	-I$(top_srcdir)/src/mesa
> +
> +if HAVE_X86_ASM
> +GLAPI_ASM_SOURCES = $(X86_API)
> +endif
> +if HAVE_X86_64_ASM
> +GLAPI_ASM_SOURCES = $(X86_64_API)
> +endif
> +if HAVE_SPARC_ASM
> +GLAPI_ASM_SOURCES = $(SPARC_API)
> +endif
> +
> +if HAVE_SHARED_GLAPI
> +libglapi_la_CPPFLAGS += \
> +	-DMAPI_MODE_BRIDGE \
> +	-DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"
> +glapi_GLAPI_sources =
> +glapi_ASM_sources =
> +glapi_MAPI_sources = $(MAPI_BRIDGE_FILES)
> +else
> +libglapi_la_CPPFLAGS += \
> +	-DMAPI_MODE_UTIL
> +glapi_GLAPI_sources = $(GLAPI_SOURCES)
> +glapi_ASM_sources = $(GLAPI_ASM_SOURCES)
> +glapi_MAPI_sources = $(MAPI_UTIL_FILES)
> +endif

s/libglapi_la_CPPFLAGS/AM_CPPFLAGS/g may get you prettier build output
(at least with CFLAGS, it prepends the lib name to the .o files, which
affects build logs).

> +noinst_LTLIBRARIES = libglapi.la
> +
> +libglapi_la_SOURCES = $(glapi_GLAPI_sources) $(glapi_ASM_sources) $(glapi_MAPI_sources)
> +libglapi_la_LIBADD =
> +libglapi_la_LDFLAGS =
> +
> +# list all possible sources, so automake understands what should be distributed
> +EXTRA_libglapi_la_SOURCES = $(X86_API) $(X86_64_API) $(SPARC_API)

I don't think you need this if you're adding sources to the list using
automake conditionals, and you've removed autoconf substitutions from
the variables (which, afaik, is the reason for the "no autoconf
substitutions in SOURCES" rule.)

> +# Provide compatibility with scripts for the old Mesa build system for
> +# a while by putting a link to libglapi.a here
> +all-local: libglapi.la
> +	ln -sf .libs/libglapi.a libglapi.a

This libglapi.a should be in CLEANFILES.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120711/99991458/attachment.pgp>


More information about the mesa-dev mailing list