GithubHelp home page GithubHelp logo

hello-scons's Introduction

Name: Hello-scons
Author: Thomas Leonard
License: Public domain
Date: 2011-05-28

This is a simple "Hello world" program written in C. It is built using SCons.

Its purpose is to demonstrate the use of 0compile to fetch build dependencies;
you do not need to install SCons manually on your system in order to build it.

To build, run 0compile with the Hello-scons interface as the first argument and
a directory for the build as the second. You can give the URL of Hello-scons to
fetch both the source and SCons using Zero Install. 0compile will create a
'Hello-scons' directory for the build; you should run futher commands from there.

$ 0compile setup http://0install.net/tests/Hello-scons.xml Hello-scons
$ cd Hello-scons

Alternatively, if you've downloaded the source manually (or cloned the Git
repository), then you can skip this step and just run "0compile build" directly
inside the checkout.

Eitherway, you will be prompted to choose the versions of Hello-scons and SCons
(if you used the local feed file then only that version of Hello-scons will be
available).

To build, use the build command:

$ 0compile build

This creates a 'hello-scons-ARCH' directory ready for use and/or distribution,
and a 'build' directory with some temporary files, such as 'hello.o'. This is
used only to speed up later rebuilds.

To run:

$ 0launch hello-scons-ARCH/0install/Hello-scons.xml
Hello world!

To see or modify a copy of the source:

$ 0compile copy-src

This creates a 'src' subdirectory. For more information (including how to
publish the binary using Zero Install), see the main 0compile tutorial:

  http://0install.net/0compile.html


Notes:

The main issues with using SCons with 0compile are that:

- SCons defaults to saving build files in the source directory. 0compile
  requires that the source directory is assumed to be read-only. Therefore, you
  must use --srcdir. See the Hello-scons.xml file for the command to use.

- By default, SCons resets all environment variables. This means that
  instead of compiling against the library versions you chose, it will
  build against whatever happens to be the default on the system today.
  This also breaks plash, which requires certain variables to be set.

The example SConstruct file shows how to fix these problems.

hello-scons's People

Contributors

talex5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.