diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2012-06-20 15:41:34 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2012-06-20 15:57:19 +0100 |
commit | 89025e6ce2edfe1f2ee776d775c6cb0d2b6b530c (patch) | |
tree | ff7cca479f98e46c24215e3ec808fbf54d17d631 | |
parent | f60eb78eb54898c4fedfb508ae0e56cdb7e304a3 (diff) |
Convert to build with mingw64 toolchain
-rw-r--r-- | Makefile.am | 2 | ||||
-rwxr-xr-x | autobuild.sh | 41 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | mingw-libosinfo.spec.in | 129 | ||||
-rw-r--r-- | mingw32-libosinfo.spec.in | 88 |
5 files changed, 162 insertions, 100 deletions
diff --git a/Makefile.am b/Makefile.am index 4b9ff49..d605152 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ EXTRA_DIST = \ COPYING.LIB \ libosinfo.spec \ libosinfo.spec.in \ - mingw32-libosinfo.spec.in \ + mingw-libosinfo.spec.in \ build-aux/mktempd \ cfg.mk \ GNUmakefile \ diff --git a/autobuild.sh b/autobuild.sh index 5ec5510..d107216 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -44,28 +44,49 @@ if [ -f /usr/bin/rpmbuild ]; then -ba --clean libosinfo.spec fi -if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then +# Test mingw32 cross-compile +if test -x /usr/bin/i686-w64-mingw32-gcc ; then make distclean - PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig" \ - CC="i686-pc-mingw32-gcc" \ + PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig" \ + CC="i686-w64-mingw32-gcc" \ ../configure \ --build=$(uname -m)-pc-linux \ - --host=i686-pc-mingw32 \ + --host=i686-w64-mingw32 \ + --prefix="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \ + --enable-werror \ --enable-introspection=no \ - --enable-tests=no \ - --prefix="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw" \ + --enable-tests=no make make install - #set -o pipefail - #make check 2>&1 | tee "$RESULTS" +fi + +# Test mingw64 cross-compile +if test -x /usr/bin/x86_64-w64-mingw32-gcc ; then + make distclean + + PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig" \ + CC="x86_64-w64-mingw32-gcc" \ + ../configure \ + --build=$(uname -m)-pc-linux \ + --host=x86_64-w64-mingw32 \ + --prefix="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \ + --enable-werror \ + --enable-introspection=no \ + --enable-tests=no + + make + make install + +fi - if [ -f /usr/bin/rpmbuild ]; then +if test -x /usr/bin/i686-w64-mingw32-gcc && test -x /usr/bin/x86_64-w64-mingw32-gcc ; then + if test -f /usr/bin/rpmbuild ; then rpmbuild --nodeps \ --define "extra_release $EXTRA_RELEASE" \ --define "_sourcedir `pwd`" \ - -ba --clean mingw32-libosinfo.spec + -ba --clean mingw-libosinfo.spec fi fi diff --git a/configure.ac b/configure.ac index 1544d69..7c519f8 100644 --- a/configure.ac +++ b/configure.ac @@ -165,7 +165,7 @@ AC_SUBST(COVERAGE_LDFLAGS) AC_CONFIG_FILES([ Makefile libosinfo.spec - mingw32-libosinfo.spec + mingw-libosinfo.spec osinfo/Makefile osinfo/libosinfo-1.0.pc data/Makefile diff --git a/mingw-libosinfo.spec.in b/mingw-libosinfo.spec.in new file mode 100644 index 0000000..bd6b433 --- /dev/null +++ b/mingw-libosinfo.spec.in @@ -0,0 +1,129 @@ +%{?mingw_package_header} + +Name: mingw-libosinfo +Version: @VERSION@ +Release: 1%{?dist}%{?extra_release} +Summary: MinGW Windows port of a library for managing OS information for virtualization +License: LGPLv2+ +Group: Development/Libraries +Source: libosinfo-%{version}.tar.gz +URL: https://fedorahosted.org/libosinfo/ +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildArch: noarch + +BuildRequires: mingw32-filesystem >= 95 +BuildRequires: mingw64-filesystem >= 95 +BuildRequires: mingw32-gcc +BuildRequires: mingw64-gcc +BuildRequires: mingw32-binutils +BuildRequires: mingw64-binutils + +BuildRequires: mingw32-glib2 +BuildRequires: mingw64-glib2 +BuildRequires: mingw32-libxml2 +BuildRequires: mingw64-libxml2 +BuildRequires: mingw32-libsoup +BuildRequires: mingw64-libsoup + +BuildRequires: pkgconfig + +Requires: pkgconfig + +%description +libosinfo is a library that allows virtualization provisioning tools to +determine the optimal device settings for a hypervisor/operating system +combination. + +%package -n mingw32-libosinfo +Summary: %{summary} + +%description -n mingw32-libosinfo +libosinfo is a library that allows virtualization provisioning tools to +determine the optimal device settings for a hypervisor/operating system +combination. + +%package -n mingw64-libosinfo +Summary: %{summary} + +%description -n mingw64-libosinfo +libosinfo is a library that allows virtualization provisioning tools to +determine the optimal device settings for a hypervisor/operating system +combination. + +%{?mingw_debug_package} + +%prep +%setup -q -n libosinfo-%{version} + +%build +%mingw_configure \ + --enable-introspection=no \ + --enable-tests=no + +%mingw_make %{?_smp_mflags} + + +%install +%mingw_make_install "DESTDIR=$RPM_BUILD_ROOT" + +# Remove static libraries but DON'T remove *.dll.a files. +rm -f $RPM_BUILD_ROOT%{mingw32_libdir}/libosinfo-1.0.a +rm -f $RPM_BUILD_ROOT%{mingw64_libdir}/libosinfo-1.0.a + +rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/gtk-doc +rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/gtk-doc + +%files -n mingw32-libosinfo +%defattr(-,root,root) +%doc AUTHORS ChangeLog COPYING.LIB NEWS README +%{mingw32_bindir}/osinfo-detect.exe +%{mingw32_bindir}/osinfo-db-validate.exe +%{mingw32_bindir}/osinfo-query.exe +%{mingw32_bindir}/libosinfo-1.0-0.dll +%{mingw32_libdir}/libosinfo-1.0.dll.a +%{mingw32_libdir}/libosinfo-1.0.la +%{mingw32_libdir}/pkgconfig/libosinfo-1.0.pc +%dir %{mingw32_includedir}/libosinfo-1.0/ +%dir %{mingw32_includedir}/libosinfo-1.0/osinfo +%{mingw32_includedir}/libosinfo-1.0/osinfo/*.h +%dir %{mingw32_datadir}/libosinfo +%dir %{mingw32_datadir}/libosinfo/db +%dir %{mingw32_datadir}/libosinfo/schemas +%{mingw32_datadir}/libosinfo/db/usb.ids +%{mingw32_datadir}/libosinfo/db/pci.ids +%{mingw32_datadir}/libosinfo/db/devices +%{mingw32_datadir}/libosinfo/db/oses +%{mingw32_datadir}/libosinfo/db/hypervisors +%{mingw32_datadir}/libosinfo/schemas/libosinfo.rng +%{mingw32_mandir}/man1/osinfo-db-validate.1* +%{mingw32_mandir}/man1/osinfo-detect.1* +%{mingw32_mandir}/man1/osinfo-query.1* + +%files -n mingw64-libosinfo +%defattr(-,root,root) +%doc AUTHORS ChangeLog COPYING.LIB NEWS README +%{mingw64_bindir}/osinfo-detect.exe +%{mingw64_bindir}/osinfo-db-validate.exe +%{mingw64_bindir}/osinfo-query.exe +%{mingw64_bindir}/libosinfo-1.0-0.dll +%{mingw64_libdir}/libosinfo-1.0.dll.a +%{mingw64_libdir}/libosinfo-1.0.la +%{mingw64_libdir}/pkgconfig/libosinfo-1.0.pc +%dir %{mingw64_includedir}/libosinfo-1.0/ +%dir %{mingw64_includedir}/libosinfo-1.0/osinfo +%{mingw64_includedir}/libosinfo-1.0/osinfo/*.h +%dir %{mingw64_datadir}/libosinfo +%dir %{mingw64_datadir}/libosinfo/db +%dir %{mingw64_datadir}/libosinfo/schemas +%{mingw64_datadir}/libosinfo/db/usb.ids +%{mingw64_datadir}/libosinfo/db/pci.ids +%{mingw64_datadir}/libosinfo/db/devices +%{mingw64_datadir}/libosinfo/db/oses +%{mingw64_datadir}/libosinfo/db/hypervisors +%{mingw64_datadir}/libosinfo/schemas/libosinfo.rng +%{mingw64_mandir}/man1/osinfo-db-validate.1* +%{mingw64_mandir}/man1/osinfo-detect.1* +%{mingw64_mandir}/man1/osinfo-query.1* + +%changelog diff --git a/mingw32-libosinfo.spec.in b/mingw32-libosinfo.spec.in deleted file mode 100644 index 1083e5d..0000000 --- a/mingw32-libosinfo.spec.in +++ /dev/null @@ -1,88 +0,0 @@ -%define __strip %{_mingw32_strip} -%define __objdump %{_mingw32_objdump} -%define _use_internal_dependency_generator 0 -%define __find_requires %{_mingw32_findrequires} -%define __find_provides %{_mingw32_findprovides} - -Name: mingw32-libosinfo -Version: @VERSION@ -Release: 1%{?dist}%{?extra_release} -Summary: MinGW Windows port of a library for managing OS information for virtualization -License: LGPLv2+ -Group: Development/Libraries -Source: libosinfo-%{version}.tar.gz -URL: https://fedorahosted.org/libosinfo/ -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -BuildArch: noarch - -BuildRequires: mingw32-filesystem >= 40 -BuildRequires: mingw32-gcc -BuildRequires: mingw32-binutils - -BuildRequires: mingw32-glib2 -BuildRequires: mingw32-libxml2 -BuildRequires: mingw32-libsoup -BuildRequires: mingw32-libsoup-gnome -BuildRequires: pkgconfig - -Requires: pkgconfig - -%description -libosinfo is a library that allows virtualization provisioning tools to -determine the optimal device settings for a hypervisor/operating system -combination. - -%prep -%setup -q -n libosinfo-%{version} - -%build -%{_mingw32_configure} --enable-introspection=no --enable-tests=no -make - - -%install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install - -# Remove static libraries but DON'T remove *.dll.a files. -rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/libosinfo-1.0.a -# Kill gtk-doc stuff that just duplicates content from -# the native package -rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/gtk-doc -#find_lang libosinfo - -%clean -rm -rf $RPM_BUILD_ROOT - - -%files -%defattr(-,root,root) -%doc AUTHORS ChangeLog COPYING.LIB NEWS README -%{_mingw32_bindir}/osinfo-detect.exe -%{_mingw32_bindir}/osinfo-db-validate.exe -%{_mingw32_bindir}/osinfo-query.exe -%{_mingw32_bindir}/libosinfo-1.0-0.dll -%{_mingw32_libdir}/libosinfo-1.0.dll.a -%{_mingw32_libdir}/libosinfo-1.0.la -%{_mingw32_libdir}/pkgconfig/libosinfo-1.0.pc -%dir %{_mingw32_includedir}/libosinfo-1.0/ -%dir %{_mingw32_includedir}/libosinfo-1.0/osinfo -%{_mingw32_includedir}/libosinfo-1.0/osinfo/*.h -%dir %{_mingw32_datadir}/libosinfo -%dir %{_mingw32_datadir}/libosinfo/db -%dir %{_mingw32_datadir}/libosinfo/schemas -%{_mingw32_datadir}/libosinfo/db/usb.ids -%{_mingw32_datadir}/libosinfo/db/pci.ids -%{_mingw32_datadir}/libosinfo/db/devices -%{_mingw32_datadir}/libosinfo/db/oses -%{_mingw32_datadir}/libosinfo/db/hypervisors -%{_mingw32_datadir}/libosinfo/schemas/libosinfo.rng -%{_mingw32_mandir}/man1/osinfo-db-validate.1* -%{_mingw32_mandir}/man1/osinfo-detect.1* -%{_mingw32_mandir}/man1/osinfo-query.1* - - -%changelog -* Wed Aug 25 2010 Daniel P. Berrange <berrange@redhat.com> - 0.2.0-1 -- Initial package |