Cygwin Package Port: Difference between revisions

From miki
Jump to navigation Jump to search
(→‎socat: Building 2.0.0.0 beta 2)
 
(→‎Socat 2.0.0 beta 2: also need openssl-devel)
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:


== Socat ==
== Socat ==

=== Socat 1.6.0.1 ===


A port of '''socat 1.6.0.1''' on Cygwin is easily obtained (see [http://www.nikhef.nl/~janjust/socat/]).
A port of '''socat 1.6.0.1''' on Cygwin is easily obtained (see [http://www.nikhef.nl/~janjust/socat/]).
Line 13: Line 15:
</source>
</source>


Porting '''socat 2.0.0.0 beta 2'''. After untar:
=== Socat 2.0.0 beta 2 ===


<blockquote><font color="red">'''!!! Interaction with McAfee Anti-Virus !!!'''</font> - McAfee AV detects socat 2.0.0-b2 as a potentially unwanted program, and deletes <tt>socat.exe</tt> at first execution. To prevent this, open ''McAfee VirusScan Console'' &rarr; ''Unwanted program policy'' &rarr; ''Unwanted program exclusions'' &rarr; click ''Exlusions... '' &rarr; click ''Add...'' &rarr; click ''Browse...'' &rarr; select 'Socat' and then click ''Ok''. This should prevent McAfee AV to detect ''Socat'' as an unwanted program.</blockquote>
<source lang="bash">

./configure
First install the following packages in Cygwin:
make
* <tt>libwrap-devel</tt> (optional - to enable tcp wrappers)
</source>
* <tt>readline</tt> (optional - to enable readline)
This gives the error message
* <tt>minires</tt>, <tt>minires-devel</tt> (optional - to enable resolver)
* <tt>openssl-devel</tt> (optional - to enable openssl)

The following changes must be made to the build & install procedure:
* Add <tt>LIBS="-lresolv"</tt> to configure call (note that <tt>/lib/libresolv.a</tt> is a link to <tt>/lib/libminires.dll.a</tt> on Cygwin). This is only needed if package <tt>minires-devel</tt> is installed. In that case, HAVE_RESOLV_H is defined, and without this change, we get the compilation error:
<pre>
<pre>
gcc -O -D_GNU_SOURCE -Wall -Wno-parentheses -DHAVE_CONFIG_H -I. -o socat socat.o libxio.a -lutil -lssl -lcrypto -lpthread
gcc -O -D_GNU_SOURCE -Wall -Wno-parentheses -DHAVE_CONFIG_H -I. -o socat socat.o libxio.a -lutil -lssl -lcrypto -lpthread
Line 26: Line 33:
...
...
</pre>
</pre>

A way to fix it is to tell to link ''socat'' with the resolv library:
The build & install procedure:
<source lang="bash">
<source lang="bash">
./configure LIBS="-lresolv"
gcc -O -D_GNU_SOURCE -Wall -Wno-parentheses -DHAVE_CONFIG_H -I. -o socat socat.o libxio.a -lutil -lssl -lcrypto -lpthread -lresolv
make
make install
</source>

Note that a custom <tt>config.h</tt> and <tt>Makefile</tt> for Cygwin can also be found in the directory <tt>config/</tt>.

Tests can be run, but it needs the following changes to <tt>test.sh</tt>
<source lang="diff">
--- socat-2.0.0-b2/test.sh 2008-11-16 23:33:09.312500000 +0100
+++ socat-2.0.0-b2-cygwin/test.sh 2008-11-16 23:25:21.312500000 +0100
@@ -2189,7 +2189,7 @@
# with MacOS, this test hangs if nonblock is not used. Is an OS bug.
tp="$td/pipe$N"
# note: the nonblock is required by MacOS 10.1(?), otherwise it hangs (OS bug?)
-testecho "$N" "$TEST" "" "pipe:$tp,nonblock" "$opts"
+#testecho "$N" "$TEST" "" "pipe:$tp,nonblock" "$opts"
esac
N=$((N+1))
</source>

Apply the patch above, and run the tests:
<source lang="bash">
patch -Np1 <test.sh.patch
make test
</source>
</source>
(note that <tt>/lib/libresolv.a</tt> is a link to <tt>/lib/libminires.dll.a</tt> on Cygwin)

Latest revision as of 15:03, 18 November 2008

This page explains how to build on Cygwin packages that are not part of the official Cygwin distribution.

Socat

Socat 1.6.0.1

A port of socat 1.6.0.1 on Cygwin is easily obtained (see [1]).

After untar & cd:

./configure
make
make install
make test

Socat 2.0.0 beta 2

!!! Interaction with McAfee Anti-Virus !!! - McAfee AV detects socat 2.0.0-b2 as a potentially unwanted program, and deletes socat.exe at first execution. To prevent this, open McAfee VirusScan ConsoleUnwanted program policyUnwanted program exclusions → click Exlusions... → click Add... → click Browse... → select 'Socat' and then click Ok. This should prevent McAfee AV to detect Socat as an unwanted program.

First install the following packages in Cygwin:

  • libwrap-devel (optional - to enable tcp wrappers)
  • readline (optional - to enable readline)
  • minires, minires-devel (optional - to enable resolver)
  • openssl-devel (optional - to enable openssl)

The following changes must be made to the build & install procedure:

  • Add LIBS="-lresolv" to configure call (note that /lib/libresolv.a is a link to /lib/libminires.dll.a on Cygwin). This is only needed if package minires-devel is installed. In that case, HAVE_RESOLV_H is defined, and without this change, we get the compilation error:
gcc -O -D_GNU_SOURCE  -Wall -Wno-parentheses -DHAVE_CONFIG_H -I.   -o socat socat.o libxio.a -lutil  -lssl -lcrypto -lpthread
libxio.a(xio-ip.o):xio-ip.c:(.text+0x24): undefined reference to `___res_init'
libxio.a(xio-ip.o):xio-ip.c:(.text+0x51): undefined reference to `___res_state'
...

The build & install procedure:

./configure LIBS="-lresolv"
make
make install

Note that a custom config.h and Makefile for Cygwin can also be found in the directory config/.

Tests can be run, but it needs the following changes to test.sh

--- socat-2.0.0-b2/test.sh      2008-11-16 23:33:09.312500000 +0100
+++ socat-2.0.0-b2-cygwin/test.sh       2008-11-16 23:25:21.312500000 +0100
@@ -2189,7 +2189,7 @@
 # with MacOS, this test hangs if nonblock is not used. Is an OS bug.
 tp="$td/pipe$N"
 # note: the nonblock is required by MacOS 10.1(?), otherwise it hangs (OS bug?)
-testecho "$N" "$TEST" "" "pipe:$tp,nonblock" "$opts"
+#testecho "$N" "$TEST" "" "pipe:$tp,nonblock" "$opts"
 esac
 N=$((N+1))

Apply the patch above, and run the tests:

patch -Np1 <test.sh.patch
make test