diff options
author | Eric Anholt <[email protected]> | 2013-09-27 16:57:11 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2013-10-24 14:13:09 -0700 |
commit | bdcee13ca374e4dd72c46951cb137b4f60a6303f (patch) | |
tree | 20b8b41ebd4e2b4ba82436c89f4f910bd41fffe7 /src | |
parent | 86d50c2f1567eebd193ac797a49c58c969646787 (diff) |
swrast: Build the driver into the shared mesa_dri_drivers.so.
v2: drop dridir now that it's unused.
v3: Fix linking after rebase when building just swrast from classic but a
drm-using gallium driver.
v4: Consistently put spaces around += in the updated Makefile.am block.
v5: Set a global driverAPI variable so loaders don't have to update to
createNewScreen2() (though they may want to for thread safety).
Reviewed-by: Matt Turner <[email protected]> (v3)
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/Makefile.am | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/Makefile.am | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/swrast/Makefile.am | 18 | ||||
-rw-r--r-- | src/mesa/drivers/dri/swrast/Makefile.sources | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/swrast/swrast.c | 19 |
5 files changed, 28 insertions, 27 deletions
diff --git a/src/mesa/drivers/dri/Makefile.am b/src/mesa/drivers/dri/Makefile.am index 57b2341fa07..aee6990c439 100644 --- a/src/mesa/drivers/dri/Makefile.am +++ b/src/mesa/drivers/dri/Makefile.am @@ -37,7 +37,9 @@ MEGADRIVERS += radeon_dri.so endif if HAVE_SWRAST_DRI -SUBDIRS+=swrast +SUBDIRS += swrast +MEGADRIVERS_DEPS += swrast/libswrast_dri.la +MEGADRIVERS += swrast_dri.so endif pkgconfigdir = $(libdir)/pkgconfig diff --git a/src/mesa/drivers/dri/common/Makefile.am b/src/mesa/drivers/dri/common/Makefile.am index e9c4acaece5..9f49ff3aee4 100644 --- a/src/mesa/drivers/dri/common/Makefile.am +++ b/src/mesa/drivers/dri/common/Makefile.am @@ -27,7 +27,6 @@ AM_CFLAGS = \ -I$(top_srcdir)/src/mapi \ -I$(top_srcdir)/src/mesa/ \ $(DEFINES) \ - $(LIBDRM_CFLAGS) \ $(VISIBILITY_CFLAGS) noinst_LTLIBRARIES = \ @@ -47,3 +46,10 @@ libdri_test_stubs_la_CFLAGS = $(AM_CFLAGS) -DNO_MAIN libmegadriver_stub_la_SOURCES = megadriver_stub.c sysconf_DATA = drirc + +if DRICOMMON_NEED_LIBDRM +AM_CFLAGS += $(LIBDRM_CFLAGS) +libdricommon_la_LDFLAGS = $(LIBDRM_LIBS) +else +AM_CFLAGS += -D__NOT_HAVE_DRM_H +endif diff --git a/src/mesa/drivers/dri/swrast/Makefile.am b/src/mesa/drivers/dri/swrast/Makefile.am index c51ad2d874b..0837b4518ff 100644 --- a/src/mesa/drivers/dri/swrast/Makefile.am +++ b/src/mesa/drivers/dri/swrast/Makefile.am @@ -34,19 +34,5 @@ AM_CFLAGS = \ $(DEFINES) \ $(VISIBILITY_CFLAGS) -dridir = $(DRI_DRIVER_INSTALL_DIR) -dri_LTLIBRARIES = swrast_dri.la - -swrast_dri_la_SOURCES = \ - $(SWRAST_C_FILES) - -swrast_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS) - -swrast_dri_la_LIBADD = \ - $(DRI_LIB_DEPS) - -# Provide compatibility with scripts for the old Mesa build system for -# a while by putting a link to the driver into /lib of the build tree. -all-local: swrast_dri.la - $(MKDIR_P) $(top_builddir)/$(LIB_DIR); - ln -f .libs/swrast_dri.so $(top_builddir)/$(LIB_DIR)/swrast_dri.so; +noinst_LTLIBRARIES = libswrast_dri.la +libswrast_dri_la_SOURCES = $(SWRAST_C_FILES) diff --git a/src/mesa/drivers/dri/swrast/Makefile.sources b/src/mesa/drivers/dri/swrast/Makefile.sources index fc7ef32dbd5..70e432febb5 100644 --- a/src/mesa/drivers/dri/swrast/Makefile.sources +++ b/src/mesa/drivers/dri/swrast/Makefile.sources @@ -1,11 +1,5 @@ SWRAST_DRIVER_FILES = \ swrast.c -SWRAST_COMMON_FILES = \ - ../common/utils.c \ - ../common/dri_util.c \ - ../common/xmlconfig.c - SWRAST_C_FILES = \ - $(SWRAST_COMMON_FILES) \ $(SWRAST_DRIVER_FILES) diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 4725a7f42dd..bfa2efd21c8 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -59,6 +59,7 @@ #include "swrast_priv.h" #include "swrast/s_context.h" +const __DRIextension **__driDriverGetExtensions_swrast(void); /** * Screen and config-related functions @@ -819,7 +820,7 @@ dri_unbind_context(__DRIcontext * cPriv) } -const struct __DriverAPIRec driDriverAPI = { +static const struct __DriverAPIRec swrast_driver_api = { .InitScreen = dri_init_screen, .DestroyScreen = dri_destroy_screen, .CreateContext = dri_create_context, @@ -831,9 +832,21 @@ const struct __DriverAPIRec driDriverAPI = { .UnbindContext = dri_unbind_context, }; -/* This is the table of extensions that the loader will dlsym() for. */ -PUBLIC const __DRIextension *__driDriverExtensions[] = { +static const struct __DRIDriverVtableExtensionRec swrast_vtable = { + .base = { __DRI_DRIVER_VTABLE, 1 }, + .vtable = &swrast_driver_api, +}; + +static const __DRIextension *swrast_driver_extensions[] = { &driCoreExtension.base, &driSWRastExtension.base, + &swrast_vtable.base, NULL }; + +PUBLIC const __DRIextension **__driDriverGetExtensions_swrast(void) +{ + globalDriverAPI = &swrast_driver_api; + + return swrast_driver_extensions; +} |