Daniel P. Berrange wrote:
On Mon, Nov 10, 2008 at 09:54:04PM +0100, Farkas Levente wrote:
> Daniel P. Berrange wrote:
>> On Mon, Nov 10, 2008 at 07:28:06PM +0000, Daniel P. Berrange wrote:
>>
>> ./configure --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu \
>> --target=x86_64-redhat-linux-gnu \
>> --program-prefix= \
>> --prefix=/usr \
>> --exec-prefix=/usr \
>> --bindir=/usr/bin \
>> --sbindir=/usr/sbin \
>> --sysconfdir=/etc \
>> --datadir=/usr/share \
>> --includedir=/usr/include \
>> --libdir=/usr/lib64 \
>> --libexecdir=/usr/libexec \
>> --localstatedir=/var \
>> --sharedstatedir=/usr/com \
>> --mandir=/usr/share/man \
>> --infodir=/usr/share/info
>>
>> But for mingw,its only defining the --prefix
>>
>> ./configure \
>> --build=x86_64-unknown-linux-gnu --host=i686-pc-mingw32
--target=i686-pc-mingw32 \
>> --prefix=/usr/i686-pc-mingw32/sys-root/mingw
>>
>> We need to fix %_mingw32_configure macro to work the same way as the
>> native macro & thus not rely on unpredictable autoconf defaults which
>> vary depending on what version of autoconf the upstream app happened
>> to generate their configure script with.
> ok but which one?
> there is a mingw32-configure.sh and also there is a %_mingw32_configure
> macro in /etc/rpm/macros.mingw32. why these two different place, it's
> redundant. does it really needed?
The 'mingw32-configure.sh' shell script in /usr/bin is for developers
who are doing builds outside the context of RPMs. As such it should only
set the minimal possible args to cross-compile. It should not apply RPM
packaging policy. So we don't need to change mingw32-configure.sh
Just the %_mingw32_ocnfigure macro definition whose purpose is to apply
RPM packaging policy such as man page in /usr/share/man
i'm attached a rewrite mingw32-macros.mingw32 which works and now
libxml2 build.
i also added MINGW_CFLAGS and MINGW_CXXFLAGS to be able to overwrite
default flags.
what's the current policy for packages accepted for fedora? should i
open a new bugzilla entry, add to the original review request or post it
here?
--
Levente "Si vis pacem para bellum!"
# RPM macros for Fedora MinGW.
# Paths.
%_mingw32_sysroot %{_prefix}/i686-pc-mingw32/sys-root
%_mingw32_prefix %{_mingw32_sysroot}/mingw
%_mingw32_exec_prefix %{_mingw32_prefix}
%_mingw32_bindir %{_mingw32_prefix}/bin
%_mingw32_sbindir %{_mingw32_prefix}/sbin
%_mingw32_libdir %{_mingw32_prefix}/lib
%_mingw32_libexecdir %{_mingw32_prefix}/libexec
%_mingw32_datadir %{_mingw32_prefix}/share
%_mingw32_docdir %{_mingw32_prefix}/share/doc
%_mingw32_infodir %{_mingw32_prefix}/share/info
%_mingw32_mandir %{_mingw32_prefix}/share/man
%_mingw32_sysconfdir %{_mingw32_prefix}/etc
%_mingw32_includedir %{_mingw32_prefix}/include
# Build macros.
%_mingw32_host i686-pc-mingw32
%_mingw32_target i686-pc-mingw32
%_mingw32_cflags -O2 -g -pipe -Wall \\\
-Wp,-D_FORTIFY_SOURCE=2 \\\
-fexceptions \\\
--param=ssp-buffer-size=4
%_mingw32_cc i686-pc-mingw32-gcc
%_mingw32_cpp i686-pc-mingw32-gcc -E
%_mingw32_ar i686-pc-mingw32-ar
%_mingw32_as i686-pc-mingw32-as
%_mingw32_dlltool i686-pc-mingw32-dlltool
%_mingw32_ranlib i686-pc-mingw32-ranlib
%_mingw32_strip i686-pc-mingw32-strip
%_mingw32_objdump i686-pc-mingw32-objdump
%_mingw32_windres i686-pc-mingw32-windres
%_mingw32_cxx i686-pc-mingw32-g++
%_mingw32_findprovides /usr/lib/rpm/mingw32-find-provides.sh
%_mingw32_findrequires /usr/lib/rpm/mingw32-find-requires.sh
%_mingw32_configure \
PKG_CONFIG_PATH="%{_mingw32_libdir}/pkgconfig" ; \
CC="%{_mingw32_cc}" ; export CC ; \
CXX="%{_mingw32_cxx}" ; export CXX ; \
CFLAGS="${MINGW_CFLAGS:-%_mingw32_cflags}" ; export CFLAGS ; \
CXXFLAGS="${MINGW_CXXFLAGS:-%_mingw32_cflags}" ; export CXXFLAGS ; \
./configure --host=%{_mingw32_host} --build=%{_build} \\\
--target=%{_mingw32_target} \\\
--program-prefix=%{?_program_prefix} \\\
--prefix=%{_mingw32_prefix} \\\
--exec-prefix=%{_mingw32_exec_prefix} \\\
--bindir=%{_mingw32_bindir} \\\
--sbindir=%{_mingw32_sbindir} \\\
--sysconfdir=%{_mingw32_sysconfdir} \\\
--datadir=%{_mingw32_datadir} \\\
--includedir=%{_mingw32_includedir} \\\
--libdir=%{_mingw32_libdir} \\\
--libexecdir=%{_mingw32_libexecdir} \\\
--mandir=%{_mingw32_mandir} \\\
--infodir=%{_mingw32_infodir}