perl 5.10.0 / osx 10.5.2 'make' dies at "error: redefinition of 'union semun'"

2008-03-05 Thread snowcrash+perl
i'm building perl 5.10.0 on

Darwin Kernel Version 9.2.0: Tue Feb  5 16:15:19 PST 2008;
root:xnu-1228.3.13~1/RELEASE_PPC
powerpc-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5531)


currently,

make

dies @ "redef of 'union semun'"


cd /build/perl-5.10.0
make
...
In file included from miniperlmain.c:36:
perl.h:5431: error: redefinition of 'union semun'
make: *** [miniperlmain.o] Error 1


looking @ perl.h:5427
...
#ifdef HAS_SEM
#   include 
#   include 
#   ifndef HAS_UNION_SEMUN  /* Provide the union semun. */
union semun {
int val;
struct semid_ds *buf;
unsigned short  *array;
};
#   endif
#   ifdef USE_SEMCTL_SEMUN
#   ifdef IRIX32_SEMUN_BROKEN_BY_GCC
union gccbug_semun {
int val;
struct semid_ds *buf;
unsigned short  *array;
char__dummy[5];
};
#   define semun gccbug_semun
#   endif
#   define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun)
#   else
#   ifdef USE_SEMCTL_SEMID_DS
#   ifdef EXTRA_F_IN_SEMUN_BUF
#   define Semctl(id, num, cmd, semun) semctl(id, num,
cmd, semun.buff)
#   else
#   define Semctl(id, num, cmd, semun) semctl(id, num,
cmd, semun.buf)
#   endif
#   endif
#   endif
#endif
...


it looks like a HAS_UNION_SEMUN or HAS_SEM needs to be undef'd?

i don't see this issue w/ 5.8.8, so it might be perl-src ...

before I blindly undef/def symbols, can anyone comment/hint on this?

thanks.


Using Perl to Read jar file MANIFEST file.

2008-03-05 Thread Michael Barto




Has anybody every tried to create a Perl program ro read the contents
of the MANIFEST file in java jar file? We are trying to develop
something to provide comparisons for change between different
implementations. Is this a simple Perl backtic, system or exec of the
jar command or is there a more exotic way to do it? Also, we need to
extract Checksum. But that seems documented.
-- 





  

  
  


  Michael Barto
  Software Architect
  
  
  
  


   LogiQwest
Inc.
16458 Bolsa Chica Street, # 15
Huntington Beach, CA  92649
  http://www.logiqwest.com/
  
  
     
  [EMAIL PROTECTED]
Tel:  714 377 3705
Fax: 714 840 3937
Cell: 714 883 1949
  
  


  'tis a gift to be
simple
   


   This e-mail may contain
LogiQwest
proprietary information and should be treated as confidential. 

  








Re: perl 5.10.0 / osx 10.5.2 'make' dies at "error: redefinition of 'union semun'"

2008-03-05 Thread Edward Moy

When I build 5.10.0, I don't have this problem.  In config.h, I have:

#define HAS_UNION_SEMUN /**/

Did you run Configure and does your config.h define HAS_UNION_SEMUN?
--
Edward Moy
Apple Inc.
[EMAIL PROTECTED]

On Mar 5, 2008, at 10:20 AM, snowcrash+perl wrote:


i'm building perl 5.10.0 on

Darwin Kernel Version 9.2.0: Tue Feb  5 16:15:19 PST 2008;
root:xnu-1228.3.13~1/RELEASE_PPC
powerpc-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5531)


currently,

make

dies @ "redef of 'union semun'"


cd /build/perl-5.10.0
make
...
In file included from miniperlmain.c:36:
perl.h:5431: error: redefinition of 'union semun'
make: *** [miniperlmain.o] Error 1


looking @ perl.h:5427
...
#ifdef HAS_SEM
#   include 
#   include 
#   ifndef HAS_UNION_SEMUN  /* Provide the union semun. */
   union semun {
   int val;
   struct semid_ds *buf;
   unsigned short  *array;
   };
#   endif
#   ifdef USE_SEMCTL_SEMUN
#   ifdef IRIX32_SEMUN_BROKEN_BY_GCC
   union gccbug_semun {
   int val;
   struct semid_ds *buf;
   unsigned short  *array;
   char__dummy[5];
   };
#   define semun gccbug_semun
#   endif
#   define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun)
#   else
#   ifdef USE_SEMCTL_SEMID_DS
#   ifdef EXTRA_F_IN_SEMUN_BUF
#   define Semctl(id, num, cmd, semun) semctl(id, num,
cmd, semun.buff)
#   else
#   define Semctl(id, num, cmd, semun) semctl(id, num,
cmd, semun.buf)
#   endif
#   endif
#   endif
#endif
...


