Licensing Home

LCT Overview

LCT Installation

LCT Example

CCSC Paper

PN Home

LCT Example

The following tar ball contains the example described below. After installing the License Compliance Toolkit and LIDESC, download and untar it into a test directory, so you can execute the example yourself.

Directory structure

The tar ball contains the following directory structure:

root-of-test: makefile that builds the entire directory tree.
lgpl: LGPL COPYING file (applies the LGPL license to this directory's sources and' sources in all subdirectories of this directory), global header, lgpl.c, makefile to build this branch of the directory tree. gpl: GPL COPYING file, gpl.c, makefile to build this directory
proprietary: main.c (a proprietary source file, initially with no license at all), makefile to make this directory.

Overview of procedure

In general, to run the License Compliance Toolkit, do the following:
  1. Run licompr.pl and look for missing licenses.
  2. Resolve errors found by doing one or both of the following:
    • Add COPYING files to source directory structure where appropriate.
    • Add license and version strings in comments in source files where appropriate.
    The license and version strings to add are the second and third fields, respectively, in the file licfile.txt (located in the same directory as licompr.pl).

    Note: COPYING or source files must contain BOTH the license name AND version string to be considered marked with the license.

  3. Modify build scripts to add switches needed by the map tracer.
  4. Build sources.
  5. Run mapTracer.pl on the link map produced by the build to ensure all sources in the build are accounted for.
  6. Run licompo.pl to collect all built sources and send them to LIDESC for license compliance checking.

Here we go

In the following description, .../ means the directory in which you installed the License Compliance Toolkit.

Preprocessor

Run Preprocessor

licompr.pl full_path_to_lctExample_directory
Do not use a relative path. Look for "ERROR" in log file created by licompr. "ERROR" implies no license was found for the corresponding source file.

Check for a pre-existing applicable license

Check existing LIDESC descriptions at www.mibsoftware.com/librock/lidesc/exist.htm to see if one works for you.

Create a new LIDESC license

If there is no applicable pre-existing license, do the following to create a new license:
  • Create text for license (see ...lics/tplOrig.txt for this example).
  • Create a LIDESC license (see www.mibsoftware.com/librock/lidesc/create.htm for instructions.) Note: This example has a basic license with no TAGS or COMBINE strings.
            cd bin (directory where license toolkit is installed)
            lidesc -d lics create librock tpl < lics/tplOrig.txt
    
    librock is required as the prefix in the LIDESC command line in order to get LIDESC to do the compliance check correctly. Note: This example assumes you are storing licenses in the lics directory where you installed the license compliance toolkit.

Edit .lh file produced by LIDESC

Edit ...lics/tpl.lh and add license and version strings, to the line that defines librock_LIDESC_TV_tpl. Edit this line appear as follows:
#define librock_LIDESC_TV_tpl "Test Proprietary License\tVersion 0.1"

Add a new license line to .../licfile.txt

TPL|Test Proprietary License|Version 0.1|lics/tpl.txt

Add reference to new license line to sources

Add license and version strings to source files, or create COPYING file(s) to propagate the new license. In our example, we add:
Test Proprietary License, Version 0.1
to proprietary/main.c

Run Preprocessor Again

licompr.pl full_path_to_lctExample_directory
Look for "ERROR" in the new log file created by licompr.

Modify build scripts to add switches for the link map tracer

Ensure something like the following line appears in the appropriate makefiles:
EXE = main
CFLAGS = -MD
LDFLAGS = -Wl,-Map -Wl,$(EXE).map
See the map tracer documentation for an explanation of these switches.

Build sources

cd lctExample
make

Run the link map tracer

mapTracer.pl lctExample/proprietary/main.map .../DBTracer.txt
If the map tracer stops with:
Cannot open filename.d for reading: No such file or directory
and filename.o is an object module that is always part of the link environment for all binaries linked on the system, or filename.a is a library that is always part of this link environment, add filename with the appropriate extension to your file listing the names of standard modules. E.g., suppose I linked a hypothetical file /usr/include/sys/embeddedtypes.h, licensed under the hypothetical license EMB, into all my programs, I would need to add the following line to the mapTracer's database' file (.../DBTracer.txt or your own file listing standard object modules and libraries):
/usr/include/sys/embeddedtypes.h EMB
I would also need to create a LIDESC definition for the EMB license and add a line to licfile.txt, something like:
EMB|Embedded Source License|Version 1.0|lics/emb.txt

Successful runs of the map tracer produce something similar to the following on standard output:

Process complete.
Output results can be found in: OutputResults2003918102541.log
Source files can be found in: map2003918102541.log
The OutputResults file is helpful debugging information produced by the map tracer, but is not needed during normal use of the toolkit.

LIDESC compliance check

licompo.pl map2003918102541.log > licompo.log
In licompo.log, look for ERROR, which usually implies a LIDESC license is somehow malformed, and CONFLICT, which indicates that LIDESC found a known or possible conflict.