[Mesa-dev] [PATCH] automake: src/gbm
Matt Turner
mattst88 at gmail.com
Sun Jan 22 14:36:18 PST 2012
libgbm.so.1.0.0 (instead of libgbm.so.1.0) is installed now
along with libgbm.so.1 (no change).
---
configs/autoconf.in | 8 ----
configs/default | 13 ------
configure.ac | 16 ++-----
src/gbm/Makefile | 14 ------
src/gbm/Makefile.am | 34 +++++++++++++++
src/gbm/backends/Makefile | 14 ------
src/gbm/backends/dri/Makefile | 22 ----------
src/gbm/main/Makefile | 90 -----------------------------------------
src/gbm/main/gbm.pc.in | 10 ++--
9 files changed, 43 insertions(+), 178 deletions(-)
delete mode 100644 src/gbm/Makefile
create mode 100644 src/gbm/Makefile.am
delete mode 100644 src/gbm/backends/Makefile
delete mode 100644 src/gbm/backends/dri/Makefile
delete mode 100644 src/gbm/main/Makefile
diff --git a/configs/autoconf.in b/configs/autoconf.in
index 3e5da79..55886ea 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -75,7 +75,6 @@ GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
-GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
@@ -88,7 +87,6 @@ GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
VG_LIB_NAME = @VG_LIB_NAME@
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@
-GBM_LIB_NAME = @GBM_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
@@ -101,7 +99,6 @@ GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
VG_LIB_GLOB = @VG_LIB_GLOB@
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@
-GBM_LIB_GLOB = @GBM_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
@@ -109,7 +106,6 @@ SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
-GBM_BACKEND_DIRS = @GBM_BACKEND_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
@@ -147,7 +143,6 @@ GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @WAYLAND_EGL_LIB_DEPS@
-GBM_LIB_DEPS = $(EXTRA_LIB_PATH) @GBM_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
@@ -209,9 +204,6 @@ EGL_PC_CFLAGS = @GL_PC_CFLAGS@
WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@
WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@
WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@
-GBM_PC_REQ_PRIV = @GBM_PC_REQ_PRIV@
-GBM_PC_LIB_PRIV = @GBM_PC_LIB_PRIV@
-GBM_PC_CFLAGS = @GBM_PC_CFLAGS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
diff --git a/configs/default b/configs/default
index 2ca6fe4..7e1aceb 100644
--- a/configs/default
+++ b/configs/default
@@ -63,7 +63,6 @@ GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
-GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).so
@@ -76,7 +75,6 @@ GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
VG_LIB_NAME = lib$(VG_LIB).so
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so
-GBM_LIB_NAME = lib$(GBM_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
@@ -89,7 +87,6 @@ GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)*
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)*
-GBM_LIB_GLOB = $(GBM_LIB_NAME)*
DRI_CFLAGS = $(CFLAGS)
DRI_CXXFLAGS = $(CXXFLAGS)
@@ -113,9 +110,6 @@ DRIVER_DIRS = x11 osmesa
# EGL drivers to build
EGL_DRIVERS_DIRS = glx
-# gbm backends to build
-GBM_BACKEND_DIRS = dri
-
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
@@ -141,7 +135,6 @@ GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
-GBM_LIB_DEPS = $(EXTRA_LIB_PATH) -ludev -ldl
# Program dependencies - specific GL libraries added in Makefiles
X11_LIBS = -lX11
@@ -160,9 +153,6 @@ DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
-# gbm backend install directory
-GBM_BACKEND_INSTALL_DIR = $(INSTALL_LIB_DIR)/gbm
-
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
@@ -192,6 +182,3 @@ VG_PC_CFLAGS =
WAYLAND_EGL_PC_REQ_PRIV =
WAYLAND_EGL_PC_LIB_PRIV =
WAYLAND_EGL_PC_CFLAGS =
-GBM_PC_REQ_PRIV =
-GBM_PC_LIB_PRIV =
-GBM_PC_CFLAGS =
diff --git a/configure.ac b/configure.ac
index 656a8d9..08c98d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -414,7 +414,6 @@ GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
WAYLAND_EGL_LIB_NAME='lib$(WAYLAND_EGL_LIB).'${LIB_EXTENSION}
-GBM_LIB_NAME='lib$(GBM_LIB).'${LIB_EXTENSION}
GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
@@ -426,7 +425,6 @@ GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LI
VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
WAYLAND_EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(WAYLAND_EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
-GBM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GBM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
AC_SUBST([GL_LIB_NAME])
AC_SUBST([GLU_LIB_NAME])
@@ -437,7 +435,6 @@ AC_SUBST([GLESv2_LIB_NAME])
AC_SUBST([VG_LIB_NAME])
AC_SUBST([GLAPI_LIB_NAME])
AC_SUBST([WAYLAND_EGL_LIB_NAME])
-AC_SUBST([GBM_LIB_NAME])
AC_SUBST([GL_LIB_GLOB])
AC_SUBST([GLU_LIB_GLOB])
@@ -448,7 +445,6 @@ AC_SUBST([GLESv2_LIB_GLOB])
AC_SUBST([VG_LIB_GLOB])
AC_SUBST([GLAPI_LIB_GLOB])
AC_SUBST([WAYLAND_EGL_LIB_GLOB])
-AC_SUBST([GBM_LIB_GLOB])
dnl
dnl Arch/platform-specific settings
@@ -779,6 +775,8 @@ if test "x$enable_glx" = xno; then
enable_xlib_glx=no
fi
+AM_CONDITIONAL(HAVE_DRI, test x"$enable_dri" = xyes)
+
dnl
dnl Driver specific build directories
dnl
@@ -1303,18 +1301,10 @@ if test "x$enable_gbm" = xauto; then
fi
if test "x$enable_gbm" = xyes; then
SRC_DIRS="$SRC_DIRS gbm"
- GBM_BACKEND_DIRS=""
PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
AC_MSG_ERROR([gbm needs udev]))
- GBM_LIB_DEPS="$DLOPEN_LIBS $LIBUDEV_LIBS"
-
- if test "x$enable_dri" = xyes; then
- GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
- fi
fi
-AC_SUBST([GBM_LIB_DEPS])
-AC_SUBST([GBM_BACKEND_DIRS])
GBM_PC_REQ_PRIV="libudev"
GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
GBM_PC_CFLAGS=
@@ -1869,6 +1859,8 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
dnl Substitute the config
AC_CONFIG_FILES([configs/autoconf
+ src/gbm/Makefile
+ src/gbm/main/gbm.pc
src/mesa/drivers/dri/dri.pc
src/mesa/drivers/dri/Makefile
src/mesa/drivers/dri/i915/Makefile
diff --git a/src/gbm/Makefile b/src/gbm/Makefile
deleted file mode 100644
index 4769a97..0000000
--- a/src/gbm/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# src/gbm/Makefile
-
-TOP = ../..
-include $(TOP)/configs/current
-
-SUBDIRS = backends main
-
-
-default install clean:
- @for dir in $(SUBDIRS) ; do \
- if [ -d $$dir ] ; then \
- (cd $$dir && $(MAKE) $@) || exit 1 ; \
- fi \
- done
diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am
new file mode 100644
index 0000000..29ee88e
--- /dev/null
+++ b/src/gbm/Makefile.am
@@ -0,0 +1,34 @@
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = main/gbm.pc
+
+AM_CFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/gbm/main \
+ $(LIBUDEV_CFLAGS) \
+ $(DLOPEN_CFLAGS) \
+ -D_OS_UNIX=1 \
+ -DMODULEDIR='"$(libdir)/gbm"' \
+ $(DEFINES)
+
+lib_LTLIBRARIES = libgbm.la
+include_HEADERS = main/gbm.h
+
+libgbm_la_SOURCES = \
+ main/gbm.c \
+ main/backend.c \
+ main/common.c
+libgbm_la_LDFLAGS = -version-info 1:0
+
+if HAVE_DRI
+noinst_LTLIBRARIES = libgbm_dri.la
+libgbm_dri_la_SOURCES = \
+ backends/dri/gbm_dri.c \
+ backends/dri/driver_name.c
+
+libgbm_dri_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ -DDEFAULT_DRIVER_DIR='"$(libdir)/dri"' \
+ $(LIBDRM_CFLAGS)
+
+libgbm_la_LIBADD = libgbm_dri.la
+endif
diff --git a/src/gbm/backends/Makefile b/src/gbm/backends/Makefile
deleted file mode 100644
index 97eaac4..0000000
--- a/src/gbm/backends/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# src/gbm/backends/Makefile
-
-TOP = ../../..
-include $(TOP)/configs/current
-
-SUBDIRS = $(GBM_BACKEND_DIRS)
-
-
-default install clean:
- @for dir in $(SUBDIRS) ; do \
- if [ -d $$dir ] ; then \
- (cd $$dir ; $(MAKE) $@) || exit 1 ; \
- fi \
- done
diff --git a/src/gbm/backends/dri/Makefile b/src/gbm/backends/dri/Makefile
deleted file mode 100644
index 78fb329..0000000
--- a/src/gbm/backends/dri/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-# src/gbm/backends/dri/Makefile
-
-TOP = ../../../..
-include $(TOP)/configs/current
-
-GBM_BACKEND = gbm_dri
-GBM_SOURCES = gbm_dri.c driver_name.c
-
-GBM_INCLUDES = \
- -I$(TOP)/include \
- -I$(TOP)/src/gbm/main \
-
-GBM_LIBS = $(LIBUDEV_LIBS) $(LIBDRM_LIB) -L$(TOP)/lib -lglapi
-
-GBM_CFLAGS = \
- -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
- $(LIBUDEV_CFLAGS) \
- $(LIBDRM_CFLAGS)
-
-GBM_BUILTIN=true
-
-include ../Makefile.template
diff --git a/src/gbm/main/Makefile b/src/gbm/main/Makefile
deleted file mode 100644
index 5130b9b..0000000
--- a/src/gbm/main/Makefile
+++ /dev/null
@@ -1,90 +0,0 @@
-# src/gbm/main/Makefile
-
-TOP = ../../..
-include $(TOP)/configs/current
-
-INCLUDE_DIRS = -I$(TOP)/include
-
-HEADERS = \
- common.h \
- backend.h \
- gbmint.h \
- gbm.h
-
-SOURCES = \
- gbm.c \
- backend.c \
- common.c
-
-OBJECTS = $(SOURCES:.c=.o)
-
-# use dl*() to load drivers
-LOCAL_CFLAGS = $(LIBUDEV_CFLAGS) $(DLOPEN_CFLAGS) \
- -D_OS_UNIX=1 -DMODULEDIR='"$(GBM_BACKEND_INSTALL_DIR)"'
-LOCAL_LIBS =
-
-# Builtin backends
-ifeq ($(filter dri, $(GBM_BACKEND_DIRS)),dri)
-LOCAL_LIBS += $(TOP)/src/gbm/backends/dri/libgbm_dri.a
-endif
-
-.c.o:
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(LOCAL_CFLAGS) $< -o $@
-
-
-default: depend library
-
-
-library: $(TOP)/$(LIB_DIR)/libgbm.so
-
-$(TOP)/$(LIB_DIR)/libgbm.so: $(OBJECTS) $(LOCAL_LIBS)
- $(MKLIB) -o gbm -linker '$(CC)' -ldflags '$(LDFLAGS)' \
- -major 1 -minor 0 \
- -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
- -L$(TOP)/$(LIB_DIR) $(GBM_LIB_DEPS) \
- $(OBJECTS) $(LOCAL_LIBS)
-
-install-headers:
- $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/
- $(INSTALL) -m 644 $(TOP)/src/gbm/main/gbm.h \
- $(DESTDIR)$(INSTALL_INC_DIR)
-
-
-PKG_CONFIG_DIR = $(INSTALL_LIB_DIR)/pkgconfig
-
-gbm_pcedit = sed \
- -e 's, at INSTALL_DIR@,$(INSTALL_DIR),' \
- -e 's, at INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
- -e 's, at INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
- -e 's, at VERSION@,0.0.0,' \
- -e 's, at GBM_PC_REQ_PRIV@,$(GBM_PC_REQ_PRIV),' \
- -e 's, at GBM_PC_LIB_PRIV@,$(GBM_PC_LIB_PRIV),' \
- -e 's, at GBM_PC_CFLAGS@,$(GBM_PC_CFLAGS),' \
- -e 's, at GBM_LIB@,$(GBM_LIB),'
-
-gbm.pc: gbm.pc.in
- $(gbm_pcedit) $< > $@
-
-install: default install-headers gbm.pc
- $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
- $(MINSTALL) $(TOP)/$(LIB_DIR)/libgbm.so* \
- $(DESTDIR)$(INSTALL_LIB_DIR)
- $(INSTALL) -d $(DESTDIR)$(PKG_CONFIG_DIR)
- $(INSTALL) -m 644 gbm.pc $(DESTDIR)$(PKG_CONFIG_DIR)
-
-clean:
- -rm -f *.o
- -rm -f depend depend.bak
- -rm -f gbm.pc
-
-
-depend: $(SOURCES) $(HEADERS)
- @ echo "running $(MKDEP)"
- @ rm -f depend
- @ touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \
- $(SOURCES) $(HEADERS) > /dev/null 2>/dev/null
-
-
--include depend
-# DO NOT DELETE
diff --git a/src/gbm/main/gbm.pc.in b/src/gbm/main/gbm.pc.in
index 76299e7..dacdd9f 100644
--- a/src/gbm/main/gbm.pc.in
+++ b/src/gbm/main/gbm.pc.in
@@ -1,12 +1,12 @@
-prefix=@INSTALL_DIR@
-exec_prefix=${prefix}
-libdir=@INSTALL_LIB_DIR@
-includedir=@INSTALL_INC_DIR@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
Name: gbm
Description: Mesa gbm library
Requires.private: @GBM_PC_REQ_PRIV@
Version: @VERSION@
-Libs: -L${libdir} -l at GBM_LIB@
+Libs: -L${libdir} -lgbm
Libs.private: @GBM_PC_LIB_PRIV@
Cflags: -I${includedir} @GBM_PC_CFLAGS@
--
1.7.3.4
More information about the mesa-dev
mailing list