public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* distributing executables for windows
@ 2011-03-03  3:55 anctop
  2011-03-03  6:45 ` Andy Koppe
  0 siblings, 1 reply; 11+ messages in thread
From: anctop @ 2011-03-03  3:55 UTC (permalink / raw)
  To: cygwin

I'd like to ask a question about distributing programs compiled with
cygwin to windows.

I've compiled some utility programs (e.g. "grep") in the cygwin bash
environment, then copied the executables and the dependent libraries
(e.g. "grep.exe" and "cygwin1.dll", "cygintl-8.dll", "cygiconv-2.dll",
"cyggcc_s-1.dll", "cygpcre-0.dll") back to windows.

For those programs with only text outputs, this method gives a working
windows port of the software, but it is not the case for those
terminal handling programs (e.g. "less"). I can still compile and
distribute, but the program works correctly only within the cygwin
bash. Under windows, all the terminal capabilities are lost, with the
"WARNING: terminal is not fully functional" message.

I'm eager to know how to make the terminal features work in windows as well.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: distributing executables for windows
  2011-03-03  3:55 distributing executables for windows anctop
@ 2011-03-03  6:45 ` Andy Koppe
  2011-03-03  7:17   ` anctop
  0 siblings, 1 reply; 11+ messages in thread
From: Andy Koppe @ 2011-03-03  6:45 UTC (permalink / raw)
  To: cygwin

On 3 March 2011 03:54, anctop wrote:
> I'd like to ask a question about distributing programs compiled with
> cygwin to windows.
>
> I've compiled some utility programs (e.g. "grep") in the cygwin bash
> environment, then copied the executables and the dependent libraries
> (e.g. "grep.exe" and "cygwin1.dll", "cygintl-8.dll", "cygiconv-2.dll",
> "cyggcc_s-1.dll", "cygpcre-0.dll") back to windows.

Remember that you also need to offer the sources when distributing GPL software.

> For those programs with only text outputs, this method gives a working
> windows port of the software, but it is not the case for those
> terminal handling programs (e.g. "less"). I can still compile and
> distribute, but the program works correctly only within the cygwin
> bash. Under windows, all the terminal capabilities are lost, with the
> "WARNING: terminal is not fully functional" message.

You need the relevant terminfo entry, i.e. /usr/share/terminfo/63/cygwin.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: distributing executables for windows
  2011-03-03  6:45 ` Andy Koppe
@ 2011-03-03  7:17   ` anctop
  2011-03-03  7:22     ` Andy Koppe
  0 siblings, 1 reply; 11+ messages in thread
From: anctop @ 2011-03-03  7:17 UTC (permalink / raw)
  To: cygwin

I understand that the terminfo entry should be distributed too, but
this is my very question : where to put the "cygwin" file in the
windows tree ?
I've tried "C:\usr\share\terminfo\63", but it does not work.
Do you mean that I have to re-compile "ncurses" and "terminfo" with
some adjustment to the paths ?

On 03/03/2011, Andy Koppe <andy.koppe@gmail.com> wrote:
> On 3 March 2011 03:54, anctop wrote:
>> I'd like to ask a question about distributing programs compiled with
>> cygwin to windows.
>>
>> I've compiled some utility programs (e.g. "grep") in the cygwin bash
>> environment, then copied the executables and the dependent libraries
>> (e.g. "grep.exe" and "cygwin1.dll", "cygintl-8.dll", "cygiconv-2.dll",
>> "cyggcc_s-1.dll", "cygpcre-0.dll") back to windows.
>
> Remember that you also need to offer the sources when distributing GPL
> software.
>
>> For those programs with only text outputs, this method gives a working
>> windows port of the software, but it is not the case for those
>> terminal handling programs (e.g. "less"). I can still compile and
>> distribute, but the program works correctly only within the cygwin
>> bash. Under windows, all the terminal capabilities are lost, with the
>> "WARNING: terminal is not fully functional" message.
>
> You need the relevant terminfo entry, i.e. /usr/share/terminfo/63/cygwin.
>
> Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: distributing executables for windows
  2011-03-03  7:17   ` anctop
@ 2011-03-03  7:22     ` Andy Koppe
  2011-03-03  8:10       ` anctop
  0 siblings, 1 reply; 11+ messages in thread
From: Andy Koppe @ 2011-03-03  7:22 UTC (permalink / raw)
  To: cygwin

On 3 March 2011 07:17, anctop wrote:
> I understand that the terminfo entry should be distributed too, but
> this is my very question : where to put the "cygwin" file in the
> windows tree ?
> I've tried "C:\usr\share\terminfo\63", but it does not work.

The Cygwin DLL assumes that the directory above its own is the root directory.

> Do you mean that I have to re-compile "ncurses" and "terminfo" with
> some adjustment to the paths ?

No, that shouldn't be necessary.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: distributing executables for windows
  2011-03-03  7:22     ` Andy Koppe
