[Xastir] cygwin compile problem

Tom Russo russo at bogodyn.org
Mon Dec 18 10:37:05 EST 2006


On Mon, Dec 18, 2006 at 07:16:03AM -0800, we recorded a bogon-computron collision of the <archer at eskimo.com> flavor, containing:
> On Mon, 18 Dec 2006, Curt, WE7U wrote:
> 
> > > Of course, that shouldn't happen if we're doing an AC_CHECK_LIB, which will
> > > attempt a link --- those should catch the missing "dipstick" issue by failing
> > > to link the conftest.  As long as that's what's happening, it's all good.  But
> > > I thought I heard that it was bombing badly.  Perhaps I misread things.
> >
> > Without a system to test on I can't be sure.
> >
> > Looks like we use AC_CHECK_PROG() to find "GraphicsMagick-config".
> > In the following section we use AC_CHECK_HEADERS() and
> > AC_CHECK_LIB(), but only if "darwin" isn't defined.  The comments
> > state that we don't want to use these additional functions on OSX
> > 'cuz the standard macros won't find them.  The GM section is VERY
> > similar to the IM section immediately preceeding it.
> 
> So I see your point Tom...  Is there a way we can use
> AC_CHECK_HEADERS() and AC_CHECK_LIB() against non-standard
> locations?  My Autoconf/automake/libtool book doesn't go into much
> detail on things like this.  Maybe the only way to know for sure is
> to go look at the code for the m4 macros themselves?

Yes.

Have a block early on that adds those non-standard locations to LDFLAGS
and CPPFLAGS, e.g. (fudging on syntax here):

switch ($target)


 *darwin*)
    LDFLAGS="-L/sw/lib $LDFLAGS"
    CPPFLAGS="-I/sw/include $CPPFLAGS"

... etc.

AC_CHECK_HEADERS and AC_CHECK_LIB use LDFLAGS and CPPFLAGS in the compile
and link lines they create, and setting them at the beginning like this takes
care of all the idiosyncrasies once and for all.  We do stuff like this in
the configure script of our project at work.  It makes for a fairly ugly
block of system-dependent crud at the top of the configure.ac file, but really 
saves you a ton of system-dependent crud scattered all over the configure.ac 
file.

Autotools are good for picking up most system details like "does the compiler 
support left-handed ternary operators on user-defined bogons?" but are not
meant for searching the entire system for matching libraries --- which leads
to a real pain when systems come up with their own arbitrary choices for 
where to put things (/opt, /sw/, /whatevertheheck/).  Fortunately, the
macros make consistent use of things like LDFLAGS and CPPFLAGS, so there's
a clean way to force it for specific systems.

> If we could set up some paths before we called the m4 macros it
> might simplify a lot of our configure code.

You betcha.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://kevan.org/brain.cgi?DDTNM
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick



More information about the Xastir mailing list