Linking against ODE with autoconf

3 views
Skip to first unread message

Sqeaky

unread,
Nov 5, 2009, 12:24:59 AM11/5/09
to ode-users
Is there some easy macro to put in configure.ac to have autoconf/
configure verify the has libode somewhere on it? I have googled quite
a bit and I could not find how to properly include this in my project.

Stephen Sinclair

unread,
Nov 5, 2009, 10:44:54 AM11/5/09
to ode-...@googlegroups.com

I just do this, like any library:

AC_CHECK_LIB(ode, [dBodyCreate], [],
AC_MSG_ERROR([Couldn't find ODE library.]))


Steve

Joseph Toppi

unread,
Nov 5, 2009, 6:20:43 PM11/5/09
to ode-...@googlegroups.com

Thanks, that worked perfectly.
--
- Joe Toppi
(402) 714-7539
top...@gmail.com
http://www.assuredts.com/toppij/

Daniel K. O.

unread,
Nov 7, 2009, 12:30:13 PM11/7/09
to ode-...@googlegroups.com

I would recommend to use the pkg-config macro:

PKG_CHECK_MODULES(ODE, ode)

Then use the variables ODE_CFLAGS and ODE_LIBS in your Makefiles. For
automake, it would be like this:

AM_CPPFLAGS = $(ODE_CFLAGS)
LIBS += $(ODE_LIBS)


You can also indicate which version you require, like:

PKG_CHECK_MODULES(ODE, ode >= 0.11)


BUT if your software depends on specific behaviors (say, a game), you
better distribute the specific version you need with your software. You
never know how somebody else might have built and installed ODE
system-wide. This could be done with AC_CONFIG_SUBDIRS(ode-subdir), for
example.

--
Daniel K. O.
"The only way to succeed is to build success yourself"

Reply all
Reply to author
Forward
0 new messages