@ 2011-03-03  8:10       ` anctop
  2011-03-03 10:32         ` jdzstz - gmail dot com
  2011-03-03 16:45         ` Charles Wilson
  0 siblings, 2 replies; 11+ messages in thread
From: anctop @ 2011-03-03  8:10 UTC (permalink / raw)
  To: cygwin

Thank you very much for your info, it now works.

Just for curiosity :
1. The files in "/usr/share/terminfo/c" are identical to those in
"/usr/share/terminfo/63", but the former one does not work. What're
their differences ?
2. The "less" executable distributed by the GnuWin32 project depends
only on a single external library "libpcre", is this possible with
cygwin ?

On 03/03/2011, Andy Koppe <andy.koppe@gmail.com> wrote:
> On 3 March 2011 07:17, anctop wrote:
>> I understand that the terminfo entry should be distributed too, but
>> this is my very question : where to put the "cygwin" file in the
>> windows tree ?
>> I've tried "C:\usr\share\terminfo\63", but it does not work.
>
> The Cygwin DLL assumes that the directory above its own is the root
> directory.
>
>> Do you mean that I have to re-compile "ncurses" and "terminfo" with
>> some adjustment to the paths ?
>
> No, that shouldn't be necessary.
>
> Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: distributing executables for windows
  2011-03-03  8:10       ` anctop
@ 2011-03-03 10:32         ` jdzstz - gmail dot com
  2011-03-03 15:27           ` Christopher Faylor
  2011-03-03 16:45         ` Charles Wilson
  1 sibling, 1 reply; 11+ messages in thread
From: jdzstz - gmail dot com @ 2011-03-03 10:32 UTC (permalink / raw)
  To: cygwin; +Cc: anctop

About ncurses library, you can get rid of all terminfo files if you
replace ncurses with pdcurses: http://pdcurses.sourceforge.net/

I have compiled varnish cache with pdcurses and it works fine.

You have to:
  *  compile pdcurses library in cygwin
  *  include curses.h files of pdcurses instead ncurses one's
  *  use -lpdcurses instead -lncurses

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: distributing executables for windows
  2011-03-03 10:32         ` jdzstz - gmail dot com
@ 2011-03-03 15:27           ` Christopher Faylor
  0 siblings, 0 replies; 11+ messages in thread
From: Christopher Faylor @ 2011-03-03 15:27 UTC (permalink / raw)
  To: cygwin

On Thu, Mar 03, 2011 at 11:32:05AM +0100, jdzstz - gmail dot com wrote:
>About ncurses library, you can get rid of all terminfo files if you
>replace ncurses with pdcurses: http://pdcurses.sourceforge.net/
>
>I have compiled varnish cache with pdcurses and it works fine.
>
>You have to:
>  *  compile pdcurses library in cygwin
>  *  include curses.h files of pdcurses instead ncurses one's
>  *  use -lpdcurses instead -lncurses

  * still provide the sources for all of the above to anyone outside of
    your organization who receives your binaries

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: distributing executables for windows
  2011-03-03  8:10       ` anctop
  2011-03-03 10:32         ` jdzstz - gmail dot com
@ 2011-03-03 16:45         ` Charles Wilson
       [not found]           ` <20110304051757.000036ce@unknown>
  2011-03-04  6:31           ` Christopher Faylor
  1 sibling, 2 replies; 11+ messages in thread
From: Charles Wilson @ 2011-03-03 16:45 UTC (permalink / raw)
  To: cygwin

