www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/01/21/02:02:17

Date: Tue, 21 Jan 1997 08:59:21 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Configure scripts
In-Reply-To: <Pine.LNX.3.91.970120071749.1672A-100000@acp3bf>
Message-ID: <Pine.SUN.3.91.970121084140.26269E-100000@is>
MIME-Version: 1.0

On Mon, 20 Jan 1997, Hans-Bernhard Broeker wrote:

> So, you'ld have to distribute a modified `configure' instead of a
> modified Makefile.

Correct.  But with bash, the modifications are *extremely* small, see 
below, and can be done with a Sed script which rarely changes, and can
even be shared by different packages.

> them than those in the Makefiles. For the record, here's the list of most
> probable gotchas: 
> 
> * ... but sometimes, configure will look for executables or other files
> using `find'. `find /bin -name "*install"' won't find
> 'c:/prg/djgpp/ginstall.exe', will it?

Current configure scripts don't use this method, at least as far as I 
could see.  They all use "test -f gcc" (which must be changed on MSDOS to 
"test -x gcc" to find gcc.exe).

> * some configure scripts I've seen want to decide if a given path
> specification is absolute or relative. In their native Un*x environment,
> that's easy: if it matches the `^/' regexp, it's absolute. But in DOS,
> that's a bit more complicated: `C:\', `C:/', '\' and `/' are absolute, but
> neither `C:' nor `C:.' is. This can be done with a slightly more arcane
> regexp, but first you have to spot this in the configure script. 

Bash port solves this by letting you define $SYSROOT.  If you say set 
SYSROOT=c:, then every pathname on C:\pathname gets converted to 
Unix-style /pathname, and every pathname on other drives, like 
D:\pathname, gets converted to //d/pathname, so the scripts work without 
any problems.  Bash also converts the `;' in $PATH into `:', so the 
scripts which take $PATH apart also work.

> IMHO, my previous approach would still be a good alternative, then: change
> autoconf so that it generates special DOS-style configure scripts, with
[snip] 
> The drawback of this method that all people interested in rebuilding DJGPP
> packages from source would have to acquire the ported autoconf and m4 in

Seems to me like more pain than editing configure.  For starters, there's
no m4 port to DJGPP right now (although that shouldn't be a great
problem).  But since I didn't use configure yet except in a couple of
packages, I will wait for more experience before I pass judgement on 
these two approaches. 

> If anyone's interested, I could try porting autoconf in the way I just
> described, targetting the DJGPP versions of bash and file-/textutils.  It
> never worked really well with ms_sh, but the major problems I had should
> not be there with DJGPP bash, so it could actually work now. 

You'd be surprised how easy it is with bash, so please try this if you 
have time.  I found out that the only things which should be changed to 
make configure run on DJGPP bash are these:

	* change "test -f" to "test -x"
	* fix any filenames illegal on MSDOS (like config.h.in)

(you can skip the last item on Windows 95).

Btw, anybody has a clue why configure doesn't use test -x in the first 
place?  Are there any versions of sh which don't support -x?

- Raw text -


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