
reid 2002/06/14 17:29:10 PDT Modified files: lib/exts Storable.hs src MkInstal.in connect.h ffi.c machdep.c static.c storage.c storage.h Log: Tweaked install to install HsFFI.h in $prefix/share/hugs/include As a result you have to 'make install' before testing the code. Note: Use of the install directory $prefix/share/hugs isn't really appropriate since HsFFI.h is machine dependent and any libraries containing ffi code will be machine dependent too. Tweaked ffi code to compile the code it generates. (As before, the code needs autoconfed. It currently uses cc -shared and it assumes directory separators of "/".) Note: There's now an awful lot of code scattered around Hugs for manipulating strings: parsing them, finding substrings (notable equivalents of gnumake's basename, notdir, dir, etc.). A very worthwhile task would be to create a proper library of string manipulation code (taking care of all the overflow issues properly, etc.) and clean up all the cruft that has accumulated. A suitable test sequence for the ffi looks like this: cd unix ./configure --prefix=$HOME/tmp make install cc -I. ../lib/exts/Storable_aux.c -c -o ../lib/exts/Storable_aux.o $HOME/tmp/bin/hugs +G test.hs < /dev/null $HOME/tmp/bin/hugs test.hs stty sane ToDo: Add some file modification time code to build the .{c,so} files only if needed. Hmmm, but how do we define 'needed'? The right thing to do is a dependency analysis from this module. Revision Changes Path 1.2 +2 -2 hugs98/lib/exts/Storable.hs 1.7 +1 -0 hugs98/src/MkInstal.in 1.37 +7 -4 hugs98/src/connect.h 1.7 +93 -8 hugs98/src/ffi.c 1.52 +21 -7 hugs98/src/machdep.c 1.71 +19 -10 hugs98/src/static.c 1.42 +3 -2 hugs98/src/storage.c 1.38 +3 -2 hugs98/src/storage.h