Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 161 lines (142 sloc) 5.782 kb
7cb0ad9 -Initial commit of Bullet port.
Chris Culy authored
1 #----------------------------------------------------------------------------
2 # Autoconf input script. Invoke the ./autogen.sh script to generate a
3 # configure script from this file.
4 #----------------------------------------------------------------------------
5 AC_PREREQ([2.54])
6
7 #----------------------------------------------------------------------------
8 # Initialize Autoconf.
9 #----------------------------------------------------------------------------
10 AC_INIT(
11 [bullet],
12 [2.79],
13 [bullet@erwincoumans.com])
14 AC_CANONICAL_HOST
15 AC_CONFIG_SRCDIR([configure.ac])
16 AM_INIT_AUTOMAKE
17 AM_PROG_CC_C_O
18 AC_PROG_CXX
19 AC_PROG_LIBTOOL
20
21 case "$host" in
22 *-*-mingw*|*-*-cygwin*)
23 AC_DEFINE(PLATFORM_WIN32, 1, [Platform is Win32])
24 opengl_LIBS="-lunsupported_platform"
25 PLATFORM_STRING="Win32"
26 ;;
27 *-*-linux*)
28 AC_DEFINE(PLATFORM_LINUX, 1, [Platform is Linux])
29 opengl_LIBS="-lGL -lGLU -lglut"
30 PLATFORM_STRING="Linux"
31 ;;
32 *-*-darwin*)
33 AC_DEFINE(PLATFORM_APPLE, 1, [Platform is Apple])
34 opengl_LIBS="-framework AGL -framework OpenGL -framework GLUT"
35 PLATFORM_STRING="Apple"
36 ;;
37 *)
38 AC_MSG_WARN([*** Please add $host to configure.ac checks!])
39 ;;
40 esac
41 AC_SUBST(opengl_LIBS)
42
43 case "$host" in
44 i?86-* | k?-* | athlon-* | pentium*-)
45 AC_DEFINE(ARCH_X86, 1, [Architecture is x86])
46 ARCH_SPECIFIC_CFLAGS=""
47 ARCH_STRING="X86"
48 ;;
49 x86_64-*)
50 AC_DEFINE(ARCH_X86_64, 1, [Architecture is x86-64])
51 ARCH_SPECIFIC_CFLAGS="-DUSE_ADDR64"
52 ARCH_STRING="X86-64"
53 ;;
54 ppc-* | powerpc-*)
55 AC_DEFINE(ARCH_PPC, 1, [Architecture is PowerPC])
56 ARCH_SPECIFIC_CFLAGS=""
57 ARCH_STRING="PowerPC"
58 ;;
59 *)
60 AC_MSG_ERROR([Unknown Architecture])
61 ;;
62 esac
63 AC_C_BIGENDIAN
64
65
66 #----------------------------------------------------------------------------
67 # Setup for the configuration header.
68 #----------------------------------------------------------------------------
69 AC_CONFIG_HEADERS([config.h])
70 #----------------------------------------------------------------------------
71 # Package configuration switches.
72 #----------------------------------------------------------------------------
73 AC_ARG_ENABLE([multithreaded],
74 [AC_HELP_STRING([--enable-multithreaded],
75 [build BulletMultiThreaded (default NO)])],
76 [disable_multithreaded=no], [disable_multithreaded=yes])
77 AC_MSG_CHECKING([BulletMultiThreaded])
78 AS_IF([test "$disable_multithreaded" = yes], [build_multithreaded=no], [build_multithreaded=yes])
79 AC_MSG_RESULT([$build_multithreaded])
80 AM_CONDITIONAL([CONDITIONAL_BUILD_MULTITHREADED], [test "$build_multithreaded" = yes])
81
82 AC_ARG_ENABLE([demos],
83 [AS_HELP_STRING([--disable-demos],
84 [disable Bullet demos])],
85 [],
86 [enable_demos=yes])
87 AM_CONDITIONAL([CONDITIONAL_BUILD_DEMOS], [false])
88
89 dnl Check for OpenGL and GLUT
90 if test "x$drawstuff" = "xOSX"; then
91 AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1],
92 [Use the Apple OpenGL framework.])
93 GL_LIBS="-framework GLUT -framework OpenGL -framework Carbon -framework AGL"
94 have_glut=yes
95 else
96 have_gl_headers=yes
97 AC_CHECK_HEADERS(GL/gl.h GL/glu.h GL/glext.h GL/glut.h, ,
98 [have_gl_headers=no],
99 [[#ifdef WIN32
100 #include <windows.h>
101 #endif
102 #if HAVE_GL_GL_H
103 #include <GL/gl.h>
104 #endif
105 #if HAVE_GL_GLU_H
106 #include <GL/glu.h>
107 #endif
108 ]])
109 have_gl=no
110 have_glu=no
111 have_glut=no
112 TEMP_LDFLAGS="$LDFLAGS"
113 AC_CHECK_LIB(GL, main, [GL_LIBS="-lGL"; have_gl=yes])
114 AC_CHECK_LIB(GLU, main, [GL_LIBS="-lGLU $GL_LIBS"; have_glu=yes], , -lGL)
115 AC_CHECK_LIB(GLUT, main, [GL_LIBS="-lGLUT -LGLU $GL_LIBS"; have_glut=yes], ,-lGLUT)
116 AC_CHECK_LIB(opengl32, main, [GL_LIBS="-lopengl32"; have_gl=yes])
117 AC_CHECK_LIB(glu32, main, [GL_LIBS="-lglu32 $GL_LIBS"; have_glu=yes], , -lopengl32)
118 LDFLAGS="$TEMP_LDFLAGS"
119 if test $have_gl = no -o $have_glu = no -o $have_gl_headers = no; then
120 if test x$enable_demos = xyes; then
121 AC_MSG_WARN([Demos and Extras will not be built because OpenGL and GLUT doesn't seem to work. See `config.log' for details.])
122 fi
123 enable_demos=no
124 else
125 AC_MSG_NOTICE([Found OpenGL])
126 fi
127 fi
128 AC_SUBST(GL_LIBS)
129
130
131 if test "x$enable_demos" != xno; then
132 AC_MSG_NOTICE([Building Bullet demos])
133 AM_CONDITIONAL([CONDITIONAL_BUILD_DEMOS],[true])
134 fi
135
136
137
138 AC_ARG_ENABLE([debug],
139 [AC_HELP_STRING([--enable-debug],
140 [build with debugging information (default NO)])],
141 [], [enable_debug=no])
142
143 AC_MSG_CHECKING([build mode])
144 AS_IF([test $enable_debug = yes], [build_mode=debug], [build_mode=optimize])
145 AC_MSG_RESULT([$build_mode])
146
147
148
149 CFLAGS="$ARCH_SPECIFIC_CFLAGS $CFLAGS"
150 CXXFLAGS="$ARCH_SPECIFIC_CFLAGS $CXXFLAGS $CFLAGS"
151 #----------------------------------------------------------------------------
152 # Emit generated files.
153 #----------------------------------------------------------------------------
154 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])
155 AC_OUTPUT
156
157 AC_MSG_NOTICE([
158
159 Please type 'make' to build Bullet
160 ])
Something went wrong with that request. Please try again.