2 %global multilib_arches %{ix86} x86_64
7 Summary: A portable foreign function interface library
9 Url: http://sourceware.org/libffi
11 Source0: ftp://sourceware.org/pub/libffi/libffi-%{version}.tar.gz
12 Source1: ffi-multilib.h
13 Source2: ffitarget-multilib.h
16 Compilers for high level languages generate code that follow certain
17 conventions. These conventions are necessary, in part, for separate
18 compilation to work. One such convention is the "calling convention".
19 The calling convention is a set of assumptions made by the compiler
20 about where function arguments will be found on entry to a function. A
21 calling convention also specifies where the return value for a function
24 Some programs may not know at the time of compilation what arguments
25 are to be passed to a function. For instance, an interpreter may be
26 told at run-time about the number and types of arguments used to call a
27 given function. `Libffi' can be used in such programs to provide a
28 bridge from the interpreter program to compiled code.
30 The `libffi' library provides a portable, high level programming
31 interface to various calling conventions. This allows a programmer to
32 call any function specified by a call interface description at run time.
34 FFI stands for Foreign Function Interface. A foreign function
35 interface is the popular name for the interface that allows code
36 written in one language to call code written in another language. The
37 `libffi' library really only provides the lowest, machine dependent
38 layer of a fully featured foreign function interface. A layer must
39 exist above `libffi' that handles type conversions for values passed
40 between the two languages.
43 Summary: Development files for %{name}
44 Requires: %{name} = %{version}
48 The %{name}-devel package contains libraries and header files for
49 developing applications that use %{name}.
52 Summary: Development files for %{name}
53 Requires: %{name}-devel = %{version}
55 %description devel-static
56 The %{name}-devel package contains libraries and header files for
57 developing applications that use %{name}.
63 export LDFLAGS+="-Wl,-z,noexecstack"
64 %reconfigure "--enable-portable-binary"
65 %{__make} %{?_smp_mflags}
70 # Determine generic arch target name for multilib wrapper
76 %ifarch %{multilib_arches}
77 # Do header file switcheroo to avoid file conflicts on systems where you
78 # can have both a 32- and 64-bit version of the library, and they each need
79 # their own correct-but-different versions of the headers to be usable.
80 for i in ffi ffitarget; do
81 mv %{buildroot}%{_includedir}/$i.h %{buildroot}%{_includedir}/$i-${basearch}.h
83 install -m644 %{SOURCE1} %{buildroot}%{_includedir}/ffi.h
84 install -m644 %{SOURCE2} %{buildroot}%{_includedir}/ffitarget.h
88 %post -p /sbin/ldconfig
90 %postun -p /sbin/ldconfig
94 %defattr(-,root,root,-)
99 %defattr(-,root,root,-)
100 %{_libdir}/pkgconfig/*.pc
101 %{_includedir}/ffi*.h
104 #%{_infodir}/libffi.info.gz
109 %defattr(-,root,root,-)