Skip to contentSkip to conversation

socat: Add version 1.7.1.2

PATCH Superseded John Faith 4 participants 9 messages Jan 23, 2010

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

John Faith

author
#0 lore raw

PATCH 1/1 socat: Add version 1.7.1.2

Allow socat 1.7.1.2 to cross build. In configure.in, the 4th value in AC_TRY_RUN() gives a default value for cross build environments since a test program cannot be run on the build system. There are 2 places where AC_MSG_RESULT() is used instead of a default value which seems to result in code like "#define CRDLY_SHIFT" which breaks preprocessor checks like "#if CRDLY_SHIFT >= 0".

The patch gives default values in configure and configure.in for cross compiling and checks were added in the affected source.

---
 recipes/socat/files/socat-1.7.1.2-cross.patch |   98 +++++++++++++++++++++++++
 recipes/socat/socat_1.7.1.2.bb                |   23 ++++++
 2 files changed, 121 insertions(+), 0 deletions(-)
 create mode 100644 recipes/socat/files/socat-1.7.1.2-cross.patch
 create mode 100644 recipes/socat/socat_1.7.1.2.bb
recipes/socat/files/socat-1.7.1.2-cross.patch new file +98 -0
new file mode 100644
index 0000000..b2380f8
@@ -0,0 +1,98 @@
+--- socat-1.7.1.2/configure.in.orig	2010-01-10 05:29:50.000000000 -0800
++++ socat-1.7.1.2/configure.in	2010-01-21 09:41:42.959191482 -0800
+@@ -1286,10 +1286,13 @@ AC_CACHE_CHECK(shift offset of $1, $2,
+  ],
+  [$2=`cat $conftestoffset`],
+  [$2=-1],
+- [AC_MSG_RESULT(please determine $1_SHIFT manually)]
++ [$2=-1]
+ )
+  LIBS="$LIBS1"])
+ AC_DEFINE_UNQUOTED($1_SHIFT, ${$2})
++if test "$2" = -1; then
++AC_MSG_WARN(please determine $1_SHIFT manually)
++fi
+ ])
+ 
+ AC_SHIFT_OFFSET(CRDLY,  sc_cv_sys_crdly_shift)
+--- socat-1.7.1.2/configure.orig	2010-01-10 05:39:29.000000000 -0800
++++ socat-1.7.1.2/configure	2010-01-21 10:01:27.463190768 -0800
+@@ -13596,6 +13596,7 @@ else
+  if test "$cross_compiling" = yes; then
+   { echo "$as_me:$LINENO: result: please determine CRDLY_SHIFT manually" >&5
+ echo "${ECHO_T}please determine CRDLY_SHIFT manually" >&6; }
++	sc_cv_sys_crdly_shift=-1
+ 
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+@@ -13680,6 +13681,7 @@ else
+  if test "$cross_compiling" = yes; then
+   { echo "$as_me:$LINENO: result: please determine TABDLY_SHIFT manually" >&5
+ echo "${ECHO_T}please determine TABDLY_SHIFT manually" >&6; }
++	sc_cv_sys_tabdly_shift=-1
+ 
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+@@ -13764,6 +13766,7 @@ else
+  if test "$cross_compiling" = yes; then
+   { echo "$as_me:$LINENO: result: please determine CSIZE_SHIFT manually" >&5
+ echo "${ECHO_T}please determine CSIZE_SHIFT manually" >&6; }
++	sc_cv_sys_csize_shift=-1
+ 
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+--- socat-1.7.1.2/xioopts.c.orig	2010-01-04 04:29:36.000000000 -0800
++++ socat-1.7.1.2/xioopts.c	2010-01-21 10:54:03.561742501 -0800
+@@ -763,7 +763,7 @@ const struct optname optionnames[] = {
+ 	IF_IP6    ("ipv6only",	&opt_ipv6_v6only)
+ #endif
+ 	IF_TERMIOS("isig",	&opt_isig)
+-#ifdef HAVE_TERMIOS_ISPEED
++#if defined(HAVE_TERMIOS_ISPEED) && defined(ISPEED_OFFSET) && (ISPEED_OFFSET != -1)
+ 	IF_TERMIOS("ispeed",	&opt_ispeed)
+ #endif
+ 	IF_TERMIOS("istrip",	&opt_istrip)
+@@ -1077,7 +1077,7 @@ const struct optname optionnames[] = {
+ 	IF_OPENSSL("openssl-pseudo",	&opt_openssl_pseudo)
+ 	IF_OPENSSL("openssl-verify",	&opt_openssl_verify)
+ 	IF_TERMIOS("opost",	&opt_opost)
+-#ifdef HAVE_TERMIOS_ISPEED
++#if defined(HAVE_TERMIOS_ISPEED) && defined(OSPEED_OFFSET) && (OSPEED_OFFSET != -1)
+ 	IF_TERMIOS("ospeed",	&opt_ospeed)
+ #endif
+ 	IF_ANY    ("owner",	&opt_user)
+--- socat-1.7.1.2/xio-termios.c.orig	2009-04-02 00:32:48.000000000 -0700
++++ socat-1.7.1.2/xio-termios.c	2010-01-21 10:51:46.627690848 -0800
+@@ -270,8 +270,12 @@ const struct optdesc opt_raw      = { "r
+ const struct optdesc opt_sane     = { "sane",   NULL,    OPT_SANE,     GROUP_TERMIOS, PH_FD, TYPE_CONST, OFUNC_TERMIOS_SPEC };
+ 
+ #ifdef HAVE_TERMIOS_ISPEED
++#if defined(ISPEED_OFFSET) && (ISPEED_OFFSET != -1)
++#if defined(OSPEED_OFFSET) && (OSPEED_OFFSET != -1)
+ const struct optdesc opt_ispeed = { "ispeed", NULL, OPT_ISPEED, GROUP_TERMIOS, PH_FD, TYPE_UINT, OFUNC_TERMIOS_SPEED, ISPEED_OFFSET };
+ const struct optdesc opt_ospeed = { "ospeed", NULL, OPT_OSPEED, GROUP_TERMIOS, PH_FD, TYPE_UINT, OFUNC_TERMIOS_SPEED, OSPEED_OFFSET };
++#endif
++#endif
+ #endif /* HAVE_TERMIOS_ISPEED */
+ 
+ 
+--- socat-1.7.1.2/xioinitialize.c.orig	2009-04-02 00:32:48.000000000 -0700
++++ socat-1.7.1.2/xioinitialize.c	2010-01-21 10:46:50.620191091 -0800
+@@ -62,12 +62,16 @@ int xioinitialize(void) {
+       assert(tdata.termarg.c_oflag == tdata.flags[1]);
+       assert(tdata.termarg.c_cflag == tdata.flags[2]);
+       assert(tdata.termarg.c_lflag == tdata.flags[3]);
+-#if HAVE_TERMIOS_ISPEED
++#if HAVE_TERMIOS_ISPEED && (ISPEED_OFFSET != -1) && (OSPEED_OFFSET != -1)
++#if defined(ISPEED_OFFSET) && (ISPEED_OFFSET != -1)
++#if defined(OSPEED_OFFSET) && (OSPEED_OFFSET != -1)
+       tdata.termarg.c_ispeed = 0x56789abc;
+       tdata.termarg.c_ospeed = 0x6789abcd;
+       assert(tdata.termarg.c_ispeed == tdata.speeds[ISPEED_OFFSET]);
+       assert(tdata.termarg.c_ospeed == tdata.speeds[OSPEED_OFFSET]);
+ #endif
++#endif
++#endif
+    }
+ #endif
+ 
recipes/socat/socat_1.7.1.2.bb new file +23 -0
new file mode 100644
index 0000000..5bbb421
@@ -0,0 +1,23 @@
+SECTION = "console/network"
+DEPENDS = "openssl readline"
+DESCRIPTION = "Socat is a relay for bidirectional data \
+transfer between two independent data channels."
+LICENSE = "GPL"
+PR = "r1"
+
+SRC_URI = "http://www.dest-unreach.org/socat/download/socat-1.7.1.2.tar.bz2 \
+           file://socat-1.7.1.2-cross.patch;patch=1 "
+
+inherit autotools
+
+do_configure() {
+	# Override this function to avoid autoconf/automake/aclocal/autoheader
+	# since config.h.in gets recreated.
+	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+	oe_runconf
+}
+
+do_install_prepend () {
+	mkdir -p ${D}${bindir}
+	install -d ${D}${bindir} ${D}${mandir}/man1
+}
Signature · 1 line
1.6.3.3
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

recipes/socat/socat_1.7.1.2.bb line 17

Quoted 5 lines · John Faith
recipes/socat/socat_1.7.1.2.bb new file +5 -0
+do_configure() {
+	# Override this function to avoid autoconf/automake/aclocal/autoheader
+	# since config.h.in gets recreated.
+	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+	oe_runconf

Isn't the whole point of autotools_do_configure to recreate such files? When config.h.in triggers an errror it's usually a case of people abusing aclocal.m4.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFLW0/vMkyGM64RGpERAhQiAJ4u5TIrT1f/0b6088k89eL/0sb5VACdHL2O E+c5kZe4tr84wj7kBN5VIDk=
=ebYT
-----END PGP SIGNATURE-----

author
#2 lore raw
Quoted 8 lines · Koen Kooi

On 23-01-10 20:03, John Faith wrote:

recipes/socat/socat_1.7.1.2.bb new file +5 -0
+do_configure() {
+	# Override this function to avoid autoconf/automake/aclocal/autoheader
+	# since config.h.in gets recreated.
+	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+	oe_runconf
Quoted 9 lines

Isn't the whole point of autotools_do_configure to recreate such files? When config.h.in triggers an errror it's usually a case of people abusing aclocal.m4.

regards,

Koen

Hello,
It looked like the config.h.in included in the source tarfile was needed which is why I avoided the autoheader-generated one. Does oe generally have any trouble with a config.h.in included in a package's source?

Thanks,
John

#3 lore raw

What set the state in Patchwork to? (was: [PATCH] socat: Add version 1.7.1.2)

In reply to Koen Kooi

Am Samstag, den 23.01.2010, 20:37 +0100 schrieb Koen Kooi:

Quoted 9 lines

recipes/socat/socat_1.7.1.2.bb line 17

Quoted 5 lines
recipes/socat/socat_1.7.1.2.bb new file +5 -0
+do_configure() {
+     # Override this function to avoid autoconf/automake/aclocal/autoheader
+     # since config.h.in gets recreated.
+     (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+     oe_runconf

Isn't the whole point of autotools_do_configure to recreate such files? When config.h.in triggers an errror it's usually a case of people abusing aclocal.m4.

I want to help in maintaining the statuses in Patchwork. I registered, got pwclient [1] and set up .pwclientrc, which is of course optional.

So regarding this patch. To what status should this be set to?

»Changes Requested« or »Under Review«. I guess the first one and when John updates the patch then to »Superseded«?

pwclient update -s "under review" 1514

This command should do the trick from the command line.

Thanks,

Paul

[1] http://patchwork.openembedded.org/help/pwclient/
[2] http://patchwork.openembedded.org/project/openembedded/pwclientrc/

#4 lore raw
In reply to John Faith

Am Samstag, den 23.01.2010, 11:03 -0800 schrieb John Faith:

Quoted 11 lines

Allow socat 1.7.1.2 to cross build. In configure.in, the 4th value in AC_TRY_RUN() gives a default value for cross build environments since a test program cannot be run on the build system. There are 2 places where AC_MSG_RESULT() is used instead of a default value which seems to result in code like "#define CRDLY_SHIFT" which breaks preprocessor checks like "#if CRDLY_SHIFT >= 0".

The patch gives default values in configure and configure.in for cross compiling and checks were added in the affected source.

Thank you for your patch.

1. Applying your patch gives me warnings.

        $ git am /tmp/\[oe\]_\[PATCH\]_socat\:_Add_version_1.7.1.2 
        Applying: socat: Add version 1.7.1.2
        /srv/filme/oe/openembedded/.git/rebase-apply/patch:29: trailing whitespace.

/srv/filme/oe/openembedded/.git/rebase-apply/patch:38: trailing whitespace.

/srv/filme/oe/openembedded/.git/rebase-apply/patch:46: trailing whitespace.

/srv/filme/oe/openembedded/.git/rebase-apply/patch:54: trailing whitespace.

/srv/filme/oe/openembedded/.git/rebase-apply/patch:60: space before tab in indent.
IF_IP6 ("ipv6only", &opt_ipv6_v6only)
warning: squelched 13 whitespace errors
warning: 18 lines add whitespace errors.

recipes/socat/files/socat-1.7.1.2-cross.patch

Quoted 8 lines
---
 recipes/socat/files/socat-1.7.1.2-cross.patch |   98 +++++++++++++++++++++++++
 recipes/socat/socat_1.7.1.2.bb                |   23 ++++++
 2 files changed, 121 insertions(+), 0 deletions(-)
 create mode 100644 recipes/socat/files/socat-1.7.1.2-cross.patch
 create mode 100644 recipes/socat/socat_1.7.1.2.bb
recipes/socat/files/socat-1.7.1.2-cross.patch +0 -0

[ … I do not no autotools.]

recipes/socat/socat_1.7.1.2.bb line 6

Quoted 12 lines
recipes/socat/socat_1.7.1.2.bb new file +6 -0
new file mode 100644
index 0000000..5bbb421
@@ -0,0 +1,23 @@
+SECTION = "console/network"
+DEPENDS = "openssl readline"
+DESCRIPTION = "Socat is a relay for bidirectional data \
+transfer between two independent data channels."
+LICENSE = "GPL"
+PR = "r1"

You can start with r0 I think.

recipes/socat/socat_1.7.1.2.bb line 8

Quoted 2 lines
recipes/socat/socat_1.7.1.2.bb new file +2 -0
+
+SRC_URI = "http://www.dest-unreach.org/socat/download/socat-1.7.1.2.tar.bz2 \

Can we do this more generic: …/download/${P}.tar.bz2.

Quoted 5 lines
recipes/socat/socat_1.7.1.2.bb new file +5 -0
+           file://socat-1.7.1.2-cross.patch;patch=1 "
+
+inherit autotools
+
+do_configure() {

recipes/socat/socat_1.7.1.2.bb line 23

Quoted 10 lines
recipes/socat/socat_1.7.1.2.bb new file +10 -0
+	# Override this function to avoid autoconf/automake/aclocal/autoheader
+	# since config.h.in gets recreated.
+	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+	oe_runconf
+}
+
+do_install_prepend () {
+	mkdir -p ${D}${bindir}
+	install -d ${D}${bindir} ${D}${mandir}/man1
+}

2. I cannot build your patch because checksums are missing [1].
3. Looking at the difference between socat_1.3.2.1.bb and socat_1.7.1.2.bb there is not much. Could you factor that out into an include file e. g. unify this?

Please fix this up and resend with [PATCH v2] in the subject line and a note in the commit message.

Thanks,

Paul

[1] http://wiki.openembedded.net/index.php/Checksums

#5 lore raw

Paul Menzel <[email protected]> [2010-01-23 20:53:54]:

Quoted 8 lines

1. Applying your patch gives me warnings.

        $ git am /tmp/\[oe\]_\[PATCH\]_socat\:_Add_version_1.7.1.2 
        Applying: socat: Add version 1.7.1.2
        /srv/filme/oe/openembedded/.git/rebase-apply/patch:29: trailing whitespace.

/srv/filme/oe/openembedded/.git/rebase-apply/patch:38: trailing whitespace.

Quoted 8 lines

/srv/filme/oe/openembedded/.git/rebase-apply/patch:46: trailing whitespace.

/srv/filme/oe/openembedded/.git/rebase-apply/patch:54: trailing whitespace.

/srv/filme/oe/openembedded/.git/rebase-apply/patch:60: space before tab in indent.
IF_IP6 ("ipv6only", &opt_ipv6_v6only)
warning: squelched 13 whitespace errors
warning: 18 lines add whitespace errors.

Those are warnings "only", just whitespace errors. It was applied anyway, right? I think, it's because git don't like upstream code much.

-- ynezz

author
#6 lore raw
In reply to Paul Menzel
Quoted 15 lines · Paul Menzel

Am Samstag, den 23.01.2010, 11:03 -0800 schrieb John Faith:

Quoted 2 lines

..

Thank you for your patch.

1. Applying your patch gives me warnings.

        $ git am /tmp/\[oe\]_\[PATCH\]_socat\:_Add_version_1.7.1.2 
        Applying: socat: Add version 1.7.1.2
        /srv/filme/oe/openembedded/.git/rebase-apply/patch:29: trailing whitespace.

/srv/filme/oe/openembedded/.git/rebase-apply/patch:38: trailing whitespace.

Quoted 9 lines

/srv/filme/oe/openembedded/.git/rebase-apply/patch:46: trailing whitespace.

/srv/filme/oe/openembedded/.git/rebase-apply/patch:54: trailing whitespace.

/srv/filme/oe/openembedded/.git/rebase-apply/patch:60: space before tab in indent.
IF_IP6 ("ipv6only", &opt_ipv6_v6only)
warning: squelched 13 whitespace errors
warning: 18 lines add whitespace errors.

There are space-tabs in the original source file so I'm not sure how to remove those. The other trailing whitespace I see is might be an artifact from diff which I used to create files/socat-1.7.1.2-cross.patch; I can remove those manually.

Quoted 17 lines

...

recipes/socat/socat_1.7.1.2.bb line 6

Quoted 13 lines
recipes/socat/socat_1.7.1.2.bb new file +6 -0
new file mode 100644
index 0000000..5bbb421
@@ -0,0 +1,23 @@
+SECTION = "console/network"
+DEPENDS = "openssl readline"
+DESCRIPTION = "Socat is a relay for bidirectional data \
+transfer between two independent data channels."
+LICENSE = "GPL"
+PR = "r1"

You can start with r0 I think.

Ok.

Quoted 7 lines

recipes/socat/socat_1.7.1.2.bb line 8

Quoted 4 lines
recipes/socat/socat_1.7.1.2.bb new file +2 -0
+
+SRC_URI = "http://www.dest-unreach.org/socat/download/socat-1.7.1.2.tar.bz2 \

Can we do this more generic: …/download/${P}.tar.bz2.

Ok.

Quoted 10 lines
Quoted 10 lines
recipes/socat/socat_1.7.1.2.bb new file +10 -0
+           file://socat-1.7.1.2-cross.patch;patch=1 "
+
+inherit autotools
+
+do_configure() {
+	# Override this function to avoid autoconf/automake/aclocal/autoheader
+	# since config.h.in gets recreated.
+	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+	oe_runconf
+}
Quoted 9 lines

recipes/socat/socat_1.7.1.2.bb line 23

Quoted 6 lines
recipes/socat/socat_1.7.1.2.bb new file +5 -0
+
+do_install_prepend () {
+	mkdir -p ${D}${bindir}
+	install -d ${D}${bindir} ${D}${mandir}/man1
+}

2. I cannot build your patch because checksums are missing [1].

Ok, I'll add this.

Quoted 4 lines

3. Looking at the difference between socat_1.3.2.1.bb and socat_1.7.1.2.bb there is not much. Could you factor that out into an include file e. g. unify this?

I'd rather not potentially break v 1.3 and would prefer not to change this.

Quoted 3 lines

Please fix this up and resend with [PATCH v2] in the subject line and a note in the commit message.

git send-email really doesn't want to put "[PATCH v2]" in the mail subject even when I specify --subject on the command line. Could you point me to the trick to do this?

Thanks,
John

#7 lore raw

Am Samstag, den 23.01.2010, 14:31 -0800 schrieb John Faith:

Quoted 1 line

Paul Menzel wrote:

[…]

Quoted 5 lines
Quoted 3 lines

Please fix this up and resend with [PATCH v2] in the subject line and a note in the commit message.

git send-email really doesn't want to put "[PATCH v2]" in the mail subject even when I specify --subject on the command line.

git help send-email says that this just kicks in when --compose is specified too.

Quoted 1 line

Could you point me to the trick to do this?

Good question. The subject seems to be set when you do git format-patch. There you have an option --subject-prefix. So --subject-prefix="PATCH v2" should do the trick.

As you can see in [1] some people also briefly note what changed in the patch revisions. But that is optional I think.

Thanks,

Paul

[1] http://sourceforge.net/mailarchive/forum.php?thread_name=1264014090-18814-1-git-send-email-luca%40luca-barbieri.com&forum_name=dri-devel
(Different style of subject. ;-))

#8 lore raw
In reply to John Faith

John Faith <[email protected]> [2010-01-23 14:31:53]:

Quoted 10 lines
Quoted 4 lines · Paul Menzel

Am Samstag, den 23.01.2010, 11:03 -0800 schrieb John Faith:
warning: squelched 13 whitespace errors
warning: 18 lines add whitespace errors.

There are space-tabs in the original source file so I'm not sure how to remove those. The other trailing whitespace I see is might be an artifact from diff which I used to create files/socat-1.7.1.2-cross.patch; I can remove those manually.

Maybe settings this can fix that whitespace problem?

git config core.whitespace "trailing-space,space-before-tab" git config apply.whitespace "trailing-space,space-before-tab"

-- ynezz