Permalink
Browse files

Added example where a library and a progrma is built with the same SC…

…onstruct.

darcs-hash:20051113014020-71b0c-3e109275a9da1be75816d89541d9a6dc7133dbce.gz
  • Loading branch information...
1 parent f94bdb9 commit a0a2c9489947e6d0a9b07bfff22830f0f694024c @pupeno committed Nov 13, 2005
Showing with 66 additions and 5 deletions.
  1. +5 −4 README
  2. +2 −1 examples/SConstruct
  3. +25 −0 examples/sc-lap/SConstruct
  4. +16 −0 examples/sc-lap/sc-lapl.scm
  5. +18 −0 examples/sc-lap/sc-lapp.scm
View
9 README
@@ -14,10 +14,11 @@ Usage
-----
To learn how to use scons-chicken, check out the examples directories.
sc-sap: scons-chicken stand-alone-program (doesn't depend on any library).
-sc-ofl: scons-chicken one-file-library
-sc-mfl: scons-chicken multiple-file-library (depends on sc-ofl)
-sc-ofp: scons-chicken one-file-program
-sc-mfp: scons-chicken multiple-file-program (depends on sc-tfl)
+sc-ofl: scons-chicken one-file-library.
+sc-mfl: scons-chicken multiple-file-library (depends on sc-ofl).
+sc-ofp: scons-chicken one-file-program.
+sc-mfp: scons-chicken multiple-file-program (depends on sc-tfl).
+sc-lap: scons-chicken library-and-file (it is a mix of ofl and ofp).
Limitations
-----------
View
@@ -11,4 +11,5 @@ SConscript(["sc-sap/SConstruct",
"sc-ofl/SConstruct",
"sc-ofp/SConstruct",
"sc-mfl/SConstruct",
- "sc-mfp/SConstruct"])
+ "sc-mfp/SConstruct",
+ "sc-lap/SConstruct"])
View
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2005 José Pablo Ezequiel "Pupeno" Fernández Silva
+#
+# This file is part of scons-chicken.
+#
+# scons-chicken is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+# scons-chicken is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License along with scons-chicken; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+# Create an environment including the scons-chicken tool.
+env = Environment(tools = ["default", "chicken"], toolpath=["../../"])
+# The previous line is to use the non-installed scons-chicken. In your project use:
+# env = Environment(tools = ["default", "chicken"])
+
+# sc-ofl.so made of sc-ofl.scm.
+sc_lapl, sc_lapl_setup = env.ChickenExtension(env, "sc-lapl.scm")
+env.Install(env["CHICKENREPOSITORY"], sc_lapl)
+env.Install(env["CHICKENREPOSITORY"], sc_lapl_setup)
+
+sc_lapp = env.ChickenProgram(env, "sc-lapp.scm")
+env.Install("/usr/bin/", sc_lapp)
+
+# Install alias
+env.Alias("install", env["CHICKENREPOSITORY"])
+env.Alias("install", "/usr/bin/")
@@ -0,0 +1,16 @@
+;;;; Copyright (C) 2005 José Pablo Ezequiel "Pupeno" Fernández Silva
+;;;;
+;;;; This file is part of scons-chicken.
+;;;;
+;;;; scons-chicken is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+;;;; scons-chicken is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+;;;; You should have received a copy of the GNU General Public License along with scons-chicken; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+(define-extension sc-lapl)
+(declare (export sc-lapl-proc))
+
+;;; An example of a procedure defined in a library/extension that will be called by other programs and extensions.
+;;; It is called sc-lapl-proc to avoid confusion/overlaping with the extension itself.
+(define (sc-lapl-proc)
+ (display "Hello from sc-lapl, the scons-chicken library-and-program library.")
+ (newline))
@@ -0,0 +1,18 @@
+;;;; Copyright (C) 2005 José Pablo Ezequiel "Pupeno" Fernández Silva
+;;;;
+;;;; This file is part of scons-chicken.
+;;;;
+;;;; scons-chicken is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+;;;; scons-chicken is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+;;;; You should have received a copy of the GNU General Public License along with scons-chicken; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+(use sc-lapl)
+
+;;; An example of a procedure defined on a program that uses a procedure from an extension.
+;;; It is named sc-lapp-proc to avoid conflict/confusion with the program itself.
+(define (sc-lapp-proc)
+ (display "Hello from sc-lapp, the scons-chicken library-and-program program.")
+ (newline)
+ (sc-lapl-proc))
+
+(sc-lapp-proc)

0 comments on commit a0a2c94

Please sign in to comment.