| delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
| From: | "Wiktor S. (wswiktorSP AT Mpoczta DOT fm)" <djgpp AT delorie DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: DJGGP/GCC - detect unset env variables before using them |
| Date: | Tue, 26 May 2015 17:40:38 +0200 |
| Organization: | INTERIA.PL S.A. |
| Lines: | 45 |
| Message-ID: | <mk245o$9im$1@usenet.news.interia.pl> |
| References: | <556480e2$0$3071$426a34cc AT news DOT free DOT fr> |
| NNTP-Posting-Host: | user-46-112-192-2.play-internet.pl |
| X-Trace: | usenet.news.interia.pl 1432654841 9814 46.112.192.2 (26 May 2015 15:40:41 GMT) |
| X-Complaints-To: | usenet AT firma DOT interia DOT pl |
| NNTP-Posting-Date: | Tue, 26 May 2015 15:40:41 +0000 (UTC) |
| X-Priority: | 3 |
| X-MSMail-Priority: | Normal |
| X-Newsreader: | Microsoft Outlook Express 6.00.2900.5931 |
| X-RFC2646: | Format=Flowed; Response |
| X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2900.6157 |
| Bytes: | 2264 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
> The current GCC.EXE compiler crashes horribly when the environment
> variable "DJGPP" is not set. This variable is supposed to point to the
> djgpp.env file, and I understand it's necessary. However, it would be
> *really* nice if gcc could simply output an error message saying that
> this variable needs to be set, and what it needs to point to, instead
> of crashing with a page fault.
It works for me
gcc.exe: fatal error: environment variable DJGPP not defined
compilation terminated.
but I suggest you to create a .bat file that is always in PATH, which sets
PATH and other environment variables needed by all your compilers and other
tools:
C:\DJ\bin>s dj
OK
C:\DJ\bin>gcc -v
Using built-in specs.
COLLECT_GCC=c:/dj/bin/gcc.exe
COLLECT_LTO_WRAPPER=c:/dj/bin/../libexec/gcc/djgpp/5.10/lto-wrapper.exe
Target: djgpp
Configured with: /gcc-5.10/configure
djgpp --prefix=/dev/env/DJDIR --disable-werror --enable-languages=c,c++,fortran,objc,obj-c++
--enable-libquadmath-support --enable-lto
Thread model: single
gcc version 5.1.0 (GCC)
That "s dj" command effectively sets DJGPP and modifies PATH for me.
There are others like s perl, s python, s msvc, etc.
--
Wiktor S.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |