%define _libdir64 %{_prefix}/lib64 Summary: A garbage collector for C and C++ Name: gc Version: 6.8 Release: 1 Group: System Environment/Libraries License: BSD Url: http://www.hpl.hp.com/personal/Hans_Boehm/gc/ Source0: http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/%{name}%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %description The Boehm-Demers-Weiser conservative garbage collector can be used as a garbage collecting replacement for C malloc or C++ new. %package devel Summary: Libraries and header files for %{name} development Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel %{summary}. %prep %setup -q -n %{name}%{version} mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit tar cf - . | (cd ../64bit ; tar xpf -) %build # see bugzilla.redhat.com/689877 export CPPFLAGS="-DUSE_GET_STACKBASE_FOR_MAIN" export CC="cc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" export CXX="xlC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" cd 64bit # first build the 64-bit version export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export OBJECT_MODE=64 ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --enable-threads=posix \ --enable-shared --disable-static make %{?_smp_mflags} cd ../32bit # now build the 32-bit version export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export OBJECT_MODE=32 ./configure \ --prefix=%{_prefix} \ --enable-threads=posix \ --enable-shared --disable-static make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 make install DESTDIR=${RPM_BUILD_ROOT} cd ../32bit export OBJECT_MODE=32 make install DESTDIR=${RPM_BUILD_ROOT} ( 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}/lib%{name}.a ${RPM_BUILD_ROOT}%{_libdir64}/lib%{name}.so* mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man3 cp doc/gc.man ${RPM_BUILD_ROOT}%{_mandir}/man3/gc.3 chmod 0644 ${RPM_BUILD_ROOT}%{_mandir}/man3/gc.3 ( cd ${RPM_BUILD_ROOT} for dir in include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/doc/README %doc 32bit/doc/README.changes 32bit/doc/README.contributors %doc 32bit/doc/README.environment 32bit/doc/README.linux %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system,-) %doc 32bit/doc/*.html %{_includedir}/* %{_libdir}/*.la %{_libdir64}/*.la %{_mandir}/man?/* /usr/include/* /usr/lib/*.la /usr/lib64/*.la %changelog * Sat Feb 04 2012 Michael Perzl - 6.8-1 - first version for AIX V5.1 and higher