changeset 4488:8f9bee27223f

optionally build mesa OpenGL library
author John W. Eaton <jwe@octave.org>
date Thu, 05 Oct 2017 10:44:53 -0400
parents 7b73612f57b9
children d50a2adc8d75
files Makefile.in configure.ac dist-files.mk index.html src/default-octave.mk src/mesa.mk src/mingw-mesa-1-fixes.patch src/mingw-osmesa-1-fixes.patch src/octave.mk src/osmesa.mk src/stable-octave.mk
diffstat 11 files changed, 112 insertions(+), 75 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.in	Thu Oct 05 07:57:25 2017 -0400
+++ b/Makefile.in	Thu Oct 05 10:44:53 2017 -0400
@@ -36,11 +36,15 @@
 USE_SYSTEM_GCC := @USE_SYSTEM_GCC@
 
 # Set to "yes" to use the version of fontconfig already installed
-# on your system (default is yes if doing native build). 
+# on your system (default is yes if doing native build).
 USE_SYSTEM_FONTCONFIG := @USE_SYSTEM_FONTCONFIG@
 
+# Set to "yes" to use the OpenGL libraries already installed
+# on your system (default is yes).
+USE_SYSTEM_OPENGL := @USE_SYSTEM_OPENGL@
+
 # Set to "yes" to use the X11 libraries already installed
-# on your system (default is yes if doing native build). 
+# on your system (default is yes if doing native build).
 USE_SYSTEM_X11_LIBS := @USE_SYSTEM_X11_LIBS@
 
 # Build compiler for 64-bit Windows.  Using this option will build
--- a/configure.ac	Thu Oct 05 07:57:25 2017 -0400
+++ b/configure.ac	Thu Oct 05 10:44:53 2017 -0400
@@ -189,6 +189,16 @@
    esac], [USE_SYSTEM_FONTCONFIG=$MXE_NATIVE_BUILD])
 AC_SUBST(USE_SYSTEM_FONTCONFIG)
 
