summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosh Heidenreich <josh.sickmate@gmail.com>2014-02-02 22:12:37 (GMT)
committerTony Theodore <tonyt@logyst.com>2014-02-21 18:06:00 (GMT)
commita58fe28cff9fc2249149bf350cc93b86c14dd6c8 (patch)
treeec23bfb25c2c7767fdfb8ad4de0207ede70637ce /src
parent0bbc1d18659f48e988680642802e1128850a0a84 (diff)
downloadmxe-a58fe28cff9fc2249149bf350cc93b86c14dd6c8.zip
mxe-a58fe28cff9fc2249149bf350cc93b86c14dd6c8.tar.gz
mxe-a58fe28cff9fc2249149bf350cc93b86c14dd6c8.tar.bz2
add package bullet
Diffstat (limited to 'src')
-rw-r--r--src/bullet-1-pkgconfig.patch22
-rw-r--r--src/bullet-test.cpp29
-rw-r--r--src/bullet.mk38
3 files changed, 89 insertions, 0 deletions
diff --git a/src/bullet-1-pkgconfig.patch b/src/bullet-1-pkgconfig.patch
new file mode 100644
index 0000000..235e57e
--- /dev/null
+++ b/src/bullet-1-pkgconfig.patch
@@ -0,0 +1,22 @@
+This file is part of MXE.
+See index.html for further information.
+
+--- a/CMakeLists.txt Sat Sep 14 11:25:52 2013 -0700
++++ b/CMakeLists.txt Fri Sep 27 15:03:58 2013 +1000
+@@ -402,14 +402,14 @@
+ ## the following are directories where stuff will be installed to
+ SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/bullet/" CACHE PATH "The subdirectory to the header prefix")
+ SET(PKGCONFIG_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig/" CACHE STRING "Base directory for pkgconfig files")
+- IF(NOT WIN32)
++
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bullet.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/bullet.pc @ONLY)
+ INSTALL(
+ FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/bullet.pc
+ DESTINATION
+ ${PKGCONFIG_INSTALL_PREFIX})
+- ENDIF(NOT WIN32)
++
+ ENDIF(INSTALL_LIBS)
+
+ #INSTALL of other files requires CMake 2.6
diff --git a/src/bullet-test.cpp b/src/bullet-test.cpp
new file mode 100644
index 0000000..808f00a
--- /dev/null
+++ b/src/bullet-test.cpp
@@ -0,0 +1,29 @@
+/*
+ * This file is part of MXE.
+ * See index.html for further information.
+ */
+
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+
+#include <btBulletDynamicsCommon.h>
+
+int main(int argc, char *argv[])
+{
+ btBroadphaseInterface* broadphase = new btDbvtBroadphase();
+ btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();
+ btCollisionDispatcher* dispatcher = new btCollisionDispatcher(collisionConfiguration);
+ btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver();
+ btDiscreteDynamicsWorld* dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration);
+
+ (void)argc;
+ (void)argv;
+
+ delete dynamicsWorld;
+ delete solver;
+ delete dispatcher;
+ delete collisionConfiguration;
+ delete broadphase;
+
+ return 0;
+}
diff --git a/src/bullet.mk b/src/bullet.mk
new file mode 100644
index 0000000..1e4c37f
--- /dev/null
+++ b/src/bullet.mk
@@ -0,0 +1,38 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := bullet
+$(PKG)_IGNORE :=
+$(PKG)_VERSION := 2.82-r2704
+$(PKG)_CHECKSUM := a0867257b9b18e9829bbeb4c6c5872a5b29d1d33
+$(PKG)_SUBDIR := bullet-$($(PKG)_VERSION)
+$(PKG)_FILE := bullet-$($(PKG)_VERSION).tgz
+$(PKG)_URL := https://bullet.googlecode.com/files/$($(PKG)_FILE)
+$(PKG)_DEPS := gcc
+
+define $(PKG)_UPDATE
+ $(WGET) -q -O- 'http://code.google.com/p/bullet/downloads/list?sort=-uploaded' | \
+ $(SED) -n 's,.*bullet-\([0-9][^<]*\)\.tgz,\1,p' | \
+ head -1
+endef
+
+define $(PKG)_BUILD
+ cd '$(1)' && cmake . \
+ -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
+ -DINSTALL_LIBS=ON \
+ -DBUILD_CPU_DEMOS=OFF \
+ -DBUILD_DEMOS=OFF \
+ -DBUILD_EXTRAS=OFF \
+ -DBUILD_MULTITHREADING=OFF \
+ -DBUILD_UNIT_TESTS=OFF \
+ -DUSE_CUSTOM_VECOR_MATH=OFF \
+ -DUSE_DOUBLE_PRECISION=OFF \
+ -DUSE_GLUT=OFF \
+ -DUSE_GRAPHICAL_BENCHMARK=OFF
+ $(MAKE) -C '$(1)' -j '$(JOBS)' install VERBOSE=1
+
+ '$(TARGET)-g++' \
+ -W -Wall -Werror -ansi -pedantic \
+ '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
+ `'$(TARGET)-pkg-config' $(PKG) --cflags --libs`
+endef