Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Tue, 3 Apr 2001 19:53:42 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: How to (dynamically) control Unix/Dos PATH-like variable tran slation Message-ID: <20010403195342.A1588@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.11i In-Reply-To: ; from honza@ied.com on Tue, Apr 03, 2001 at 06:06:24PM -0400 On Tue, Apr 03, 2001 at 06:06:24PM -0400, Jan Vicherek wrote: > > Hi all, > > Here is the problem I have, and why do I think that the variable >translation would be really useful: > > Products get installed on NT/W2k. These products use environment >variables (ENVVARs), that point to files and directories, to determine >context from which they are being called. > > I am constructing some platform-independent makefiles, which 1) invoke >the installed programs and 2) pass ENVVARs containing pathnames to these >to communicate the context and 3) pass cmd-line args containing pathnames >to the invoked pgms. > > The makefile references the same variables. They do not contain all >relative paths, but ofter contain absolute paths (c:\prod\app\cfg\...). > > It semms to me quite natural, that the ENVVARs (and cmd line params) get >translated when crossing the Windows-Cygwin boundaries. > > It doesn't seem to me easy / easily maintainable to translate a variable >and parse and translate cmd args to windows path using "cygpath" every >time I make an invocation. But I find "cygpath" quite useful otherwise. > > I would welcome any suggestions on how to solve this ! > > Would anybody have a suggestion for better solution than translating the >ENVVARs and cmd line args ? If you are using Cygwin programs, then set the environment variables using UNIX paths. If you are using non-Cygwin programs, then use Windows paths in the environment variables. I really don't understand the problem. Environment variables like HOME, TMP, and PATH which have meaning in both a UNIX and Windows environment obviously need to be translated. Environment variables like LENNYSOFTWARE don't need to be translated. If The "lenny" software is a Cygwin program then the LENNYSOFTWARE environment variable should be set to a Cygwin path. If it is a Windows native program then the environment variable should be set to a Windows path. If you are passing paths to a non-cygwin program then you need to either use Windows paths in the Makefile (along with --win32) or use cygpath. There is no alternative. cgf -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple