unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Compile mode in emacs!!
@ 2007-03-27  8:18 elxsian
  0 siblings, 0 replies; 11+ messages in thread
From: elxsian @ 2007-03-27  8:18 UTC (permalink / raw)
  To: Help-gnu-emacs

When I try to use the compile mode in emacs, it picks up the default gcc (/usr/bin/gcc). I need it to pick the gcc in a different location. How do I do that? I tried sourcing the path from the compile mode, but did not help. 

Thanks in advance 
Nazir 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Compile mode in emacs!!
@ 2007-03-27  8:20 elxsian
  2007-03-27 12:10 ` Peter Dyballa
  0 siblings, 1 reply; 11+ messages in thread
From: elxsian @ 2007-03-27  8:20 UTC (permalink / raw)
  To: Help-gnu-emacs


When I try to use the compile mode in emacs, it picks up the default gcc
(/usr/bin/gcc). I need it to pick the gcc in a different location. How do I
do that? I tried sourcing the path from the compile mode, but did not help. 

Thanks
Nazir

-- 
View this message in context: http://www.nabble.com/Compile-mode-in-emacs%21%21-tf3471660.html#a9688221
Sent from the Emacs - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Compile mode in emacs!!
  2007-03-27  8:20 Compile mode in emacs!! elxsian
@ 2007-03-27 12:10 ` Peter Dyballa
  2007-03-28  5:10   ` Nazir 
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2007-03-27 12:10 UTC (permalink / raw)
  To: elxsian; +Cc: Help-gnu-emacs


Am 27.03.2007 um 10:20 schrieb elxsian:

> When I try to use the compile mode in emacs, it picks up the  
> default gcc
> (/usr/bin/gcc). I need it to pick the gcc in a different location.  
> How do I
> do that?

Set path or PATH in the shell from which you launch GNU Emacs or in  
your login shell accordingly. Or set an environment variable CC that  
points to the compiler you want to use. Makefile can also set which  
compiler will be used ...

And finally you can correct what M-x compile RET does by inserting in  
the read-area (mini-buffer), just an example:

	time nice +17 env USE_XCB=NO PATH=/Users/pete/Quellen/X11R7.1/util/ 
modular:/usr/local/bin:/sw/lib/freetype219/bin:/sw/lib/odcctools/bin:/ 
sw/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/gwTeX/ 
bin/bin CFLAGS="-v -pipe -fPIC -O0 -mcpu=7450 -mtune=7450 -fno- 
common" CPPFLAGS="-v -no-cpp-precomp -I/usr/include/openssl -I/sw/ 
include/pango-1.0 -I/sw/lib/freetype219/include -I/sw/lib/freetype219/ 
include/freetype2 -I/sw/include/libpng12 -I/sw/include -I/usr/local/ 
include" LDFLAGS="-dead_strip -bind_at_load -L/sw/lib/freetype219/lib  
-L/sw/lib/fontconfig2/lib -L/sw/lib/ncurses -L/usr/local/lib -L/sw/ 
lib" ACLOCAL="aclocal -I /usr/local/share/aclocal -I /sw/share/ 
aclocal" PKG_CONFIG_PATH=/sw/lib/freetype219/lib/pkgconfig:/sw/lib/ 
fontconfig2/lib/pkgconfig:/usr/X11R7/lib/pkgconfig:/sw/lib/pkgconfig:/ 
sw/lib/system-openssl/lib/pkgconfig:/sw/share/pkgconfig:/usr/lib/ 
pkgconfig:/usr/local/lib/pkgconfig:/usr/local/clamXav/lib/pkgconfig  
util/modular/build1.sh -m /Users/pete/Quellen/X11R7.1/Mesa-6.5.2 -D / 
usr/X11R7 -n

You see: not even make needs to used to compile some software ...

--
Greetings

   Pete

Remember: use logout to logout.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Compile mode in emacs!!
  2007-03-27 12:10 ` Peter Dyballa
@ 2007-03-28  5:10   ` Nazir 
  2007-03-28  8:29     ` Peter Dyballa
  0 siblings, 1 reply; 11+ messages in thread
From: Nazir  @ 2007-03-28  5:10 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: Help-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 2295 bytes --]

Thanks for your reply Peter.
The path in the shell is already set to the required compiler. I need to run
a set of make files.
I do not want to change the "CC" in the make files.
But , when I say which gcc in the Mx- compile:
It says "/usr/bin/gcc"
I want to use, say "/tools/gnu/gcc". (THe shell from which emacs is laucnhed
points to this gcc! )
Can I configure the emacs to pick the required compiler?

Thanks again,
Nazir



On 3/27/07, Peter Dyballa <Peter_Dyballa@web.de> wrote:
>
>
> Am 27.03.2007 um 10:20 schrieb elxsian:
>
> > When I try to use the compile mode in emacs, it picks up the
> > default gcc
> > (/usr/bin/gcc). I need it to pick the gcc in a different location.
> > How do I
> > do that?
>
> Set path or PATH in the shell from which you launch GNU Emacs or in
> your login shell accordingly. Or set an environment variable CC that
> points to the compiler you want to use. Makefile can also set which
> compiler will be used ...
>
> And finally you can correct what M-x compile RET does by inserting in
> the read-area (mini-buffer), just an example:
>
>        time nice +17 env USE_XCB=NO PATH=/Users/pete/Quellen/X11R7.1/util/
> modular:/usr/local/bin:/sw/lib/freetype219/bin:/sw/lib/odcctools/bin:/
> sw/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/gwTeX/
> bin/bin CFLAGS="-v -pipe -fPIC -O0 -mcpu=7450 -mtune=7450 -fno-
> common" CPPFLAGS="-v -no-cpp-precomp -I/usr/include/openssl -I/sw/
> include/pango-1.0 -I/sw/lib/freetype219/include -I/sw/lib/freetype219/
> include/freetype2 -I/sw/include/libpng12 -I/sw/include -I/usr/local/
> include" LDFLAGS="-dead_strip -bind_at_load -L/sw/lib/freetype219/lib
> -L/sw/lib/fontconfig2/lib -L/sw/lib/ncurses -L/usr/local/lib -L/sw/
> lib" ACLOCAL="aclocal -I /usr/local/share/aclocal -I /sw/share/
> aclocal" PKG_CONFIG_PATH=/sw/lib/freetype219/lib/pkgconfig:/sw/lib/
> fontconfig2/lib/pkgconfig:/usr/X11R7/lib/pkgconfig:/sw/lib/pkgconfig:/
> sw/lib/system-openssl/lib/pkgconfig:/sw/share/pkgconfig:/usr/lib/
> pkgconfig:/usr/local/lib/pkgconfig:/usr/local/clamXav/lib/pkgconfig
> util/modular/build1.sh -m /Users/pete/Quellen/X11R7.1/Mesa-6.5.2 -D /
> usr/X11R7 -n
>
> You see: not even make needs to used to compile some software ...
>
> --
> Greetings
>
>   Pete
>
> Remember: use logout to logout.
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 2890 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Compile mode in emacs!!
  2007-03-28  5:10   ` Nazir 
@ 2007-03-28  8:29     ` Peter Dyballa
  2007-03-28  8:56       ` Nazir 
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2007-03-28  8:29 UTC (permalink / raw)
  To: Nazir ; +Cc: Help-gnu-emacs


Am 28.03.2007 um 07:10 schrieb Nazir:

> The path in the shell is already set to the required compiler.

So the question is, why has GNU Emacs another another PATH value  
active? Do launch it from some menu? I looks as if your login shell  
provides a different environment than what you use in an interactive  
shell. If you fix this issue, then GNU Emacs will find the same  
compiler as you in some shell.

> I need to run a set of make files.
> I do not want to change the "CC" in the make files.

As I showed in my examples: you can use env to set particular  
environment variables.

>
> I want to use, say "/tools/gnu/gcc". (THe shell from which emacs is  
> laucnhed points to this gcc! )

Then my guess is that some environment variables reset the value. You  
can, for example do M-x compile RET and then erase the default make  
command and substitute it with env or printenv to see which  
environment the compile process sees. Then some corrections can be made.

> Can I configure the emacs to pick the required compiler?
>

I don't see this. There is a customisation group for the compilation  
process (C-h f compile RET and you'll find a hint in the *Help*  
buffer or via menus Options -> Customize Emacs -> Specific Group…,  
name completion works), but there is nothing to set the compiler  
explicitly. This is done in the shell or in Makefiles, as determined  
by a configure script for example, or set by the programmer.

--
Greetings

   Pete                                           0
                                            %-/\_//
                                             (*)(*)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Compile mode in emacs!!
  2007-03-28  8:29     ` Peter Dyballa
@ 2007-03-28  8:56       ` Nazir 
  2007-03-28  9:17         ` Peter Dyballa
  0 siblings, 1 reply; 11+ messages in thread
From: Nazir  @ 2007-03-28  8:56 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: Help-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 2505 bytes --]

Hi Peter,

Oops!! ... when I said "printenv", in the Mx-compile, it shows a different
value for "PATH", from the one I see in the terminal.

> I looks as if your login shell
>provides a different environment than what you use in an interactive
>shell. If you fix this issue, then GNU Emacs will find the same
>compiler as you in some shell.

I guess, you are right. Could you please tell me how to fix this?
Infact, when I said "printenv", I saw a big list, where in PATH_USER had the
correct value, where as the PATH variable was referring to an incorrect
value.
I also changed the path in Mx-compile, using "setenv PATH <value>", but it
gets reset to a different value!!

Thanks,
Nazir


On 3/28/07, Peter Dyballa <Peter_Dyballa@web.de> wrote:
>
>
> Am 28.03.2007 um 07:10 schrieb Nazir:
>
> > The path in the shell is already set to the required compiler.
>
> So the question is, why has GNU Emacs another another PATH value
> active? Do launch it from some menu? I looks as if your login shell
> provides a different environment than what you use in an interactive
> shell. If you fix this issue, then GNU Emacs will find the same
> compiler as you in some shell.
>
> > I need to run a set of make files.
> > I do not want to change the "CC" in the make files.
>
> As I showed in my examples: you can use env to set particular
> environment variables.
>
> >
> > I want to use, say "/tools/gnu/gcc". (THe shell from which emacs is
> > laucnhed points to this gcc! )
>
> Then my guess is that some environment variables reset the value. You
> can, for example do M-x compile RET and then erase the default make
> command and substitute it with env or printenv to see which
> environment the compile process sees. Then some corrections can be made.
>
> > Can I configure the emacs to pick the required compiler?
> >
>
> I don't see this. There is a customisation group for the compilation
> process (C-h f compile RET and you'll find a hint in the *Help*
> buffer or via menus Options -> Customize Emacs -> Specific Group…,
> name completion works), but there is nothing to set the compiler
> explicitly. This is done in the shell or in Makefiles, as determined
> by a configure script for example, or set by the programmer.
>
> --
> Greetings
>
>   Pete                                           0
>                                            %-/\_//
>                                             (*)(*)
>
>
>


-- 
" LIFE ROCKS "

