Hi Esteban.
2014-03-10 2:22 GMT+01:00 Esteban Campostrini <[email protected]>: > I'm using Mint and > ls -l `which sh` > lrwxrwxrwx 1 root root 4 Apr 5 2013 /bin/sh -> dash > > After a little search I found that to avoid problems with bash scripts the > shebang line should be set to #!/bin/bash (among > other alternatives) so that made it. > My bad. I though hsct.sh was free of any bash-isms but apparently I used "source" instead of dot "." for sourcing other files. I fixed this and on my system it works with dash now. > The issue was again related to the path, the script sets the HSCT_HOME in > a relative way and not in an absolute. By setting > HSCT_HOME=$PWD it works, although I don't know if this can bring problems > with other packages. > HSCT_HOME points to the directory with hsct.sh and all the harbours. This variable is not used during the build so it shall not matter whether it is absolute or relative. But I will look into this. There is some magic involved when guessing the proper value that may not work under all circumstances. If you use absolute path when calling hsct.sh init ..., does the problem persist? By the way, if you set HSCT_HOME to $PWD, it seems to me that you are building in the source tree of coastline. That may work (I probably never even tested that) but it is better to build in a different directory. That way, you can build more architectures in parallel etc. > I made an attempt to write a HARBOUR for libpng, this is what the build > function looks like > > shipname=libpng > shipversion=1.6.10 > shipsources=" > ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/${shipname}-${shipversion}.tar.gz > " > > build() { > run tar xzf "${shipname}-${shipversion}.tar.gz" > cd "${shipname}-${shipversion}" > run env \ > CC="$HSCT_CC" \ > CFLAGS="$HSCT_CFLAGS $HSCT_LDFLAGS_FOR_CC" \ > LD="$HSCT_LD" \ > LDFLAGS="-L/home/esteban/helenos/coastline/dist/zlib/lib"\ > ./configure > > run make > } > > The configuration process ends correctly but the testing executable > 'testpng' isn't built for HelenOS but for my system. > I'm not quite sure why is this happening. > I tried this script on my system and the ./configure failed. I guess missing --host switch [1] is the culprit as I was compiling on x86_64 for ia32. This might also explain why it does not work on your system. Also, sometimes, it is necessary to forcefully tell the ./configure script that it is cross compiling [2]. libpng probably requires working math functions so you might need to compile fdlibm as well. Also, there were some changes to libmath in HelenOS recently and I have not checked yet whether that affects some existing harbours. By the way, if you use $HSCT_LIB_DIR in LDFLAGS, the script would be more portable. See [3] and [4] for examples. (Of course, you first need to "install" the files there by calling hsct.sh package zlib). > > In the big picture, what I'm trying to do is to generate the static > library so then I copy it along with the corresponding header file into > the right directories in the source tree of the OS. A good way of testing > should be by trying to compile something from the > OS itself. Is this something possible right now? > Yes, that is possible. However, it requires a bit more work than doing the same job in, for example, Linux. You can download a prebuilt GCC from [5] (unpack into overlay/) but be aware that you have to specify some extra switches when running it inside HelenOS (see [6]). 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 :-). 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
