Jul 25, 2014

A try with Autotools, EclipseCDT and MingW

I am a big fan of GNU utilities but I have never had a chance to use "Autotools" before. Autotools is a tool set for generating Makefile/configure. As far as I know, autotools checks what kind of OS/compiler characteristics have such as byte-endian-ness or the size of boolean. And it generates Makefile depending on the characteristics.

A few days ago, I found that Eclipse CDT has a project template for GNU autotools, so I tried it. It seems that I have been following instructions from web pages but I am stuck at some point. It shows me this error message:
Generating Makefile in build directory: C:/Users/wrice/workspace/cpp/camd/

sh -c "C:/Users/wrice127/workspace/cpp/camd/C/Users/wrice127/workspace/cpp/camd/configure CFLAGS=\"-g\""
sh: C:/Users/wrice127/workspace/cpp/camd/C/Users/wrice127/workspace/cpp/camd/configure: No such file or directory

Configuration failed with error
 Somehow the autotool successfully generated a file, "configure". But it cannot execute because the path is wrong. The folder path is repeated twice: "C:/Users/wrice/workspace/cpp/camd/C/Users/wrice/workspace/cpp/camd/configure".

I am thinking that it may be a bug in CDT not working with my MingW. I may need to try Cygwin instead.

1 comment:

Jay said...

It seems that the problem is from here; it is appending buildDir after project location:

rc = runScript(configurePath, project.getLocation().append(buildDir), configArgs, AutotoolsPlugin.getResourceString("MakeGenerator.gen.makefile"), errMsg, console, configureEnvs, false);

http://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.git/tree/autotools/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java?id=cc4aa948d20222c7c5b2348b5ecf410301199c4f