www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/18/07:02:17

From: Boon van der RJ <rjvdboon AT sloep46 DOT cs DOT vu DOT nl>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Do it without DOS variables?
Date: 18 Sep 1998 10:41:59 GMT
Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
Lines: 45
Message-ID: <6ttddn$5he$1@star.cs.vu.nl>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980918113747 DOT 17626J-100000 AT is>
NNTP-Posting-Host: sloep46.cs.vu.nl
User-Agent: tin/pre-1.4-980730 (UNIX) (SunOS/5.5.1 (sun4u))
Originator: rjvdboon AT sloep46 DOT cs DOT vu DOT nl
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
> 
> On Thu, 17 Sep 1998, Glenn David Blank wrote:
> 
>> It would be much,
>> much simpler and smoother, if DJGPP didn't need to use DOS variables.
>> Is it possible to recompile DJGPP so that it gets its information in
>> some other way, such as a Windows file or even hard-coded for this
>> particular application?
> 
> Please explain what DOS variables are you talking about.

Don't know if this is (supposed) to work, but if just the DJGPP
variable is of concern, maybe a putenv("DJGPP=k:/abcd/djgpp.env") in
your IDE might work? Then programs spawned by the IDE should use
this[1]. If it works it is easily extended to any variable you want.
It only works with programs spawned from the IDE though.

hth,
 Robert.

[1] I am unsure if this works, but i think it should, at least it
    works under solaris. with the following test program (tes.c):
/* -*- mode: C; compile-command: "gcc -Wall -o tes.exe tes.c" -*- */
/* quick and dirty get-/putenv test by rjvdboon AT cs DOT vu DOT nl          */
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv) {
  char *t;
  if (argc > 1) {
    printf("%s option: %s\n", argv[0], argv[1]);
    t = getenv("TST1TST");
    if (t) {printf("%s\n", t); }else{ printf("no TST1TST"); }
  } else {
    printf("putenv + system:\n\n");
    putenv("TST1TST=JaEnzoEnv");
    system("tes jaja");
    printf("\nsystem done\n");
  }
  return 0;
}

-- 
rjvdboon AT cs DOT vu DOT nl        | "En dat is niet waar!" sprak ex-Staatsecretaris-
www.cs.vu.nl/~rjvdboon   |    van-Onderwijs Netelenbos fel.

- Raw text -


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