annotate src/mesa.mk @ 4513:1fdd8063e38d

mesa: windows: optionally build opengl target; build in release mode
author John W. Eaton <jwe@octave.org>
date Wed, 18 Oct 2017 10:50:32 -0400
parents 0117b5797a5c
children 0f62ac5c6fd8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3785
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
1 # This file is part of MXE Octave.
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
2 # See index.html for further information.
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
3
4488
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
4 PKG := mesa
4481
7d6f1fd0d672 update osmesa package to version 7.2.1
John W. Eaton <jwe@octave.org>
parents: 3929
diff changeset
5 $(PKG)_VERSION := 17.2.1
7d6f1fd0d672 update osmesa package to version 7.2.1
John W. Eaton <jwe@octave.org>
parents: 3929
diff changeset
6 $(PKG)_CHECKSUM := 7429e74a0ef12ea9d60b41b2b852898b3da0b238
7d6f1fd0d672 update osmesa package to version 7.2.1
John W. Eaton <jwe@octave.org>
parents: 3929
diff changeset
7 $(PKG)_SUBDIR := mesa-$($(PKG)_VERSION)
7d6f1fd0d672 update osmesa package to version 7.2.1
John W. Eaton <jwe@octave.org>
parents: 3929
diff changeset
8 $(PKG)_FILE := mesa-$($(PKG)_VERSION).tar.xz
7d6f1fd0d672 update osmesa package to version 7.2.1
John W. Eaton <jwe@octave.org>
parents: 3929
diff changeset
9 $(PKG)_URL := ftp://ftp.freedesktop.org/pub/mesa/$($(PKG)_FILE)
4507
4c645e979279 s2tc: New package.
John W. Eaton <jwe@octave.org>
parents: 4500
diff changeset
10 $(PKG)_DEPS := build-mako s2tc zlib
4488
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
11 ifeq ($(MXE_WINDOWS_BUILD),yes)
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
12 ifeq ($(USE_SYSTEM_OPENGL),no)
4513
1fdd8063e38d mesa: windows: optionally build opengl target; build in release mode
John W. Eaton <jwe@octave.org>
parents: 4511
diff changeset
13 $(PKG)_SCONS_OPENGL_OPTIONS := libgl-gdi
4488
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
14 endif
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
15 else
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
16 ifeq ($(USE_SYSTEM_OPENGL),yes)
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
17 $(PKG)_CONFIGURE_OPENGL_OPTIONS := \
4500
102c3d608dd6 mesa: enable egl when building opengl.
John W. Eaton <jwe@octave.org>
parents: 4497
diff changeset
18 --disable-opengl --disable-egl --disable-gles1 --disable-gles2 \
4497
e7d902eeefda mesa: also disable gles1 and gles2 if opengl is disabled.
John W. Eaton <jwe@octave.org>
parents: 4488
diff changeset
19 --disable-dri --disable-glx \
4488
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
20 --with-gallium-drivers="" --with-dri-drivers="" \
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
21 --with-platforms=""
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
22 else
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
23 $(PKG)_CONFIGURE_OPENGL_OPTIONS := \
4500
102c3d608dd6 mesa: enable egl when building opengl.
John W. Eaton <jwe@octave.org>
parents: 4497
diff changeset
24 --enable-opengl --enable-egl --enable-gles1 --enable-gles2 \
4511
0117b5797a5c mesa: Depend on llvm for native opengl builds.
John W. Eaton <jwe@octave.org>
parents: 4507
diff changeset
25 --with-gallium-drivers="swrast" --with-dri-drivers="" \
4488
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
26 --with-platforms="x11"
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
27 ifeq ($(USE_SYSTEM_X11_LIBS),no)
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
28 $(PKG)_DEPS += dri2proto glproto libdrm libxshmfence x11 xdamage xext xfixes
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
29 endif
4511
0117b5797a5c mesa: Depend on llvm for native opengl builds.
John W. Eaton <jwe@octave.org>
parents: 4507
diff changeset
30 $(PKG)_DEPS += llvm
4488
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
31 endif
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
32 endif
3785
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
33
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
34 define $(PKG)_UPDATE
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
35 echo 'Warning: Updates are temporarily disabled for package $(PKG).' >&2;
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
36 echo $($(PKG)_VERSION)
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
37 endef
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
38
3790
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
39 ifeq ($(MXE_WINDOWS_BUILD),yes)
3803
f2776007d295 osmesa: update for win64
John D
parents: 3790
diff changeset
40 ifeq ($(ENABLE_WINDOWS_64),yes)
f2776007d295 osmesa: update for win64
John D
parents: 3790
diff changeset
41 $(PKG)_MACHINE := x86_64
f2776007d295 osmesa: update for win64
John D
parents: 3790
diff changeset
42 else
f2776007d295 osmesa: update for win64
John D
parents: 3790
diff changeset
43 $(PKG)_MACHINE := x86
f2776007d295 osmesa: update for win64
John D
parents: 3790
diff changeset
44 endif
3790
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
45 define $(PKG)_BUILD
4513
1fdd8063e38d mesa: windows: optionally build opengl target; build in release mode
John W. Eaton <jwe@octave.org>
parents: 4511
diff changeset
46 cd '$(1)' && scons platform=windows toolchain=crossmingw machine=$($(PKG)_MACHINE) verbose=1 build=release osmesa $($(PKG)_SCONS_OPENGL_OPTIONS)
3790
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
47
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
48 ## Do the scons config files have useful install targets?
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
49 $(INSTALL) -d '$(3)$(HOST_INCDIR)/GL';
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
50 for f in '$(1)/include/GL/*.h' ; do \
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
51 $(INSTALL) -m 644 $$f '$(3)$(HOST_INCDIR)/GL'; \
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
52 done
4513
1fdd8063e38d mesa: windows: optionally build opengl target; build in release mode
John W. Eaton <jwe@octave.org>
parents: 4511
diff changeset
53
1fdd8063e38d mesa: windows: optionally build opengl target; build in release mode
John W. Eaton <jwe@octave.org>
parents: 4511
diff changeset
54 $(INSTALL) -d '$(3)$(HOST_LIBDIR)';
1fdd8063e38d mesa: windows: optionally build opengl target; build in release mode
John W. Eaton <jwe@octave.org>
parents: 4511
diff changeset
55 $(INSTALL) -m 644 '$(1)/build/windows-$($(PKG)_MACHINE)/gallium/targets/osmesa/libosmesa.a' '$(3)$(HOST_LIBDIR)/libOSMesa.a';
1fdd8063e38d mesa: windows: optionally build opengl target; build in release mode
John W. Eaton <jwe@octave.org>
parents: 4511
diff changeset
56
3790
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
57 $(INSTALL) -d '$(3)$(HOST_BINDIR)';
4513
1fdd8063e38d mesa: windows: optionally build opengl target; build in release mode
John W. Eaton <jwe@octave.org>
parents: 4511
diff changeset
58 $(INSTALL) -m 755 '$(1)/build/windows-$($(PKG)_MACHINE)/gallium/targets/osmesa/osmesa.dll' '$(3)$(HOST_BINDIR)/osmesa.dll';
1fdd8063e38d mesa: windows: optionally build opengl target; build in release mode
John W. Eaton <jwe@octave.org>
parents: 4511
diff changeset
59
1fdd8063e38d mesa: windows: optionally build opengl target; build in release mode
John W. Eaton <jwe@octave.org>
parents: 4511
diff changeset
60 if [ -f '$(1)/build/windows-$($(PKG)_MACHINE)/gallium/targets/libgl-gdi/opengl32.dll' ]; then \
1fdd8063e38d mesa: windows: optionally build opengl target; build in release mode
John W. Eaton <jwe@octave.org>
parents: 4511
diff changeset
61 $(INSTALL) -m 755 '$(1)/build/windows-$($(PKG)_MACHINE)/gallium/targets/libgl-gdi/opengl32.dll' '$(3)$(HOST_BINDIR)/opengl32.dll'; \
1fdd8063e38d mesa: windows: optionally build opengl target; build in release mode
John W. Eaton <jwe@octave.org>
parents: 4511
diff changeset
62 fi
3790
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
63 endef
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
64 else
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
65 define $(PKG)_BUILD
3785
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
66 mkdir '$(1)/.build'
3825
b6f31861c73e osmesa:call autoreconf
John Donoghue
parents: 3803
diff changeset
67 cd '$(1)' && autoreconf -fi -I m4
3788
f6d63f2a2de6 allow osmesa to build; remove it from octave deps for Windows systems
John W. Eaton <jwe@octave.org>
parents: 3787
diff changeset
68 cd '$(1)/.build' && $($(PKG)_CONFIGURE_ENV) '$(1)/configure' \
3785
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
69 $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
70 $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
71 --prefix='$(HOST_PREFIX)' \
4488
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
72 $($(PKG)_CONFIGURE_OPENGL_OPTIONS) \
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
73 --enable-osmesa \
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
74 --disable-gbm \
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
75 --disable-xvmc \
8f9bee27223f optionally build mesa OpenGL library
John W. Eaton <jwe@octave.org>
parents: 4481
diff changeset
76 --enable-texture-float \
3785
e1e69acf0bb2 osmesa: added for offscreen rendering with OpenGL toolkits
Andreas Weber <andy.weber.aw@gmail.com>
parents:
diff changeset
77 && $(CONFIGURE_POST_HOOK)
3787
282bc5054a7f (incompletely) attempt to make osmesa actually build for Windows
John W. Eaton <jwe@octave.org>
parents: 3785
diff changeset
78
282bc5054a7f (incompletely) attempt to make osmesa actually build for Windows
John W. Eaton <jwe@octave.org>
parents: 3785
diff changeset
79 $(MAKE) -C '$(1)/.build' -j '$(JOBS)' install DESTDIR='$(3)'
3790
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
80 endef
a169ad26bac2 use scons to build osmesa on windows systems
John W. Eaton <jwe@octave.org>
parents: 3788
diff changeset
81 endif