Spivoxity / obc-3

Oxford Oberon-2 compiler
38 stars 7 forks source link

Request: Add pkgconfig to find libffi #45

Open Lucretia opened 1 year ago

Lucretia commented 1 year ago

When reporting bugs, please do your best to

Oxford Oberon-2 compiler driver version 3.4alpha [build git-5fcd50f07fa7] Oxford Oberon-2 compiler version 3.4alpha [build git-5fcd50f07fa7] Oxford Oberon-2 linker version 3.4alpha [build git-5fcd50f07fa7] Oxford Oberon-2 runtime system version 3.4alpha [build git-5fcd50f07fa7] (JIT) Oxford Oberon-2 library version 3.4alpha [build git-5fcd50f07fa7]

$ eix bffi [I] dev-libs/libffi Available versions: 3.4.4(0/8)^t 3.4.4-r1(0/8)^t {debug exec-static-trampoline pax-kernel static-libs test ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32"} Installed versions: 3.4.4-r1(0/8)^t(23:11:22 26/04/23)(-debug -exec-static-trampoline -pax-kernel -static-libs -test ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="32 64 -x32") Homepage: https://sourceware.org/libffi/ Description: a portable, high level programming interface to various calling conventions

[I] dev-libs/libffi-compat Available versions:
(6) 3.2.1-r3^t (7) 3.3-r2^t {debug pax-kernel test ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32"} Installed versions: 3.2.1-r3(6)^t(13:00:36 15/10/21)(-debug -pax-kernel -test ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="32 64 -x32") 3.3-r2(7)^t(16:53:59 07/05/22)(-debug -pax-kernel -test ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="32 64 -x32") Homepage: https://sourceware.org/libffi/ Description: a portable, high level programming interface to various calling conventions

$ cat /usr/lib/pkgconfig/libffi.pc prefix=/usr exec_prefix=${prefix} libdir=/usr/lib toolexeclibdir=${libdir} includedir=/usr/lib/libffi/include

Name: libffi Description: Library supporting Foreign Function Interfaces Version: 3.4.4 Libs: -L${toolexeclibdir} -lffi Cflags: -I${includedir}

Lucretia commented 1 year ago

Actually, forget that, worked it out:

CFLAGS="-I/usr/lib/libffi/include" ./configure --prefix=$HOME/opt/obc-3 --enable-ffi

Doh!

Spivoxity commented 1 year ago

Actually, libffi is not needed for most uses, because the build process will make its own static wrappers for primitives in the standard library -- it's only if you want to add dynamic primitives that FFI is useful.

I prefer not to rely on pkgconfig except for GTK stuff, because I want to be able to build (without the GUI debugger) under minimal assumptions about the host environment.

I'm guessing the references to 3.4alpha mean you're trying to build the default branch. Please note also that I can give even less promises about correct functioning of that branch than I can about release branches! You might like to stick to the latest release branch unless there's a special reason to do otherwise.