public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* distinguishing cygwin from mingw binaries
@ 2017-07-10 17:40 Nellis, Kenneth
  2017-07-10 19:01 ` Hans-Bernhard Bröker
  2017-07-11 14:37 ` cyg Simple
  0 siblings, 2 replies; 6+ messages in thread
From: Nellis, Kenneth @ 2017-07-10 17:40 UTC (permalink / raw)
  To: cygwin

For my personal use, I use gcc to generate binaries, but occasionally I need 
to make a binary available to someone who doesn't use Cygwin. For that I use 
Cygwin's x86_64-w64-mingw32-gcc.

After the fact, I would like to know whether the binary requires Cygwin support 
or not. One way is: strings foo.exe | grep cygwin1.dll

Curious what techniques others might use.

One of my wishes for Cygwin is for the "file" command to make the distinction.

--Ken Nellis

--
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] 6+ messages in thread

* Re: distinguishing cygwin from mingw binaries
  2017-07-10 17:40 distinguishing cygwin from mingw binaries Nellis, Kenneth
@ 2017-07-10 19:01 ` Hans-Bernhard Bröker
  2017-07-11 14:20   ` Nellis, Kenneth
  2017-07-11 14:37 ` cyg Simple
  1 sibling, 1 reply; 6+ messages in thread
From: Hans-Bernhard Bröker @ 2017-07-10 19:01 UTC (permalink / raw)
  To: cygwin

Am 10.07.2017 um 19:40 schrieb Nellis, Kenneth:
> For my personal use, I use gcc to generate binaries, but occasionally I need
> to make a binary available to someone who doesn't use Cygwin. For that I use
> Cygwin's x86_64-w64-mingw32-gcc.
> 
> After the fact, I would like to know whether the binary requires Cygwin support
> or not. One way is: strings foo.exe | grep cygwin1.dll

That's a bit too rough.  Something like

	cygcheck ./foo.exe  | grep cygwin1.dll
or	ldd ./foo.exe | grep cygwin1.dll

would be more precise.

> One of my wishes for Cygwin is for the "file" command to make the distinction.

Well, SHTDI. IOW: please don't feel as if anybody were keeping you from 
constructing a 'file' rule that achieves that, and offering it to the 
public.  ;-)

--
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] 6+ messages in thread

* RE: distinguishing cygwin from mingw binaries
  2017-07-10 19:01 ` Hans-Bernhard Bröker
@ 2017-07-11 14:20   ` Nellis, Kenneth
  0 siblings, 0 replies; 6+ messages in thread
From: Nellis, Kenneth @ 2017-07-11 14:20 UTC (permalink / raw)
  To: Hans-Bernhard Bröker, cygwin

From: Hans-Bernhard Bröker
> That's a bit too rough.  Something like
> 
> 	cygcheck ./foo.exe  | grep cygwin1.dll
> or	ldd ./foo.exe | grep cygwin1.dll
> 
> would be more precise.

Appreciate the improved tests. Thanx!

> > One of my wishes for Cygwin is for the "file" command to make the
> distinction.
> 
> Well, SHTDI. IOW: please don't feel as if anybody were keeping you from
> constructing a 'file' rule that achieves that, and offering it to the
> public.  ;-)

Of course. Just expressing a wish in case someone with more know-how
than I has their interest piqued by the idea.

--Ken Nellis

--
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] 6+ messages in thread

* Re: distinguishing cygwin from mingw binaries
  2017-07-10 17:40 distinguishing cygwin from mingw binaries Nellis, Kenneth
  2017-07-10 19:01 ` Hans-Bernhard Bröker
@ 2017-07-11 14:37 ` cyg Simple
  1 sibling, 0 replies; 6+ messages in thread
From: cyg Simple @ 2017-07-11 14:37 UTC (permalink / raw)
  To: cygwin

On 7/10/2017 1:40 PM, Nellis, Kenneth wrote:
> For my personal use, I use gcc to generate binaries, but occasionally I need 
> to make a binary available to someone who doesn't use Cygwin. For that I use 
> Cygwin's x86_64-w64-mingw32-gcc.
> 
> After the fact, I would like to know whether the binary requires Cygwin support 
> or not. One way is: strings foo.exe | grep cygwin1.dll
> 
> Curious what techniques others might use.
> 

I would use a --prefix or whatever defines the install directories in
your cases to be something easily recognizable and install it.  Then
execute a recursive grep on that folder.

grep -lir --binary-files=binary cygwin1.dll /my/install/dir

If a file is listed then you can decide what to do next.

-- 
cyg Simple

--
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] 6+ messages in thread

* Re: distinguishing cygwin from mingw binaries
  2017-07-10 18:01 Kaz Kylheku
@ 2017-07-11 14:43 ` cyg Simple
  0 siblings, 0 replies; 6+ messages in thread
