autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fwd: Re: Clips with autoconf]


From: Ralf Wildenhues
Subject: Re: [Fwd: Re: Clips with autoconf]
Date: Fri, 27 Apr 2007 00:37:33 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

* Harald Servat wrote on Thu, Apr 12, 2007 at 06:37:00PM CEST:
> > > mac wrote:
> > > > 
> > > > i have this line in a configure.in:
> > > > AC_CHECK_LIB([clips], [Clear])
> 
> > > What does config.log say?
> > 
> > configure:5971: gcc -o conftest -g -O2   conftest.c -lclips  -lm  >&5 
> > /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libclips.so: undefined
> > reference to `EnvUserFunctions'
> > 
> > I think why this check doesnt work, is necessary to define a function
> > called EnvUserFunctions, because is an undefined symbol.
> > 
> > How could i make this check work?
>
>   I would suggest you locate that "EnvUserFunctions" symbol (not
> undefined, a real TEXT or DATA component) and then force CHECK_LIB to
> use the container of this symbol.
> 
>   If EnvUserFunctions is on libblabla.so maybe a hardcoded solution
> would be to set LIBS="-lblabla" before calling AC_CHECK_LIB

Here's a suggestion for a macro to specifically check for the Clips
library.

Hope that helps.

Cheers,
Ralf

# Test for the Clips library, <http://www.ghg.net/clips/CLIPS.html>.
# This library is special in that it requires the user to define some
# symbols needed from within the library.
# If library and header are found, -lClips is added to LIBS.
AC_DEFUN([RW_CHECK_CLIPS_LIB],
[AC_CACHE_CHECK([for Clips library], [rw_cv_clips_lib],
[rw_save_LIBS=$LIBS
LIBS="-lClips $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT[
#ifdef __cplusplus
extern "C"
{
#endif
  #include "clips.h"
  void UserFunctions(void) { }
  void EnvUserFunctions(void *p) { }
#ifdef __cplusplus
}
#endif
]], [[CreateEnvironment();]])],
  [rw_cv_clips_lib=yes], [rw_cv_clips_lib=no])
if test "$rw_cv_clips_lib" != yes; then
  LIBS=$rw_save_LIBS
fi
])])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]