[Top][All Lists]

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

Re: Macro for compile, run, and return output

From: Ralf Wildenhues
Subject: Re: Macro for compile, run, and return output
Date: Fri, 14 Jan 2011 07:56:00 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

Hello Lyle,

* Lyle Brooks wrote on Thu, Jan 13, 2011 at 05:51:27PM CET:
> I have been attempting to copy and modify a macro for a
> new library.  I was looking at ax_lib_oracle_oci.m4  and
> ax_lib_xerces.m4 as the basis for a start.
> What I'd like to do is obtain the library version info for
> this new shared library.
> The above macros get the library version info by parsing header
> files.  With the library I am using, the version information is
> obtained via a function call.

That is less ideal for cross-compilation, when you cannot execute code
compiled on the build system.

> Is there a "best practice" way of compiling a short piece of code,
> running it, and then getting the output back into the configure
> variables?

There is the AC_RUN_IFELSE macro which you can use for generally running
programs.  It has an argument you can set which is used for cross
compilation.  Autoconf also has an undocumented macro
  AC_LANG_INT_SAVE([prologue], [expression])

which saves the runtime evaluation of expression into the "conftest.val"
file.  You could at least look at what it does (autoconf/c.m4).

Eric, would it make sense to document the macro?

Hope this helps, Lyle.  If you need more help, show what you tried and
how that works or doesn't work.  (I'm sure others have done this before
too, but I don't have any reference.)


reply via email to

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