it looks like a HAS_UNION_SEMUN or HAS_SEM needs to be undef'd?

i don't see this issue w/ 5.8.8, so it might be perl-src ...

before I blindly undef/def symbols, can anyone comment/hint on this?

thanks.





Re: Using Perl to Read jar file MANIFEST file.

2008-03-05 Thread Claes Jakobsson

On 5 mar 2008, at 19.23, Michael Barto wrote:
Has anybody every tried to create a Perl program ro read the  
contents of the MANIFEST file in java jar file? We are trying to  
develop something to provide comparisons for change between  
different implementations. Is this a simple Perl backtic, system or  
exec of the jar command or is there a more exotic way to do it?  
Also, we need to extract Checksum. But that seems documented.


If I remember correctly JAR files are simply Zip files so you should  
be able to use something like Archive::Zip to read the file.


Cheers
Claes


Re: Using Perl to Read jar file MANIFEST file.

2008-03-05 Thread Claes Jakobsson

#!/usr/bin/perl

use strict;
use warnings;

use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
use Archive::Zip::MemberRead;

my $archive = Archive::Zip->new();
die "read error" if $archive->read(shift) != AZ_OK;

my $fh  = Archive::Zip::MemberRead->new($archive, "META-INF/ 
MANIFEST.MF");

while (defined($_ = $fh->getline())) {
print "$_\n";
}



galaxy:~ claes$ perl jar_reader.pl /usr/share/java/junit.jar
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.5.0_04-b05 (Sun Microsystems Inc.)


seems to work

/Claes

On 5 mar 2008, at 19.40, Claes Jakobsson wrote:

On 5 mar 2008, at 19.23, Michael Barto wrote:
Has anybody every tried to create a Perl program ro read the  
contents of the MANIFEST file in java jar file? We are trying to  
develop something to provide comparisons for change between  
different implementations. Is this a simple Perl backtic, system or  
exec of the jar command or is there a more exotic way to do it?  
Also, we need to extract Checksum. But that seems documented.


If I remember correctly JAR files are simply Zip files so you should  
be able to use something like Archive::Zip to read the file.


Cheers
Claes


Re: perl 5.10.0 / osx 10.5.2 'make' dies at "error: redefinition of 'union semun'"

2008-03-05 Thread snowcrash+perl
hi edward,

On Wed, Mar 5, 2008 at 10:34 AM, Edward Moy <[EMAIL PROTECTED]> wrote:
> When I build 5.10.0, I don't have this problem.  In config.h, I have:
>
>
> #define HAS_UNION_SEMUN /**/
>
> Did you run Configure

yes

> and does your config.h define HAS_UNION_SEMUN?

if i

  ./Configure -Dfirstmakefile='GNUmakefile' ...

as usual,

 grep HAS_UNION_SEMUN config.h
  /* HAS_UNION_SEMUN:
  /*#define HAS_UNION_SEMUN / **/

after digging abt in perl src, i note that if i *ADD*

  ./Configure -Dfirstmakefile='GNUmakefile' ... -Dd_union_semun

then,

  grep HAS_UNION_SEMUN config.h
   /* HAS_UNION_SEMUN:
   #define HAS_UNION_SEMUN  /**/

and, subsequent

   make

seems happy with that.

so, the question is -- why's it need to be defined on my system, and
not on yours?

did _you_ run Configure? or the default install?

thanks.


Re: perl 5.10.0 / osx 10.5.2 'make' dies at "error: redefinition of 'union semun'"

2008-03-05 Thread Edward Moy


On Mar 5, 2008, at 11:02 AM, snowcrash+perl wrote:


hi edward,

On Wed, Mar 5, 2008 at 10:34 AM, Edward Moy <[EMAIL PROTECTED]> wrote:

When I build 5.10.0, I don't have this problem.  In config.h, I have:


#define HAS_UNION_SEMUN /**/

Did you run Configure


yes


and does your config.h define HAS_UNION_SEMUN?


if i

 ./Configure -Dfirstmakefile='GNUmakefile' ...

as usual,

grep HAS_UNION_SEMUN config.h
 /* HAS_UNION_SEMUN:
 /*#define HAS_UNION_SEMUN  / **/

after digging abt in perl src, i note that if i *ADD*

 ./Configure -Dfirstmakefile='GNUmakefile' ... -Dd_union_semun

then,

 grep HAS_UNION_SEMUN config.h
  /* HAS_UNION_SEMUN:
  #define HAS_UNION_SEMUN   /**/

and, subsequent

  make

seems happy with that.

so, the question is -- why's it need to be defined on my system, and
not on yours?

did _you_ run Configure? or the default install?


Yes, I run Configure, and it prints:

You have union semun in .

Configure determines this by trying to compile:

--- try.c ---
#include 
#include 
#include 
int main () { union semun semun; semun.buf = 0; }
--

What happens when you try to compile the above program?

I forgot to mention that I'm still using the 4.0.1 compiler, while it  
looks like you're using the 4.2 compiler.  If the above fails to  
compile with 4.2, you might try compiling try.c with 4.0.1 just to see  
if 4.2 has a bug (though I would think this unlikely).


--
Edward Moy
Apple Inc.
[EMAIL PROTECTED]



Re: perl 5.10.0 / osx 10.5.2 'make' dies at "error: redefinition of 'union semun'"

2008-03-05 Thread snowcrash+perl
hi,

On Wed, Mar 5, 2008 at 11:17 AM, Edward Moy <[EMAIL PROTECTED]> wrote:
> Configure determines this by trying to compile:
>
> --- try.c ---
> #include 
> #include 
> #include 
> int main () { union semun semun; semun.buf = 0; }
> --
>
> What happens when you try to compile the above program?

with

gcc --version
powerpc-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 
5531)
gcc -v try.c

