This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Semi-OT: (Was Re: attn: which, bzip2,gzip maintainers (was Re: some problems with setup.ini))


----- Original Message -----
From: "Paul G." <pgarceau@qwest.net>
> > I didn't know that Cygwin runs under several flavors of Unix.
AFAIK,
> > it's calling Win32 API functions but I could be wrong...
>
> hmm...is that a challenge?  Not sure how else to take it --
>
> You're right, of course, dear Corinna, it is calling Win32api
functions, but afaik, that is not
> all it does.  In fact I've forced it into doing more than that.  Most
folks that I told about it asked,
> "What's the point?".  The answer I typically give:  "It is fun, it is
educational and, who knows,
> maybe someone, somewhere wants to build Cygwin generated apps under a
*nix or Linux
> platform..."

I think we've got a terminology problem.

"cygwin1.dll" aka Cygwin - a runtime POSIX compatability layer. ONLY
executes on win32 platforms - Win 95/98/ME/NT4/2K/XP. When configuring a
gcc+binutils toolchain use pc-ix86-cygwin to target this 'platform'.
(It's really just a different C library for win32, so 'platform is a
little strong :}).
"Cygwin" aka the cygwin Net distribution. A collection of open and free
software provided in binary form along with cygwin1.dll

So Cygwin means two things :}.

...
> Of course, I've only been working with Cygwin since about r17, so I
could be completely
> wrong about this.
> If you are wanting to cross-compile to other targets you can, can't
you?  Or is there some
> rule (legal or otherwise) that states Cygwin can not run on anything
but Win32api based
> platforms?

Cygwin the dll only works on w32api programs - because it's translating
posix calls to win32 calls. It can be ported of course, and win64 and
wince are both platforms that could benefit from a port of cygwin to
them. Un*x machines won't benefit because they already have the posix
calls natively. So the restriction to where cygwin the dll runs is
purely technical - and can be lifted somewhat. I'd really love to see
cygwin1.dll running under WINE for example. I think that'd be a neat
hack.

> Please, do correct me if I am wrong.  Cygwin (not necessarily "just
the API") is built with
> some variation of gcc/g++ right?  Ie. the source code, for the most
part, is written using C, C++ or
> C/C++ language syntax, right?  (Setup.exe is, syntactically speaking,
C/C++)

cygwin1.dll and the associated utilites are C/C++/x86assembler.

...
> Bottom line: It don't matter what Cygwin is targetted for as default
build environment.
....................................GCC.................................
.................
> gcc/g++ compiled/linked source code, in standalone mode (w/no gui
dependencies), will run on
> Win32api based platforms, Linux based platforms (with some lib
modifications), *nix platforms (lib > modifications) and Cray
Supercomputers (Terraflops anyone?).
> All a developer needs to do, in the absence of any GUI dependencies,
is build using
> gcc/g++ and be able to output the appropriate, platform specific,
libraries & support.  From that
> standpoint, gcc/g++ is about the closest thing to a multi-platform
(universal?) C/C++ compiler I
> have ever found.

Absolutely (with the one correction I've made in your paragraph :}).
cygwin1.dll is newlib+lowlevelposixsupport. So on linux you have glibc +
linux kernel + gcc toolchain, on bsd you have bsd kernel, plus the BSD C
library + gcc toolchain, and on win32 you have
either
MSCVRT - MS C library + gcc toolchain
or
cygwin1.dll + gcc toolchain.

And of those two, one gives you POSIX, and one doesn't :}. And as a
second comment on your last paragraph, there are many non-GUI
dependencies - pthreads for example - that are also present to some
extent on all of the platforms listed, which aids portability.

Rob


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]