diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -12251,9 +12251,10 @@
     AC_MSG_RESULT([external])
     SYSTEM_BOX2D=TRUE
     AC_LANG_PUSH([C++])
-    BOX2D_VERSION=`$PKG_CONFIG --modversion box2d 2>/dev/null`
-    BOX2D_MAJOR=`echo $BOX2D_VERSION | cut -d"." -f1`
-    BOX2D_MINOR=`echo $BOX2D_VERSION | cut -d"." -f2`
+    dnl box2d ships no pkg-config file upstream, so ask the headers which
+    dnl version is installed: box2d/id.h is new in the 3.x rewrite
+    AC_CHECK_HEADER([box2d/id.h], [BOX2D_MAJOR=3; BOX2D_MINOR=1],
+        [AC_MSG_ERROR([box2d 3.x headers not found.])])
     if test "$BOX2D_MAJOR" -eq "2"; then
         if test "$BOX2D_MINOR" -eq "4"; then
             _BOX2D_LIB=box2d
@@ -12265,6 +12266,9 @@
             _BOX2D_LIB=Box2D
             AC_DEFINE(BOX2D_HEADER,<Box2D/Box2D.h>)
         fi
+    elif test "$BOX2D_MAJOR" -eq "3"; then
+        _BOX2D_LIB=box2d
+        AC_DEFINE(BOX2D_HEADER,<box2d/box2d.h>)
     fi
     AC_CHECK_LIB([$_BOX2D_LIB], [main], [:],
         [ AC_MSG_ERROR(box2d library not found.) ], [])
