Avoid mesa_headers on X11, also link with -lGL only where necesssary

The GLEW headers are enough, and what we actually use in these
places. In addition to handling GL extension things in its dynamic
fashion, GLEW headers also have declarations for standard,
non-extension, OpenGL API, including xgl and wgl ones.

Most likely we don't need mesa_headers on Windows or OS X either, and
can drop them completely.

Change-Id: Ic0d8d6238c862f8fe4a74e99e95344dcbf540980
This commit is contained in:
Tor Lillqvist 2015-11-12 01:13:01 +02:00
parent 318c3a48c6
commit b216cc1b80
18 changed files with 31 additions and 36 deletions

View File

@ -26,7 +26,7 @@ $(eval $(call gb_Library_add_defs,avmedia,\
$(eval $(call gb_Library_use_externals,avmedia,\
boost_headers \
glew \
mesa_headers \
$(if $(filter WNT MACOSX,$(OS)),mesa_headers) \
))
$(eval $(call gb_Library_use_libraries,avmedia,\

View File

@ -18,7 +18,7 @@ $(eval $(call gb_Library_use_externals,avmediaogl, \
libgltf \
glew \
glm_headers \
mesa_headers \
$(if $(filter WNT MACOSX,$(OS)),mesa_headers) \
))
$(eval $(call gb_Library_use_libraries,avmediaogl,\

View File

@ -43,7 +43,7 @@ $(eval $(call gb_Library_add_exception_objects,oglcanvas,\
$(eval $(call gb_Library_use_externals,oglcanvas,\
boost_headers \
glew \
mesa_headers \
$(if $(filter WNT MACOSX,$(OS)),mesa_headers) \
))
ifeq ($(strip $(OS)),MACOSX)

View File

@ -29,7 +29,7 @@ $(eval $(call gb_Library_use_externals,chartcore,\
boost_headers \
glm_headers \
glew \
mesa_headers \
$(if $(filter WNT MACOSX,$(OS)),mesa_headers) \
))
$(eval $(call gb_Library_use_custom_headers,chartcore,\

View File

@ -22,7 +22,7 @@ $(eval $(call gb_Library_set_precompiled_header,chartopengl,$(SRCDIR)/chart2/inc
$(eval $(call gb_Library_use_externals,chartopengl,\
boost_headers \
glm_headers \
mesa_headers \
$(if $(filter WNT MACOSX,$(OS)),mesa_headers) \
glew \
))

View File

@ -10410,23 +10410,25 @@ else
fi
ENABLE_OPENGL_CANVAS=TRUE
dnl ===================================================================
dnl Check for system Mesa
dnl ===================================================================
AC_MSG_CHECKING([which Mesa headers to use])
if test "$with_system_mesa_headers" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_MESA_HEADERS=TRUE
AC_LANG_PUSH(C)
AC_CHECK_HEADER(GL/glxext.h, [],
[ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
AC_LANG_POP(C)
else
AC_MSG_RESULT([internal])
SYSTEM_MESA_HEADERS=
BUILD_TYPE="$BUILD_TYPE MESA"
if test "$USING_X11" != TRUE; then
dnl ===================================================================
dnl Check for system Mesa
dnl ===================================================================
AC_MSG_CHECKING([which Mesa headers to use])
if test "$with_system_mesa_headers" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_MESA_HEADERS=TRUE
AC_LANG_PUSH(C)
AC_CHECK_HEADER(GL/glxext.h, [],
[ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
AC_LANG_POP(C)
else
AC_MSG_RESULT([internal])
SYSTEM_MESA_HEADERS=
BUILD_TYPE="$BUILD_TYPE MESA"
fi
fi
fi

View File

@ -112,7 +112,6 @@ $(eval $(call gb_Library_use_static_libraries,sofficeapp,\
$(eval $(call gb_Library_add_libs,sofficeapp,\
-lm $(DLOPEN_LIBS) \
-lpthread \
-lGL \
-lX11 \
))
endif

View File

@ -67,7 +67,7 @@ $(call gb_ExternalProject_get_state_target,libgltf,build) :
$(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
--disable-werror \
BOOST_CFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost))" \
GLEW_CFLAGS="$(if $(SYSTEM_GLEW),$(GLEW_CFLAGS),-I$(call gb_UnpackedTarball_get_dir,glew)/include)" \
GLEW_CFLAGS="$(if $(SYSTEM_GLEW),$(GLEW_CFLAGS),-I$(call gb_UnpackedTarball_get_dir,glew)/include) -DGLEW_NO_GLU" \
GLM_CFLAGS="$(if $(SYSTEM_GLM),$(GLM_CFLAGS),-I$(call gb_UnpackedTarball_get_dir,glm))" \
$(if $(libgltf_CPPFLAGS),CPPFLAGS='$(libgltf_CPPFLAGS)') \
&& $(MAKE) \

View File

@ -31,7 +31,7 @@ $(eval $(call gb_Library_use_libraries,OGLTrans,\
$(eval $(call gb_Library_use_externals,OGLTrans,\
boost_headers \
glew \
mesa_headers \
$(if $(filter WNT MACOSX,$(OS)),mesa_headers) \
glm_headers \
))

View File

@ -29,7 +29,7 @@ $(eval $(call gb_Library_set_precompiled_header,slideshow,$(SRCDIR)/slideshow/in
$(eval $(call gb_Library_use_externals,slideshow,\
boost_headers \
glew \
mesa_headers \
$(if $(filter WNT MACOSX,$(OS)),mesa_headers) \
))
$(eval $(call gb_Library_use_sdk_api,slideshow))

View File

@ -71,7 +71,6 @@ ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Executable_add_libs,gengal,\
$(DLOPEN_LIBS) \
-lpthread \
-lGL \
-lX11 \
))

View File

@ -84,7 +84,7 @@ $(eval $(call gb_Library_use_externals,svxcore,\
boost_headers \
icuuc \
icu_headers \
mesa_headers \
$(if $(filter WNT MACOSX,$(OS)),mesa_headers) \
glew \
libxml2 \
))

View File

@ -18,7 +18,7 @@ $(eval $(call gb_CppunitTest_use_externals,vcl_bitmap_test,\
boost_headers \
glew \
glm_headers \
mesa_headers \
$(if $(filter WNT MACOSX,$(OS)),mesa_headers) \
))
$(eval $(call gb_CppunitTest_set_include,vcl_bitmap_test,\

View File

@ -13,7 +13,7 @@ $(eval $(call gb_Executable_use_externals,icontest,\
boost_headers \
glew \
glm_headers \
mesa_headers \
$(if $(filter WNT MACOSX,$(OS)),mesa_headers) \
))
$(eval $(call gb_Executable_use_api,icontest,\
@ -29,7 +29,6 @@ ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Executable_add_libs,icontest,\
-lm $(DLOPEN_LIBS) \
-lpthread \
-lGL \
-lX11 \
))

View File

@ -44,7 +44,6 @@ ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Executable_add_libs,mtfdemo,\
-lm $(DLOPEN_LIBS) \
-lpthread \
-lGL \
-lX11 \
))

View File

@ -38,7 +38,6 @@ ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Executable_add_libs,ui-previewer,\
-lm $(DLOPEN_LIBS) \
-lpthread \
-lGL \
-lX11 \
))

View File

@ -19,7 +19,7 @@ $(eval $(call gb_Executable_use_externals,vcldemo,\
boost_headers \
glew \
glm_headers \
mesa_headers \
$(if $(filter WNT MACOSX,$(OS)),mesa_headers) \
))
$(eval $(call gb_Executable_set_include,vcldemo,\
@ -50,7 +50,6 @@ ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Executable_add_libs,vcldemo,\
-lm $(DLOPEN_LIBS) \
-lpthread \
-lGL \
-lX11 \
))

View File

@ -33,7 +33,6 @@ $(eval $(call gb_StaticLibrary_add_libs,glxtest,\
-lm \
-ldl \
-lpthread \
-lGL \
-lX11 \
))