You guys are welcome to have a look at this fix.

Basically, I add 0002_FD_SETSIZE_depends_on_arch.patch, which makes a different check in pth.h depending on _LP64 (same as what is in Solaris' sys/select.h), using the Solaris' values. It's not very elegant nor portable, but that project appears dead, so it should not be an issue. This should fix the build of 64 bit tools using pth, particularly for GnuPG2.

Cheers,

Laurent


On 27/08/13 15:41, [email protected] wrote:
Revision: 21859
           http://gar.svn.sourceforge.net/gar/?rev=21859&view=rev
Author:   lblume
Date:     2013-08-27 13:41:16 +0000 (Tue, 27 Aug 2013)
Log Message:
-----------
pth/trunk: Modify pth.h so it can handle FD_SETSIZE for either 32 or 64 bit

Modified Paths:
--------------
     csw/mgar/pkg/pth/trunk/Makefile

Added Paths:
-----------
     csw/mgar/pkg/pth/trunk/files/0001_patch_pth_fdsetsize64.diff
     csw/mgar/pkg/pth/trunk/files/0002_FD_SETSIZE_depends_on_arch.patch

Removed Paths:
-------------
     csw/mgar/pkg/pth/trunk/files/patch_pth_fdsetsize64.diff

Modified: csw/mgar/pkg/pth/trunk/Makefile
===================================================================
--- csw/mgar/pkg/pth/trunk/Makefile     2013-08-27 12:14:47 UTC (rev 21858)
+++ csw/mgar/pkg/pth/trunk/Makefile     2013-08-27 13:41:16 UTC (rev 21859)
@@ -13,8 +13,11 @@
  DISTFILES  = $(DISTNAME).tar.gz

  # Patch PTH.H to increase FD_SETSIZE for 64bit builds
-PATCHFILES = patch_pth_fdsetsize64.diff
+PATCHFILES += 0001_patch_pth_fdsetsize64.diff

+# The max FD_SETSIZE test must depend on the architecture being built
+PATCHFILES += 0002_FD_SETSIZE_depends_on_arch.patch
+
  VENDOR_URL = http://www.gnu.org/software/pth/

  PACKAGES += CSWlibpth20
@@ -29,6 +32,8 @@

  BUILD64_LIBS_ONLY = 1

+CONFIGURE_ARGS = $(DIRPATHS)
+
  # This is an example of 'configure'
  CHECKPKG_OVERRIDES_CSWlibpth-dev += 
file-with-bad-content|/usr/local|root/opt/csw/share/man/man3/pth.3


Copied: csw/mgar/pkg/pth/trunk/files/0001_patch_pth_fdsetsize64.diff (from rev 
21828, csw/mgar/pkg/pth/trunk/files/patch_pth_fdsetsize64.diff)
===================================================================
--- csw/mgar/pkg/pth/trunk/files/0001_patch_pth_fdsetsize64.diff                
                (rev 0)
+++ csw/mgar/pkg/pth/trunk/files/0001_patch_pth_fdsetsize64.diff        
2013-08-27 13:41:16 UTC (rev 21859)
@@ -0,0 +1,39 @@
+--- pth-2.0.7/configure.o      2009-04-03 21:48:07.888815157 -0500
++++ pth-2.0.7/configure        2009-04-03 21:50:45.969836100 -0500
+@@ -19603,7 +19603,7 @@
+ echo $ECHO_N "checking for default value of FD_SETSIZE... $ECHO_C" >&6
+ cross_compiling=no
+ if test "$cross_compiling" = yes; then
+-  ac_fdsetsize=1024
++  ac_fdsetsize=65536
+
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+@@ -19652,7 +19652,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ( exit $ac_status )
+-ac_fdsetsize=1024
++ac_fdsetsize=65536
+ fi
+ rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext 
conftest.$ac_ext
+ fi
+@@ -19666,12 +19666,13 @@
+ if test "${with_fdsetsize+set}" = set; then
+   withval="$with_fdsetsize"
+
+-case $withval in
+-    [1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]) PTH_FDSETSIZE=$withval ;;
+-    * ) { { echo "$as_me:$LINENO: error: invalid FD_SETSIZE specified -- allowed: 
10-9999" >&5
++  if test $withval -ge 10 -a test $withval -le 65536; then
++      PTH_FDSETSIZE=$withval
++  else
++      { { echo "$as_me:$LINENO: error: invalid FD_SETSIZE specified -- allowed: 
10-9999" >&5
+ echo "$as_me: error: invalid FD_SETSIZE specified -- allowed: 10-9999" >&2;}
+-   { (exit 1); exit 1; }; } ;;
+-esac
++   { (exit 1); exit 1; }; }
++fi
+ CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=$PTH_FDSETSIZE"
+ echo "$as_me:$LINENO: checking for overridden FD_SETSIZE value" >&5
+ echo $ECHO_N "checking for overridden FD_SETSIZE value... $ECHO_C" >&6

Added: csw/mgar/pkg/pth/trunk/files/0002_FD_SETSIZE_depends_on_arch.patch
===================================================================
--- csw/mgar/pkg/pth/trunk/files/0002_FD_SETSIZE_depends_on_arch.patch          
                (rev 0)
+++ csw/mgar/pkg/pth/trunk/files/0002_FD_SETSIZE_depends_on_arch.patch  
2013-08-27 13:41:16 UTC (rev 21859)
@@ -0,0 +1,17 @@
+--- a/pth.h.in
++++ b/pth.h.in
+@@ -89,7 +89,13 @@ struct timespec;
+
+     /* check if the user requests a bigger FD_SETSIZE than we can handle */
+ #if defined(FD_SETSIZE)
+-#if FD_SETSIZE > @PTH_FDSETSIZE@
++#ifdef _LP64
++#if FD_SETSIZE > 65536
++#error "FD_SETSIZE is larger than what GNU Pth can handle."
++#endif
++#else /* ! _LP64 */
++#if FD_SETSIZE > 1024
+ #error "FD_SETSIZE is larger than what GNU Pth can handle."
++#endif
+ #endif
+ #endif

Deleted: csw/mgar/pkg/pth/trunk/files/patch_pth_fdsetsize64.diff
===================================================================
--- csw/mgar/pkg/pth/trunk/files/patch_pth_fdsetsize64.diff     2013-08-27 
12:14:47 UTC (rev 21858)
+++ csw/mgar/pkg/pth/trunk/files/patch_pth_fdsetsize64.diff     2013-08-27 
13:41:16 UTC (rev 21859)
@@ -1,39 +0,0 @@
---- pth-2.0.7/configure.o      2009-04-03 21:48:07.888815157 -0500
-+++ pth-2.0.7/configure        2009-04-03 21:50:45.969836100 -0500
-@@ -19603,7 +19603,7 @@
- echo $ECHO_N "checking for default value of FD_SETSIZE... $ECHO_C" >&6
- cross_compiling=no
- if test "$cross_compiling" = yes; then
--  ac_fdsetsize=1024
-+  ac_fdsetsize=65536
-
- else
-   cat >conftest.$ac_ext <<_ACEOF
-@@ -19652,7 +19652,7 @@
- sed 's/^/| /' conftest.$ac_ext >&5
-
- ( exit $ac_status )
--ac_fdsetsize=1024
-+ac_fdsetsize=65536
- fi
- rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext 
conftest.$ac_ext
- fi
-@@ -19666,12 +19666,13 @@
- if test "${with_fdsetsize+set}" = set; then
-   withval="$with_fdsetsize"
-
--case $withval in
--    [1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]) PTH_FDSETSIZE=$withval ;;
--    * ) { { echo "$as_me:$LINENO: error: invalid FD_SETSIZE specified -- allowed: 
10-9999" >&5
-+  if test $withval -ge 10 -a test $withval -le 65536; then
-+      PTH_FDSETSIZE=$withval
-+  else
-+      { { echo "$as_me:$LINENO: error: invalid FD_SETSIZE specified -- allowed: 
10-9999" >&5
- echo "$as_me: error: invalid FD_SETSIZE specified -- allowed: 10-9999" >&2;}
--   { (exit 1); exit 1; }; } ;;
--esac
-+   { (exit 1); exit 1; }; }
-+fi
- CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=$PTH_FDSETSIZE"
- echo "$as_me:$LINENO: checking for overridden FD_SETSIZE value" >&5
- echo $ECHO_N "checking for overridden FD_SETSIZE value... $ECHO_C" >&6

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

_______________________________________________
devel mailing list
[email protected]
https://lists.opencsw.org/mailman/listinfo/devel


_______________________________________________
devel mailing list
[email protected]
https://lists.opencsw.org/mailman/listinfo/devel

Reply via email to