Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 40064
Status: stalled
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: damien.faure [...] bull.net
Cc:
AdminCc:

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



CC: JEAN-CLAUDE BOUCHAND <Jean-Claude.Bouchand [...] bull.net>, Christian Beau <christian.beau [...] bull.net>
Subject: Tk-804.028 fails to compile on AIX - I propose a fix
Date: Wed, 15 Oct 2008 12:26:07 +0200
To: bug-Tk [...] rt.cpan.org
From: Faure Damien <damien.faure [...] bull.net>
I encountered several problems when trying to compile Tk-804.028 on AIX:

Show quoted text
cpan> make Tk
[...]
D_LARGE_FILES -qlonglong   -DUSE_MMAP -c inffast.c
        ar rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o  zutil.o inflate.o infback.o inftrees.o inffast.o
        cd libpng && make libpng.a "CC=cc_r  " RANLIB=":"
make: 1254-002 Cannot find a rule to create target libpng.a from dependencies.
Stop.
make: 1254-004 The error code from the last command is 2.

I therefore decided to change file in .cpan/build/Tk-804.028/PNG/Makefile:
    cd libpng && $(MAKE) libpng.a $(PASTHRU)
changed to :
   cd libpng && $(MAKE) libpng12.a $(PASTHRU)

which led to :
~/.cpan/build/Tk-804.028$> make
[...]
Target "libz.a" is up to date.
        cd libpng && make libpng.a "CC=cc_r  " RANLIB=":"
        cc_r   -I../zlib -Wall -O2 -c png.c
cc_r: 1501-210 command option Wall contains an incorrect subargument
make: 1254-004 The error code from the last command is 40.

I therefore modified .cpan/build/Tk-804.028/PNG/libpng/Makefile:
CFLAGS = -I$(ZLIBINC) $(WARNMORE) $(CRELEASE)
changed to :
CFLAGS = -I$(ZLIBINC) $(CRELEASE)


which led to :
~/.cpan/build/Tk-804.028$> make
[...]
        cc_r   -I../zlib -O2 -c pngtest.c
"pngtest.c", line 693.15: 1506-022 (S) "__jmpbuf" is not a member of "struct png_struct_def".
"pngtest.c", line 717.15: 1506-022 (S) "__jmpbuf" is not a member of "struct png_struct_def".
make: 1254-004 The error code from the last command is 1.

I therefore had a look at the structure and also at the preprocessed code with:
 cc_r   -I../zlib -O2 -c  -E pngtest.c> pouet

Line 693 was changed from :
if (setjmp(png_jmpbuf(read_ptr)))
into:
if (setjmp(((read_ptr)->__jmpbuf)))

This seems to be a conflict problem with /usr/include/sys/context.h where I can find:
#define jmpbuf          __jmpbuf
/usr/include/sys/context.h is included  by /usr/include/sys/signal.h

I therefore modified:
PNG/libpng/pngconf.h:1390:#  define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
into
PNG/libpng/pngconf.h:1390:#  define png_jmpbuf(png_ptr) ((png_ptr)->libpngjmpbuf)

and in the same line
PNG/libpng/png.h:1093:   jmp_buf jmpbuf;            /* used in png_error */
PNG/libpng/pngerror.c:216:   longjmp(png_ptr->jmpbuf, 1);
PNG/libpng/pngread.c:74:   if (setjmp(png_ptr->jmpbuf))
PNG/libpng/pngread.c:167:   if (setjmp(png_ptr->jmpbuf))
PNG/libpng/pngread.c:261:   png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf));
PNG/libpng/pngread.c:276:   png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof (jmp_buf));
PNG/libpng/pngread.c:1275:   png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf));
PNG/libpng/pngread.c:1295:   png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof (jmp_buf));
PNG/libpng/pngwrite.c:478:   if (setjmp(png_ptr->jmpbuf))
PNG/libpng/pngwrite.c:556:   if (setjmp(png_ptr->jmpbuf))
PNG/libpng/pngwrite.c:652:   png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf));
PNG/libpng/pngwrite.c:679:   png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof (jmp_buf));
PNG/libpng/pngwrite.c:1095:   png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf));
PNG/libpng/pngwrite.c:1115:   png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof (jmp_buf));

I then was able to run make and then make test successfully :)
Target "test" is up to date.

Regards.
Damien

Message body is not shown because sender requested not to inline it.

On Wed Oct 15 07:01:25 2008, damien.faure@bull.net wrote: Show quoted text
> I encountered several problems when trying to compile Tk-804.028 on > AIX: >
Hello Damien, there's a sample makefile.aix in the PNG/libpng/scripts directory. I attached a modified PNG/Makefile.libpng.maybe which uses this Makefile on AIX systems. Can you try to build with this change only? And if this fails, there's also the alternative to run the configure script instead (instructions follow if necessary). Regards, Slaven
Download Makefile.libpng.maybe
application/octet-stream 1.6k

