delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/11/01/19:39:19

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Fri, 1 Nov 2002 19:39:06 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Mike Bresnahan <mbresnah AT visi DOT com>
cc: cygwin AT cygwin DOT com
Subject: RE: Cygwin, GNU make and VC++ ?
In-Reply-To: <EKEJKOHPOIIALFJMKEIGOEADEDAA.mbresnah@visi.com>
Message-ID: <Pine.GSO.4.44.0211011920390.5605-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Fri, 1 Nov 2002, Mike Bresnahan wrote:

> For what its worth, this is the script I use:
>
> #! /bin/sh
> #
> # Wrapper script for the Microsoft Visual C++ compiler (cl) to allow it to
> work with Cygwin based makefiles.
>
> cmd="/c/Program\ Files/Microsoft\ Visual\ Studio/VC98/Bin/cl"
>
> for option
> do
>     case $option in
>     -I/*)
>         path=`expr $option : '-I/\(.*\\)'`
>         cmd="$cmd -IC:/cygwin/$path"
>     ;;
>     /*)
>         path=`expr $option : '/\(.*\\)'`
>         cmd="$cmd C:/cygwin/$path"
>     ;;
>     *)
>         cmd="$cmd $option"
>     ;;
>     esac
> done
>
> echo $cmd
> eval $cmd

Mike,
You should be very careful of quoting here.  Since you use eval, you
could insert extra quotes as part of the command - they won't hurt, and
will make it safer.  Another note is that the user's installation may not
be in C:\cygwin.  The following modification should fix both (and the
extraneous '\', to boot):

     -I/*)
         path="`expr "$option" : '-I/\(.*\)'`"
         cmd="$cmd \"-I`cygpath -m /`/$path\""
     ;;

In fact, you could do even better, by passing the path to cygpath as well:

     -I/*)
         path="`expr "$option" : '-I/\(.*\)'`"
         cmd="$cmd \"-I`cygpath -m /$path`\""
     ;;

I leave the the rest of the cases as an exercise for the reader.  :-D
Oh, and the last line should be 'eval "$cmd"' (note the double quotes).
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Water molecules expand as they grow warmer" (C) Popular Science, Oct'02, p.51


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019