improve (gcc): static build

This commit is contained in:
Mickael Kerjean
2020-01-13 13:45:52 +11:00
parent 2426ca4459
commit 0c785954dc
5 changed files with 7 additions and 7 deletions

View File

@ -13,8 +13,12 @@ To test the libraries are working fine:
# libtranscode:
gcc -Wall -c src/libtranscode_test.c
gcc -o main_transcode.bin libtranscode_test.o -lm -lpthread -L. -l:libtranscode.a
curl -O https://archive.kerjean.me/public/2020/sample.CR2
./main_transcode.bin ./sample.CR2
# libresize:
gcc -Wall -c src/libresize_test.c `pkg-config --cflags glib-2.0`
gcc -o main_resize.bin libresize_test.o -lm -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -L. -l:libresize.a
curl -O https://archive.kerjean.me/public/2020/sample.jpg
./main_resize.bin ./sample.jpg
```

View File

@ -1,4 +1,3 @@
#include <stdlib.h>
#include <vips/vips.h>
int image_resize(const char *filename, void **buf, size_t *len, int size, int crop, int quality, int exif);

View File

@ -1,4 +1,3 @@
#include <stdlib.h>
#include <libraw/libraw.h>
int image_transcode_compute(const char* filename, int min_width);

View File

@ -4,8 +4,5 @@ set -e
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
cd "$(dirname "$0")"/deps
echo `pwd`
curl -s https://downloads.filestash.app/upload/libresize-linux-x86-64.a > libresize.a
curl -Ls https://downloads.filestash.app/upload/libresize-linux-headers.tar.gz | tar zxf - -C /usr/local/include/
curl -s https://downloads.filestash.app/upload/libtranscode-linux-x86-64.a > libtranscode.a
curl -Ls https://downloads.filestash.app/upload/libtranscode-linux-headers.tar.gz | tar zxf - -C /usr/local/include/
curl -s https://downloads.filestash.app/upload/libresize_`uname -s`-`uname -m`.a > libresize.a
curl -s https://downloads.filestash.app/upload/libtranscode_`uname -s`-`uname -m`.a > libtranscode.a

View File

@ -3,6 +3,7 @@ package plg_image_light
// #cgo CFLAGS: -I./deps/src
// #cgo LDFLAGS: -lm -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -ldl -L./deps -l:libresize.a
// #include "libresize.h"
// #include "glib-2.0/glib.h"
import "C"
import (