Front page | perl.perl5.porters |
Postings from January 2005
Re: [perl #33948] configure checking echo (and using Configure in WIN32)
From:
Stephen
Date:
January 28, 2005 10:32
Subject:
Re: [perl #33948] configure checking echo (and using Configure in WIN32)
Message ID:
BAY0-SMTP08E78239A817BD887403B79C790@phx.gbl
Like Cygwin, Msys runs on a dll that allows it to provied the user with a
bash sell in Windows, but unlike Cygwin, it lets MinGW compile programs
independently of it. The benefit is that it allows the user to run configure
scripts and still compile using the regular native version of MinGW, Cygwin
has its own version of MinGW and indeed of everything else, I want to
operate a bash shell and still compile programs that will run in a cmd.exe
shell. Cygwin does not offer that functionality. For people who start out
compiling with MinGW in a cmd.exe shell, it is not tempting to migrate to
CygWin, I make that choice years ago. It is tremendously helpfuf,
instructive to be able to run Configure, if only to learn more about what is
involved in compiling Perl.
Right now I am compling Perl using dmake in the cmd.exe shell on the one
hand and using Configure to rewrite makefile.mk, config.gc, and Config_H.gc
on the other hand. Recently, I ran into an interesting snag that config.gc
must have the following logically conflicting lines in order to compile in
Windows due to the absence of a usable DIR struct in dirent.h:
direntrytype='struct direct'
i_dirent='define'
Configure assumes direntrytype='struct dirent' if dirent.h exists, but in
Windows 'striuct dirent' is incompatible with the Unix version. This is the
way config.gc looks as shipped in perl-5.8.6 and is correct, unless you want
to remove the dependency on dirent.h for the Windows compile entirely or
possibly take away Configures assuption that 'struct dirent' is usable if
dirent.h exists, but it is an example of where the output from Configure
must be hand edited for a Windows compile to compile properly. Personally I
think MinGW should not ship with a version of both direct.h and dirent.h, as
that is bound to confuse almost any Unix configure script.
Basically, I am trying to have the best of both worlds, using Configure to
guide me in updating and tailoring a Windows compile on my computer. My
pipedream is that an msys user can run Configure with no options, msys will
pop up as a system, those defaults will be used successfully and perl will
compile for Windows in a bash shell, using the default Unix directory
structure: --prefix=/usr/local. The first challenge toward that goal is to
figure out what those defaults need to be. So it is necessary for me to
reinvent the wheel, since someone already figured most of this when creating
config.gc and config_H.gc. Most of it, but not for running bash using
gnumake, although I really do appreciate dmake now that I am running it, its
just that msys comes with its own version of make and it would be nice to
make the process more transparent to the user. The dmake option is *the*
answer for people who use MinGW in the cmd.exe shell.
The final problem I find is that htonl is found in sys/socket.h in Windows,
but Configure does not look for it there, so
d_htonl='define'
is the second edit needed.
This is the Configure command line I use so far:
/home/Stephen/perl/perl-5.8.6/Configure -Dprefix='c:/msys/1.0/local' -Doptimize="-O3
-march=pentium4 -malign-double" -Dlibs='-lgdbm -lm' -Dcc=gcc -Dso=dll -Uusenm
-Dusemymalloc -Dusethreads -Uinstallusrbinperl -Ubincompat5005 -Dyacc='bison
-y' -Accflags="-DPERL_DEBUGGING_MSTATS -DPERL_IMPLICIT_CONTEXT -DPERL_MSVCRT_READFIX"
-Dlibpth="/usr/local/lib
/usr/mingw/lib" -Dosname=Windows_NT -Dosvers=5.1 -Dgidtype=long -Duidtype=long
-Dextras="Compress::Zlib Bundle::LWP
DBI" -Dcf_email="stecmccarthy@hotpop.com" -Dfirstmakefile=GNUmakefile -des
Under msys all programs in /bin must use the msys-1.0.dll, so the programs
I compile are put in /usr/local/bin by default. So to recap, like CygWIN,
msys does rely on its own dll to function, but unlike CygWIN it allows MinGW
to compile programs that don't rely on it.
I also used to include the define -UWIN32, but now I am focusing on
producing a config.sh that I can use in place of config.gc.
I realize that this is too long because I am bringing up multiple issues
relating to using Configure in a WIN32 environment in the same thread.
Unfortunately, I am good enough at juggling multiple parallel ideas in my
own head that I have a hard time reigning it in sometmes. I assure you, I do
respect the need to stay on topic in a thead and do have one eye on that
issue of netiquette. Just respond, please, to whatever part of this thread
interests you and feel free to ignore the rest. I will not be offended.
Thank you,
Stephen
----- Original Message -----
From: "John Peacock via RT" <perlbug-followup@perl.org>
To: <stecmccarthy@hotpop.com>
Sent: Friday, January 28, 2005 8:30 AM
Subject: Re: [perl #33948] configure checking echo
> Andy Dougherty wrote:
>
>> What is 'msys' ? That might explain the '.exe' suffix.
>
> msys is the Minimal System for MinGW:
>
> http://www.mingw.org/msys.shtml
>
> I haven't had that much luck with it; CygWin is better maintained. It
> does have the ability to create native Win32 apps that don't have
> dependencies on other libraries. YMMV
>
> HTH
>
> John
>
> --
> John Peacock
> Director of Information Research and Technology
> Rowman & Littlefield Publishing Group
> 4501 Forbes Boulevard
> Suite H
> Lanham, MD 20706
> 301-459-3366 x.5010
> fax 301-429-5748
>
>
-
Re: [perl #33948] configure checking echo (and using Configure in WIN32)
by Stephen