[SOLVED] Out-of-source auto-tools build [message #1422352] |
Fri, 12 September 2014 18:33 |
Alex Mising name Messages: 149 Registered: March 2010 |
Senior Member |
|
|
Hello,
I am a new user of CDT. I want to work on an auto-tools project using GNU gcc. Details on my environment are at the end of this post. My problem is that I can only get CDT builds to work when building alongside the source directory. I would create "debug" and "release" sub-folders and run configure within those folders. I mean the usual approach of things like:
mkdir debug ; cd debug
CFLAGS="-g3 -O0" ../configure
Although my goal is to work on an existing project, I tried creating one from scratch, to see if this can be done. So I invoked the new project wizard:
New -> Project... -> C/C++ -> C++ Project
Name: testauto
Project type: GNU Autotools -> Autotools Shared Library Project
I was then prompted for Build configurations. I think this is where I am supposed to configure what I want (separate folder, different CFLAGS). In any case, I accepted the default "Build (GNU)" that was already present and pressed "Finish". At this point I can build and run the project just fine:
Right-click on project -> Reconfigure (this ran "autoreconf -i" successfully)
Right-click on project -> Build Project (this ran "make all" successfully)
I could see Binaries and Archives with both the shared library and exampleProgram, created a launch configuration, ran it, everything was perfect. BUT it was compiling alongside the sources. I want to set custom CFLAGS and build in a separate directory. So I tried this:
Right-click on project -> Build Configurations -> Manage
New... (note that I could see the default "Build (GNU)" which was checked here)
Now in this dialog there was a message at the top which read:
Quote:Note: The configuration name will be used as a directory name in the file system. Please ensure that it is valid for your platform.
Splendid, exactly what I want! I typed the name "Debug" and description "No optimizations and full symbols" and found the promising "Shared Library -> MacOSX GCC -> Debug" in the drop-down next to "Import predefined". True to its promise, CDT created a "Debug" folder and ran "make distclean" at the top-level folder to tidy up, followed by a switch to the new "Debug" sub-folder in which it ran configure. In the console log I see that this completed successfully. In fact it was followed by a "make clean" was also successful, but then I got a modal error dialog with:
Errors occurred during the build.
Errors running builder 'CDT Builder' on project 'test'.
A resource exists with a different case: '/test/Debug/Makefile'.
A resource exists with a different case: '/test/Debug/Makefile'.
No output was produced, but there was nothing in the console log output to indicate an error.
Now, I don't what it THINKS is wrong there, but the fact is that everything is ok. If I open up a terminal and go to <workspace>/test/Debug, then running "make" works fine. (To be perfectly honest, it fails when linking because the new project wizard generates a Makefile.am with "exampleProgram_LDFLAGS = $(top_srcdir)/libtestauto/libtestauto.la" which I changed at this point to "exampleProgram_LDFLAGS = $(top_builddir)/libtestauto/libtestauto.la" and then the terminal "make" ran straight to the end. CDT however refuses to try to run make. Every time I choose "Build Project" I get the same error.
Any ideas what is wrong?
My environment is Mac OS X 10.9.x and Eclipse Luna with CDT 8.4.0.201406111759 (all x86_64)
The JDK is Oracle 1.8.0_20 (again x86_64)
Update - here is the stack trace I found in the error log:
org.eclipse.core.internal.resources.ResourceException: A resource exists with a different case: '/test/Debug/Makefile'.
at org.eclipse.core.internal.resources.Resource.checkDoesNotExist(Resource.java:329)
at org.eclipse.core.internal.resources.Resource.checkDoesNotExist(Resource.java:307)
at org.eclipse.core.internal.resources.File.create(File.java:112)
at org.eclipse.core.internal.resources.File.create(File.java:188)
at org.eclipse.cdt.managedbuilder.makegen.gnu.GnuMakefileGenerator.createFile(GnuMakefileGenerator.java:4340)
at org.eclipse.cdt.managedbuilder.makegen.gnu.GnuMakefileGenerator.regenerateMakefiles(GnuMakefileGenerator.java:953)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.performMakefileGeneration(CommonBuilder.java:1006)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.performPrebuildGeneration(CommonBuilder.java:873)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:748)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:510)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:459)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:496)
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:415)
at org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:305)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[Updated on: Fri, 12 September 2014 20:23] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03822 seconds