+AC_ARG_ENABLE([system-opengl],
+  [AS_HELP_STRING([--disable-system-opengl],
+    [Use OpenGL libraries already installed on system])],
+  [case "$enableval" in
+     no) USE_SYSTEM_OPENGL=no ;;
+     yes) USE_SYSTEM_OPENGL=yes ;;
+     *) AC_MSG_ERROR([bad value "$enableval" for --enable-system-opengl]) ;;
+   esac], [USE_SYSTEM_OPENGL=yes])
+AC_SUBST(USE_SYSTEM_OPENGL)
+
 AC_ARG_ENABLE([system-x11-libs],
   [AS_HELP_STRING([--enable-system-x11-libs],
     [Use X11 libraries already installed on system])],
--- a/dist-files.mk	Thu Oct 05 07:57:25 2017 -0400
+++ b/dist-files.mk	Thu Oct 05 10:44:53 2017 -0400
@@ -311,6 +311,7 @@
   lzo.mk \
   matio.mk \
   mdbtools.mk \
+  mesa.mk \
   mingw-cairo-1-ssize-t-defined.patch \
   mingw-cfitsio-1-fixes.patch \
   mingw-epstool-1-fixes.patch \
@@ -319,8 +320,8 @@
   mingw-hdf5-1.patch \
   mingw-libgcrypt-1-fixes.patch \
   mingw-libmng-1-noundefines.patch \
+  mingw-mesa-1-fixes.patch \
   mingw-openssl-3-libdeps.patch \
-  mingw-osmesa-1-fixes.patch \
   mingw-portaudio-1-pkgconfig.patch \
   mingw-texinfo-1-fixes.patch \
   mingw-utils-1-portability-fix.patch \
@@ -520,7 +521,6 @@
   openscenegraph.mk \
   openssl-1-fixes.patch \
   openssl.mk \
-  osmesa.mk \
   pango.mk \
   pangomm.mk \
   pcre.mk \
--- a/index.html	Thu Oct 05 07:57:25 2017 -0400
+++ b/index.html	Thu Oct 05 10:44:53 2017 -0400
@@ -2134,8 +2134,8 @@
         <td class="website"><a href="http://www.openssl.org/">openssl</a></td>
     </tr>
     <tr>
-        <td class="package">osmesa</td>
-        <td class="website"><a href="http://www.mesa3d.org/osmesa.html">OSMesa</a></td>
+        <td class="package">mesa</td>
+        <td class="website"><a href="http://www.mesa3d.org/osmesa.html">Mesa</a></td>
     </tr>
     <tr>
         <td class="package">pango</td>
--- a/src/default-octave.mk	Thu Oct 05 07:57:25 2017 -0400
+++ b/src/default-octave.mk	Thu Oct 05 10:44:53 2017 -0400
@@ -14,7 +14,7 @@
 ifeq ($(USE_SYSTEM_FONTCONFIG),no)
   $(PKG)_FONTCONFIG := fontconfig
 endif
-$(PKG)_DEPS     := blas arpack curl epstool fftw fltk $($(PKG)_FONTCONFIG) ghostscript gl2ps glpk gnuplot graphicsmagick hdf5 lapack libsndfile osmesa pcre portaudio pstoedit qhull qrupdate qscintilla readline sundials-ida suitesparse texinfo zlib
+$(PKG)_DEPS     := blas arpack curl epstool fftw fltk $($(PKG)_FONTCONFIG) ghostscript gl2ps glpk gnuplot graphicsmagick hdf5 lapack libsndfile mesa pcre portaudio pstoedit qhull qrupdate qscintilla readline sundials-ida suitesparse texinfo zlib
 
 ifeq ($(ENABLE_QT5),yes)
     $(PKG)_DEPS += qt5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mesa.mk	Thu Oct 05 10:44:53 2017 -0400
@@ -0,0 +1,75 @@
+# This file is part of MXE Octave.
+# See index.html for further information.
+
+PKG             := mesa
+$(PKG)_VERSION  := 17.2.1
+$(PKG)_CHECKSUM := 7429e74a0ef12ea9d60b41b2b852898b3da0b238
+$(PKG)_SUBDIR   := mesa-$($(PKG)_VERSION)
+$(PKG)_FILE     := mesa-$($(PKG)_VERSION).tar.xz
+$(PKG)_URL      := ftp://ftp.freedesktop.org/pub/mesa/$($(PKG)_FILE)
+$(PKG)_DEPS     := build-mako zlib
+ifeq ($(MXE_WINDOWS_BUILD),yes)
+  ifeq ($(USE_SYSTEM_OPENGL),no)
+    $(PKG)_CONFIGURE_OPENGL_OPTIONS := libgl-gdi
+  endif
+else
+  ifeq ($(USE_SYSTEM_OPENGL),yes)
+    $(PKG)_CONFIGURE_OPENGL_OPTIONS := \
+      --disable-opengl --disable-dri --disable-glx \
+      --with-gallium-drivers="" --with-dri-drivers="" \
+      --with-platforms=""
+  else
+    $(PKG)_CONFIGURE_OPENGL_OPTIONS := \
+      --enable-opengl --enable-dri --enable-glx="dri" \
+      --with-gallium-drivers="" --with-dri-drivers="swrast" \
+      --with-platforms="x11"
+    ifeq ($(USE_SYSTEM_X11_LIBS),no)
+      $(PKG)_DEPS += dri2proto glproto libdrm libxshmfence x11 xdamage xext xfixes
+    endif
+  endif
+endif
+
+define $(PKG)_UPDATE
+    echo 'Warning: Updates are temporarily disabled for package $(PKG).' >&2;
+    echo $($(PKG)_VERSION)
+endef
+
+ifeq ($(MXE_WINDOWS_BUILD),yes)
+  ifeq ($(ENABLE_WINDOWS_64),yes)
+    $(PKG)_MACHINE := x86_64
+  else
+    $(PKG)_MACHINE := x86
+  endif
+  define $(PKG)_BUILD
+    cd '$(1)' && scons platform=windows toolchain=crossmingw machine=$($(PKG)_MACHINE) verbose=1 osmesa $($(PKG)_CONFIGURE_OPENGL_OPTIONS)
+
+    ## Do the scons config files have useful install targets?
+    $(INSTALL) -d '$(3)$(HOST_INCDIR)/GL';
+    for f in '$(1)/include/GL/*.h' ; do \
+      $(INSTALL) -m 644 $$f '$(3)$(HOST_INCDIR)/GL'; \
+    done
+    $(INSTALL) -d '$(3)$(HOST_BINDIR)';
+    $(INSTALL) -m 755 '$(1)/build/windows-$($(PKG)_MACHINE)-debug/mesa/drivers/osmesa/osmesa.dll' '$(3)$(HOST_BINDIR)/osmesa.dll';
+    $(INSTALL) -d '$(3)$(HOST_LIBDIR)';
+    $(INSTALL) -m 644 '$(1)/build/windows-$($(PKG)_MACHINE)-debug/mesa/drivers/osmesa/libosmesa.a' '$(3)$(HOST_LIBDIR)/libOSMesa.a';
+  endef
+else
+  define $(PKG)_BUILD
+    mkdir '$(1)/.build'
+    cd '$(1)' && autoreconf -fi  -I m4
+    cd '$(1)/.build' && $($(PKG)_CONFIGURE_ENV) '$(1)/configure' \
+        $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \
+        $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
+        --prefix='$(HOST_PREFIX)' \
+        $($(PKG)_CONFIGURE_OPENGL_OPTIONS) \
+        --enable-osmesa \
+        --disable-gbm \
+        --disable-egl \
+        --disable-xvmc \
+        --disable-llvm \
+        --enable-texture-float \
+        && $(CONFIGURE_POST_HOOK)
+
+    $(MAKE) -C '$(1)/.build' -j '$(JOBS)' install DESTDIR='$(3)'
+  endef
+endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mingw-mesa-1-fixes.patch	Thu Oct 05 10:44:53 2017 -0400
@@ -0,0 +1,14 @@
+diff -uNr a/src/mesa/main/imports.h b/src/mesa/main/imports.h
+--- a/src/mesa/main/imports.h	2017-09-17 19:03:22.000000000 -0400
++++ b/src/mesa/main/imports.h	2017-10-02 09:54:19.341817963 -0400
+@@ -357,10 +357,6 @@
+ #define snprintf _snprintf
+ #endif
+ 
+-#if defined(_WIN32) && !defined(strtok_r)
+-#define strtok_r strtok_s
+-#endif
+-
+ #ifdef __cplusplus
+ }
+ #endif
--- a/src/mingw-osmesa-1-fixes.patch	Thu Oct 05 07:57:25 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-diff -uNr a/src/mesa/main/imports.h b/src/mesa/main/imports.h
---- a/src/mesa/main/imports.h	2017-09-17 19:03:22.000000000 -0400
-+++ b/src/mesa/main/imports.h	2017-10-02 09:54:19.341817963 -0400
-@@ -357,10 +357,6 @@
- #define snprintf _snprintf
- #endif
- 
--#if defined(_WIN32) && !defined(strtok_r)
--#define strtok_r strtok_s
--#endif
--
- #ifdef __cplusplus
- }
- #endif
--- a/src/octave.mk	Thu Oct 05 07:57:25 2017 -0400
+++ b/src/octave.mk	Thu Oct 05 10:44:53 2017 -0400
@@ -11,7 +11,7 @@
 ifeq ($(USE_SYSTEM_FONTCONFIG),no)
   $(PKG)_FONTCONFIG := fontconfig
 endif
