aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ode-0.9/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ode-0.9/configure.in')
-rw-r--r--libraries/ode-0.9/configure.in580
1 files changed, 580 insertions, 0 deletions
diff --git a/libraries/ode-0.9/configure.in b/libraries/ode-0.9/configure.in
new file mode 100644
index 0000000..96eea67
--- /dev/null
+++ b/libraries/ode-0.9/configure.in
@@ -0,0 +1,580 @@
1dnl Initial configure.in by Rodrigo Hernandez
2dnl Modified in 26/10/2005 by Rodrigo Hernandez
3
4dnl AC_INIT does not take a macro as a version nr: set it separately! - Bram
5AC_INIT(ODE,0.9.0,ode@ode.org)
6
7dnl When upgrading version nr, also change the AC_INIT line! - Bram
8ODE_CURRENT=0
9ODE_REVISION=9
10ODE_AGE=0
11ODE_RELEASE=[$ODE_CURRENT].[$ODE_REVISION].[$ODE_AGE]
12AC_CANONICAL_HOST
13AC_CANONICAL_TARGET
14
15AM_INIT_AUTOMAKE(ODE,[$ODE_RELEASE])
16AM_CONFIG_HEADER(include/ode/config.h)
17dnl Set CFLAGS to zero, so that we avoid getting the gratis -g -O2
18CFLAGS=
19CXXFLAGS=
20AC_C_BIGENDIAN
21AC_PATH_X
22AC_PATH_XTRA
23
24ODE_SONAME=libode.so.[$ODE_CURRENT]
25
26AC_SUBST(ODE_CURRENT)
27AC_SUBST(ODE_REVISION)
28AC_SUBST(ODE_AGE)
29AC_SUBST(ODE_RELEASE)
30AC_SUBST(ODE_SONAME)
31
32dnl This is needed because we have subdirectories
33AC_PROG_MAKE_SET
34
35AC_PROG_CXX
36AC_PROG_INSTALL
37AC_CHECK_TOOLS([WINDRES], [windres])
38AC_C_CONST
39AC_C_INLINE
40AC_C_VOLATILE
41AC_HEADER_STDBOOL
42AC_PROG_RANLIB
43AC_TYPE_SIZE_T
44
45dnl Check if using sonames is requested
46dnl THIS IS TEMPORARY!
47AC_MSG_CHECKING(if a soname should be set)
48AC_ARG_ENABLE(soname,AC_HELP_STRING([--enable-soname],
49[Configure ODE shared library to set the soname field on ELF files]),
50use_soname=$enableval,use_soname=no)
51AC_MSG_RESULT($use_soname)
52AM_CONDITIONAL(USE_SONAME, test x$use_soname = xyes)
53
54
55dnl Check if we want to build demos
56AC_MSG_CHECKING(if tests should be built)
57AC_ARG_ENABLE(demos,AC_HELP_STRING([--enable-demos], [build tests]), enable_demos=$enableval,enable_demos=yes)
58AC_MSG_RESULT($enable_demos)
59AM_CONDITIONAL(ENABLE_DEMOS, test x$enable_demos = xyes)
60
61
62AC_ARG_WITH(arch,AC_HELP_STRING([--with-arch=[arch]],
63[build for $arch, where arch is any of the -march flags passed to gcc, without the -march, for example --with-arch=pentium3]),
64arch=$withval,arch=no)
65ARCHFLAGS=""
66if test "x$arch" != xno
67then
68 ARCHFLAGS="-march=$arch"
69fi
70AC_SUBST(ARCHFLAGS)
71
72dnl Decide whether or not SSE is available
73dnl Why dont we compile and run programs like we do to find out if
74dnl this is a Pentium machine further down? simple!
75dnl this may NOT be the machine on which the code is going to run in,
76dnl so allow users to compile programs for their target machine.
77case "$arch" in
78 pentium3 | pentium4 | athlon* )
79 AC_DEFINE(HAVE_SSE,,[Use SSE Optimizations])
80 ;;
81dnl this space available for other architectures specific extensions and/or
82dnl other Intel based extensions such as 3DNow, SSE2, MMX, etc.
83esac
84
85dnl check for required headers
86AC_CHECK_HEADERS( alloca.h ieeefp.h stdio.h stdlib.h math.h string.h stdarg.h malloc.h values.h float.h time.h sys/time.h )
87
88
89opcode=no
90gimpact=no
91AC_ARG_WITH(trimesh,AC_HELP_STRING([--with-trimesh=[opcode|gimpact|none]],
92[use the specified system for trimesh support.]),
93trimesh=$withval,trimesh=opcode
94)
95if test "$trimesh" = opcode
96then
97 opcode=yes
98fi
99if test "$trimesh" = gimpact
100then
101 gimpact=yes
102fi
103
104AM_CONDITIONAL(OPCODE, test $opcode = yes)
105AM_CONDITIONAL(GIMPACT, test $gimpact = yes)
106AM_CONDITIONAL(TRIMESH, test $opcode = yes -o $gimpact = yes)
107
108
109AC_MSG_CHECKING(if gyroscopic term should be used)
110AC_ARG_ENABLE(gyroscopic,AC_HELP_STRING([--disable-gyroscopic],
111[Configure ODE to work without gyroscopic term (may improve stability)]),
112gyroscopic=$enableval,gyroscopic=yes)
113AC_MSG_RESULT($gyroscopic)
114if test x"$gyroscopic" = xyes
115then
116AC_DEFINE(dGYROSCOPIC,,[Use gyroscopic terms])
117fi
118
119dnl Check Precision, define the dInfinity constant--------------------------/
120AC_MSG_CHECKING(if double precision is requested)
121AC_ARG_ENABLE(double-precision,AC_HELP_STRING([--enable-double-precision],
122[Configure ODE to work with double precision, if not specified, single precision is used]),
123precision=$enableval,precision=no)
124if test "$precision" != no
125then
126dnl DOUBLE was chosen
127AC_DEFINE(dDOUBLE,,[Use double precision])
128dnl Check from lest likelly to more likelly.
129if test "$build_os" == "$target_os"
130then
131AC_TRY_RUN([
132#define dInfinity 1e20
133int main()
134{
135if (dInfinity > 1e10 && -dInfinity < -1e10 && -dInfinity < dInfinity)
136return 0;
137else return -1;
138}
139],dinfinity=1e20,,)
140AC_TRY_RUN([
141#define dInfinity 1.7976931348623157e+308
142int main()
143{
144if (dInfinity > 1e10 && -dInfinity < -1e10 && -dInfinity < dInfinity)
145return 0;
146else return -1;
147}
148],dinfinity=1.7976931348623157e+308,,)
149AC_TRY_RUN([
150#include <float.h>
151#define dInfinity HUGE_VAL
152int main()
153{
154if (dInfinity > 1e10 && -dInfinity < -1e10 && -dInfinity < dInfinity)
155return 0;
156else return -1;
157}
158],dinfinity=HUGE_VAL,,)
159AC_TRY_RUN([
160#include <float.h>
161#define dInfinity DBL_MAX
162int main()
163{
164if (dInfinity > 1e10 && -dInfinity < -1e10 && -dInfinity < dInfinity)
165return 0;
166else return -1;
167}
168],dinfinity=DBL_MAX,,)
169else
170#cross-compiling, use a reasonable value. We should add an option for setting this.
171dinfinity=DBL_MAX
172fi
173else
174dnl default to SINGLE.
175AC_DEFINE(dSINGLE,,[Use single precision])
176dnl Check from lest likelly to more likelly.
177if test "$build_os" == "$target_os"
178then
179AC_TRY_RUN([
180#define dInfinity 1e20f
181int main()
182{
183if (dInfinity > 1e10f && -dInfinity < -1e10f && -dInfinity < dInfinity)
184return 0;
185else return -1;
186}
187],dinfinity=1e20f,,)
188AC_TRY_RUN([
189#define dInfinity 3.402823466e+38F
190int main()
191{
192if (dInfinity > 1e10f && -dInfinity < -1e10f && -dInfinity < dInfinity)
193return 0;
194else return -1;
195}
196],dinfinity=3.402823466e+38F,,)
197AC_TRY_RUN([
198#include <float.h>
199#define dInfinity HUGE_VALF
200int main()
201{
202if (dInfinity > 1e10f && -dInfinity < -1e10f && -dInfinity < dInfinity)
203return 0;
204else return -1;
205}
206],dinfinity=HUGE_VALF,,)
207AC_TRY_RUN([
208#include <float.h>
209#define dInfinity FLT_MAX
210int main()
211{
212if (dInfinity > 1e10f && -dInfinity < -1e10f && -dInfinity < dInfinity)
213return 0;
214else return -1;
215}
216],dinfinity=FLT_MAX,,)
217#cross-compiling, use a reasonable value. We should add an option for setting this.
218dinfinity=FLT_MAX
219fi
220fi
221AC_MSG_RESULT($precision)
222AC_DEFINE_UNQUOTED(dInfinity,${dinfinity},[dInfinity Constant])
223AC_MSG_CHECKING(for appropriate dInfinity constant)
224AC_MSG_RESULT($dinfinity)
225dnl --------------------------------------------------------------------------/
226
227dnl Define dEpsilon
228AC_CHECK_HEADER(float.h,[have_float_h=yes],[have_float_h=no])
229AC_MSG_CHECKING(for appropriate dEpsilon constant)
230if test "x$have_float_h" == xyes
231then
232if test $precision == yes
233then
234dEpsilon=DBL_EPSILON
235else
236dEpsilon=FLT_EPSILON
237fi
238else
239if test $precision == yes
240then
241dEpsilon=2.2204460492503131e-16
242else
243dEpsilon=1.19209290e-07f
244fi
245fi
246AC_DEFINE_UNQUOTED(dEpsilon,${dEpsilon},[dEpsilon Constant])
247AC_MSG_RESULT($dEpsilon)
248
249
250dnl Check for PENTIUM
251if test "$build_os" == "$target_os"
252then
253AC_MSG_CHECKING(for a Pentium CPU)
254AC_TRY_RUN([
255int main()
256{
257asm ("mov \$0,%%eax;\n"
258 "cpuid\n" : : : "%eax");
259return 0;
260};
261],pentium=yes,pentium=no,)
262else
263pentium=no
264fi
265if test "x$pentium" == xyes
266then
267AC_DEFINE(PENTIUM,1,[is this a pentium on a gcc-based platform?])
268fi
269AC_MSG_RESULT($pentium)
270
271dnl Check for 64bit CPU
272AC_MSG_CHECKING(for a x86-64 CPU)
273if test "$build_os" == "$target_os"
274then
275AC_TRY_RUN([
276int main()
277{
278int a = 0;
279int * pa = &a;
280asm ("mov %0,%%rax\n"
281 "movl (%%rax),%%eax\n"
282 : : "r"(pa) : "%rax");
283return 0;
284};
285],cpu64=yes,cpu64=no,)
286else
287cpu64=no
288fi
289if test "x$cpu64" == xyes
290then
291AC_DEFINE(X86_64_SYSTEM,1,[is this a X86_64 system on a gcc-based platform?])
292fi
293AC_MSG_RESULT($cpu64)
294AM_CONDITIONAL(X86_64_SYSTEM, test x$cpu64 = xyes)
295
296AC_MSG_CHECKING(if building a release library)
297AC_ARG_ENABLE(release,AC_HELP_STRING([--enable-release],
298[build a release library with -fomit-frame-pointer and -ffast-math]),
299release=$enableval,release=no)
300if test "x$release" == xyes
301then
302 CFLAGS="$CFLAGS -fomit-frame-pointer -ffast-math"
303 CPPFLAGS="$CPPFLAGS -fomit-frame-pointer -ffast-math"
304 CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -ffast-math"
305 AC_DEFINE(dNODEBUG,,[Disable debug output])
306fi
307AC_MSG_RESULT($release)
308
309AC_MSG_CHECKING(if building a debug library)
310AC_ARG_ENABLE(debug,AC_HELP_STRING([--enable-debug],
311[Add debug symbols to the library with -g]),
312debug=$enableval,debug=yes)
313if test "x$debug" == xyes
314then
315 CFLAGS="$CFLAGS -g"
316 CPPFLAGS="$CPPFLAGS -g"
317 CXXFLAGS="$CXXFLAGS -g"
318fi
319AC_MSG_RESULT($debug)
320
321
322dnl Check variable type sizes
323AC_CHECK_SIZEOF(char)
324AC_CHECK_SIZEOF(int)
325AC_CHECK_SIZEOF(short)
326AC_CHECK_SIZEOF(long int)
327AC_CHECK_SIZEOF(void*)
328
329dnl Set some Platform Specific Variables
330case "$host_os" in
331 cygwin* | mingw*)
332 so_ext=".dll"
333 DLLDEFINE="-DODE_DLL"
334 SHARED_LDFLAGS="-shared"
335 drawstuff="Win32" # if in a Windows enviroment
336 ;;
337 *apple* | *darwin*) # For Mac OS X
338 so_ext=".dylib"
339 DLLDEFINE=""
340 SHARED_LDFLAGS="-dynamiclib"
341 drawstuff="OSX"
342 dnl We need to use C++ compilation and linking for ode on Mac
343 dnl Might as well do it for all code.
344 CC="$CXX"
345 LINK="$CXXLINK"
346 ;;
347 *)
348 drawstuff="X11" # if anything else default to X11
349 if test x$use_soname = xyes; then
350 so_ext=".so.$ODE_RELEASE"
351 else
352 so_ext=".so"
353 fi
354 DLLDEFINE=""
355 SHARED_LDFLAGS="-shared"
356 ;;
357esac
358dnl Set Conditionals
359AM_CONDITIONAL(WIN32, test x$drawstuff = xWin32)
360AM_CONDITIONAL(X11, test x$drawstuff = xX11)
361AM_CONDITIONAL(OSX, test x$drawstuff = xOSX)
362dnl Set Drawstuff variables
363AC_MSG_CHECKING(which drawstuff lib to build)
364AC_MSG_RESULT($drawstuff)
365AC_SUBST(DRAWSTUFF)
366dnl Set shared library variables
367AC_MSG_CHECKING(for the suffix of shared libraries)
368AC_MSG_RESULT($so_ext)
369AC_DEFINE_UNQUOTED(SO_EXT,"$so_ext",[The extension for shared libraries.])
370AC_SUBST(so_ext)
371AC_SUBST(SHARED_LDFLAGS)
372
373dnl Check for AC_PATH_X variables
374if test "X$x_includes" != "XNONE"; then
375 CFLAGS="$CFLAGS -I$x_includes"
376 CXXFLAGS="$CXXFLAGS -I$x_includes"
377fi
378if test "X$x_libraries" != "XNONE"; then
379 CFLAGS="$CFLAGS -L$x_libraries"
380 CXXFLAGS="$CXXFLAGS -L$x_libraries"
381fi
382
383dnl Check for OpenGL
384if test "x$drawstuff" = "xOSX"; then
385 AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1],
386 [Use the Apple OpenGL framework.])
387 GL_LIBS="-framework OpenGL -framework Carbon -framework AGL"
388else
389 AC_CHECK_HEADERS(GL/gl.h GL/glu.h GL/glext.h,,,
390 [[#if HAVE_GL_GL_H
391 #include <GL/gl.h>
392 #endif
393 #if HAVE_GL_GLU_H
394 #include <GL/glu.h>
395 #endif
396 ]])
397 AC_CHECK_LIB(GL, main,[GL_LIBS="$GL_LIBS -lGL"])
398 TEMP_LDFLAGS="$LDFLAGS"
399 LDFLAGS="$LDFLAGS $GL_LIBS"
400 AC_CHECK_LIB(GLU, main,[GL_LIBS="$GL_LIBS -lGLU"])
401 LDFLAGS="$TEMP_LDFLAGS"
402 AC_CHECK_LIB(opengl32, main,[GL_LIBS="$GL_LIBS -lopengl32"])
403 AC_CHECK_LIB(glu32, main,[GL_LIBS="$GL_LIBS -lglu32"])
404 AC_CHECK_LIB(Xmu, main,[GL_LIBS="$GL_LIBS -lXmu"])
405 AC_CHECK_LIB(Xi, main,[GL_LIBS="$GL_LIBS -lXi"])
406 AC_CHECK_LIB(X, main,[GL_LIBS="$GL_LIBS -lX"])
407 AC_CHECK_LIB(X11, main,[GL_LIBS="$GL_LIBS -lX11"])
408fi
409AC_SUBST(GL_LIBS)
410
411dnl Add some Windows libraries if found
412AC_CHECK_LIB(comctl32,main,[LIBS="$LIBS -lcomctl32"])
413AC_CHECK_LIB(kernel32,main,[LIBS="$LIBS -lkernel32"])
414AC_CHECK_LIB(user32,main,[LIBS="$LIBS -luser32"])
415AC_CHECK_LIB(gdi32,main,[LIBS="$LIBS -lgdi32"])
416AC_CHECK_LIB(winmm,main,[LIBS="$LIBS -lwinmm"])
417
418dnl Add math and standard c++ lib just in case
419AC_CHECK_LIB(stdc++,main,[LIBS="$LIBS -lstdc++"])
420AC_CHECK_LIB(m,main,[LIBS="$LIBS -lm"])
421AC_CHECK_LIB(pthread,main,[LIBS="$LIBS -lpthread"])
422
423
424TOPDIR=`cd $srcdir;pwd`
425AC_SUBST(TOPDIR)
426
427dnl Check if the user wants to profile ODE using gprof
428AC_MSG_CHECKING(for gprof)
429AC_ARG_ENABLE(gprof,
430AC_HELP_STRING([--enable-gprof],[enable profiling with gprof]),
431gprof=$enableval,gprof=no)
432if test "$gprof" != no
433then
434 CFLAGS="-pg $CFLAGS"
435 CPPFLAGS="-pg $CPPFLAGS"
436 CXXFLAGS="-pg $CXXFLAGS"
437 AC_CHECK_LIB(gmon, main,[LIBS="$LIBS -lgmon"])
438 AC_MSG_RESULT(enabled)
439else
440 AC_MSG_RESULT(no)
441fi
442
443dnl Check for autoscan sugested functions
444AC_CHECK_FUNCS([floor memmove memset select sqrt sqrtf sinf cosf fabsf atan2f fmodf copysignf copysign snprintf vsnprintf gettimeofday isnan isnanf _isnan _isnanf __isnan __isnanf])
445if test "$build_os" == "$target_os"
446then
447AC_FUNC_ALLOCA
448AC_FUNC_MALLOC
449AC_FUNC_OBSTACK
450AC_FUNC_REALLOC
451AC_FUNC_SELECT_ARGTYPES
452AC_FUNC_VPRINTF
453fi
454
455dnl include found system headers into config.h
456AH_TOP([
457#ifndef ODE_CONFIG_H
458#define ODE_CONFIG_H
459])
460AH_BOTTOM([
461
462#ifdef HAVE_ALLOCA_H
463#include <alloca.h>
464#endif
465#if defined(HAVE_IEEEFP_H) && !defined(__CYGWIN__)
466// This header creates conflicts with math.h in Cygwin.
467#include <ieeefp.h>
468#endif
469#ifdef HAVE_STDIO_H
470#include <stdio.h>
471#endif
472#ifdef HAVE_STDLIB_H
473#include <stdlib.h>
474#endif
475#ifdef HAVE_MATH_H
476#include <math.h>
477#endif
478#ifdef HAVE_STRING_H
479#include <string.h>
480#endif
481#ifdef HAVE_STDARG_H
482#include <stdarg.h>
483#endif
484#ifdef HAVE_MALLOC_H
485#include <malloc.h>
486#endif
487#ifdef HAVE_VALUES_H
488#include <values.h>
489#endif
490#ifdef HAVE_FLOAT_H
491#include <float.h>
492#endif
493#if SIZEOF_CHAR == 1
494typedef char int8;
495typedef unsigned char uint8;
496#else
497#error "expecting sizeof(char) == 1"
498#endif
499#if SIZEOF_SHORT == 2
500typedef short int16;
501typedef unsigned short uint16;
502#else
503#error "can not find 2 byte integer type"
504#endif
505/* integer types (we assume int >= 32 bits) */
506#if SIZEOF_INT == 4
507typedef short int32;
508typedef unsigned short uint32;
509#else
510#error "can not find 4 byte integer type"
511#endif
512/* an integer type that we can safely cast a pointer to and
513 * from without loss of bits.
514 */
515#if SIZEOF_SHORT == SIZEOF_VOIDP
516typedef unsigned short intP;
517#elif SIZEOF_INT == SIZEOF_VOIDP
518typedef unsigned int intP;
519#elif SIZEOF_LONG_INT == SIZEOF_VOIDP
520typedef unsigned long int intP;
521#endif
522
523/*
524Handle Windows DLL odities
525Its easier to export all symbols using the -shared flag
526for MinGW than differentiating with declspec,
527so only do it for MSVC
528*/
529#if defined(ODE_DLL) && defined(WIN32) && defined(_MSC_VER)
530#define ODE_API __declspec( dllexport )
531#elif !defined(ODE_DLL) && defined(WIN32) && defined(MSC_VER)
532#define ODE_API __declspec( dllimport )
533#else
534#define ODE_API
535#endif
536
537#endif /* #define ODE_CONFIG_H */
538])
539
540
541dnl Finally write our Makefiles
542AC_OUTPUT([
543 Makefile
544 include/Makefile
545 include/ode/Makefile
546 ode/Makefile
547 ode/src/Makefile
548 drawstuff/Makefile
549 drawstuff/src/Makefile
550 drawstuff/dstest/Makefile
551 ode/demo/Makefile
552 tests/Makefile
553 tests/CppTestHarness/Makefile
554 ode-config
555 ])
556
557chmod +x ode-config
558
559dnl Print some useful information
560echo "Configuration:"
561echo " Target system type: $target"
562echo " Build system type: $build"
563echo " Host system type: $host"
564echo " Use double precision: $precision"
565echo " Use OPCODE: $opcode"
566echo " Use GIMPACT: $gimpact"
567echo " Use gyroscopic term: $gyroscopic"
568echo " Is this a Pentium: $pentium"
569echo " Is the CPU x86-64: $cpu64"
570echo " Is this a release build: $release"
571echo " Adding debug symbols: $debug"
572echo " Using SONAME: $use_soname"
573echo " Headers will be installed in $prefix/include/ode"
574echo " Libraries will be installed in $prefix/lib"
575
576if test $gimpact = yes -a $precision = yes
577then
578 echo "WARNING! Double precision not yet supported for GIMPACT"
579fi
580