Message body not shown because it is not plain text.

From: will.saxon [...] sage.com
On Wed Nov 05 16:31:56 2008, SREZIC wrote: Show quoted text
> On Wed Oct 15 07:01:25 2008, damien.faure@bull.net wrote:
> > I encountered several problems when trying to compile Tk-804.028 on > > AIX: > >
> > Hello Damien, > > there's a sample makefile.aix in the PNG/libpng/scripts directory. I > attached a modified PNG/Makefile.libpng.maybe which uses this Makefile > on AIX systems. Can you try to build with this change only? And if this > fails, there's also the alternative to run the configure script instead > (instructions follow if necessary). > > Regards, > Slaven >
I am experiencing the same issue with this package on AIX 5.1. Based on a hint from this thread: http://old.nabble.com/jmpbuf-on-AIX-td7618363.html, I changed PNG/libpng/pngtest.c to move the '#include <png.h>' after the inclusion of other system headers. I was then able to compile Tk without issue, although a handful of tests fail.
On Mon Nov 16 21:03:05 2009, wsaxon wrote: Show quoted text
> On Wed Nov 05 16:31:56 2008, SREZIC wrote:
> > On Wed Oct 15 07:01:25 2008, damien.faure@bull.net wrote:
> > > I encountered several problems when trying to compile Tk-804.028 on > > > AIX: > > >
> > > > Hello Damien, > > > > there's a sample makefile.aix in the PNG/libpng/scripts directory. I > > attached a modified PNG/Makefile.libpng.maybe which uses this Makefile > > on AIX systems. Can you try to build with this change only? And if this > > fails, there's also the alternative to run the configure script instead > > (instructions follow if necessary). > > > > Regards, > > Slaven > >
> > I am experiencing the same issue with this package on AIX 5.1. > > Based on a hint from this thread: > http://old.nabble.com/jmpbuf-on-AIX-td7618363.html, I changed > PNG/libpng/pngtest.c to move the '#include <png.h>' after the inclusion > of other system headers. I was then able to compile Tk without issue, > although a handful of tests fail.
It seems that the newest libpng (version 1.4.0) has an AIX-specific ifdef for this problem. However, it takes some effort to replace the bundled libpng with the newest one in Perl/Tk. So my suggestion is as follows: apply the attached patch, install libpng on your system, and try to recompile Perl/Tk. Now it should hopefully pick the system libpng, and not the bundled anymore. Regards, Slaven
Subject: mmtry.diff
commit 8ea4964d2af55b62bc87aba54b1db58c7c604a1c Author: Slaven Rezic <slaven@rezic.de> Date: Tue Feb 2 14:56:32 2010 +0100 * MMtry improvements * VERBOSE is now even more verbose by showing all of compiler stderr output * use $Config{ldflags} when trying to compile things diff --git a/Tk/MMtry.pm b/Tk/MMtry.pm index 110f6b2..58acd13 100644 --- a/Tk/MMtry.pm +++ b/Tk/MMtry.pm @@ -23,9 +23,10 @@ sub try_compile $inc = [] unless $inc; $lib = [] unless $lib; $def = [] unless $def; + my $stderr_too = $VERBOSE ? '' : $stderr_too; my $out = basename($file,'.c').$Config{'exe_ext'}; warn "Test Compiling $file\n"; - my $msgs = `$Config{'cc'} -o $out $Config{'ccflags'} @$inc $file @$lib @$def $stderr_too`; + my $msgs = `$Config{'cc'} -o $out $Config{'ccflags'} @$inc $file $Config{ldflags} @$lib @$def $stderr_too`; my $ok = ($? == 0); warn "$msgs\n" if $VERBOSE && $msgs; unlink($out) if (-f $out); @@ -38,9 +39,10 @@ sub try_run $inc = [] unless $inc; $lib = [] unless $lib; $def = [] unless $def; + my $stderr_too = $VERBOSE ? '' : $stderr_too; my $out = basename($file,'.c').$Config{'exe_ext'}; warn "Test Compile/Run $file\n"; - my $cmdline = "$Config{'cc'} -o $out $Config{'ccflags'} @$inc $file @$lib @$def"; + my $cmdline = "$Config{'cc'} -o $out $Config{'ccflags'} @$inc $file $Config{ldflags} @$lib @$def"; my $msgs = `$cmdline $stderr_too`; my $ok = ($? == 0); warn "$cmdline:\n$msgs\n" if $VERBOSE && $msgs;