-$(PKG)_DEPS     := blas arpack curl epstool fftw fltk $($(PKG)_FONTCONFIG) ghostscript gl2ps glpk gnuplot graphicsmagick hdf5 lapack libsndfile osmesa pcre portaudio pstoedit qhull qrupdate qscintilla readline suitesparse texinfo zlib
+$(PKG)_DEPS     := blas arpack curl epstool fftw fltk $($(PKG)_FONTCONFIG) ghostscript gl2ps glpk gnuplot graphicsmagick hdf5 lapack libsndfile mesa pcre portaudio pstoedit qhull qrupdate qscintilla readline suitesparse texinfo zlib
 
 ifeq ($(ENABLE_QT5),yes)
     $(PKG)_DEPS += qt5
--- a/src/osmesa.mk	Thu Oct 05 07:57:25 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-# This file is part of MXE Octave.
-# See index.html for further information.
-
-PKG             := osmesa
-$(PKG)_VERSION  := 17.2.1
-$(PKG)_CHECKSUM := 7429e74a0ef12ea9d60b41b2b852898b3da0b238
-$(PKG)_SUBDIR   := mesa-$($(PKG)_VERSION)
-$(PKG)_FILE     := mesa-$($(PKG)_VERSION).tar.xz
-$(PKG)_URL      := ftp://ftp.freedesktop.org/pub/mesa/$($(PKG)_FILE)
-$(PKG)_DEPS     := build-mako zlib
-
-define $(PKG)_UPDATE
-    echo 'Warning: Updates are temporarily disabled for package $(PKG).' >&2;
-    echo $($(PKG)_VERSION)
-endef
-
-ifeq ($(MXE_WINDOWS_BUILD),yes)
-  ifeq ($(ENABLE_WINDOWS_64),yes)
-    $(PKG)_MACHINE := x86_64
-  else
-    $(PKG)_MACHINE := x86
-  endif
-  define $(PKG)_BUILD
-    cd '$(1)' && scons platform=windows toolchain=crossmingw machine=$($(PKG)_MACHINE) verbose=1 osmesa
-
-    ## Do the scons config files have useful install targets?
-    $(INSTALL) -d '$(3)$(HOST_INCDIR)/GL';
-    for f in '$(1)/include/GL/*.h' ; do \
-      $(INSTALL) -m 644 $$f '$(3)$(HOST_INCDIR)/GL'; \
-    done
-    $(INSTALL) -d '$(3)$(HOST_BINDIR)';
-    $(INSTALL) -m 755 '$(1)/build/windows-$($(PKG)_MACHINE)-debug/mesa/drivers/osmesa/osmesa.dll' '$(3)$(HOST_BINDIR)/osmesa.dll';
-    $(INSTALL) -d '$(3)$(HOST_LIBDIR)';
-    $(INSTALL) -m 644 '$(1)/build/windows-$($(PKG)_MACHINE)-debug/mesa/drivers/osmesa/libosmesa.a' '$(3)$(HOST_LIBDIR)/libOSMesa.a';
-  endef
-else
-  define $(PKG)_BUILD
-    mkdir '$(1)/.build'
-    cd '$(1)' && autoreconf -fi  -I m4
-    cd '$(1)/.build' && $($(PKG)_CONFIGURE_ENV) '$(1)/configure' \
-        $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \
-        $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
-        --prefix='$(HOST_PREFIX)' \
-        --enable-osmesa --disable-gbm --disable-dri --disable-egl \
-        --disable-xvmc --disable-glx --disable-llvm \
-        --with-gallium-drivers="" --with-dri-drivers="" \
-        --with-platforms="" --enable-texture-float \
-        && $(CONFIGURE_POST_HOOK)
-
-    $(MAKE) -C '$(1)/.build' -j '$(JOBS)' install DESTDIR='$(3)'
-  endef
-endif
--- a/src/stable-octave.mk	Thu Oct 05 07:57:25 2017 -0400
+++ b/src/stable-octave.mk	Thu Oct 05 10:44:53 2017 -0400
@@ -11,7 +11,7 @@
 ifeq ($(USE_SYSTEM_FONTCONFIG),no)
   $(PKG)_FONTCONFIG := fontconfig
 endif
-$(PKG)_DEPS     := blas arpack curl epstool fftw fltk $($(PKG)_FONTCONFIG) ghostscript gl2ps glpk gnuplot graphicsmagick hdf5 lapack libsndfile osmesa pcre portaudio pstoedit qhull qrupdate qscintilla readline suitesparse texinfo zlib
+$(PKG)_DEPS     := blas arpack curl epstool fftw fltk $($(PKG)_FONTCONFIG) ghostscript gl2ps glpk gnuplot graphicsmagick hdf5 lapack libsndfile mesa pcre portaudio pstoedit qhull qrupdate qscintilla readline suitesparse texinfo zlib
 
 ifeq ($(ENABLE_QT5),yes)
     $(PKG)_DEPS += qt5