1 #----------------------------------------------------------------------------
2 # Autoconf input script. Invoke the ./autogen.sh script to generate a
3 # configure script from this file.
4 #----------------------------------------------------------------------------
7 #----------------------------------------------------------------------------
9 #----------------------------------------------------------------------------
13 [bullet@erwincoumans.com])
15 AC_CONFIG_SRCDIR([configure.ac])
22 *-*-mingw*|*-*-cygwin*)
23 AC_DEFINE(PLATFORM_WIN32, 1, [Platform is Win32])
24 opengl_LIBS="-lunsupported_platform"
25 PLATFORM_STRING="Win32"
28 AC_DEFINE(PLATFORM_LINUX, 1, [Platform is Linux])
29 opengl_LIBS="-lGL -lGLU -lglut"
30 PLATFORM_STRING="Linux"
34 AC_DEFINE(PLATFORM_APPLE, 1, [Platform is Apple])
35 opengl_LIBS="-framework AGL -framework OpenGL -framework GLUT"
36 PLATFORM_STRING="Apple"
39 AC_MSG_WARN([*** Please add $host to configure.ac checks!])
45 i?86-* | k?-* | athlon-* | pentium*-)
46 AC_DEFINE(ARCH_X86, 1, [Architecture is x86])
47 ARCH_SPECIFIC_CFLAGS=""
51 AC_DEFINE(ARCH_X86_64, 1, [Architecture is x86-64])
52 ARCH_SPECIFIC_CFLAGS="-DUSE_ADDR64"
56 AC_MSG_WARN([HI THERE!])
57 AC_DEFINE(ARCH_PPC, 1, [Architecture is PowerPC])
58 ARCH_SPECIFIC_CFLAGS=""
62 AC_MSG_ERROR([Unknown Architecture])
68 #----------------------------------------------------------------------------
69 # Setup for the configuration header.
70 #----------------------------------------------------------------------------
71 AC_CONFIG_HEADERS([config.h])
72 #----------------------------------------------------------------------------
73 # Package configuration switches.
74 #----------------------------------------------------------------------------
75 AC_ARG_ENABLE([multithreaded],
76 [AC_HELP_STRING([--enable-multithreaded],
77 [build BulletMultiThreaded (default NO)])],
78 [disable_multithreaded=no], [disable_multithreaded=yes])
79 AC_MSG_CHECKING([BulletMultiThreaded])
80 AS_IF([test "$disable_multithreaded" = yes], [build_multithreaded=no], [build_multithreaded=yes])
81 AC_MSG_RESULT([$build_multithreaded])
82 AM_CONDITIONAL([CONDITIONAL_BUILD_MULTITHREADED], [test "$build_multithreaded" = yes])
84 AC_ARG_ENABLE([demos],
85 [AS_HELP_STRING([--disable-demos],
86 [disable Bullet demos])],
89 AM_CONDITIONAL([CONDITIONAL_BUILD_DEMOS], [false])
91 dnl Check for OpenGL and GLUT
96 AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1],
97 [Use the Apple OpenGL framework.])
98 GL_LIBS="-framework GLUT -framework OpenGL -framework Carbon -framework AGL"
105 AC_CHECK_HEADERS(GL/gl.h GL/glu.h GL/glext.h GL/glut.h, ,
106 [have_gl_headers=no],
120 TEMP_LDFLAGS="$LDFLAGS"
121 AC_CHECK_LIB(GL, main, [GL_LIBS="-lGL"; have_gl=yes])
122 AC_CHECK_LIB(GLU, main, [GL_LIBS="-lGLU $GL_LIBS"; have_glu=yes], , -lGL)
123 AC_CHECK_LIB(GLUT, main, [GL_LIBS="-lGLUT -LGLU $GL_LIBS"; have_glut=yes], ,-lGLUT)
124 AC_CHECK_LIB(opengl32, main, [GL_LIBS="-lopengl32"; have_gl=yes])
125 AC_CHECK_LIB(glu32, main, [GL_LIBS="-lglu32 $GL_LIBS"; have_glu=yes], , -lopengl32)
126 LDFLAGS="$TEMP_LDFLAGS"
127 if test $have_gl = no -o $have_glu = no -o $have_gl_headers = no; then
128 if test x$enable_demos = xyes; then
129 AC_MSG_WARN([Demos and Extras will not be built because OpenGL and GLUT doesn't seem to work. See `config.log' for details.])
133 AC_MSG_NOTICE([Found OpenGL])
143 if test "x$enable_demos" != xno; then
144 AC_MSG_NOTICE([Building Bullet demos])
145 AM_CONDITIONAL([CONDITIONAL_BUILD_DEMOS],[true])
150 AC_ARG_ENABLE([debug],
151 [AC_HELP_STRING([--enable-debug],
152 [build with debugging information (default NO)])],
153 [], [enable_debug=no])
155 AC_MSG_CHECKING([build mode])
156 AS_IF([test $enable_debug = yes], [build_mode=debug], [build_mode=optimize])
157 AC_MSG_RESULT([$build_mode])
161 CFLAGS="$ARCH_SPECIFIC_CFLAGS $CFLAGS"
162 CXXFLAGS="$ARCH_SPECIFIC_CFLAGS $CXXFLAGS $CFLAGS"
163 #----------------------------------------------------------------------------
164 # Emit generated files.
165 #----------------------------------------------------------------------------
166 AC_CONFIG_FILES([bullet.pc Makefile Demos/Makefile Demos/SoftDemo/Makefile Demos/AllBulletDemos/Makefile Demos/MultiThreadedDemo/Makefile Demos/OpenGL/Makefile Demos/BasicDemo/Makefile Demos/CcdPhysicsDemo/Makefile Demos/VehicleDemo/Makefile Demos/TerrainDemo/Makefile src/Makefile Extras/Makefile])
171 Please type 'make' to build Bullet