looks ok to me,


Using built-in specs.
Target: powerpc-apple-darwin9
Configured with:
/usr/ports/gcc_42-5531/gcc_42-5531/build/obj/src/configure
--disable-checking -enable-werror --prefix=/usr
--mandir=/usr/share/man --enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--with-gxx-include-dir=/usr/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=powerpc-apple-darwin9 --host=powerpc-apple-darwin9
--target=powerpc-apple-darwin9
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5531)
 /usr/libexec/gcc/powerpc-apple-darwin9/4.2.1/cc1 -quiet -v
-D__DYNAMIC__ try.c -fPIC -quiet -dumpbase try.c
-mmacosx-version-min=10.5 -auxbase try -version -o
/var/folders/fi/fi+R69XvFXyPa7H6QIvBUk+++TI/-Tmp-//ccDnzd3s.s
ignoring nonexistent directory
"/usr/lib/gcc/powerpc-apple-darwin9/4.2.1/../../../../powerpc-apple-darwin9/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/powerpc-apple-darwin9/4.2.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
GNU C version 4.2.1 (Apple Inc. build 5531) (powerpc-apple-darwin9)
compiled by GNU C version 4.2.1 (Apple Inc. build 5531).
GGC heuristics: --param ggc-min-expand=100 --param 
ggc-min-heapsize=131072
Compiler executable checksum: 31bffcb05d987b0795677d6c6078
 /usr/libexec/gcc/powerpc-apple-darwin9/4.2.1/as -arch ppc -o
/var/folders/fi/fi+R69XvFXyPa7H6QIvBUk+++TI/-Tmp-//ccTS1Z3j.o
/var/folders/fi/fi+R69XvFXyPa7H6QIvBUk+++TI/-Tmp-//ccDnzd3s.s
 /usr/libexec/gcc/powerpc-apple-darwin9/4.2.1/collect2 -dynamic -arch
ppc -macosx_version_min 10.5 -weak_reference_mismatches non-weak -o
a.out -lcrt1.10.5.o -L/usr/lib/gcc/powerpc-apple-darwin9/4.2.1
-L/usr/lib/gcc/powerpc-apple-darwin9/4.2.1
-L/usr/lib/gcc/powerpc-apple-darwin9/4.2.1/../../..
/var/folders/fi/fi+R69XvFXyPa7H6QIvBUk+++TI/-Tmp-//ccTS1Z3j.o
-lgcc_s.10.5 -lgcc -lSystemStubs -lSystem

> I forgot to mention that I'm still using the 4.0.1 compiler, while it looks
> like you're using the 4.2 compiler.  If the above fails to compile with 4.2,
> you might try compiling try.c with 4.0.1 just to see if 4.2 has a bug
> (though I would think this unlikely).

gcc_select 4.0
Default compiler has been set to:
gcc version 4.0.1 (Apple Inc. build 5465)
gcc -v try.c

Using built-in specs.
Target: powerpc-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5465~16/src/configure
--disable-checking -enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=i686-apple-darwin9 --program-prefix=
--host=powerpc-apple-darwin9 --target=powerpc-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5465)
 /usr/libexec/gcc/powerpc-apple-darwin9/4.0.1/cc1 -quiet -v
