From 8443efdf2c7772f18e8209b6b6cfc6b19e638423 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Fri, 31 Aug 2012 17:11:35 -0700 Subject: [PATCH] state_trackers/egl: Convert to automake --- configure.ac | 1 + src/gallium/state_trackers/egl/.gitignore | 1 + src/gallium/state_trackers/egl/Makefile | 127 --------------------- src/gallium/state_trackers/egl/Makefile.am | 109 ++++++++++++++++++ src/gallium/state_trackers/egl/x11/dri2.c | 1 + 5 files changed, 112 insertions(+), 127 deletions(-) create mode 100644 src/gallium/state_trackers/egl/.gitignore delete mode 100644 src/gallium/state_trackers/egl/Makefile create mode 100644 src/gallium/state_trackers/egl/Makefile.am create mode 120000 src/gallium/state_trackers/egl/x11/dri2.c diff --git a/configure.ac b/configure.ac index bfd3c0aa4d1..8fcef8e1a54 100644 --- a/configure.ac +++ b/configure.ac @@ -2045,6 +2045,7 @@ AC_CONFIG_FILES([configs/current src/gallium/state_trackers/dri/Makefile src/gallium/state_trackers/dri/drm/Makefile src/gallium/state_trackers/dri/sw/Makefile + src/gallium/state_trackers/egl/Makefile src/gallium/targets/Makefile src/gallium/targets/opencl/Makefile src/gallium/winsys/Makefile diff --git a/src/gallium/state_trackers/egl/.gitignore b/src/gallium/state_trackers/egl/.gitignore new file mode 100644 index 00000000000..f3c7a7c5da6 --- /dev/null +++ b/src/gallium/state_trackers/egl/.gitignore @@ -0,0 +1 @@ +Makefile diff --git a/src/gallium/state_trackers/egl/Makefile b/src/gallium/state_trackers/egl/Makefile deleted file mode 100644 index 66b2e7ec78f..00000000000 --- a/src/gallium/state_trackers/egl/Makefile +++ /dev/null @@ -1,127 +0,0 @@ -TOP = ../../../.. -include $(TOP)/configs/current - -common_INCLUDES = \ - -I. \ - -I$(TOP)/src/gallium/include \ - -I$(TOP)/src/gallium/auxiliary \ - -I$(TOP)/src/egl/main \ - -I$(TOP)/src/egl/wayland/wayland-drm/ \ - -I$(TOP)/include - -common_SOURCES = $(wildcard common/*.c) -common_OBJECTS = $(common_SOURCES:.c=.o) - -x11_INCLUDES = \ - -I$(TOP)/src/gallium/drivers \ - -I$(TOP)/src/glx \ - -I$(TOP)/src/mapi \ - -I$(TOP)/src/mesa \ - $(X11_CFLAGS) \ - $(shell $(PKG_CONFIG) --cflags-only-I libdrm dri2proto) - -x11_SOURCES = $(wildcard x11/*.c) \ - $(TOP)/src/glx/dri2.c -x11_OBJECTS = $(x11_SOURCES:.c=.o) - -wayland_INCLUDES = \ - -I$(TOP)/src/gallium/winsys \ - -I$(TOP)/src/egl/wayland/wayland-egl \ - -I$(TOP)/src/egl/wayland/wayland-drm \ - $(shell $(PKG_CONFIG) --cflags-only-I libdrm wayland-client wayland-server) - -wayland_SOURCES = $(wildcard wayland/*.c) -wayland_OBJECTS = $(wayland_SOURCES:.c=.o) - -drm_INCLUDES = -I$(TOP)/src/gallium/winsys $(shell $(PKG_CONFIG) --cflags-only-I libdrm) \ - -I$(TOP)/src/gbm/main -I$(TOP)/src/gallium/state_trackers/gbm -drm_SOURCES = $(wildcard drm/*.c) -drm_OBJECTS = $(drm_SOURCES:.c=.o) - - -fbdev_INCLUDES = -I$(TOP)/src/gallium/winsys/sw -fbdev_SOURCES = $(wildcard fbdev/*.c) -fbdev_OBJECTS = $(fbdev_SOURCES:.c=.o) - - -null_INCLUDES = -I$(TOP)/src/gallium/winsys/sw -null_SOURCES = $(wildcard null/*.c) -null_OBJECTS = $(null_SOURCES:.c=.o) - - -ALL_INCLUDES = $(common_INCLUDES) $(x11_INCLUDES) $(drm_INCLUDES) $(fbdev_INCLUDES) $(null_INCLUDES) $(wayland_INCLUDES) -ALL_SOURCES = $(common_SOURCES) $(x11_SOURCES) $(drm_SOURCES) $(fbdev_SOURCES) $(null_SOURCES) $(wayland_SOURCES) - -EGL_OBJECTS = $(common_OBJECTS) -EGL_CPPFLAGS = $(common_INCLUDES) - -# add backends -ifneq ($(findstring x11, $(EGL_PLATFORMS)),) -EGL_OBJECTS += $(x11_OBJECTS) -EGL_CPPFLAGS += -DHAVE_X11_BACKEND -endif -ifneq ($(findstring wayland, $(EGL_PLATFORMS)),) -EGL_OBJECTS += $(wayland_OBJECTS) -EGL_CPPFLAGS += -DHAVE_WAYLAND_BACKEND -DEFINES += -DHAVE_WAYLAND_BACKEND -common_INCLUDES += $(wayland_INCLUDES) -endif -ifneq ($(findstring drm, $(EGL_PLATFORMS)),) -EGL_OBJECTS += $(drm_OBJECTS) -EGL_CPPFLAGS += -DHAVE_DRM_BACKEND -endif -ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),) -EGL_OBJECTS += $(fbdev_OBJECTS) -EGL_CPPFLAGS += -DHAVE_FBDEV_BACKEND -endif -ifneq ($(findstring null, $(EGL_PLATFORMS)),) -EGL_OBJECTS += $(null_OBJECTS) -EGL_CPPFLAGS += -DHAVE_NULL_BACKEND -endif - -##### TARGETS ##### - -default: depend libegl.a - -libegl.a: $(EGL_OBJECTS) Makefile - $(MKLIB) -o egl -static $(EGL_OBJECTS) - -depend: - rm -f depend - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(ALL_INCLUDES) $(ALL_SOURCES) 2> /dev/null - -clean: - rm -f libegl.a - rm -f $(EGL_OBJECTS) - rm -f depend depend.bak - -# Dummy target -install: - @echo -n "" - -##### RULES ##### - -define egl-cc -$(CC) -c $(common_INCLUDES) $($(1)_INCLUDES) $(DEFINES) $(CFLAGS) $< -o $@ -endef - -$(common_OBJECTS): %.o: %.c - $(CC) -c $(EGL_CPPFLAGS) $(DEFINES) $(CFLAGS) $< -o $@ - -$(x11_OBJECTS): %.o: %.c - $(call egl-cc,x11) - -$(wayland_OBJECTS): %.o: %.c - $(call egl-cc,wayland) - -$(drm_OBJECTS): %.o: %.c - $(call egl-cc,drm) - -$(fbdev_OBJECTS): %.o: %.c - $(call egl-cc,fbdev) - -$(null_OBJECTS): %.o: %.c - $(call egl-cc,null) - -sinclude depend diff --git a/src/gallium/state_trackers/egl/Makefile.am b/src/gallium/state_trackers/egl/Makefile.am new file mode 100644 index 00000000000..cce3a84f7ae --- /dev/null +++ b/src/gallium/state_trackers/egl/Makefile.am @@ -0,0 +1,109 @@ +# Copyright © 2012 Intel Corporation +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +AUTOMAKE_OPTIONS = subdir-objects + +include $(top_srcdir)/src/gallium/Automake.inc + +AM_CFLAGS = $(GALLIUM_CFLAGS) +AM_CPPFLAGS = \ + -I$(top_srcdir)/src/egl/main \ + -I$(top_srcdir)/src/egl/wayland/wayland-drm/ \ + -I$(top_srcdir)/include + +noinst_LTLIBRARIES = libegl.la +libegl_la_SOURCES = \ + common/egl_g3d_api.c \ + common/egl_g3d.c \ + common/egl_g3d_image.c \ + common/egl_g3d_st.c \ + common/egl_g3d_sync.c \ + common/native_helper.c \ + common/native_wayland_drm_bufmgr_helper.c + +if HAVE_EGL_PLATFORM_X11 +libegl_la_SOURCES += \ + x11/glxinit.c \ + x11/native_dri2.c \ + x11/native_x11.c \ + x11/native_ximage.c \ + x11/x11_screen.c \ + x11/dri2.c +AM_CFLAGS += \ + $(X11_CFLAGS) \ + $(LIBDRM_CFLAGS) \ + $(DRI2PROTO_CFLAGS) +AM_CPPFLAGS += \ + -I$(top_srcdir)/src/gallium/drivers \ + -I$(top_srcdir)/src/glx \ + -I$(top_srcdir)/src/mapi \ + -I$(top_srcdir)/src/mesa \ + -DHAVE_X11_BACKEND +endif + +if HAVE_EGL_PLATFORM_WAYLAND +libegl_la_SOURCES += \ + wayland/native_drm.c \ + wayland/native_shm.c \ + wayland/native_wayland.c +AM_CFLAGS += \ + $(LIBDRM_CFLAGS) \ + $(WAYLAND_CFLAGS) +AM_CPPFLAGS += \ + -I$(top_srcdir)/src/gallium/winsys \ + -I$(top_srcdir)/src/egl/wayland/wayland-egl \ + -I$(top_srcdir)/src/egl/wayland/wayland-drm \ + -DHAVE_WAYLAND_BACKEND +endif + +if HAVE_EGL_PLATFORM_DRM +libegl_la_SOURCES += \ + drm/modeset.c \ + drm/native_drm.c +AM_CFLAGS += \ + $(LIBDRM_CFLAGS) +AM_CPPFLAGS += \ + -I$(top_srcdir)/src/gallium/winsys \ + -I$(top_srcdir)/src/gbm/main \ + -I$(top_srcdir)/src/gallium/state_trackers/gbm \ + -DHAVE_DRM_BACKEND +endif + +if HAVE_EGL_PLATFORM_FBDEV +libegl_la_SOURCES += fbdev/native_fbdev.c +AM_CPPFLAGS += \ + -I$(top_srcdir)/src/gallium/winsys/sw \ + -DHAVE_FBDEV_BACKEND +endif + +if HAVE_EGL_PLATFORM_NULL +libegl_la_SOURCES += null/native_null.c +AM_CPPFLAGS += \ + -I$(top_srcdir)/src/gallium/winsys/sw \ + -DHAVE_NULL_BACKEND +endif + +#XXX: Delete this when all targets that rely on egl are converted to automake. +all-local: libegl.la + ln -f $(builddir)/.libs/libegl.a $(builddir)/libegl.a + +CLEANFILES = libegl.a diff --git a/src/gallium/state_trackers/egl/x11/dri2.c b/src/gallium/state_trackers/egl/x11/dri2.c new file mode 120000 index 00000000000..344a11c1f83 --- /dev/null +++ b/src/gallium/state_trackers/egl/x11/dri2.c @@ -0,0 +1 @@ +../../../../glx/dri2.c \ No newline at end of file -- 2.30.2