Re: Automatic dependency checking problems

Bram Moolenaar <[email protected]> Thu, 06 May 2004 22:57:46 +0200
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
Thore Karlsen wrote:

> On Thu, 06 May 2004 20:37:00 +0200, Bram Moolenaar
> <[email protected]> wrote:
> 
> >> I'm having some issues with this.
> >> 
> >> First: I'm running AAP under cygwin, but I'm compiling with MSVC. This
> >> means that gcc can be found, so AAP will default to using that to
> >> generate the dependencies. This doesn't work, for a couple of reasons:
> >> 
> >> 1. gcc doesn't understand the MSVC compiler flags.
> >> 2. The dependency files use .o for object files, not .obj which is the
> >> standard suffix for the windows platform.
> >> 
> >> It would be good if I could tell AAP not to try to use gcc for
> >> dependency checking, regardless of whether it's found or not. There
> >> doesn't seem to be a good way to do this.
> 
> >This is actually mentioned in the default.aap recipe as a todo item.
> >
> >I would think that when $CC is set to use MSVC, the test that gcc exists
> >should fail and Aap will use aap_depend_c() instead.  Why doesn't it
> >work that way?  Is $CC still set to gcc perhaps?
> 
> When I run AAP in cygwin, AAP defaults to using gcc. I have ":usetool
> MSVC" in my recipe. However, the gcccheck action has cc for $CC and gcc
> for $CXX. I assume this is because the value of these variables is
> substituted when the action is parsed, and not when it is actually
> invoked?

No, they are expanded when the action is invoked.

I think the problem simply is that the msvc tool doesn't set $CC or
$CXX.  It only sets $MSVC.

So, should a tool like msvc set $CC and $CXX, so that all places where
they are used will use the selected tools?  I suppose so.

> >The order in which directories are searched for include files is often a
> >cause of trouble.  I think when using a file in double quotes the search
> >always looks in the directory of the source file first.  When using <>
> >that is skipped.  My old K&R C book mentions this.
> >
> >The code apparently uses the current directory instead of the directory
> >of the source file.  I suppose that's wrong.  Please try this patch:
> 
> [...]
> 
> This does appear to have done the trick. I had to trick AAP into
> believing that gcc wasn't present to get it to use aap_depend_c(),
> though.

Setting $CC and $CXX should help:

	CC = cl
	CXX = cl

May need to use _top.CC and _top.CXX when not in the main recipe.

-- 
hundred-and-one symptoms of being an internet addict:
1 49. You find your computer sexier than your girlfriend

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3