diff options
author | Tony Theodore <tonyt@logyst.com> | 2011-09-19 09:32:19 (GMT) |
---|---|---|
committer | Tony Theodore <tonyt@logyst.com> | 2011-09-19 09:32:19 (GMT) |
commit | caca5b75f5043ca90d63914e3702789da0f1bb23 (patch) | |
tree | 915e991278195b6b0a2122440952930aeab1dc46 | |
parent | 9e943586ae78569488a795fa14cd98d0efc681c4 (diff) | |
download | mxe-caca5b75f5043ca90d63914e3702789da0f1bb23.zip mxe-caca5b75f5043ca90d63914e3702789da0f1bb23.tar.gz mxe-caca5b75f5043ca90d63914e3702789da0f1bb23.tar.bz2 |
package libffi: bugfix for build directory and add test program
-rw-r--r-- | src/libffi-test.c | 31 | ||||
-rw-r--r-- | src/libffi.mk | 9 |
2 files changed, 38 insertions, 2 deletions
diff --git a/src/libffi-test.c b/src/libffi-test.c new file mode 100644 index 0000000..1a0123e --- /dev/null +++ b/src/libffi-test.c @@ -0,0 +1,31 @@ +/* This file is part of mingw-cross-env. */ +/* See doc/index.html for further information. */ + +#include <stdio.h> +#include <ffi.h> + +int main(int argc, char *argv[]) +{ + ffi_cif cif; + ffi_type *args[1]; + void *values[1]; + char *s; + int rc; + + (void)argc; + (void)argv; + + args[0] = &ffi_type_pointer; + values[0] = &s; + + if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_uint, args) == FFI_OK) + { + s = "Hello World!"; + ffi_call(&cif, FFI_FN(puts), &rc, values); + s = "Goodbye!"; + ffi_call(&cif, FFI_FN(puts), &rc, values); + } + + return 0; +} diff --git a/src/libffi.mk b/src/libffi.mk index fbc8760..511def3 100644 --- a/src/libffi.mk +++ b/src/libffi.mk @@ -24,6 +24,11 @@ define $(PKG)_BUILD --host='$(TARGET)' \ --prefix='$(PREFIX)/$(TARGET)' \ --disable-shared - $(MAKE) -C '$(1)' -j '$(JOBS)' - $(MAKE) -C '$(1)' -j 1 install + $(MAKE) -C '$(1)/$(TARGET)' -j '$(JOBS)' + $(MAKE) -C '$(1)/$(TARGET)' -j 1 install + + '$(TARGET)-gcc' \ + -W -Wall -Werror -std=c99 -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-libffi.exe' \ + `'$(TARGET)-pkg-config' libffi --cflags --libs` endef |