On Mon, Dec 21, 2009 at 6:09 AM, Matthew W. S. Bell
<matt...@bells23.org.uk> wrote:
> On Sat, 2009-12-19 at 12:09 -0800, Dan Nicholson wrote:
>> This seems fine (except for the gratuitous newline introduced), but I
>> think someone submitted a patch the other day that makes the egl build
>> work static. Can you show where the build fails without this patch?
> It fails when it tries to build libEGL.so for target library in
> src/egl/main/Makefile with static (non-PIC) code. Can you find the patch
> so I can see if it fixes the problem?
I don't recall such patch.  Does the attached one help?

It cleans up the build rule a little and should fix the issue.
From d1764079ee22f9a374aff329b38d4ed94af366cf Mon Sep 17 00:00:00 2001
From: Chia-I Wu <olva...@gmail.com>
Date: Mon, 21 Dec 2009 11:13:18 +0800
Subject: [PATCH] egl: Clean up the Makefile rules.

This allows libEGL to be built as a static library and removes libX11
from the dependencies.

Signed-off-by: Chia-I Wu <olva...@gmail.com>
---
 configs/autoconf.in   |    3 +++
 configs/default       |    5 ++++-
 configure.ac          |   18 ++++++++++--------
 src/egl/main/Makefile |   25 ++++++++++++++-----------
 4 files changed, 31 insertions(+), 20 deletions(-)

diff --git a/configs/autoconf.in b/configs/autoconf.in
index a7f3c9d..66dede4 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -52,6 +52,7 @@ GLU_LIB_NAME = @GLU_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@
@@ -59,12 +60,14 @@ GLU_LIB_GLOB = @GLU_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@
+EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
 GALLIUM_DIRS = @GALLIUM_DIRS@
 GALLIUM_AUXILIARY_DIRS = @GALLIUM_AUXILIARY_DIRS@
 GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
diff --git a/configs/default b/configs/default
index eb6123d..b7e511e 100644
--- a/configs/default
+++ b/configs/default
@@ -55,6 +55,7 @@ GLUT_LIB = glut
 GLEW_LIB = GLEW
 GLW_LIB = GLw
 OSMESA_LIB = OSMesa
+EGL_LIB = EGL
 
 
 # Library names (actual file names)
@@ -64,6 +65,7 @@ GLUT_LIB_NAME = lib$(GLUT_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)*
@@ -71,6 +73,7 @@ GLU_LIB_GLOB = $(GLU_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 = 
@@ -89,7 +92,7 @@ DRIVER_DIRS = x11 osmesa
 # Which subdirs under $(TOP)/progs/ to enter:
 PROGRAM_DIRS = demos redbook samples glsl objviewer xdemos
 
-# EGL directories
+# EGL drivers to build
 EGL_DRIVERS_DIRS = demo
 
 # Gallium directories and 
diff --git a/configure.ac b/configure.ac
index 6fa0a60..9ad1d60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -242,24 +242,28 @@ GLU_LIB_NAME='lib$(GLU_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}'*'
+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([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([EGL_LIB_GLOB])
 
 dnl
 dnl Arch/platform-specific settings
@@ -887,17 +891,15 @@ AC_ARG_ENABLE([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"
     fi
-    EGL_LIB_DEPS="$EGL_LIB_DEPS $DLOPEN_LIBS"
 fi
 AC_SUBST([EGL_LIB_DEPS])
+AC_SUBST([EGL_DRIVERS_DIRS])
 
 dnl
 dnl GLU configuration
diff --git a/src/egl/main/Makefile b/src/egl/main/Makefile
index c951b07..ec326a8 100644
--- a/src/egl/main/Makefile
+++ b/src/egl/main/Makefile
@@ -4,7 +4,10 @@ TOP = ../../..
 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 \
@@ -43,7 +46,7 @@ SOURCES = \
 OBJECTS = $(SOURCES:.c=.o)
 
 
-# Undefined for now
+# use dl*() to load drivers
 LOCAL_CFLAGS = -D_EGL_PLATFORM_X=1
 
 
@@ -56,21 +59,21 @@ default: depend library
 
 
 # EGL Library
-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)
-	$(MINSTALL) $(TOP)/$(LIB_DIR)/libEGL.so* $(DESTDIR)$(INSTALL_LIB_DIR)
+	$(MINSTALL) $(TOP)/$(LIB_DIR)/$(EGL_LIB_GLOB) \
+		$(DESTDIR)$(INSTALL_LIB_DIR)
 
 clean:
-	-rm -f *.o *.so*
-	-rm -f core.*
+	-rm -f *.o
 	-rm -f depend depend.bak
 
 
@@ -82,5 +85,5 @@ depend: $(SOURCES) $(HEADERS)
 		$(SOURCES) $(HEADERS) > /dev/null 2>/dev/null
 
 
-include depend
+-include depend
 # DO NOT DELETE
-- 
1.6.5

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to