delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/06/18/12:46:13

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
Message-ID: <42B4508C.DB748376@dessent.net>
Date: Sat, 18 Jun 2005 09:49:16 -0700
From: Brian Dessent <brian AT dessent DOT net>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: How to write minimal program using GD library
References: <6188710 DOT 1119111656421 DOT JavaMail DOT SYSTEM AT CCC-NOVA1>
X-Spam-Report: -5.9/5.0 ---- Start SpamAssassin results * -3.3 ALL_TRUSTED Did not pass through any untrusted hosts * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] * 0.0 AWL AWL: From: address is in the auto white-list ---- End SpamAssassin results
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com

Siegfried Heintze wrote:

> It works! My problem was that I was running the program (via bash) from the
> emacs compile command.
> 
> I wonder why the path is not set up correctly when I use emacs to create a
> subprocess? The path is setup correctly when I click on the Cygwin prompt.
> 
> I think emacs specifies bash.exe -- perhaps that is the problem. Do I have
> to specify cygwin.bat?

When you run cygwin.bat, that starts a login shell.  When you start bash
from emacs, that is just a regular shell, not a login shell.  The
difference matters as to which files bash reads (e.g. /etc/profile,
~/.bashrc, ~/.profile, etc.)  Read "man bash" section INVOCATION.  If
some aspect of the PATH is only set in the profile then it will only
occur for login shells.  Though normally once an environment variable is
set, it is inherited in subshells, so I don't know why your PATH is not
inherited correctly.  The default set of startup scripts that comes with
Cygwin should be correct in terms of having a correct PATH set for you,
even in subshells, but it's possible you stumbled upon a situation where
something needs to be fixed.

You will have to investigate the contents of your startup files and the
manner in which emacs invokes the shell in order to find out why.  It
could also have to do with the fact that emacs probably launches /bin/sh
by default (not bash), which has its own rules for which startup files
to read (e.g. sh does not know about ~/.bashrc.)  I can't really tell
you more off-hand because a) I have long since modified most of my
startup files and b) I don't use emacs.  You'll have to trace it through
to find out what's going on.  You might add a "set +x" to the top of all
such files to make them print out the commands as they're being
executed.

> I'd also like to make this compile with msvc using the MSVC version of the
> gd library I downloaded from boutell.com. I guess I'll send email to him as
> the web site suggests unless someone can suggests a forum to post in.

I don't know anything about that, sorry.  It's off-topic for this list.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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