On 3/3/2011 3:10 AM, anctop wrote:
> Thank you very much for your info, it now works.
> 
> Just for curiosity :
> 1. The files in "/usr/share/terminfo/c" are identical to those in
> "/usr/share/terminfo/63", but the former one does not work. What're
> their differences ?

The files in /usr/share/terminfo/<single letter>/ are used by
applications that link against the cygncurses-8.dll or older (e.g.
ncurses-5.5-10 or older). They were compiled using what is now called
'tic0.exe' (and old version of the 'tic' program) and distributed as
part of the terminfo0 and terminfo0-extra packages.

The files in /usr/share/terminfo/<2 digit hex code>/ are used by
applications that link against newer versions of ncurses AND ncursesw
(5.7-1 or newer) -- that is, cygncurses-9.dll or newer.  These files
were compiled by a modern version of the 'tic' program (tic.exe) and
distributed as part of the terminfo and terminfo-extra packages.

/usr/share/doc/Cygwin/ncurses.README
/usr/share/doc/Cygwin/terminfo.README
/usr/share/doc/Cygwin/terminfo0.README

provide additional information:
> As contrasted with the backwards-compatible terminfo0 package, in this
> version the database entries are arranged by the two-char hex code of
> the first letter of the entry name, rather than by that first letter
> itself.  The older arrangement can cause problems on case-insensitve
> file systems. That is:
>    old:   r/rxvt    R/Rxvt    (clash!)
>    new:   72/rxvt   52/Rxvt   (no clash)
> Both versions of the database can be installed at the same time. The
> newer structure is used by cygncurses-9.dll and its clients. The older
> structure is used by cygncurses-8.dll and its clients.


> 2. The "less" executable distributed by the GnuWin32 project depends
> only on a single external library "libpcre", is this possible with
> cygwin ?

Anything is possible. Shall cygwin's less.exe be changed in this manner?

I'm not the less maintainer, but I can almost guarantee the answer is "No."

GnuWin32 distributes native win32 ports.  Cygwin distributes (mostly)
cygwin ports, and (almost) all binaries distributed by cygwin will
depend on the cygwin runtime dll, as a minimum.

Furthermore, cygwin attempts to provide as close to a POSIX or Linux
"experience" as possible -- e.g. all the bells and whistles, including
i18n (and now, native language/code page/encoding) support, extended
terminal handling support, etc.  GnuWin32 is willing to accept somewhat
limited functionality in return for "it just kinda works without a lot
of extra dependencies".

Hence, their less.exe has only a single dep for regular expression
support...but little in the way of terminal handling, highlighting,
color, switch-to-$EDITOR, alternate screen...

=====
However, all of this rather avoids the central question: WHY are you
trying to do all this?

You're jumping thru hoops to create a "mini" cygwin distribution that
(a) is "installed" using some unsupported method -- e.g. not setup.exe
(b) is missing some integral elements -- like the terminfo database, and
(c) doesn't really provide anything OTHER than what a standard 'Base'
cygwin installation installs, except for
(d) an exciting probability that it will be both broken, and break any
existing, working, cygwin installation your users have already installed.

This, to me, does not seem to be the path of wisdom.

Why don't you instead simply do this:

1) download setup.exe
2) run it to install a minimal cygwin instance (it's called the 'Base'
installation because if you try to strip anything MORE from it, you get
a broken install.  As you have discovered the hard way).
   setup.exe --root 'C:/my-custom-cygwin' --categories 'Base' --no-shortcuts

The end.  You can even bundle it with a pre-populated tree of .tar.bz2
(AND -src.tar.bz2 !!!!!) packages, use the --local-install or
--local-package-dir options, and your users won't even need network
access.  There are some tricks here, so if this is of interest start a
new thread and ask about it.


Now, if you want something even smaller, with only a limited collection
of unix utilities but without cygwin's full POSIX environment...perhaps
you shouldn't be looking at cygwin at all.  Maybe you should just use
http://gnuwin32.sourceforge.net/ itself, or
http://unxutils.sourceforge.net/ ?


