Skip Menu |

This queue is for tickets about the Crypt-IDEA CPAN distribution.

Report information
The Basics
Id: 5219
Status: resolved
Priority: 0/
Queue: Crypt-IDEA

People
Owner: DPARIS [...] cpan.org
Requestors: tdahlheim [...] gmx.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.02
Fixed in: (no value)



Subject: Removing dependency on endian.h
Hi, Crypt::IDEA won't compile without changes on platforms lacking the endian.h header. I'd like to suggest the following patch to remove the dependency on endian.h: diff -u Crypt-IDEA-1.02.orig/Makefile.PL Crypt-IDEA-1.02/Makefile.PL --- Crypt-IDEA-1.02.orig/Makefile.PL 2003-01-19 03:49:56.000000000 +0100 +++ Crypt-IDEA-1.02/Makefile.PL 2004-02-03 17:36:20.000000000 +0100 @@ -1,6 +1,11 @@ #! /usr/local/bin/perl use ExtUtils::MakeMaker; + +# Determine byte order +$is_little_endian = unpack('c', pack('s', 1)); +$byte_order = $is_little_endian ? "LITTLE_ENDIAN" : "BIG_ENDIAN"; + # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile being created. WriteMakefile( @@ -8,6 +13,7 @@ 'DISTNAME' => 'Crypt-IDEA', 'VERSION' => '1.02', 'OBJECT' => 'IDEA.o _idea.o', + 'DEFINE' => "-DBYTE_ORDER=$byte_order", 'dist' => {COMPRESS=>'gzip', SUFFIX=>'gz'} ); diff -u Crypt-IDEA-1.02.orig/_idea.c Crypt-IDEA-1.02/_idea.c --- Crypt-IDEA-1.02.orig/_idea.c 1999-05-22 22:30:48.000000000 +0200 +++ Crypt-IDEA-1.02/_idea.c 2004-02-03 17:32:48.000000000 +0100 @@ -5,8 +5,6 @@ #include "idea.h" -#include <endian.h> - #define KEYS_PER_ROUND 6 #define ROUNDS 8 #define KEYLEN (KEYS_PER_ROUND*ROUNDS+4)
Subject: Removing dependency on endian.h - short note/procedure on how to build IDEA
From: Amanda
[guest - Thu Feb 5 14:35:38 2004]: Show quoted text
> Hi, > > Crypt::IDEA won't compile without changes on platforms lacking the > endian.h header. I'd like to suggest the following patch to remove > the dependency on endian.h: > > > diff -u Crypt-IDEA-1.02.orig/Makefile.PL Crypt-IDEA-1.02/Makefile.PL > --- Crypt-IDEA-1.02.orig/Makefile.PL 2003-01-19 03:49:56.000000000
+0100 Show quoted text
> +++ Crypt-IDEA-1.02/Makefile.PL 2004-02-03 17:36:20.000000000
+0100 Show quoted text
> @@ -1,6 +1,11 @@ > #! /usr/local/bin/perl > > use ExtUtils::MakeMaker; > + > +# Determine byte order > +$is_little_endian = unpack('c', pack('s', 1)); > +$byte_order = $is_little_endian ? "LITTLE_ENDIAN" : "BIG_ENDIAN"; > + > # See lib/ExtUtils/MakeMaker.pm for details of how to influence > # the contents of the Makefile being created. > WriteMakefile( > @@ -8,6 +13,7 @@ > 'DISTNAME' => 'Crypt-IDEA', > 'VERSION' => '1.02', > 'OBJECT' => 'IDEA.o _idea.o', > + 'DEFINE' => "-DBYTE_ORDER=$byte_order", > 'dist' => {COMPRESS=>'gzip', SUFFIX=>'gz'} > ); > > diff -u Crypt-IDEA-1.02.orig/_idea.c Crypt-IDEA-1.02/_idea.c > --- Crypt-IDEA-1.02.orig/_idea.c 1999-05-22 22:30:48.000000000
+0200 Show quoted text
> +++ Crypt-IDEA-1.02/_idea.c 2004-02-03 17:32:48.000000000 +0100 > @@ -5,8 +5,6 @@ > > #include "idea.h" > > -#include <endian.h> > - > #define KEYS_PER_ROUND 6 > #define ROUNDS 8 > #define KEYLEN (KEYS_PER_ROUND*ROUNDS+4)
Changes need to be done for IDEA to work on solaris 2.8 due to sys/types.h and LITTLE_ENDIAN 1. vi idea.h and change all u_int16_t to uint16_t 2. vi _idea.c and change the following to items a. change "#include <endian.h>" to "#include <arpa/nameser_compat.h> b. change all u_int16_t to uint16_t 3. vi IDEA.xs and change all u_int16_t to uint16_t Now you can start your procedure to compile, test and install it Hope this short note will help you Amanda
From: Eric
The modifications that did not demand you switch to the arp header file worked for me as I didnt have that header file either, COmpiled very nicely.
Subject: Patch for version 1.02 on Solaris 9, Perl 5.8.5
From: Ryan
Attached is a patch that makes the changes described by Amanda to idea.h, _idea.c and IDEA.xs. This compiles without errors and all tests succeed on Solaris 9, Perl 5.8.5 from Sun Freeware. -Ryan
Download diff
application/octet-stream 3.3k

Message body not shown because it is not plain text.

The patch has been applied and is now in Crypt::IDEA 1.04 - to be uploaded shortly. I've tested it on Mac OS X 10.4 and the patch is a rather elegant solution. I'm reluctant to touch the other pieces as Ryan has done a nice job for sunfreeware. -dsp