> Date: Wed, 3 Jul 2013 10:59:26 -0700
> From: Kirk Joppy <kirk.joppy@...>
> I believe the root of my confusion is in the division between MinGW and msys.
There is no division, actually. It's an illusion. Any tool you use
in the build process can be either MinGW or MSYS, with the following 2
. the shell must be from MSYS
. the compiler and its subprograms must be from MinGW
Everything else can be from anywhere, but for best results it is
advisable to use MSYS tools where possible. E.g., in my builds I use
MSYS tools, except pkg-config and makeinfo, which are MinGW programs.
> I want to be able to use a third party project's autotools build
What does that include, specifically? There's no way to answer your
questions without some details about what hides behind "third party
project's autotools build system". Please elaborate.
> I think this means that I need to use msys because I need to
> run configure and make.
To run configure and the Makefiles it produced, yes, you need MSYS.
> Since these various autotools components will
> live inside the msys file system it seems that I have no choice but to
> install my external packages into the msys file system like so
Again, this depends on what you mean by "autotools components" and
whether "external packages" are the same as "autotools components" or
include additional tools, and if the latter, which ones?
> $ cd PACKAGE_ROOT
> $ ./configure --prefix=/MSYS_ROOT/
> $ make
> $ make install
> This necessarily means MinGW won't find the dependencies by default
> when I try to build the project.
If by "dependencies" you mean packages needed by the MinGW compiler
and linker to compile and link your program, then no, these
dependencies should not be installed from MSYS root, but from the
> However, running configure should set up compiler flags to ensure
> that gcc finds the headers and libs.
That doesn't happen by magic. The configure script looks for headers
and libraries where the compiler and the linker look for them --
simply because the configure script invokes the compiler and the
linker to find out whether a header file or a library are available,
and if the compiler/linker succeed, the script decides that the
header/library is available.
As a variation on this, when a dependency installs a .pc file and the
configure script uses pkg-config to tell where to look for the
package's headers and libraries are, then you could have the headers
and libraries in some non-default (as far as MinGW GCC is concerned)
place, provided that you configure pkg-config to look for the *.pc
files where you have them installed. But not every configure script
uses pkg-config for every feature it probes, and some don't use
pkg-config at all.
> This means that putting all the packages in the msys file system
> should actually work.
It might work sometimes, but will most probably break more than once,
depending on the configury of the package you are trying to build.
By contrast, installing from the MinGW root will work in a lot more
situations and packages.
> "Installing to "/usr/local" should be avoided, since the MinGW
> compiler won't look there by default."
> This contradicts my self-derived conclusions above. I understand that
> installing to /mingw will allow external libs and headers to be
> automatically found by the compiler, but it seems that this would make
> using my package's configure script needlessly complicated.
Again, the compiler cannot "automatically" find header files and
libraries, unless they are in the directories it searches by default.
Otherwise, it needs help in the form of the -I and -L switches. If
pkg-config is used by configure, then the corresponding *.pc files
supply the necessary compiler and linker switches, but that's all the
magic there is.
> In essence I am coming to the conclusion that autotools dictates where
> I install dependencies. This seems wrong so I thought I should post
> here and get feedback.
My advice is to install in the default places. You will save you a
lot of grief that way.