--
Chuck

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: distributing executables for windows
       [not found]           ` <20110304051757.000036ce@unknown>
@ 2011-03-04  6:11             ` Charles Wilson
  2011-03-04 10:18               ` Bruce Cran
  0 siblings, 1 reply; 11+ messages in thread
From: Charles Wilson @ 2011-03-04  6:11 UTC (permalink / raw)
  Cc: cygwin

On 3/4/2011 12:17 AM, Bruce Cran wrote:
> Charles Wilson <...> wrote:

Please don't feed the spammers.

> The "base" installation also seems to include things like manual pages
> etc. that aren't required and don't cause any breakage if removed. One
> problem with running setup.exe is that when uninstalling your
> application cygwin won't be removed since the files will have been
> installed outside of the MSI system.

Then, after installing a base installation on your development machine,
remove the man pages, and treat that directory tree as the "source" for
an MSI-based installer, and embrace your future as a 3PP.  (You'll still
need to archive all of the relevant -src packages, and make them
available to your users, to fulfill your responsibilities under the GPL)

http://www.cygwin.com/acronyms/#3PP

'Course, this list will support neither you nor your users if ever they
run into a problem with the installation that results.  We don't have
time to support every frankenstein "cygwin" bowdlerization on the planet...

Still, it seems like an awful lot of effort, and future pain, to avoid a
few 10's of KB of compressed man pages...have fun.

--
Chuck



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: distributing executables for windows
  2011-03-03 16:45         ` Charles Wilson
       [not found]           ` <20110304051757.000036ce@unknown>
@ 2011-03-04  6:31           ` Christopher Faylor
  1 sibling, 0 replies; 11+ messages in thread
From: Christopher Faylor @ 2011-03-04  6:31 UTC (permalink / raw)
  To: cygwin

On Thu, Mar 03, 2011 at 11:44:47AM -0500, Charles Wilson wrote:
>On 3/3/2011 3:10 AM, anctop wrote:
>>2.  The "less" executable distributed by the GnuWin32 project depends
>>only on a single external library "libpcre", is this possible with
>>cygwin ?
>
>Anything is possible.  Shall cygwin's less.exe be changed in this
>manner?
>
>I'm not the less maintainer, but I can almost guarantee the answer is
>"No."

You're prescient.

"No"

This would exactly contradict the whole point of the project.

But, then, if you want something like this and GnuWin32 (I never have
understood why RMS doesn't come down on these folks since he hates to
see the word GNU and WIN put together) then just use that!  It's
an amazingly simple solution.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: distributing executables for windows
  2011-03-04  6:11             ` Charles Wilson
@ 2011-03-04 10:18               ` Bruce Cran
  0 siblings, 0 replies; 11+ messages in thread
From: Bruce Cran @ 2011-03-04 10:18 UTC (permalink / raw)
  To: Charles Wilson; +Cc: cygwin

On Fri, 04 Mar 2011 01:11:23 -0500
Charles Wilson <> wrote:

> 'Course, this list will support neither you nor your users if ever
> they run into a problem with the installation that results.  We don't
> have time to support every frankenstein "cygwin" bowdlerization on
> the planet...
> 
> Still, it seems like an awful lot of effort, and future pain, to
> avoid a few 10's of KB of compressed man pages...have fun.

I've tested the solution on different machines and it seems to
work, with just 17 executables in /bin (cygwin in total uses 9MB) - I
wasn't prepared to require users to install 70MB of cygwin (which can't
be uninstalled!) just to support a simple 2MB application so I did my
research and found out just what little was actually required, given a
custom batch file to launch it. I realise I won't get any support for
it, but I have enough technical knowledge that I don't think I'll need
it.

-- 
Bruce Cran

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-03-04 10:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-03  3:55 distributing executables for windows anctop
2011-03-03  6:45 ` Andy Koppe
2011-03-03  7:17   ` anctop
2011-03-03  7:22     ` Andy Koppe
2011-03-03  8:10       ` anctop
2011-03-03 10:32         ` jdzstz - gmail dot com
2011-03-03 15:27           ` Christopher Faylor
2011-03-03 16:45         ` Charles Wilson
     [not found]           ` <20110304051757.000036ce@unknown>
2011-03-04  6:11             ` Charles Wilson
2011-03-04 10:18               ` Bruce Cran
2011-03-04  6:31           ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).