From mboxrd@z Thu Jan 1 00:00:00 1970 From: gsl-discuss@lists.thewrittenword.com To: Peter Teuben Cc: gsl-discuss@sourceware.cygnus.com Subject: Re: autoconf usage : -DHAVE_GSL ? Date: Wed, 19 Dec 2001 13:20:00 -0000 Message-id: <20010907233944.A72115@oolong.il.thewrittenword.com> References: X-SW-Source: 2001/msg00477.html On Fri, Sep 07, 2001 at 09:01:31PM -0400, Peter Teuben wrote: > I'd like to have a macro HAVE_GSL, so i can #ifdef my code. I followed some of > the instructions in section 2.4 on automake, and added the gsl.m4 to my > aclocal.m4 and did something like the following in configure.in : > > AM_PATH_GSL(0.9.2, ok=yes, ok=no) > if test "$ok" = "yes"; then > AC_MSG_RESULT(ok, i found GSL) > NEMO_CFLAGS="$NEMO_CFLAGS $GSL_CFLAGS -DHAVE_GSL" > NEMO_LIBS="$NEMO_LIBS $GSL_LIBS" > else > AC_MSG_WARN(could not find GSL library) > fi That's gross. Much better might be: AM_PATH_GSL(0.9.2,[ AC_MSG_RESULT([found GSL]) NEMO_CFLAGS="$NEMO_CFLAGS $GSL_CFLAGS -DHAVE_GSL" NEMO_LIBS="$NEMO_LIBS $GSL_LIBS"],[ AC_MSG_WARN([unable to locate GSL library])]) > My question is about the kludgie looking -DHAVE_GSL. I wanted to use > something like > > > AC_CHECK_LIB(gsl,gsl_version) > > but that fails, gsl_version seems to needs -lgslcblas! (which is actually odd, > if I look at the output of nm..... -static will fix that dependancy, but > AC_CHECK_LIB does not do that) I'd like to know which function/static would be > the one that doesn't need another library. Can that be done with AC_CHECK_LIB? > If so, perhaps this should be added to section 2.4 on the automake macros. Or > perhaps is there a better way to get the HAVE_GSL macro? Then you should do something like: AC_CHECK_LIB(gslcblas, VARIABLE, [ AC_CHECK_LIB(gsl, gsl_version)]) -- albert chin (china@thewrittenword.com)