summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config_host/config_box2d.h.in7
-rw-r--r--configure.ac21
-rw-r--r--slideshow/source/engine/box2dtools.cxx3
3 files changed, 25 insertions, 6 deletions
diff --git a/config_host/config_box2d.h.in b/config_host/config_box2d.h.in
new file mode 100644
index 000000000000..cc761536dc04
--- /dev/null
+++ b/config_host/config_box2d.h.in
@@ -0,0 +1,7 @@
+#ifndef CONFIG_BOX2D_H
+#define CONFIG_BOX2D_H
+
+/* Box2D/Box2D.h is 2.3, 2.4 has box2d/box2d.h */
+#define BOX2D_HEADER <Box2D/Box2D.h>
+
+#endif
diff --git a/configure.ac b/configure.ac
index 08c4e39cbe64..894efc1b7eaa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10724,11 +10724,21 @@ if test "$with_system_box2d" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_BOX2D=TRUE
AC_LANG_PUSH([C++])
- AC_CHECK_HEADER(Box2D/Box2D.h, [],
- [AC_MSG_ERROR(box2d headers not found.)], [])
- AC_CHECK_LIB([Box2D], [main], [:],
- [ AC_MSG_ERROR(box2d library not found.) ], [])
- BOX2D_LIBS=-lBox2D
+ AC_CHECK_HEADER(box2d/box2d.h, [BOX2D_H_FOUND='TRUE'],
+ [BOX2D_H_FOUND='FALSE'])
+ if test "$BOX2D_H_FOUND" = "TRUE"; then # 2.4.0+
+ _BOX2D_LIB=box2d
+ AC_DEFINE(BOX2D_HEADER,<box2d/box2d.h>)
+ else
+ # fail this. there's no other alternative to check when we are here.
+ AC_CHECK_HEADER([Box2D/Box2D.h], [],
+ [AC_MSG_ERROR(box2d headers not found.)])
+ _BOX2D_LIB=Box2D
+ AC_DEFINE(BOX2D_HEADER,<Box2D/Box2D.h>)
+ fi
+ AC_CHECK_LIB([$_BOX2D_LIB], [main], [:],
+ [ AC_MSG_ERROR(box2d library not found.) ], [])
+ BOX2D_LIBS=-l$_BOX2D_LIB
AC_LANG_POP([C++])
BOX2D_CFLAGS=$(printf '%s' "$BOX2D_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
FilterLibs "${BOX2D_LIBS}"
@@ -13946,6 +13956,7 @@ AC_CONFIG_FILES([config_host.mk
instsetoo_native/util/openoffice.lst
sysui/desktop/macosx/Info.plist])
AC_CONFIG_HEADERS([config_host/config_buildid.h])
+AC_CONFIG_HEADERS([config_host/config_box2d.h])
AC_CONFIG_HEADERS([config_host/config_clang.h])
AC_CONFIG_HEADERS([config_host/config_dconf.h])
AC_CONFIG_HEADERS([config_host/config_eot.h])
diff --git a/slideshow/source/engine/box2dtools.cxx b/slideshow/source/engine/box2dtools.cxx
index db91ccbb57e7..c822f564a008 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -8,7 +8,8 @@
*/
#include <box2dtools.hxx>
-#include <Box2D/Box2D.h>
+#include <config_box2d.h>
+#include BOX2D_HEADER
#include <shapemanager.hxx>
#include <attributableshape.hxx>