Autoconf and configure.exe on Windows
Asked Answered
R

1

9

I'm trying to build a Linux-developed library on Windows. This library requires glib and one of the gdk libraries. While I can find 32-bit Windows binaries for most of the dependent libraries, I'd much rather compile everything myself.

I have very little C/C++ experience on Linux, but I already figured out that ./configure is required to get most of the compilation errors that are caused by platform incompatibilities. Unfortunately, all the packages have a configure shell script that can't really run on Windows.

I've installed autoconf for Windows, hoping to create a Windows configure script from configure.ac, but the Windows autoconf is also a bunch of shell scripts that can't really run on Windows.

What should I do? Must I install Cygwin?

Reduplicate answered 12/12, 2012 at 9:34 Comment(1)
I would install Cygwin. Any output you get from autoconf is going to be a Unix shell script anyway.Alectryomancy
H
5

EDIT (2022):

It's been more than 9 years since I wrote the original answer, and at this moment I would provide a different opinion.

In 2022, Linux is now mainstream platform for development, and less and less people are using Windows to build things that are closely related to Linux. Those software engineers who are forced to use Windows often use dual boot, or VM, or SSH access to a build machine, or Docker. Now, Visual Studio also supports remote Linux target, and even WSL. Crazy.

So, my suggestion as of 2022 is: if you really, really need to build Linux code on the same Windows machine, I'd had a look at these two options:

  • WSL and mingw-w64
  • Docker (this one, for example)

ORIGINAL ANSWER (2012):

I see two options here:

  • emulate Unix environment on Windows
  • cross-compile from Unix/Linux to Windows target platform

While second option might decrease headaches building in native environment, I found it uncomfortable if you are working primarily on Windows, since this requires transferring resulting binaries to Windows machine. Let's have a look at first option instead - emulate Unix environment and build GNU software on Windows.

While some packages might have support for building on Windows without preparing environment, these might be custom solutions done with CMake, Visual Studio, and other non-typical ways of building GNU open-source stuff.

There are two popular options for Unix environment emulation on Windows, Cygwin and Msys. Both of options have they pros and cons and this is a widely discussed topic, I'm not going to dive into that.

BTW, personally I'm using Msys, and never had any problems with that, apart from typical Windows incompatibility issues for some packages.

Hallucination answered 21/12, 2012 at 12:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.