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
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
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.