-D__DYNAMIC__ try.c -fPIC -quiet -dumpbase try.c
-mmacosx-version-min=10.5 -auxbase try -version -o
/var/folders/fi/fi+R69XvFXyPa7H6QIvBUk+++TI/-Tmp-//ccNmRTyR.s
ignoring nonexistent directory
"/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/../../../../powerpc-apple-darwin9/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
GNU C version 4.0.1 (Apple Inc. build 5465) (powerpc-apple-darwin9)
compiled by GNU C version 4.0.1 (Apple Inc. build 5465).
GGC heuristics: --param ggc-min-expand=100 --param 
ggc-min-heapsize=131072
Compiler executable checksum: 9f5f0a20bb36a9596f05e3c117ac5032
 /usr/libexec/gcc/powerpc-apple-darwin9/4.0.1/as -arch ppc -o
/var/folders/fi/fi+R69XvFXyPa7H6QIvBUk+++TI/-Tmp-//ccvNbScg.o
/var/folders/fi/fi+R69XvFXyPa7H6QIvBUk+++TI/-Tmp-//ccNmRTyR.s
 /usr/libexec/gcc/powerpc-apple-darwin9/4.0.1/collect2 -dynamic -arch
ppc -macosx_version_min 10.5 -weak_reference_mismatches non-weak -o
a.out -lcrt1.10.5.o -L/usr/lib/powerpc-apple-darwin9/4.0.1
-L/usr/lib/gcc/p

Re: perl 5.10.0 / osx 10.5.2 'make' dies at "error: redefinition of 'union semun'"

2008-03-05 Thread Edward Moy

On Mar 5, 2008, at 11:38 AM, snowcrash+perl wrote:


On Wed, Mar 5, 2008 at 11:17 AM, Edward Moy <[EMAIL PROTECTED]> wrote:

Configure determines this by trying to compile:

--- try.c ---
#include 
#include 
#include 
int main () { union semun semun; semun.buf = 0; }
--

What happens when you try to compile the above program?


with

gcc --version
powerpc-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 
5531)
gcc -v try.c

looks ok to me,


(snip)

I forgot to mention that I'm still using the 4.0.1 compiler, while  
it looks
like you're using the 4.2 compiler.  If the above fails to compile  
with 4.2,

you might try compiling try.c with 4.0.1 just to see if 4.2 has a bug
(though I would think this unlikely).


(snip)


looks effectively the same; only diff is:

GCC 4.2 -> ... --build=powerpc-apple-darwin9
--host=powerpc-apple-darwin9 --target=powerpc-apple-darwin9
GCC 4.0 -> ... --build=i686-apple-darwin9 ..
--host=powerpc-apple-darwin9 --target=powerpc-apple-darwin9


Well, it's a mystery.  The only other thing I can think of is if  
somehow _POSIX_C_SOURCE or _XOPEN_SOURCE are being defined when  
Configure compiles try.c (and union semun would not be defined in sys/ 
sem.h as per POSIX), but when miniperlmain.c compiles, those macros  
aren't defined, so union semun is visible in sys/sem.h, but by that  
time HAS_UNION_SEMUN has been define, so union semun gets redefined.

--
Edward Moy
Apple Inc.
[EMAIL PROTECTED]



Re: perl 5.10.0 / osx 10.5.2 'make' dies at "error: redefinition of 'union semun'"

2008-03-05 Thread snowcrash+perl
> Well, it's a mystery.

:-)

> The only other thing I can think of is if somehow
> _POSIX_C_SOURCE or _XOPEN_SOURCE are being defined when Configure compiles
> try.c (and union semun would not be defined in sys/sem.h as per POSIX), but
> when miniperlmain.c compiles, those macros aren't defined, so union semun is
> visible in sys/sem.h, but by that time HAS_UNION_SEMUN has been define, so
> union semun gets redefined.

possibly ... checking, neither _POSIX_C_SOURCE or _XOPEN_SOURCE are
def'd in perl's config.h

either way, for now, my workaround (adding the option to config) seems
to work -- and, afaict, causes no harm.

thanks for the help.


Re: Using Perl to Read jar file MANIFEST file.

2008-03-05 Thread Charlie Garrison

Good afternoon,

On 5/3/08 at 10:23 AM -0800, Michael Barto 
<[EMAIL PROTECTED]> wrote:


Has anybody every tried to create a Perl program ro read the 
contents of the MANIFEST file in java jar file? We are trying 
to develop something to provide comparisons for change between 
different implementations. Is this a simple Perl backtic, 
system or exec of the jar command or is there a more exotic way 
to do it? Also, we need to extract Checksum. But that seems documented.


Did you ask CPAN? There seems to be a few modules which might be 
helpful for you:





Charlie

--
   Charlie Garrison  <[EMAIL PROTECTED]>
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt