[Scons-users] Compiling a program with scons

Owen Alanzo Hogarth gurenchan at gmail.com
Wed Feb 18 05:24:38 EST 2015


Hi Bill

That helped but then it seems like I didn't quite need that Configure
object just yet. I added lib/ include directories so now my SConstruct file
looks like this:
env = Environment(
LIBPATH=['/Users/blubee/Downloads/curl-7.40.0/lib/'],
CPPPATH=['/Users/blubee/Downloads/curl-7.40.0/include/curl'])

env.Program(target = "curl", source = [Glob("*.c")])


I get this error:

scons: done reading SConscript files.

scons: Building targets ...

gcc -o tool_binmode.o -c -I/Users/blubee/Downloads/curl-7.40.0/include/curl
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.


Now that file curl_setup.h is actually already in the lib directory located
under the LIBPATH variable.


What am I missing here?


On Wed, Feb 18, 2015 at 1:51 PM, Bill Deegan <bill at baddogconsulting.com>
wrote:

> Owen,
>
> You've not chosen the simplest project to start with.
> Their build system uses autoconf logic which will determine information
> about the current environment (compilers, libraries, system specific items)
> and usually those generate a makefile and also some include files which set
> preprocessor defines which are used in the source code.
>
> You'll have to use Configure contexts in SCons to replicate this
> functionality. It could get pretty involved.
> See http://scons.org/doc/production/HTML/scons-user.html#chap-sconf for
> more info about SCons' autoconf like capabilities.
>
> -Bill
>
> On Tue, Feb 17, 2015 at 8:49 PM, Owen Alanzo Hogarth <gurenchan at gmail.com>
> 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.
>>
>> 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.
>>
>> On Tue, Feb 17, 2015 at 10:41 PM, William Blevins <wblevins001 at gmail.com>
>> wrote:
>>
>>> Have you skimmed through the User's Guide yet?  The SCons User's Guide
>>> is a very rich source of information.
>>>
>>> For autoconf-like behavior support please see chapter 23:
>>> http://www.scons.org/doc/HTML/scons-user/ch23.html
>>>
>>> For generic compile support just start at chapter 2:
>>> http://www.scons.org/doc/HTML/scons-user/ch02.html
>>>
>>> V/R,
>>> William
>>>
>>> On Tue, Feb 17, 2015 at 8:32 AM, Owen Alanzo Hogarth <
>>> gurenchan at gmail.com> wrote:
>>>
>>>> I am trying to learn the scons build system but I am totally lost, if
>>>> anyone has built anything with it could they please offer some assistance.
>>>>
>>>> I have this sample project that I'd like to build just to get the hang
>>>> of scons.
>>>>
>>>> http://curl.haxx.se/download/curl-7.40.0.tar.lzma
>>>>
>>>> cURL has no real dependencies and should just compile with what's in
>>>> the src directory but I just can't wrap my head around building it.
>>>>
>>>> I can work with the autotools build process but I am just not sure how
>>>> to do it with scons.
>>>>
>>>> _______________________________________________
>>>> Scons-users mailing list
>>>> Scons-users at scons.org
>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>>
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150218/a07167ce/attachment.html>


More information about the Scons-users mailing list