changeset 3790:a169ad26bac2

use scons to build osmesa on windows systems
author John W. Eaton <jwe@octave.org>
date Sun, 15 Feb 2015 13:33:36 -0500
parents 08eb76a22fa0
children 26f72c8e2be7
files src/mingw-osmesa-1-fixes.patch src/mingw-osmesa-1-pthreads.patch src/osmesa.mk
diffstat 3 files changed, 37 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mingw-osmesa-1-fixes.patch	Sun Feb 15 13:33:36 2015 -0500
@@ -0,0 +1,14 @@
+diff -uNr a/scons/gallium.py b/scons/gallium.py
+--- a/scons/gallium.py	2014-06-25 00:33:39.000000000 -0400
++++ b/scons/gallium.py	2015-02-15 12:07:49.271713764 -0500
+@@ -529,10 +529,6 @@
+         else:
+             env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group'
+         if env['platform'] == 'windows':
+-            # Avoid depending on gcc runtime DLLs
+-            linkflags += ['-static-libgcc']
+-            if 'w64' in env['CC'].split('-'):
+-                linkflags += ['-static-libstdc++']
+             # Handle the @xx symbol munging of DLL exports
+             shlinkflags += ['-Wl,--enable-stdcall-fixup']
+             #shlinkflags += ['-Wl,--kill-at']
--- a/src/mingw-osmesa-1-pthreads.patch	Sat Feb 14 21:22:13 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-diff -u a/configure.ac b/configure.ac
---- a/configure.ac	2014-06-25 00:33:39.000000000 -0400
-+++ b/configure.ac	2015-02-14 19:03:49.113882994 -0500
-@@ -514,11 +514,17 @@
- AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
- 
- dnl Check for pthreads
--AX_PTHREAD
-+case "$host_os" in
-+  mingw*)
-+  ;;
-+  *)
-+    AX_PTHREAD
- dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
- dnl to -pthread, which causes problems if we need -lpthread to appear in
- dnl pkgconfig files.
--test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
-+    test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
-+  ;;
-+esac
- 
- dnl SELinux awareness.
- AC_ARG_ENABLE([selinux],
--- a/src/osmesa.mk	Sat Feb 14 21:22:13 2015 -0800
+++ b/src/osmesa.mk	Sun Feb 15 13:33:36 2015 -0500
@@ -14,15 +14,34 @@
     echo $($(PKG)_VERSION)
 endef
 
-define $(PKG)_BUILD
+ifeq ($(MXE_WINDOWS_BUILD),yes)
+  define $(PKG)_BUILD
+    ## FIXME: is machine=x86 the correct thing for 64-bit Windows builds?
+    cd '$(1)' && scons platform=windows toolchain=crossmingw machine=x86 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-x86-debug/mesa/drivers/osmesa/osmesa.dll' '$(3)$(HOST_BINDIR)/osmesa.dll';
+    $(INSTALL) -d '$(3)$(HOST_LIBDIR)';
+    $(INSTALL) -m 644 '$(1)/build/windows-x86-debug/mesa/drivers/osmesa/libosmesa.a' '$(3)$(HOST_LIBDIR)/libOSMesa.a';
+  endef
+else
+  define $(PKG)_BUILD
     mkdir '$(1)/.build'
-    cd '$(1)' && autoreconf
     cd '$(1)/.build' && $($(PKG)_CONFIGURE_ENV) '$(1)/configure' \
         $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \
         $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
         --prefix='$(HOST_PREFIX)' \
-        --enable-osmesa --disable-dri --without-gallium-drivers --disable-egl \
+        --enable-osmesa --disable-dri --disable-egl --disable-xvmc \
+        --disable-glx --disable-shared-glapi --disable-gallium-llvm \
+        --with-gallium-drivers="" --with-dri-drivers="" \
+        --with-egl-platforms="" --enable-texture-float \
         && $(CONFIGURE_POST_HOOK)
 
     $(MAKE) -C '$(1)/.build' -j '$(JOBS)' install DESTDIR='$(3)'
-endef
+  endef
+endif