configure.ac 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. dnl AC_INIT does not take a macro as a version nr: set it separately! - Bram
  2. AC_INIT([ODE],[0.16],[[email protected]])
  3. ODE_VERSION=0.16
  4. AC_SUBST(ODE_VERSION)
  5. # Those are instructions from the Libtool manual:
  6. # 1. Start with version information of `0:0:0' for each libtool library.
  7. #
  8. # 2. Update the version information only immediately before a public
  9. # release of your software. More frequent updates are unnecessary,
  10. # and only guarantee that the current interface number gets larger
  11. # faster.
  12. #
  13. # 3. If the library source code has changed at all since the last
  14. # update, then increment REVISION (`C:R:A' becomes `C:r+1:A').
  15. #
  16. # 4. If any interfaces have been added, removed, or changed since the
  17. # last update, increment CURRENT, and set REVISION to 0.
  18. #
  19. # 5. If any interfaces have been added since the last public release,
  20. # then increment AGE.
  21. #
  22. # 6. If any interfaces have been removed since the last public release,
  23. # then set AGE to 0.
  24. CURRENT=8
  25. REVISION=0
  26. AGE=0
  27. AC_ARG_ENABLE(version-info,
  28. AS_HELP_STRING([--disable-version-info],
  29. [don't encode version information in the generated library]),
  30. version_info=$enableval,
  31. version_info=yes)
  32. if test x$version_info = xyes
  33. then
  34. ODE_VERSION_INFO="-version-info $CURRENT:$REVISION:$AGE"
  35. else
  36. ODE_VERSION_INFO="-avoid-version"
  37. fi
  38. AC_SUBST(ODE_VERSION_INFO)
  39. AC_CONFIG_SRCDIR([ode/src/ode.cpp])
  40. AC_CONFIG_MACRO_DIR([m4])
  41. AC_CANONICAL_HOST
  42. AM_INIT_AUTOMAKE([1.10 foreign])
  43. AC_CONFIG_HEADERS([ode/src/config.h])
  44. dnl This is needed because we have subdirectories
  45. AC_PROG_MAKE_SET
  46. AC_PROG_CXX
  47. AC_PROG_CC
  48. AM_PROG_CC_C_O
  49. AC_PROG_CPP
  50. AC_PROG_AWK
  51. AC_PROG_INSTALL
  52. AC_PROG_LN_S
  53. AC_PROG_MKDIR_P
  54. LT_INIT([disable-shared win32-dll])
  55. AC_CHECK_TOOLS([WINDRES], [windres])
  56. AC_C_BIGENDIAN
  57. AC_C_INLINE
  58. AC_C_VOLATILE
  59. PKG_PROG_PKG_CONFIG
  60. AC_ARG_VAR([DOXYGEN], [set to doxygen binary to generate doxygen docs])
  61. AC_CHECK_PROGS([DOXYGEN], [doxygen])
  62. AM_CONDITIONAL([HAVE_DOXYGEN], [test x$DOXYGEN = xdoxygen])
  63. dnl this may NOT be the machine on which the code is going to run in,
  64. dnl so allow users to compile programs for their target machine.
  65. pentium=no
  66. cpu64=no
  67. case "$host_cpu" in
  68. i586 | i686 | i786 )
  69. pentium=yes
  70. AC_DEFINE(PENTIUM,1,[compiling for a pentium on a gcc-based platform?])
  71. ;;
  72. x86_64* )
  73. pentium=yes
  74. cpu64=yes
  75. AC_DEFINE(X86_64_SYSTEM,1,[compiling for a X86_64 system on a gcc-based platform?])
  76. ;;
  77. esac
  78. AM_CONDITIONAL(X86_64_SYSTEM, test x$cpu64 = xyes)
  79. dnl check for required headers
  80. AC_CHECK_HEADERS( [alloca.h stdio.h inttypes.h stdint.h stdlib.h math.h \
  81. string.h stdarg.h malloc.h float.h time.h sys/time.h \
  82. limits.h stddef.h])
  83. opcode=no
  84. gimpact=no
  85. AC_ARG_WITH(trimesh, AS_HELP_STRING([--with-trimesh=@<:@opcode|gimpact|none@:>@],
  86. [use the specified system for trimesh support @<:@default=opcode@:>@]),
  87. trimesh=$withval,trimesh=opcode
  88. )
  89. if test "$trimesh" = opcode
  90. then
  91. opcode=yes
  92. fi
  93. if test "$trimesh" = gimpact
  94. then
  95. gimpact=yes
  96. fi
  97. AM_CONDITIONAL(OPCODE, test $opcode = yes)
  98. AM_CONDITIONAL(GIMPACT, test $gimpact = yes)
  99. AM_CONDITIONAL(TRIMESH, test $opcode = yes -o $gimpact = yes)
  100. AC_MSG_CHECKING(if double precision is requested)
  101. AC_ARG_ENABLE(double-precision,
  102. AS_HELP_STRING([--enable-double-precision],
  103. [Configure ODE to work with double precision, if not specified, single precision is used @<:@default=no@:>@]),
  104. usedouble=$enableval,usedouble=no)
  105. AC_MSG_RESULT([$usedouble])
  106. if test "$usedouble" = yes;
  107. then
  108. ODE_PRECISION=dDOUBLE
  109. else
  110. ODE_PRECISION=dSINGLE
  111. fi
  112. AC_SUBST(ODE_PRECISION)
  113. AC_ARG_WITH([drawstuff],
  114. AS_HELP_STRING([--with-drawstuff=X11|Win32|OSX|none],
  115. [force a particular drawstuff implementation or disable it.[default=autodetect]]),
  116. [drawstuff=$withval],[drawstuff=])
  117. dnl Set some Platform Specific Variables
  118. EXTRA_LIBTOOL_LDFLAGS=
  119. case "$host_os" in
  120. cygwin* | mingw*)
  121. if test "x$drawstuff" = x
  122. then
  123. drawstuff="Win32" # if in a Windows enviroment
  124. fi
  125. EXTRA_LIBTOOL_LDFLAGS="-no-undefined"
  126. ;;
  127. *apple* | *darwin*) # For Mac OS X
  128. if test "x$drawstuff" = x
  129. then
  130. drawstuff="OSX"
  131. fi
  132. dnl We need to use C++ compilation and linking for ode on Mac
  133. dnl Might as well do it for all code.
  134. CC="$CXX"
  135. LINK="$CXXLINK"
  136. ;;
  137. *)
  138. if test "x$drawstuff" = x
  139. then
  140. drawstuff="X11" # if anything else default to X11
  141. fi
  142. ;;
  143. esac
  144. AC_SUBST(EXTRA_LIBTOOL_LDFLAGS)
  145. dnl Set Drawstuff variables
  146. AC_MSG_CHECKING([which drawstuff lib to build])
  147. AC_MSG_RESULT($drawstuff)
  148. if test "x$drawstuff" = "xX11"
  149. then
  150. # The built-in macro, X_PATH, causes too many problems, these days everyone uses Xorg,
  151. # so we can ask pkg-config to find it for us.
  152. PKG_CHECK_MODULES(X11, x11, [], [drawstuff="none"])
  153. fi
  154. dnl Check for OpenGL
  155. if test "x$drawstuff" = "xOSX"; then
  156. AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1],
  157. [Use the Apple OpenGL framework.])
  158. GL_LIBS="-framework OpenGL -framework GLUT"
  159. elif test "x$drawstuff" != "xnone"; then
  160. have_gl_headers=yes
  161. AC_CHECK_HEADERS(GL/gl.h GL/glu.h GL/glext.h, ,
  162. [have_gl_headers=no],
  163. [[#ifdef WIN32
  164. #include <windows.h>
  165. #endif
  166. #if HAVE_GL_GL_H
  167. #include <GL/gl.h>
  168. #endif
  169. #if HAVE_GL_GLU_H
  170. #include <GL/glu.h>
  171. #endif
  172. ]])
  173. have_gl=no
  174. have_glu=no
  175. TEMP_LDFLAGS="$LDFLAGS"
  176. AC_CHECK_LIB(GL, main, [GL_LIBS="-lGL"; have_gl=yes])
  177. AC_CHECK_LIB(GLU, main, [GL_LIBS="-lGLU $GL_LIBS"; have_glu=yes], , -lGL)
  178. AC_CHECK_LIB(opengl32, main, [GL_LIBS="-lopengl32"; have_gl=yes])
  179. AC_CHECK_LIB(glu32, main, [GL_LIBS="-lglu32 $GL_LIBS"; have_glu=yes], , -lopengl32)
  180. LDFLAGS="$TEMP_LDFLAGS"
  181. if test $have_gl = no -o $have_glu = no -o $have_gl_headers = no; then
  182. drawstuff="none"
  183. fi
  184. fi
  185. AC_SUBST(GL_LIBS)
  186. dnl Set Conditionals
  187. AM_CONDITIONAL(WIN32, test x$drawstuff = xWin32)
  188. AM_CONDITIONAL(X11, test x$drawstuff = xX11)
  189. AM_CONDITIONAL(OSX, test x$drawstuff = xOSX)
  190. AM_CONDITIONAL(ENABLE_DRAWSTUFF, test x$drawstuff != xnone)
  191. dnl Check if we want to build demos
  192. AC_MSG_CHECKING(if demos should be built)
  193. AC_ARG_ENABLE(demos,
  194. AS_HELP_STRING([--disable-demos], [don't build demos]),
  195. enable_demos=$enableval,enable_demos=yes)
  196. if test x$drawstuff = xnone -a x$enable_demos = xyes ; then
  197. enable_demos=no
  198. AC_MSG_RESULT($enable_demos)
  199. AC_MSG_WARN([Demos will not be built because OpenGL doesn't seem to work. See `config.log' for details.])
  200. else
  201. AC_MSG_RESULT($enable_demos)
  202. fi
  203. dnl stdc++ is required when linking C programs against ode
  204. AC_CHECK_LIB(stdc++,main,[LIBSTDCXX="-lstdc++"],[LIBSTDCXX=])
  205. AC_SUBST(LIBSTDCXX)
  206. AC_CHECK_LIB(pthread,main,[LIBS="$LIBS -lpthread"])
  207. dnl test if we will build demos
  208. AM_CONDITIONAL(ENABLE_DEMOS, test x$enable_demos = xyes)
  209. dnl Check if the user wants the old timesh collider
  210. old_trimesh=no
  211. AC_ARG_ENABLE([old-trimesh], AS_HELP_STRING([--enable-old-trimesh],[enable use of the old trimesh collider]),
  212. [old_trimesh=$enableval]
  213. )
  214. if test x$old_trimesh = xyes -a $trimesh = opcode; then
  215. AC_DEFINE(dTRIMESH_OPCODE_USE_OLD_TRIMESH_TRIMESH_COLLIDER, 1,
  216. [Use the old trimesh-trimesh collider])
  217. else
  218. old_trimesh=no
  219. fi
  220. dnl Check if the user wants to profile ODE using gprof
  221. AC_MSG_CHECKING(for gprof)
  222. AC_ARG_ENABLE([gprof],
  223. AS_HELP_STRING([--enable-gprof],[enable profiling with gprof]),
  224. gprof=$enableval,
  225. gprof=no)
  226. if test "$gprof" != no
  227. then
  228. CFLAGS="-pg $CFLAGS"
  229. CXXFLAGS="-pg $CXXFLAGS"
  230. AC_MSG_RESULT(enabled)
  231. AC_CHECK_LIB(gmon, main,[LIBS="$LIBS -lgmon"])
  232. else
  233. AC_MSG_RESULT(no)
  234. fi
  235. AC_ARG_ENABLE([sse2],
  236. AS_HELP_STRING([--disable-sse2],
  237. [disable generating SSE2 code on x86 in favor of FPU]
  238. ),
  239. sse2=$enableval,sse2=yes)
  240. fpuarch_flags=
  241. if test x$pentium=xyes -a x$cpu64=xno
  242. then
  243. if test x$sse2=xyes
  244. then
  245. fpuarch_flags="-mmmx -msse -msse2 -mfpmath=sse -mstackrealign"
  246. fi
  247. else
  248. sse2=
  249. fi
  250. CFLAGS="$fpuarch_flags $CFLAGS"
  251. CXXFLAGS="$fpuarch_flags $CXXFLAGS"
  252. # Checks for typedefs, structures, and compiler characteristics.
  253. AC_HEADER_STDBOOL
  254. AC_C_INLINE
  255. AC_TYPE_INT32_T
  256. AC_FUNC_OBSTACK
  257. AC_TYPE_SIZE_T
  258. AC_TYPE_UINT32_T
  259. dnl Check for autoscan sugested functions
  260. AC_CHECK_LIB(m, [main])
  261. AC_CHECK_LIB(sunmath, [main])
  262. AC_CHECK_LIB(rt, [main])
  263. AC_CHECK_FUNCS([atan2f clock_gettime copysign copysignf cosf fabsf floor fmodf gettimeofday isnan _isnan __isnan isnanf _isnanf __isnanf memmove memset pthread_attr_setstacklazy pthread_attr_setinheritsched pthread_condattr_setclock sinf snprintf sqrt sqrtf strchr strstr vsnprintf])
  264. AC_FUNC_ALLOCA
  265. dnl This trick allows having additional define in case if a function is not found.
  266. dnl It fakes cached value for an inexistent function which is then used to fool function check to produce desired result.
  267. AC_CHECK_FUNC(pthread_condattr_setclock,,ac_cv_func_no_pthread_condattr_setclock=yes)
  268. AC_CHECK_FUNCS(no_pthread_condattr_setclock)
  269. AC_ARG_ENABLE([threading-intf],
  270. AS_HELP_STRING([--disable-threading-intf],
  271. [disable threading interface support (external implementations cannot be assigned)]
  272. ),
  273. threading_intf=$enableval,threading_intf=yes)
  274. AC_ARG_ENABLE([ou],
  275. AS_HELP_STRING([--enable-ou],
  276. [use TLS for global caches (allows threaded collision checks for isolated spaces)]
  277. ),
  278. use_ou_tls=$enableval,use_ou_tls=no)
  279. use_ou="no"
  280. if test x$use_ou_tls = xyes -o x$threading_intf = xyes
  281. then
  282. use_ou="yes"
  283. fi
  284. OU_NAMESPACE=odeou
  285. AC_CONFIG_COMMANDS_POST([export OU_NAMESPACE=$OU_NAMESPACE])
  286. AC_DEFINE([_OU_NAMESPACE],[odeou],[libou namespace for ODE])
  287. AC_DEFINE([dOU_ENABLED],[1],[Generic OU features are enabled])
  288. if test x$use_ou_tls = xyes
  289. then
  290. OU_FEATURE_SET=_OU_FEATURE_SET_TLS
  291. AC_DEFINE([_OU_FEATURE_SET],[_OU_FEATURE_SET_TLS],[OU features enabled])
  292. elif test x$use_ou = xyes
  293. then
  294. OU_FEATURE_SET=_OU_FEATURE_SET_ATOMICS
  295. AC_DEFINE([_OU_FEATURE_SET],[_OU_FEATURE_SET_ATOMICS],[OU features enabled])
  296. else
  297. OU_FEATURE_SET=_OU_FEATURE_SET_BASICS
  298. AC_DEFINE([_OU_FEATURE_SET],[_OU_FEATURE_SET_BASICS],[OU features enabled])
  299. fi
  300. AC_CONFIG_COMMANDS_POST([export OU_FEATURE_SET=$OU_FEATURE_SET])
  301. if test x$use_ou = xyes
  302. then
  303. AC_DEFINE([dATOMICS_ENABLED],[1],[Atomic API of OU is enabled])
  304. if test x$use_ou_tls = xyes
  305. then
  306. AC_DEFINE([dTLS_ENABLED],[1],[Thread Local Storage API of OU is enabled])
  307. fi
  308. fi
  309. case "$host_os" in
  310. cygwin* | mingw*)
  311. targetos=_OU_TARGET_OS_WINDOWS
  312. ;;
  313. *qnx*)
  314. targetos=_OU_TARGET_OS_QNX
  315. ;;
  316. *apple* | *darwin*)
  317. targetos=_OU_TARGET_OS_MAC
  318. ;;
  319. *sunos*)
  320. targetos=_OU_TARGET_OS_SUNOS
  321. ;;
  322. *aix*)
  323. targetos=_OU_TARGET_OS_AIX
  324. ;;
  325. *)
  326. targetos=_OU_TARGET_OS_GENUNIX
  327. ;;
  328. esac
  329. if test $targetos = _OU_TARGET_OS_MAC
  330. then
  331. MAC_OS_X_VERSION=1000
  332. AC_CHECK_FUNC([OSAtomicAdd32Barrier], [MAC_OS_X_VERSION=1040])
  333. AC_CHECK_FUNC([OSAtomicAnd32OrigBarrier], [MAC_OS_X_VERSION=1050])
  334. AC_DEFINE_UNQUOTED(MAC_OS_X_VERSION, $MAC_OS_X_VERSION, [Mac OS X version setting for OU Library])
  335. fi
  336. if test $targetos = _OU_TARGET_OS_SUNOS
  337. then
  338. AC_CHECK_FUNC(atomic_inc_32_nv, [],
  339. [targetos=_OU_TARGET_OS_GENUNIX])
  340. fi
  341. AC_DEFINE_UNQUOTED(_OU_TARGET_OS, $targetos, [Target OS setting for OU Library])
  342. AC_CONFIG_SUBDIRS([ou])
  343. AM_CONDITIONAL(ENABLE_OU, true)
  344. if test x$threading_intf = xyes
  345. then
  346. AC_ARG_ENABLE([builtin-threading-impl],
  347. AS_HELP_STRING([--disable-builtin-threading-impl],
  348. [disable built-in multithreaded threading implementation]
  349. ),
  350. use_builtin_threading_impl=$enableval,use_builtin_threading_impl=yes)
  351. if test x$use_builtin_threading_impl = xyes
  352. then
  353. AC_DEFINE([dBUILTIN_THREADING_IMPL_ENABLED],[1],[Built-in multithreaded threading implementation is included])
  354. fi
  355. else
  356. AC_DEFINE([dTHREADING_INTF_DISABLED],[1],[Threading interface is disabled])
  357. use_builtin_threading_impl=no
  358. fi
  359. col_cylinder_cylinder=none
  360. col_box_cylinder=default
  361. col_capsule_cylinder=none
  362. col_convex_box=none
  363. col_convex_capsule=none
  364. col_convex_cylinder=none
  365. col_convex_sphere=default
  366. col_convex_convex=default
  367. use_libccd=no
  368. libccd_all=no
  369. AC_ARG_ENABLE(libccd, AS_HELP_STRING([--enable-libccd],
  370. [enable all libccd colliders (except box-cylinder)]),
  371. libccd_all=$enableval)
  372. if test x$libccd_all = xyes
  373. then
  374. col_cylinder_cylinder=libccd
  375. col_capsule_cylinder=libccd
  376. col_convex_box=libccd
  377. col_convex_capsule=libccd
  378. col_convex_cylinder=libccd
  379. col_convex_sphere=libccd
  380. col_convex_convex=libccd
  381. use_libccd=yes
  382. fi
  383. AC_ARG_WITH([cylinder-cylinder], AS_HELP_STRING([--with-cylinder-cylinder=@<:@none,libccd@:>@], [use specific collider for cylinder-cylinder]),
  384. col_cylinder_cylinder=$withval)
  385. AC_ARG_WITH([box-cylinder],
  386. AS_HELP_STRING([--with-box-cylinder=@<:@default,libccd@:>@], [use specific collider for box-cylinder]),
  387. col_box_cylinder=$withval)
  388. AC_ARG_WITH([capsule-cylinder], AS_HELP_STRING([--with-capsule-cylinder=@<:@none,libccd@:>@], [use specific collider for capsule-cylinder]),
  389. col_capsule_cylinder=$withval)
  390. AC_ARG_WITH([convex-box], AS_HELP_STRING([--with-convex-box=@<:@none,libccd@:>@], [use specific collider for convex-box]),
  391. col_convex_box=$withval)
  392. AC_ARG_WITH([convex-capsule], AS_HELP_STRING([--with-convex-capsule=@<:@none,libccd@:>@], [use specific collider for convex-capsule]),
  393. col_convex_capsule=$withval)
  394. AC_ARG_WITH([convex-cylinder], AS_HELP_STRING([--with-convex-cylinder=@<:@none,libccd@:>@], [use specific collider for convex-cylinder]),
  395. col_convex_cylinder=$withval)
  396. AC_ARG_WITH([convex-sphere], AS_HELP_STRING([--with-convex-sphere=@<:@default,libccd@:>@], [use specific collider for convex-sphere]),
  397. col_convex_sphere=$withval)
  398. AC_ARG_WITH([convex-convex], AS_HELP_STRING([--with-convex-convex=@<:@default,libccd@:>@], [use specific collider for convex-convex]),
  399. col_convex_convex=$withval)
  400. if test x$col_cylinder_cylinder = xlibccd -o \
  401. x$col_box_cylinder = xlibccd -o \
  402. x$col_capsule_cylinder = xlibccd -o \
  403. x$col_convex_box = xlibccd -o \
  404. x$col_convex_capsule = libccd -o \
  405. x$col_convex_cylinder = xlibccd -o \
  406. x$col_convex_sphere = libccd -o \
  407. x$col_convex_convex = libccd
  408. then
  409. use_libccd=yes
  410. fi
  411. libccd_source=internal
  412. AC_ARG_WITH(libccd,
  413. [AS_HELP_STRING([--with-libccd=@<:@internal|system@:>@],
  414. [use the specified libccd @<:@default=system@:>@])],
  415. [libccd_source=$withval],
  416. [libccd_source=system])
  417. if test x$use_libccd = xyes
  418. then
  419. if test x$libccd_source = xsystem
  420. then
  421. PKG_CHECK_MODULES(CCD, ccd, ,[libccd_source=internal])
  422. fi
  423. fi
  424. CCD_FPUARCH_FLAGS="$fpuarch_flags"
  425. AC_CONFIG_COMMANDS_POST([export CCD_FPUARCH_FLAGS="$CCD_FPUARCH_FLAGS"])
  426. # Configure libccd unconditionally as that may be needed for special make targets
  427. AC_CONFIG_SUBDIRS([libccd])
  428. AM_CONDITIONAL(LIBCCD, test x$use_libccd != xno)
  429. AM_CONDITIONAL(LIBCCD_INTERNAL, test x$libccd_source = xinternal)
  430. AM_CONDITIONAL(LIBCCD_BOX_CYL, test x$col_box_cylinder = xlibccd)
  431. AM_CONDITIONAL(LIBCCD_CYL_CYL, test x$col_cylinder_cylinder = xlibccd)
  432. AM_CONDITIONAL(LIBCCD_CAP_CYL, test x$col_capsule_cylinder = xlibccd)
  433. AM_CONDITIONAL(LIBCCD_CONVEX_BOX, test x$col_convex_box = xlibccd)
  434. AM_CONDITIONAL(LIBCCD_CONVEX_CAP, test x$col_convex_capsule = xlibccd)
  435. AM_CONDITIONAL(LIBCCD_CONVEX_CYL, test x$col_convex_cylinder = xlibccd)
  436. AM_CONDITIONAL(LIBCCD_CONVEX_SPHERE, test x$col_convex_sphere = xlibccd)
  437. AM_CONDITIONAL(LIBCCD_CONVEX_CONVEX, test x$col_convex_convex = xlibccd)
  438. AC_ARG_ENABLE([asserts],
  439. AS_HELP_STRING([--disable-asserts],
  440. [disables debug error checking]),
  441. asserts=$enableval,asserts=yes)
  442. if test x$asserts = xno
  443. then
  444. CPPFLAGS="$CPPFLAGS -DdNODEBUG -DNDEBUG"
  445. fi
  446. dnl include found system headers into config.h
  447. AH_TOP([
  448. #ifndef ODE_CONFIG_H
  449. #define ODE_CONFIG_H
  450. ])
  451. AH_BOTTOM([
  452. #ifdef HAVE_ALLOCA_H
  453. #include <alloca.h>
  454. #endif
  455. #ifdef HAVE_MALLOC_H
  456. #include <malloc.h>
  457. #endif
  458. #ifdef HAVE_STDINT_H
  459. #include <stdint.h>
  460. #endif
  461. #ifdef HAVE_INTTYPES_H
  462. #include <inttypes.h>
  463. #endif
  464. #include "typedefs.h"
  465. #endif /* #define ODE_CONFIG_H */
  466. ])
  467. dnl Finally write our Makefiles
  468. AC_CONFIG_FILES([
  469. Makefile
  470. drawstuff/Makefile
  471. drawstuff/src/Makefile
  472. drawstuff/dstest/Makefile
  473. include/Makefile
  474. include/drawstuff/Makefile
  475. include/ode/Makefile
  476. include/ode/version.h
  477. include/ode/precision.h
  478. ode/Makefile
  479. ode/doc/Doxyfile
  480. ode/doc/Makefile
  481. ode/src/Makefile
  482. ode/src/joints/Makefile
  483. ode/demo/Makefile
  484. OPCODE/Makefile
  485. OPCODE/Ice/Makefile
  486. GIMPACT/Makefile
  487. GIMPACT/include/Makefile
  488. GIMPACT/include/GIMPACT/Makefile
  489. GIMPACT/src/Makefile
  490. tests/Makefile
  491. tests/joints/Makefile
  492. tests/UnitTest++/Makefile
  493. tests/UnitTest++/src/Makefile
  494. tests/UnitTest++/src/Posix/Makefile
  495. tests/UnitTest++/src/Win32/Makefile
  496. ode-config
  497. ode.pc
  498. ])
  499. AC_OUTPUT
  500. chmod +x ode-config
  501. BUILDDIR=`pwd`
  502. dnl Print some useful information
  503. echo "Configuration:"
  504. echo " Build system type: $build"
  505. echo " Host system type: $host"
  506. echo " Use double precision: $usedouble"
  507. echo " Use drawstuff: $drawstuff"
  508. echo " Demos enabled: $enable_demos"
  509. echo " Use OPCODE: $opcode"
  510. echo " Use GIMPACT: $gimpact"
  511. echo " Use libccd: $use_libccd"
  512. if test x$use_libccd = xyes
  513. then
  514. echo " libccd source: $libccd_source"
  515. fi
  516. echo " Custom colliders:"
  517. echo " cylinder-cylinder: $col_cylinder_cylinder"
  518. echo " box-cylinder: $col_box_cylinder"
  519. echo " capsule-cylinder: $col_capsule_cylinder"
  520. echo " convex-box: $col_convex_box"
  521. echo " convex-capsule: $col_convex_capsule"
  522. echo " convex-cylinder: $col_convex_cylinder"
  523. echo " convex-sphere: $col_convex_sphere"
  524. echo " convex-convex: $col_convex_convex"
  525. echo " Is target a Pentium: $pentium"
  526. echo " Is target x86-64: $cpu64"
  527. if test x$sse2 != x
  528. then
  529. echo " Is SSE2 code generated: $sse2"
  530. fi
  531. echo " Use old opcode trimesh collider: $old_trimesh"
  532. echo " TLS for global caches: $use_ou_tls"
  533. echo " Threading intf enabled: $threading_intf"
  534. echo " Built-in threading included: $use_builtin_threading_impl"
  535. echo " Enable debug error check: $asserts"
  536. echo " Headers will be installed in $includedir/ode"
  537. echo " Libraries will be installed in $libdir"
  538. echo " Building in directory $BUILDDIR"