delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/30/23:14:18

From: pjfarley AT dellnet DOT com (Peter J. Farley III)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Question about running configure script
Date: Mon, 01 May 2000 03:47:36 GMT
Organization: UUNET
Lines: 145
Message-ID: <390cfc8d.16509140@nntp276471.nntp.dellnet.com>
References: <3905B9E3 DOT C6DA3661 AT worldaccessnet DOT com>
NNTP-Posting-Host: 2cust42.tnt13.nyc3.da.uu.net
X-Trace: news01.arb1.te.uudial.us.uu.net 957152851 19510 63.23.140.42 (1 May 2000 03:47:31 GMT)
X-Complaints-To: news AT news01 DOT arb1 DOT te DOT uudial DOT us DOT uu DOT net
NNTP-Posting-Date: 1 May 2000 03:47:31 GMT
X-Newsreader: Forte Free Agent 1.21/32.243
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Roger D. Hunt" <rhunt AT worldaccessnet DOT com> wrote:
> I have a question about running what I believe is a configure shell script
> in the DJGPP environment.  Although a retired programmer, I am a complete
> novice when it comes to C or the UNIX enironment, and I readily admit it's
> all Swahili to me.  I feel so silly having to ask what must be very
> elementary questions to you folks who have spent years in the UNIX
> enironment.  The sole purpose of downloading DJGPP is to compile a complex
> mathematical C application that fascinates me.

These are normal feelings of bewilderment when first encountering such
a deep field, Roger.  Take it one step at a time, and the feeling will
fade.  As a programmer, you know already that any new language or
environment takes a little time (and help) to get used to.  This is no
different.

And some of us (most of us?) started out ignorant of C and *ix, too. 
You are not alone.  As Robert Heinlein said, through his character
Lazarus Long, "Ignorance is curable.  Only stupidity is fatal."
 
> The application comes with a small README that provides instructions for
> unpacking, configuring, and compiling the application.  Their code is
> distributed as a gzipped tar file, and they tell you first "gunzip the
> downloaded file, then use tar to unpack the archive" with:
>     $ gunzip co991215.tgz
>     $ tar xvf co991215.tar
> which I believe I accomplished by using "pkunzip -d" (at least a ton of .c
> and .h files appear to be properly distributed into several
> subdirectories).

*UNLESS* there are "long-name" files (i.e., names which do not follow
the DOS 8.3 convention) in that archive.  Which is very likely, given
your description of the instructions and the contents.  Then,
depending on which pkunzip you have (my old DOS 2.04g version, for
instance), you may *not* get the names unzipped correctly.

That's why they told you to use "gunzip", which *does" understand 
"long-name" files.  Or, in the case of DJGPP, you can use the "DJTAR" 
utility, which will happily un-zip AND un-tar the package, all in one
step.  Like this:

C:\>djtar -x -v -!. co991215.tgz

For more info on those option switches, just do "info djtar" from the
DOS prompt.  BTW, DJTAR comes with DJGPP, so you don't need to get
anything else but the basic DJGPP package to get DJTAR.

Also, you did not tell us if you are running in plain DOS or under
Win9x of some flavor.  If you are under Win9x in a DOS box, all the
"long names" can and will be preserved (provided you use the right
tool to unpack it!).

Although, as Eli Zaretskii will probably tell you, *almost* any
GNU-style package *can* be built under DJGPP in plain DOS, there are
sometimes cases where Win9x LFN (long-file-name) support is truly
necessary.  I suspect because it is an application you are trying to
build, it may well be that the authors did not pay as much attention
to portability as the GNU folk are prone to do.

For someone like you, just starting out, I *strongly* recommend that
you try all this from a Win9x DOS box, with DJGPP LFN support enabled
(which it is, by default, in the latest v2.03 packages).
 
> Next they tell you to configure the software by running:
>     $ ./configure
> which I believe is a shell script.  The first line of that file is:
>     #! /bin/sh
> which, from what I read in your mail archives, I think is a reference to
> the UNIX shell (like DOS's lowly command.com).  There is no DOS-equivalent
> shell software on my system, so does that mean I need to download BASH or
> something like that?

Yes, *and* all of the utilities that Jason Green and others have told
you about.  All of them are likely to be used in package building, so
you need to get them and install them.  Why?  Because folk who build
packages in "real" *ix environments can *assume* these utilities are
present already.  So very often, they do.
 
> They also tell you that 'configure' (actually 'configur' in my DOS
> environment) is affected by several environment variables, like 'CC' which
> controls which c compiler to use, and 'CFLAGS' which specifies the C
> compiler flags to use.  The README states that if you are using sh, bash,
> ksh, ash, or some other Bourne-like shell, you can simply set the variables
> on the command line, for example:
>     $ CC="gcc" CFLAGS="-g -O3" ./configure
> and that if you are using csh, tcsh, or some other C-shell, you set the
> variables by using setenv, for example:
>     $ setenv CC "gcc"
>     $ setenv CFLAGS "-g -O3"
>     $ ./configure
> Now I am really lost.  If I had BASH, for example, do I just type 'bash'
> from the DOS command prompt and then get the $ prompt, and then proceed to
> enter the commands above?  If so, that sounds too simple.  I am just
> certain that the UNIX gods have another trapdoor planned for me to fall through.
> Does BASH permit the entry of flags on the same line as the command, as in
> the first example they gave, or do I need to enter them with the 'setenv'
> commands?

Fear not.  Once you have and install all the utility packages you need
(oh, and BTW, don't forget to get gcc for DJGPP too!), most
"configure" scripts find and use what they need without your having to
set anything.

And if it doesn't, then you can use bash to set the variables to what
you need.  I think the bash command is "export".  Look that term up in
the bash info ("C:\>info bash") for details on how to use it.
 
> Apparently, from what the README tells me, 'configure' determines many
> features about the operating system it's running on and generates a
> 'config.h' file when it's done.  Supposedly then I will be able to compile
> the application by using MAKE with the command:
>     $ make
> also presumably using BASH.  They further state that if you are using Gnu
> MAKE, then you can separate the build directory from the source directory.
> They tell you to simply make the build directory, cd into it, and then run
> the configure from the source directory.  Thus:
>     $ mkdir concorde_build
>     $ cd concorde_build
>     $ ../concorde/configure
>     $ make

This sounds quite reasonable, again presuming that you already have
all of the required tools.
 
> Am I on the right track in assuming that I need to use something like BASH
> for this configure process?  Or is there a far easier way to configure and
> compile this software?  Let me apologize in advance for the simpleton
> questions.

You *are* on the right track.  One addition I would make to the things
that others have already said:  Before running the configure script,
run the DJGPP version of "autoconf" to modify most of the
"non-DJGPP-friendly" parts of configure.  To do this, change to the
directory where the configure script is stored, and just say:

C:>\place\where\configure\lives>bash autoconf

I have found that this eliminates many early problems in attempting a
new build.  The remaining ones are more likely to be
application-specific.

Best of luck, and don't fear to return here for more help.

----------------------------------------------------
Peter J. Farley III (pjfarley AT nospam DOT dorsai DOT org OR
                     pjfarley AT nospam DOT banet DOT net)

- Raw text -


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