So  here is my tests case:

I start with this file:

//========================================
// tgmp.flx
//========================================
include "gmp";
open Gmp;

var x : mpz = mpz_of_int 42;
var y = x + x;
println$ y;
//=======================================

and I want to do this:

flx --felix=build.fpc tgmp

and have it work.

First:

sudo mkdir /usr/local/lib/felix/packages
sudo mkdir /usr/local/lib/felix/packages/share
sudo mkdir /usr/local/lib/felix/packages/share/lib
sudo mkdir /usr/local/lib/felix/packages/host
sudo mkdir /usr/local/lib/felix/packages/host/config

I make the package directory. I have chosen to make
it "in the image" of the usual install directory.

Next I get this file:

https://raw.githubusercontent.com/felix-lang/gmp/master/GMP/gmp.flx

(I just used my browser) and copy it into the package directory

sudo cp gmp.flx /usr/local/lib/felix/packages/share/lib

So now, I need to make a config file for it called gmp.fpc

Name: gmp
Description: GNU Multiple precision Arithmetic
provides_dlib: -lgmpxx
provides_slib: -lgmpxx
requires_slibs: -lgmp
requires_dlibs: -lgmp

which I put in 

/usr/local/lib/felix/packages/host/config

This works for me: gmp.h and gmpxx.h are in /usr/local/include
and libgmp.so and libgmpxx.so and libgmp.a and libgmpxx.a are
in /usr/local/lib, for some reason I don't understand these are
already searched by C__.

Note there is a BUG in the build of libgmpxx.so, it isn't linked to
libgmp.so as it should be probably because I copied it out
of /opt/local/lib. So I have to put in a requirement for a dlib,
this normally should never be required (the linker should
handle dependencies for dynamic libraries).

Now my control files is called build.fpc and looks like this:

FLX_INSTALL_DIR: build/release
FLX_CACHE_DIR: build/release/cache/binary
FLX_OUTPUT_DIR: build/release/cache/text
FLX_LIB_DIRS: build/release/share/lib /usr/local/lib/felix/packages/share/lib
FLX_CONFIG_DIRS build/release/host/config 
/usr/local/lib/felix/packages/host/config

So I'm running off build/release. However I'm searching the package
directory for Felix libs to find the binding we just installed,
and both the build/release host config database as well as the
package one.

Note if you set FLX_LIB_DIRS or FLX_CONFIG_DIRS you have to
set the complete list of them, the default paths are wiped out.


--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to