[Bug 513825] missing i686-pc-mingw32-pkg-config

bugzilla at redhat.com bugzilla at redhat.com
Sun Jul 26 18:23:32 UTC 2009


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.


https://bugzilla.redhat.com/show_bug.cgi?id=513825





--- Comment #4 from Paolo Bonzini <pbonzini at redhat.com>  2009-07-26 14:23:31 EDT ---
[Warning: long comment ahead].

The naming however is crucial in this case.  mingw32-pkg-config is not a
convenience for the user, like the configure/make scripts; it is a
host-specific tool that (only by virtue of pkg-config's configurability)
happens to share its executable with the native tool.

The key point is that it is not invoked by the user, rather it is meant to be
found by its clients' build system.  The autotools were designed from the start
to support host-specific tools in a cross-compilation scenario <rant>*not* by
defining a zillion variables differently for each cross-compilation setup, but
rather</rant> just by naming the tools correctly and passing --host.


Now, this bug is indeed strictly connected to the wrapper scripts.   You (we?)
should be careful to distinguish the cases in which the configure/make wrapper
scripts are working around bugs in Fedora's packaging; this is one of them.

Rather, the wrapper scripts are useful to work around bugs in the program's
build system (as in the sdl-config case); they should never be *necessary*.  In
particular, this should be the way to build a program, from preferred to least
preferred:

1) "../configure --host=i686-pc-mingw32 && make".  The kosher way.

2) "mingw32-configure && make" or "mingw32-configure && mingw32-make" for
programs with a handwritten configure script (though these probably would not
accept all the arguments passed by mingw32-configure).

3) "mingw32-make" for programs that do not use autotools (crossing your
fingers).

I say this because the configure and make script in my opinion are actually
doing some inappropriate things.  Some of them might be good in an automated
build system (RPM), but maybe not for a casual user who wants to cross-compile
his favorite package and for a developer who wants to develop a Windows port
using mingw32.  Others are actively wrong.  In particular:

1) mingw32-make sets an HOST_CC variable.  This is wrong, since it is referring
to the *build* system and not the *host*, and should not be used for programs
that use an autoconf configure.  The autotools were designed to support a three
system cross (build/host/target); the HOST_CC variable comes probably from the
Linux kernel and you don't care for Windows cross compilation.

2a) compiling everything with -Wp,-D_FORTIFY_SOURCE=2 is not in general
something that should be done by a casual user.  Some programs (it's their
fault, granted) stop working.  It should be okay for a distribution in which
there is complete control on testing and a quality assurance process, but it
should not be passed automatically for the user.

2b) Passing -fexceptions for the Windows C compiler is useless, especially
before the MinGW compiler is switched to dwarf-2 exceptions.  But in any case,
the MinGW runtime is not advanced enough (unlike glibc) to take any advantage
of -fexceptions.

2c) passing -mms-bitfields also has serious binary compatibility problems. 
Either gcc/config/i386/cygming.h should be patched in GCC to make this the
default, or it should not be passed.

3) the cache file was disabled for a reason in Autoconf 2.50 (ten years ago
approx.).  A developer has to remove manually the cache file whenever he
rebuilds the configure script.  Keeping it is okay for RPM, but absolutely not
for a developer (and the nonstandard name mingw32-config.cache adds to the
confusion).

4) passing the same variables twice (first to configure and then to make) is
useless.  That's why I said that even "mingw32-configure && make" ought to be
enough.


I can file separate bugs for 1, 2a and 2c, since they affect also the building
of Fedora packages.

The only strictly necessary part of mingw-configure is this:

  for i in `ls /usr/i686-pc-mingw32/sys-root/mingw/bin/*|grep -- "-config$"` ;
do 
    x=`basename $i|tr "a-z+-" "A-ZX_"`; 
    declare -x $x="$i" ; export $x; 
  done; 

One way to do so without requiring an external wrapper script could have been
to add a /etc/profile.d script doing "export CONFIG_SITE=/etc/config.site", and
then something like this:

- in /etc/config.site (provided by a fundamental .noarch package; not autoconf
or gcc or glibc-devel!)

  for i in /etc/config.site.d/*; do . $i; done

- in /etc/config.site.d/mingw (provided by mingw-filesystem)

  case $host in
    *mingw* )
      for i in `ls /usr/i686-pc-mingw32/sys-root/mingw/bin/*|grep --
"-config$"`
      do 
        x=`basename $i|tr "a-z+-" "A-ZX_"`; 
        declare -x $x="$i" ; export $x; 
      done;;
  esac

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the mingw mailing list