[Scons-users] Compiling a program with scons
Mark A. Flacy
mflacy at verizon.net
Wed Feb 18 17:11:03 EST 2015
On Wednesday, February 18, 2015 12:49:53 PM Owen Alanzo Hogarth wrote:
> Hi William
> Thank you, I did read the documentation and I am still a bit confused.
> Doing simple things like compiling a hello.c program works but lets say for
> example look at the cURL package. Since it has no external dependencies.
It does have autogenerated code as well as a complicated automake setup.
I'd find a simpler example to try, myself.
> I download and extract the tarball, go into the src folder
> now let's say I create a SConstruct file like this:
> env = Environment()
> env.Program(target = "curl", source = [Glob("*.c")])
> Then I run scons like so and I get an error like this:
> Brother:src blubee$ scons
> scons: Reading SConscript files ...
> scons: done reading SConscript files.
> scons: Building targets ...
> gcc -o tool_binmode.o -c tool_binmode.c
> In file included from tool_binmode.c:22:
> ./tool_setup.h:36:10: fatal error: 'curl_setup.h' file not found
> #include "curl_setup.h" /* from the lib directory */
> 1 error generated.
> scons: *** [tool_binmode.o] Error 1
> scons: building terminated because of errors.
> I am writing the SConstruct file in the /src folder and running scons from
> the same folder.
If you wish to continue with this, see CPPPATH
You really need to read and understand the automake files (ALL the Makefile.am
files in all the directories) in the curl source to see how the source is put
together and how it is supposed to compile. For example, the curl binary
requires libcurl to be built first. That's the code in the lib directory.
I've built an old version of nettrek with scons as well as used scons to build
things such as docbook based documentation.
See http://syx.googlecode.com/svn/trunk/SConstruct for a sample SConstruct file
for a somewhat complicated build (from http://www.scons.org/wiki/SconsProjects
where I found the Syx project). Not all of the projects on that page are
still using SCons, but some of them still are. I suggest that you look
through them to see what can be done that isn't super simple.
Mark A. Flacy
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Scons-users