This allows libEGL to be built as a static library and removes libX11
from the dependencies.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
GLUT_LIB_NAME = @GLUT_LIB_NAME@
GLW_LIB_NAME = @GLW_LIB_NAME@
OSMESA_LIB_NAME = @OSMESA_LIB_NAME@
GLUT_LIB_NAME = @GLUT_LIB_NAME@
GLW_LIB_NAME = @GLW_LIB_NAME@
OSMESA_LIB_NAME = @OSMESA_LIB_NAME@
+EGL_LIB_NAME = @EGL_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
GLUT_LIB_GLOB = @GLUT_LIB_GLOB@
GLW_LIB_GLOB = @GLW_LIB_GLOB@
OSMESA_LIB_GLOB = @OSMESA_LIB_GLOB@
GLUT_LIB_GLOB = @GLUT_LIB_GLOB@
GLW_LIB_GLOB = @GLW_LIB_GLOB@
OSMESA_LIB_GLOB = @OSMESA_LIB_GLOB@
+EGL_LIB_GLOB = @EGL_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
# Directories to build
LIB_DIR = @LIB_DIR@
SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
+EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
GLEW_LIB = GLEW
GLW_LIB = GLw
OSMESA_LIB = OSMesa
GLEW_LIB = GLEW
GLW_LIB = GLw
OSMESA_LIB = OSMesa
# Library names (actual file names)
# Library names (actual file names)
GLEW_LIB_NAME = lib$(GLEW_LIB).a
GLW_LIB_NAME = lib$(GLW_LIB).so
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
GLEW_LIB_NAME = lib$(GLEW_LIB).a
GLW_LIB_NAME = lib$(GLW_LIB).so
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
+EGL_LIB_NAME = lib$(EGL_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
GLUT_LIB_GLOB = $(GLUT_LIB_NAME)*
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
GLUT_LIB_GLOB = $(GLUT_LIB_NAME)*
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
+EGL_LIB_GLOB = $(EGL_LIB_NAME)*
# Optional assembly language optimization files for libGL
MESA_ASM_SOURCES =
# Optional assembly language optimization files for libGL
MESA_ASM_SOURCES =
# Which subdirs under $(TOP)/progs/ to enter:
PROGRAM_DIRS = demos redbook samples glsl objviewer xdemos
# Which subdirs under $(TOP)/progs/ to enter:
PROGRAM_DIRS = demos redbook samples glsl objviewer xdemos
EGL_DRIVERS_DIRS = demo
# Gallium directories and
EGL_DRIVERS_DIRS = demo
# Gallium directories and
GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
+EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
+EGL_LIB_GLOB='lib$(EGL_LIB).*'${LIB_EXTENSION}'*'
AC_SUBST([GL_LIB_NAME])
AC_SUBST([GLU_LIB_NAME])
AC_SUBST([GLUT_LIB_NAME])
AC_SUBST([GLW_LIB_NAME])
AC_SUBST([OSMESA_LIB_NAME])
AC_SUBST([GL_LIB_NAME])
AC_SUBST([GLU_LIB_NAME])
AC_SUBST([GLUT_LIB_NAME])
AC_SUBST([GLW_LIB_NAME])
AC_SUBST([OSMESA_LIB_NAME])
+AC_SUBST([EGL_LIB_NAME])
AC_SUBST([GL_LIB_GLOB])
AC_SUBST([GLU_LIB_GLOB])
AC_SUBST([GLUT_LIB_GLOB])
AC_SUBST([GLW_LIB_GLOB])
AC_SUBST([OSMESA_LIB_GLOB])
AC_SUBST([GL_LIB_GLOB])
AC_SUBST([GLU_LIB_GLOB])
AC_SUBST([GLUT_LIB_GLOB])
AC_SUBST([GLW_LIB_GLOB])
AC_SUBST([OSMESA_LIB_GLOB])
+AC_SUBST([EGL_LIB_GLOB])
dnl
dnl Arch/platform-specific settings
dnl
dnl Arch/platform-specific settings
[enable_egl=yes])
if test "x$enable_egl" = xyes; then
SRC_DIRS="$SRC_DIRS egl"
[enable_egl=yes])
if test "x$enable_egl" = xyes; then
SRC_DIRS="$SRC_DIRS egl"
-
- if test "$x11_pkgconfig" = yes; then
- PKG_CHECK_MODULES([EGL], [x11])
- EGL_LIB_DEPS="$EGL_LIBS"
- else
- # should check these...
- EGL_LIB_DEPS="$X_LIBS -lX11"
+ EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
+ EGL_DRIVERS_DIRS=""
+ if test "$enable_static" != yes && test "$mesa_driver" != osmesa; then
+ # build egl_glx when libGL is built
+ EGL_DRIVERS_DIRS="glx"
- EGL_LIB_DEPS="$EGL_LIB_DEPS $DLOPEN_LIBS"
fi
AC_SUBST([EGL_LIB_DEPS])
fi
AC_SUBST([EGL_LIB_DEPS])
+AC_SUBST([EGL_DRIVERS_DIRS])
dnl
dnl GLU configuration
dnl
dnl GLU configuration
include $(TOP)/configs/current
include $(TOP)/configs/current
-INCLUDE_DIRS = -I$(TOP)/include -I$(TOP)/src/mesa/glapi $(X11_INCLUDES)
+EGL_MAJOR = 1
+EGL_MINOR = 0
+
+INCLUDE_DIRS = -I$(TOP)/include
HEADERS = \
eglcompiler.h \
HEADERS = \
eglcompiler.h \
OBJECTS = $(SOURCES:.c=.o)
OBJECTS = $(SOURCES:.c=.o)
+# use dl*() to load drivers
LOCAL_CFLAGS = -D_EGL_PLATFORM_X=1
LOCAL_CFLAGS = -D_EGL_PLATFORM_X=1
-library: $(TOP)/$(LIB_DIR)/libEGL.so
+library: $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME)
-$(TOP)/$(LIB_DIR)/libEGL.so: $(OBJECTS)
- $(MKLIB) -o EGL -linker '$(CC)' -ldflags '$(LDFLAGS)' \
- -major 1 -minor 0 \
- -install $(TOP)/$(LIB_DIR) \
+$(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS)
+ $(MKLIB) -o $(EGL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
+ -major $(EGL_MAJOR) -minor $(EGL_MINOR) \
+ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
$(EGL_LIB_DEPS) $(OBJECTS)
install: default
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
$(EGL_LIB_DEPS) $(OBJECTS)
install: default
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
- $(MINSTALL) $(TOP)/$(LIB_DIR)/libEGL.so* $(DESTDIR)$(INSTALL_LIB_DIR)
+ $(MINSTALL) $(TOP)/$(LIB_DIR)/$(EGL_LIB_GLOB) \
+ $(DESTDIR)$(INSTALL_LIB_DIR)
- -rm -f *.o *.so*
- -rm -f core.*
$(SOURCES) $(HEADERS) > /dev/null 2>/dev/null
$(SOURCES) $(HEADERS) > /dev/null 2>/dev/null