Aubio patch to get build working under Win32

Mo DeJong mdejong at uncounted.org
Wed Aug 17 21:02:41 CEST 2005


On Wed, 17 Aug 2005 12:43:13 +0100
Paul Brossier <piem at altern.org> wrote:

> i have been compiling and using aubio successfully on windows with
> libsamplerate and libsndfile. what new versions of these two are you
> referring to?

In the last week, I have sent some patches to the libsamplerate and
libsndfile mailing lists to fix the build under Mingw. These will
appear in the next release of these libs.

> I am surprised a bit you don't have pkgconfig, it is in cygwin since
> 2002 apparently: http://cygwin.com/packages/pkgconfig/

I am not building with Cgywin. I am building with the msys + mingw
which is not the same as cygwin or cygwin with the -mno-cygwin flag.

See:
http://www.mingw.org/

The following download contains all the msys + mingw files in a single
.zip archive which is easier than download and installing all the packages
from the mingw site.

http://sourceforge.net/project/showfiles.php?group_id=10894&package_id=41063

> > Anyway, the attached patch adds an autoconf macro that just pulls the
> > config data out of the .pc files when pkg-config can't be located at
> > build time. It looks for the .pc files in the --prefix location which is
> > the most reasonable default. The patch also fixes a problem where
> > mkinstalldirs dies under Win32  when creating a dir with a child
> > dir in it.
> 
> I would hope mkinstalldirs has also been fixed in a recent version.

Better to just work around it. The error I was seeing had to do with some
funky timing issue with a `mkdir foo/bar` when both foo and foo/bar needed
to be created.

> A few more questions:
> 
> You added some tests about prefix and exec_prefix. Does
> AC_DEFAULT_PREFIX fail on your system?

The way autoconf deals with $prefix, $exec_prefix, and other
vars like $libdir is just strange. The vars are substituted into
the Makefile.in correctly, but while the configure script is
running they are not set correctly. For example, libdir is
set to "NONE" if no --libdir option is passed, but it should
be "${exec_prefix}/lib". The patch just sets them at the
start of the configure.in script so the replacement PKG...
macro can use the ${libdir} variable.

> The check for fftw3.h header is commented. Does it also fail?

Actually, that test really should be rewritten to include the
FFTW3 -I flag grabbed out of the .pc file. I commented it out
because it was not working unless the fftw .h lived in /usr/local
or some other dir searched automatically by the compiler.

> Also, why are @FFTWLIB_FLAGS@ needed in examples/Makefile.am? It
> contains only -I/usr/include here, which is already included by default.
> Maybe you need to set CPPFLAGS?

The FFTWLIB_FLAGS variable will include ${prefix}/include when the
--prefix is set to something other than /usr on the configure command
line. The problem was that one of the extensions included fft.h and
that needed to find fftw3.h or the compile would fail.

> You also replaced darwin* with *darwin*, and ming* with *ming*. how is
> 'host_os' reported on your system?

The --host=PREFIX value could be used when cross compiling. For example,
one might configure on a Linux box with a Mingw cross compiler so that
the generated executables would run under Win32.

./configure --host=i386-mingw32msvc

That would use i386-mingw32msvc-gcc to compile the executables and
create .exe and .dll files under Linux. The point is that *mingw* will
match this host string whle mingw* will not.

cheers
Mo DeJong


-- 
To unsubscribe, send mail to aubio-unsubscribe at piem.org.



More information about the aubio-user mailing list