diff options
author | Armin Rigo <arigo@tunes.org> | 2016-09-24 22:50:12 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2016-09-24 22:50:12 +0200 |
commit | 1700eee5e5d101d91beec0c0bc6896aa77e4f478 (patch) | |
tree | 4b01bd4eca59d6872349cd7b77f30078027ae557 /demo | |
parent | c976ed5c027ee93386518efdee2bbc26566903c9 (diff) | |
download | cffi-1700eee5e5d101d91beec0c0bc6896aa77e4f478.tar.gz |
Document inline the various options to compile with embedding
Diffstat (limited to 'demo')
-rw-r--r-- | demo/embedding_test.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/demo/embedding_test.c b/demo/embedding_test.c index 87d313b..224df1d 100644 --- a/demo/embedding_test.c +++ b/demo/embedding_test.c @@ -1,7 +1,30 @@ -/* Link this program with libembedding_test.so. +/* There are two options: + + =====1===== + + Link this program with _embedding_test.so. E.g. with gcc: gcc -o embedding_test embedding_test.c _embedding_cffi*.so + + You must then run the executable with the right command + (LD_LIBRARY_PATH on Linux), otherwise it won't find the + _embedding_cffi*.so: + + LD_LIBRARY_PATH=. ./embedding_test + + There are platform-specific options to gcc to avoid needing + that, too. Linux: + + gcc -o embedding_test embedding_test.c _embedding_cffi*.so -Wl,-rpath=. + + =====2===== + + Compile and link the _embedding_test.c source code together with + this example (e.g. with PyPy): + + gcc -o embedding_test embedding_test.c _embedding_cffi.c \ + -I/opt/pypy/include -pthread -lpypy-c */ #include <stdio.h> |