diff options
author | Tony Theodore <tonyt@logyst.com> | 2013-11-10 03:59:27 (GMT) |
---|---|---|
committer | Tony Theodore <tonyt@logyst.com> | 2013-11-10 03:59:27 (GMT) |
commit | 364dc94e429503bcba1879a3425adb22ba957079 (patch) | |
tree | 4c3ada33ed6059fdf35602d1baa2ba9ec57aad95 /src | |
parent | 5f00909fc37fd0204afa1a29ff924eeb445dc4cc (diff) | |
parent | dd60b2f8178502417471ba931b7dc030a38731ae (diff) | |
download | mxe-364dc94e429503bcba1879a3425adb22ba957079.zip mxe-364dc94e429503bcba1879a3425adb22ba957079.tar.gz mxe-364dc94e429503bcba1879a3425adb22ba957079.tar.bz2 |
Merge pull request #267 from ddiproietto/master
Added glfw (version 2) package
Diffstat (limited to 'src')
-rw-r--r-- | src/glfw2-1-no-build-test.patch | 25 | ||||
-rw-r--r-- | src/glfw2-test.c | 28 | ||||
-rw-r--r-- | src/glfw2.mk | 26 |
3 files changed, 79 insertions, 0 deletions
diff --git a/src/glfw2-1-no-build-test.patch b/src/glfw2-1-no-build-test.patch new file mode 100644 index 0000000..3f26022 --- /dev/null +++ b/src/glfw2-1-no-build-test.patch @@ -0,0 +1,25 @@ +This file is part of MXE. +See index.html for further information. + +Do not waste time building examples and tests. We use our test + +--- a/Makefile ++++ b/Makefile +@@ -128,13 +128,13 @@ + + cross-mgw: + cd lib/win32 && $(MAKE) -f Makefile.win32.cross-mgw +- cd examples && $(MAKE) -f Makefile.win32.cross-mgw +- cd tests && $(MAKE) -f Makefile.win32.cross-mgw ++ #cd examples && $(MAKE) -f Makefile.win32.cross-mgw ++ #cd tests && $(MAKE) -f Makefile.win32.cross-mgw + + cross-mgw-clean: + cd lib/win32 && $(MAKE) -f Makefile.win32.cross-mgw clean +- cd examples && $(MAKE) -f Makefile.win32.cross-mgw clean +- cd tests && $(MAKE) -f Makefile.win32.cross-mgw clean ++ #cd examples && $(MAKE) -f Makefile.win32.cross-mgw clean ++ #cd tests && $(MAKE) -f Makefile.win32.cross-mgw clean + + + ########################################################################### diff --git a/src/glfw2-test.c b/src/glfw2-test.c new file mode 100644 index 0000000..8542147 --- /dev/null +++ b/src/glfw2-test.c @@ -0,0 +1,28 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include <stdlib.h> +#include <GL/glfw.h> + +int main(void) +{ + /* Initialise GLFW */ + if( !glfwInit() ) + { + return EXIT_FAILURE; + } + + /* Open a window and create its OpenGL context */ + if( !glfwOpenWindow( 640, 480, 0,0,0,0, 0,0, GLFW_WINDOW ) ) + { + glfwTerminate(); + return EXIT_FAILURE; + } + + /* Close OpenGL window and terminate GLFW*/ + glfwTerminate(); + + return EXIT_SUCCESS; +} diff --git a/src/glfw2.mk b/src/glfw2.mk new file mode 100644 index 0000000..ef7d91b --- /dev/null +++ b/src/glfw2.mk @@ -0,0 +1,26 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := glfw2 +$(PKG)_IGNORE := +$(PKG)_VERSION := 2.7.9 +$(PKG)_CHECKSUM := b189922e9804062a0014a3799b4dc35431034623 +$(PKG)_SUBDIR := glfw-$($(PKG)_VERSION) +$(PKG)_FILE := glfw-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/glfw/glfw/$($(PKG)_VERSION)/$($(PKG)_FILE) +$(PKG)_DEPS := gcc + +define $(PKG)_UPDATE + echo 'TODO: write update script for $(PKG).' >&2; + echo $($(PKG)_VERSION) +endef + +define $(PKG)_BUILD + $(MAKE) -C '$(1)' -j '$(JOBS)' cross-mgw-install TARGET=$(TARGET)- PREFIX='$(PREFIX)/$(TARGET)' + + #Test + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-glfw.exe' \ + `'$(TARGET)-pkg-config' libglfw --cflags --libs` +endef |