delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/06/12:38:47

Date: Thu, 6 Jan 2000 12:03:13 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Mumit Khan <khan AT NanoTech DOT Wisc DOT EDU>
cc: djgpp AT delorie DOT com
Subject: Re: protoize for djgpp
In-Reply-To: <Pine.HPP.3.96.1000105121838.21699H-100000@hp2.xraylith.wisc.edu>
Message-ID: <Pine.SUN.3.91.1000106120254.20220I-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 5 Jan 2000, Mumit Khan wrote:

> The SYSCALLs.c.X problem is the same on Unix, if you install it to a
> directory other than build prefix, it won't find it without -B option.

Sure.  Except that on Unix, GCC is generally not moved like that.

> I'm going eventually retrofit the "relative path" lookup to it, and
> then it should be relocatable as well.

DJGPP now has a feature to satisfy these needs: the special prefix
"/dev/env/FOO" is transparently replaced at run time by the value of
the environment variable FOO, just before the file name is passed to
the OS.  Since the DJGPP header files are at fixed places relative to
the DJDIR variable, you simply need to compile with
--prefix="/dev/env/DJDIR", it will work anywhere.

> Will do, once I clean it up a bit. I still have to the usage of POSIX
> "link" and use ANSI "rename" instead to save files under a different
> name.

DJGPP has a working "link" in the library (which simulates a hard link
by copying).  But "rename" will also work, of course.

> I'm assuming the following work for DJGPP, which is necessary in getting
> protoize to work:
>   
>   #ifdef O_BINARY
>   setmode (fd, O_BINARY)
>   #endif

Yes.  However, if FD can ever be stdin or stdout connected to the
console device, please use this:

  #ifdef O_BINARY
  if (!isatty(fd))setmode (fd, O_BINARY);
  #endif

Switching the console device to binary mode has several nasty side
effects in DJGPP, and is almost never really necessary, unless you
have an interactive program like Emacs or Less (which is what these
side effects were designed for).

- Raw text -


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