manastech/crystal — pull request #161 by kostya (2014-07-13 15:00:51+00:00)
Title: add libstatic

My attempt to add static libs. Without specs.
To easy integrate with c code.

test.c
```c
int aaa(int a, int b) {
return (a + b) / 2;
}
```

test.cr
```ruby
libstatic Test("test.o")
fun aaa(a : Int32, b : Int32) : Int32
end

p Test.aaa( 10, 20)
```

```
$ gcc test.c -c -o test.o
$ crystal test.cr --release --verbose
/home/kostya/crystal/deps/llvm/bin/clang -o test .crystal//home/kostya/crystal/test.cr/main.o test.o -Wl,-lgc,-lrt,-lm,-lpcre,-lunwind

$ ./test
15

```

Also want to expand path to test.o from current path of test.cr, but dont know how.
What do you think?