Name: libffi Version: 3.0.13 Release: 1 Summary: A portable foreign function interface library Group: System Environment/Libraries License: BSD URL: http://sourceware.org/libffi Source0: http://sourceware.org/libffi/%{name}-%{version}.tar.gz Source2: %{name}.so.5-aix32 Source3: %{name}.so.5-aix64 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: gcc >= 4.2.3-2 Requires: libgcc >= 4.2.3-2 %define _libdir64 %{_prefix}/lib64 %description Compilers for high level languages generate code that follow certain conventions. These conventions are necessary, in part, for separate compilation to work. One such convention is the "calling convention". The calling convention is a set of assumptions made by the compiler about where function arguments will be found on entry to a function. A calling convention also specifies where the return value for a function is found. Some programs may not know at the time of compilation what arguments are to be passed to a function. For instance, an interpreter may be told at run-time about the number and types of arguments used to call a given function. `Libffi' can be used in such programs to provide a bridge from the interpreter program to compiled code. The `libffi' library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time. FFI stands for Foreign Function Interface. A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language. The `libffi' library really only provides the lowest, machine dependent layer of a fully featured foreign function interface. A layer must exist above `libffi' that handles type conversions for values passed between the two languages. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkg-config Requires: /sbin/install-info, info %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %prep %setup -q mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) %build export PATH=/opt/freeware/bin:$PATH # # Please note: # # Must not use common mode as the AIX assembler code works not for common # mode anymore! Compile Use at least for POWER4 processor or better # # export CC="xlc_r -qarch=pwr4 -qtune=pwr4" # export CC="gcc -mcpu=power4 -mtune=power4" # export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include" cd 64bit # first build the 64-bit version export OBJECT_MODE=64 export CC="gcc -mcpu=power4 -mtune=power4 -maix64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ --enable-shared --disable-static make %{?_smp_mflags} cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export CC="gcc -mcpu=power4 -mtune=power4 -maix32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ --enable-shared --disable-static make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export PATH=/opt/freeware/bin:$PATH cd 64bit export OBJECT_MODE=64 make install DESTDIR=${RPM_BUILD_ROOT} cd ../32bit export OBJECT_MODE=32 make install DESTDIR=${RPM_BUILD_ROOT} mv ${RPM_BUILD_ROOT}%{_libdir}/%{name}-%{version}/include ${RPM_BUILD_ROOT}%{_prefix} rmdir ${RPM_BUILD_ROOT}%{_libdir}/%{name}-%{version} gzip --best ${RPM_BUILD_ROOT}%{_infodir}/*.info rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir ( cd ${RPM_BUILD_ROOT}%{_libdir64} for f in *.a ; do /usr/bin/ar -X64 -x ${f} done cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done ) # add the 64-bit shared objects to the shared libraries containing already the # 32-bit shared objects /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a ${RPM_BUILD_ROOT}%{_libdir64}/%{name}.so* # Add the older 3.0.10 version and below shared members for compatibility with older apps # (make sure they're set for LOADONLY with 'strip -e') cp %{SOURCE2} %{name}.so.5 cp %{SOURCE2} ${RPM_BUILD_ROOT}%{_libdir}/%{name}.so.5 /usr/bin/strip -X32 -e %{name}.so.5 /usr/bin/ar -X32 -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a %{name}.so.5 cp %{SOURCE3} %{name}.so.5 cp %{SOURCE3} ${RPM_BUILD_ROOT}%{_libdir64}/%{name}.so.5 /usr/bin/strip -X64 -e %{name}.so.5 /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/%{name}.a %{name}.so.5 ( cd ${RPM_BUILD_ROOT} for dir in include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %post devel /sbin/install-info %{_infodir}/%{name}.info.gz %{_infodir}/dir || : %preun devel if [ $1 = 0 ] ; then /sbin/install-info --delete %{_infodir}/%{name}.info.gz %{_infodir}/dir || : fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/LICENSE 32bit/README %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la %{_libdir}/pkgconfig/*.pc %{_libdir64}/pkgconfig/*.pc %{_mandir}/man3/* %{_infodir}/%{name}.info.gz /usr/include/* /usr/lib/*.la /usr/lib64/*.la %changelog * Thu Mar 28 2013 Michael Perzl - 3.0.13-1 - updated to version 3.0.13 * Thu Mar 07 2013 Michael Perzl - 3.0.12-1 - updated to version 3.0.12 - minimum required now is a POWER4 processor or better as otherwise later versions of glib (V2.32 and up) would core dump in 64-bit mode with illegal instruction errors! * Wed Oct 31 2012 Michael Perzl - 3.0.11-2 - added the missing older (version 3.0.10 and below) shared members * Thu Oct 18 2012 Michael Perzl - 3.0.11-1 - updated to version 3.0.11 * Tue Nov 22 2011 Michael Perzl - 3.0.10-1 - updated to version 3.0.10 * Fri Feb 11 2011 Michael Perzl - 3.0.10rc4-1 - updated to git version 2011.02.11 (3.0.10rc4) * Wed Feb 17 2010 Michael Perzl - 3.0.9-1 - updated to version 3.0.9 * Fri Aug 28 2009 Michael Perzl - 3.0.8-1 - first version for AIX V5.1 and higher, added the 64-bit AIX patch - from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35484