From: cyg Simple @ 2017-07-11 14:43 UTC (permalink / raw)
  To: cygwin

On 7/10/2017 2:00 PM, Kaz Kylheku wrote:
> On 10.07.2017 10:40, Nellis, Kenneth wrote:
>> For my personal use, I use gcc to generate binaries, but occasionally
>> I need
>> to make a binary available to someone who doesn't use Cygwin. For that
>> I use
>> Cygwin's x86_64-w64-mingw32-gcc.
>>
>> After the fact, I would like to know whether the binary requires
>> Cygwin support
>> or not. One way is: strings foo.exe | grep cygwin1.dll
>>
>> Curious what techniques others might use.
> 
> There is always the technique of actually packaging the program
> deliverables
> and then testing them, beginning with installation, if you were the
> end-user.
> 
> If the program doesn't run when installed by itself in C:\Program Files
> somewhere, then it might be missing DLLs.
> 
> I use a special fork of Cygwin called Cygnal for delivering programs to
> users who don't use Cygwin and don't understand POSIX conventions for paths
> and other things.
> 
> http://www.kylheku.com/cygnal/
> 
> With this, you make your executable with the regular Cygwin host compiler.
> Yes, you know your executable needs a CYGWIN1.DLL (and possibly others);
> no guesswork. You package the needed DLL's with the program.
> 
> Except, you use the CYGWIN1.DLL from the Cygnal project rather than the
> stock Cygwin one.
> 
> Example software shipping with Cygnal is the port of the TXR language to
> Win32 and Win64. Installers available here:
> https://bintray.com/kazinator/Binaries/TXR/

CAUTION: This requires you provide the entire source set of Cygnal since
it is actually Cygwin which has the GPL license applied to it.  You
might as well package Cygwin1.dll itself.

-- 
cyg Simple

--
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] 6+ messages in thread

* Re: distinguishing cygwin from mingw binaries
@ 2017-07-10 18:01 Kaz Kylheku
  2017-07-11 14:43 ` cyg Simple
  0 siblings, 1 reply; 6+ messages in thread
From: Kaz Kylheku @ 2017-07-10 18:01 UTC (permalink / raw)
  To: cygwin

On 10.07.2017 10:40, Nellis, Kenneth wrote:
> For my personal use, I use gcc to generate binaries, but occasionally I 
> need
> to make a binary available to someone who doesn't use Cygwin. For that 
> I use
> Cygwin's x86_64-w64-mingw32-gcc.
> 
> After the fact, I would like to know whether the binary requires Cygwin 
> support
> or not. One way is: strings foo.exe | grep cygwin1.dll
> 
> Curious what techniques others might use.

There is always the technique of actually packaging the program 
deliverables
and then testing them, beginning with installation, if you were the 
end-user.

If the program doesn't run when installed by itself in C:\Program Files
somewhere, then it might be missing DLLs.

I use a special fork of Cygwin called Cygnal for delivering programs to
users who don't use Cygwin and don't understand POSIX conventions for 
paths
and other things.

http://www.kylheku.com/cygnal/

With this, you make your executable with the regular Cygwin host 
compiler.
Yes, you know your executable needs a CYGWIN1.DLL (and possibly others);
no guesswork. You package the needed DLL's with the program.

Except, you use the CYGWIN1.DLL from the Cygnal project rather than the
stock Cygwin one.

Example software shipping with Cygnal is the port of the TXR language to
Win32 and Win64. Installers available here:
https://bintray.com/kazinator/Binaries/TXR/


--
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] 6+ messages in thread

end of thread, other threads:[~2017-07-11 14:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-10 17:40 distinguishing cygwin from mingw binaries Nellis, Kenneth
2017-07-10 19:01 ` Hans-Bernhard Bröker
2017-07-11 14:20   ` Nellis, Kenneth
2017-07-11 14:37 ` cyg Simple
2017-07-10 18:01 Kaz Kylheku
2017-07-11 14:43 ` cyg Simple

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).