autoconf
[Top][All Lists]
Advanced

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

Re: AC_CONFIG_LINKS and MSVC


From: Noah Misch
Subject: Re: AC_CONFIG_LINKS and MSVC
Date: Fri, 14 Apr 2006 13:49:39 -0700
User-agent: Mutt/1.5.6i

On Fri, Apr 14, 2006 at 10:11:39AM -0700, David Byron wrote:
> I'm having trouble getting autoconf to do what I want when configuring
> under cygwin for cccl/MSVC.  I'm trying to change the behavior of:
> 
> AC_CONFIG_LINKS(dest.h:source.h)
> 
> MSVC doesn't seem to deal with reading through cygwin links, I think
> because the actual filename of the link is dest.h.lnk.  When a C file
> does
> 
> #include <dest.h>
> 
> MSVC doesn't find it.
> 
> So, I want AC_CONFIG_LINKS to make a copy instead of a link.

As a quick workaround, I would put an `ln' command that always fails in your
PATH, before /bin/ln.  If $HOME/bin comes before /bin in your PATH, perhaps just
`(cd ~/bin && ln -s /bin/false ln)'.


> AC_CONFIG_COMMANDS([foo],$config_cmd)
> 
> which seems to get $config_cmd set correctly in configure, but not in
> config.status.

You can use the third argument to AC_CONFIG_COMMANDS to get the variable
declared in `config.status'.  Probably this:

  AC_CONFIG_COMMANDS(foo, $config_cmd, config_cmd='$config_cmd')

See documentation nodes `Configuration Commands' and `Configuration Actions'.

> It feels like someone must have dealt with this before,
> and probably in a cleaner way than having a separate config command for
> each link.

AC_CONFIG_LINKS is not so widely used, and neither is `cccl', so it is possible
that you are the first person to face this problem.

I would use your essential approach involving AC_CONFIG_COMMANDS, but rather
than checking $host to decide whether to use symbolic links for headers, write a
behavioral test.  Namely, create a simple header file, make a symbolic link to
the header, and try to compile a program that includes it by its symlinked name.
If this succeeds, use `ln -s' or `$as_ln_s'; otherwise, use `cp -p'.


> Does it make sense to have the code that supports AC_CONFIG_LINKS use
> $as_ln_s instead of straight ln -s in:
> 
>   # Try a symlink, then a hard link, then a copy.
>   ln -s $ac_rel_source $ac_dest 2>/dev/null ||
>     ln $srcdir/$ac_source $ac_dest 2>/dev/null ||
>     cp -p $srcdir/$ac_source $ac_dest ||

That is probably a reasonable clean up.  It will not fix your problem, because
there is no clean way to override $as_ln_s in `config.status'.




reply via email to

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