Hi Vojta,

so, after some modificatios[1] based on trial and error during the
configure and make phases the compilation gets to
this point

    /usr/local/cross/ia32/bin/i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I.
-imacros
/home/esteban/helenos/coastline/build/libpng/libpng-1.6.10/helenos_config.h
-D__LE__ -I/home/esteban/helenos/coastline/helenos/include/posix
-I/home/esteban/helenos/coastline/helenos/include/  -O3 -imacros
/home/esteban/helenos/coastline/helenos/include/system_config.h
-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32LE -finput-charset=UTF-8
-ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wextra
-Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes -std=gnu99
-Wwrite-strings -pipe -ggdb -D__LE__ -march=pentium -fno-omit-frame-pointer
-I/home/esteban/helenos/coastline/helenos/include/posix
-I/home/esteban/helenos/coastline/helenos/include/
-Wl,-L/home/esteban/helenos/coastline/helenos/lib -Wl,-n -Wl,-T
-Wl,/home/esteban/helenos/coastline/helenos/link.ld -Wl,--whole-archive
-Wl,--start-group -Wl,-lposixaslibc -Wl,-lsoftint -Wl,--end-group
-Wl,--no-whole-archive -Wl,-lc4posix
-Wl,-L/home/esteban/helenos/coastline/libs
-Wl,-L/home/esteban/helenos/coastline/build/libpng/libpng-1.6.10/fixedlibs
-Wl,--whole-archive -Wl,-lfdm -Wl,--no-whole-archive -MT
contrib/tools/pngfix.o -MD -MP -MF $depbase.Tpo -c -o
contrib/tools/pngfix.o contrib/tools/pngfix.c &&\
    mv -f $depbase.Tpo $depbase.Po
contrib/tools/pngfix.c:868:4: error: unknown type name 'posix_fpos_t'
    posix_fpos_t         data_pos;      /* Position of first byte of chunk
data */
    ^
contrib/tools/pngfix.c:1203:32: error: unknown type name 'posix_fpos_t'
 file_getpos(struct file *file, posix_fpos_t *pos)
                                ^
contrib/tools/pngfix.c:1214:20: error: unknown type name 'posix_fpos_t'
 file_setpos(struct file *file, const posix_fpos_t *pos)
                    ^
contrib/tools/pngfix.c: In function 'file_setpos':
contrib/tools/pngfix.c:1216:4: warning: passing argument 2 of 'fsetpos'
from incompatible pointer type [enabled by default]
    if (fsetpos(file->file, pos))
    ^
In file included from contrib/tools/pngfix.c:14:0:
/home/esteban/helenos/coastline/helenos/include/posix/stdio.h:158:26: note:
expected 'const struct fpos_t *' but argument is of type 'const int *'
 extern int __POSIX_DEF__(fsetpos)(FILE *stream, const
__POSIX_DEF__(fpos_t) *pos);
                          ^
/home/esteban/helenos/coastline/helenos/include/posix/stdlib.h:40:26: note:
in definition of macro '__POSIX_DEF__'
 #define __POSIX_DEF__(x) x
                          ^
contrib/tools/pngfix.c: In function 'getpos':
contrib/tools/pngfix.c:1230:4: warning: implicit declaration of function
'file_getpos' [-Wimplicit-function-declaration]
    file_getpos(file, &file->data_pos);
    ^
contrib/tools/pngfix.c: At top level:
contrib/tools/pngfix.c:1550:4: error: unknown type name 'posix_fpos_t'
    posix_fpos_t         chunk_data_pos;    /* Position of first byte of
chunk data */
    ^
contrib/tools/pngfix.c: In function 'zlib_check':
contrib/tools/pngfix.c:2615:4: error: unknown type name 'posix_fpos_t'
    posix_fpos_t start_pos;
    ^
contrib/tools/pngfix.c: In function 'main':
contrib/tools/pngfix.c:3958:25: error: 'FILENAME_MAX' undeclared (first use
in this function)
          char temp_name[FILENAME_MAX+1];
                         ^
contrib/tools/pngfix.c:3958:25: note: each undeclared identifier is
reported only once for each function it appears in
contrib/tools/pngfix.c:3958:15: warning: unused variable 'temp_name'
[-Wunused-variable]
          char temp_name[FILENAME_MAX+1];

So, I'm having problems with fpos_t. It is not defined in stdio.h (which is
were it belongs) Does stdio.h should be extended
somehow to include this definitions?

FILENAME_MAX is also missing, is it OK to add it to stdio.h?