[-- Attachment #1.2: Type: text/html, Size: 3733 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Compile mode in emacs!!
  2007-03-28  8:56       ` Nazir 
@ 2007-03-28  9:17         ` Peter Dyballa
       [not found]           ` <39262250703280328g1f53a9a0l2a5e490e8a52acad@mail.gmail.com>
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2007-03-28  9:17 UTC (permalink / raw)
  To: Nazir; +Cc: Help-gnu-emacs


Am 28.03.2007 um 10:56 schrieb Nazir:

> I guess, you are right. Could you please tell me how to fix this?

Determine what your login shell is. Set in its RC file PATH to the  
value PATH_USER shows. Log off and in. Enjoy the change.

> Infact, when I said "printenv", I saw a big list, where in  
> PATH_USER had the correct value, where as the PATH variable was  
> referring to an incorrect value.
> I also changed the path in Mx-compile, using "setenv PATH <value>",  
> but it gets reset to a different value!!
>

"Setenv" is a shell command in (t)csh. You have to use 'env  
<VARIABLE>=<value>' ...

--
Greetings

   Pete

Either this man is dead or my watch has stopped.
                                          - Groucho Marx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Compile mode in emacs!!
       [not found]           ` <39262250703280328g1f53a9a0l2a5e490e8a52acad@mail.gmail.com>
@ 2007-03-28 11:17             ` Peter Dyballa
       [not found]               ` <39262250703280551md8bdc54u5b9c31e59d207018@mail.gmail.com>
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2007-03-28 11:17 UTC (permalink / raw)
  To: Nazir ; +Cc: emacs List


Am 28.03.2007 um 12:28 schrieb Nazir:

> 1. PATH variable is showing the correct value in the terminal  
> ( tcsh ). From the same terminal I open emacs. In emacs, I execute  
> the shell command, echo $PATH, this shows an incorrect value.

What is your login shell? Without some basics nothing reasonable can  
be achieved.

What is your command to "open emacs?"
Do you have a file ~/.emacs_tcsh? This one sets values for GNU Emacs'  
*shell* buffer – but not for what is done via M-x. In case your login  
shell is tcsh, then ~/.cshrc is executed, when it exists. If it does  
not exist, then ~/.tcshrc is executed, if existing. And it is this  
order in which they are loaded, or not loaded (you can proof by  
creating a simple ~/.cshrc with only one line

	echo "Hi, it's me, your ~/.cshrc!"

). Do they manipulate path? The lower case word ``path´´ is the  
variable that sets PATH, which exists in (t)csh only for backward  
compatibility with Bourne shell look-alikes.

> 2. In the RC file (.cshrc), the PATH has already been set to  
> correct value(I guess thats how it is displayed properly in the  
> terminal). I just wonder where emacs gets the PATH from ?? Does it  
> take it from a different file??

If the GNU Emacs binary is launched from a shell as 'emacs &' than no  
other file is involved in setting PATH – except you have in some  
ELisp file a statement like

	(setenv "PATH" (concat "/some/directory" ":" (getenv "PATH")))

or such. This modulates GNU Emacs' internal private environment which  
is then copied into every new process, like for example the  
compilation process.

If the 'emacs' from 'emacs &' is a shell script, than this shell  
script can re-set PATH for the GNU Emacs launched later from this  
script.


This code in site-start.el can name in *Messages* buffer all ELisp  
files loaded:

	(defadvice load (before debug-log activate)
	  (message "(Tipp von Kai G) Now loading: %s" (ad-get-arg 0)))

You can use some for GNU Emacs options to make it not loading ELisp  
files, -q or -Q. Check with 'emacs --help' for the exact meaning! You  
might be able to find circumstances under which GNU Emacs'  
environment is correct.


In Mac OS X I have it very simple and comfortable: an XML file  
contains environment variables and their values and by a command like

	    set path=(`defaults read ~/.MacOSX/environment PATH | tr ':' ' '`)

I can use them in any shell ...

--
Greetings

   Pete

When you meet a master swordsman,
show him your sword.
When you meet a man who is not a poet,
do not show him your poem.
                 -- Rinzai, ninth century Zen master

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Compile mode in emacs!!
       [not found] <mailman.1487.1174994711.7795.help-gnu-emacs@gnu.org>
@ 2007-03-28 13:18 ` Ken Goldman
  2007-03-29  0:30 ` "Wilfred Zegwaard (privé)"
  1 sibling, 0 replies; 11+ messages in thread
From: Ken Goldman @ 2007-03-28 13:18 UTC (permalink / raw)
  To: help-gnu-emacs

elxsian@gmail.com wrote:
> When I try to use the compile mode in emacs, it picks up the default gcc (/usr/bin/gcc). I need it to pick the gcc in a different location. How do I do that? I tried sourcing the path from the compile mode, but did not help. 

IMHO, the best approach is to learn how to use make.  Then let emacs do 
the default (run make) and put details like paths, command line options, 
etc., in the makefile.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Compile mode in emacs!!
       [not found]               ` <39262250703280551md8bdc54u5b9c31e59d207018@mail.gmail.com>
@ 2007-03-28 15:20                 ` Peter Dyballa
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Dyballa @ 2007-03-28 15:20 UTC (permalink / raw)
  To: Nazir ; +Cc: emacs List


Am 28.03.2007 um 14:51 schrieb Nazir:

> >What is your command to "open emacs?"
> "emacs &" from the tcsh

And is this executable "emacs" a binary, a shell script, a sym-link  
to whatever?

>
> >If the GNU Emacs binary is launched from a shell as 'emacs &' than no
> >other file is involved in setting PATH – except you have in some
> >ELisp file a statement like  ....
> Is that to be added in the .emacs file? Or which ELISP file are you  
> referring to?

You can set in Lisp a PATH environment variable:

	(setenv "PATH" "the right one")

but this can be dangerous when you change path or PATH for your login  
and interactive shells.

> May be once the path is set in this file, emacs could get the right  
> PATH variable?

I suppose so.

> Also, I tht if we start emacs from  a terminal , it should take  
> that same PATH as that is set in that terminal !!

GNU Emacs should inherit this value. Therefore I am asking another  
time if your "emacs" command is some shell script that manipulates  
path or PATH.

--
Greetings

   Pete                           <]
              o        __o         |__    o       HPV, the real
     ___o    /I       -\<,         |o \  -\),-%     high speed!
___/\ /\___./ \___...O/ O____.....`-O-'-()--o_________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Compile mode in emacs!!
       [not found] <mailman.1487.1174994711.7795.help-gnu-emacs@gnu.org>
  2007-03-28 13:18 ` Ken Goldman
@ 2007-03-29  0:30 ` "Wilfred Zegwaard (privé)"
  1 sibling, 0 replies; 11+ messages in thread
From: "Wilfred Zegwaard (privé)" @ 2007-03-29  0:30 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

Is there anyone who can help me to let EMacspeak run on a Windows machine?

Thanks,

Wilfred

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-03-29  0:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-27  8:20 Compile mode in emacs!! elxsian
2007-03-27 12:10 ` Peter Dyballa
2007-03-28  5:10   ` Nazir 
2007-03-28  8:29     ` Peter Dyballa
2007-03-28  8:56       ` Nazir 
2007-03-28  9:17         ` Peter Dyballa
     [not found]           ` <39262250703280328g1f53a9a0l2a5e490e8a52acad@mail.gmail.com>
2007-03-28 11:17             ` Peter Dyballa
     [not found]               ` <39262250703280551md8bdc54u5b9c31e59d207018@mail.gmail.com>
2007-03-28 15:20                 ` Peter Dyballa
     [not found] <mailman.1487.1174994711.7795.help-gnu-emacs@gnu.org>
2007-03-28 13:18 ` Ken Goldman
2007-03-29  0:30 ` "Wilfred Zegwaard (privé)"
  -- strict thread matches above, loose matches on Subject: below --
2007-03-27  8:18 elxsian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).