[1]: + patch math.h to add declarations of modf, frexp, floor and pow,
since there was a file that was using them
      + change the PNG_ZLIB_VERNUM so it maches ZLIB_VERNUM (from zlib.h)
otherwise it wouldn't compile. I'm
         not sure about this change.


Thanks again,

Esteban


2014-03-11 5:25 GMT-03:00 Vojtech Horky <[email protected]>:

> Hi Esteban.
>
>
> 2014-03-11 4:17 GMT+01:00 Esteban Campostrini <[email protected]>:
>
> fdlibm as well as zlib are built and packaged before doing the build of
>> libpng. The configuration phase ends with error after preforming the
>> following checking:
>>
>> configure:12509: checking for memset
>> configure:12509: /usr/local/cross/ia32/bin/i686-pc-linux-gnu-gcc -o
>> conftest  -O3 -imacros
>> /home/esteban/helenos/coastline/helenos/include/system_config.h
>> -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32LE -finput-charset=UTF-8
>> -ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wextra
>> -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes -std=gnu99
>> -Wwrite-strings -pipe -ggdb -D__LE__ -march=pentium -fno-omit-frame-pointer
>> -I/home/esteban/helenos/coastline/helenos/include/posix
>> -I/home/esteban/helenos/coastline/helenos/include/   conftest.c  >&5
>> /usr/local/cross/ia32/lib/gcc/i686-pc-linux-gnu/4.8.1/../../../../i686-pc-linux-gnu/bin/ld:
>> warning: cannot find entry symbol _start; defaulting to 080480a0
>> /tmp/ccd5m53O.o: In function `main':
>> /home/esteban/helenos/coastline/build/libpng/libpng-1.6.10/conftest.c:57:
>> undefined reference to `memset'
>> collect2: error: ld returned 1 exit status
>> configure:12509: $? = 1
>> configure: failed program was:
>>
> What I miss in the parameters are HelenOS libraries. If you look into
> helenos/env.sh, in LDFLAGS you will notice linking with posixaslibc and
> c4posix.
>
> My guess is that LDFLAGS and CFLAGS are not used as one would expect. If
> you look into other harbours, you will notice that most of the time, you
> add the linker flags to CFLAGS, e.g.
> CFLAGS="$HSCT_CFLAGS $HSCT_LDFLAGS_FOR_CC ..."
>
>
>
>> Here is not including any library from the same package like the case for
>> example of libgmp in which you solved it by
>> patching it, I'm not quite I understand what is trying to do here, I mean
>> it seems to look for memset in libc but the prototype that declares
>> is intentionally different.
>>
> This is one of the bits of ./configure magic I never really understood.
> IMHO the point of this is to check that memset() looks as expected (i.e.
> the signature). However, the check is often built in such way that it
> passes even if the function is not defined at all. I encountered this when
> porting GCC where configure "found" fork() even if the function did not
> exist at all.
>
>
> Btw, I briefly looked at help from ./configure and maybe you would need to
> specify CPPFLAGS as well. You may want to look to Python harbour for a hack
> how to do that.
>
> - Vojta
>
>
>
>>
>>
>>  Anyway, I think you are making a good progress. I am glad you were able
>>> to fix the problems with hsct.sh yourself and I believe that you are only
>>> few details away from porting libpng :-).
>>>
>>
>> Thanks! I hope so!
>>
>> Cheers,
>> Esteban
>>
>>>
>>> Cheers,
>>> - Vojta
>>>
>>>
>>> [1] https://github.com/vhotspur/coastline/blob/master/libgmp/HARBOUR#L42
>>> [2] https://github.com/vhotspur/coastline/blob/master/gcc/HARBOUR#L90
>>> [3]
>>> https://github.com/vhotspur/coastline/blob/master/libmpfr/HARBOUR#L48
>>> [4] https://github.com/vhotspur/coastline/blob/master/zlib/HARBOUR#L57
>>> [5] http://helenos.alisma.cz/coastline/matrix/
>>> [6]
>>> http://trac.helenos.org/browser/mainline/uspace/dist/src/c/demos/hello/build.gcc
>>>
>>>
>>> _______________________________________________
>>> HelenOS-devel mailing list
>>> [email protected]
>>> http://lists.modry.cz/listinfo/helenos-devel
>>>
>>>
>>
>> _______________________________________________
>> HelenOS-devel mailing list
>> [email protected]
>> http://lists.modry.cz/listinfo/helenos-devel
>>
>>
>
> _______________________________________________
> HelenOS-devel mailing list
> [email protected]
> http://lists.modry.cz/listinfo/helenos-devel
>
>
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to