Chapter 2. Installing the Distribution Kit

All FLEXlm distribution kits consist of the following:

The type of distribution tape depends on the configuration, but all tapes are in UNIX tar or VMS BACKUP format.

Binary Installation for UNIX Systems

A FLEXlm binary distribution kit consists of a single directory which contains all the libraries, include files, and programs. To install FLEXlm, you will create a directory for the kit, read the distribution media, then run the FLEXlm installation program.

  1. Create the directory

    % mkdir <directory to hold the kit>
    % cd <directory to hold the kit>
    

  2. Read the distribution media

    CD - SunOS4:

    % mount -t hsfs -r /dev/sr0 /cdrom
    % cd /cdrom
    % install.cd
    

    CD - Solaris:


    Note: If volume management is running the following mount step is not necessary. Volume management is turned on by default on Solaris 2.2 and later.


    % mount -f hsfs /dev/dsk/c0t6d0s0 /cdrom
    %cd /cdrom
    % INSTALL.CD
    

    CD HP:

    % mount /dev/dsk/cdrom /cdrom -t cdfs
    % cd /cdrom
    % ./INSTALL.CD\;1
    

    For all CD distributions, put the resulting kit(s) into the directory you created earlier.

    SUN 1/4” tape:

    % tar xfb /dev/rst0 126 lmgr
    

    3 1/2” floppy:

    % tar xf /dev/rfd0
    % uncompress lmgr.Z
    

  3. Run the FLEXlm installation program

    % cd lmgr/machind
    % INSTALL
    

    Example (SUN 1/4” tape):

    % mkdir /usr/license
    % cd /usr/license
    % tar xfb /dev/rst0 126 lmgr
    % cd lmgr/machind
    % INSTALL
    

    Example (SUN floppy):

    % mkdir /usr/license
    % cd /usr/license
    % tar xf /dev/rfd0
    % uncompress lmgr.Z
    % cd lmgr/machind
    % INSTALL
    

Appendix A, “Distribution Kit Contents,” lists the contents of the binary distribution kit.

There are two installation scripts on the distribution kit: INSTALL and CONFIG_DAEMON. INSTALL is used when first installing the kit. CONFIG_DAEMON is used to configure and build your vendor daemon, either when running the initial installation or any time later.

INSTALL will ranlib the libraries and ask if you want to continue and build your daemon. If you reply “y”, the CONFIG_DAEMON script will be run. CONFIG_DAEMON will prompt you for the parameters associated with your vendor daemon (encryption seeds, vendor keys, and other parameters). CONFIG_DAEMON then edits all the appropriate files (makefile, lm_code.h, and ls_vendor.c). In addition, CONFIG_DAEMON will create the file “daemon.dat”, which contains a log of the options selected, for your review.

You can manually edit ls_vendor.c, lm_code.h and the makefile, in place of running CONFIG_DAEMON. (This is required on VMS and Windows NT systems, where CONFIG_DAEMON is not supported).

Binary Installation for VMS Systems

A FLEXlm distribution kit consists of a single directory which contains all the libraries, include files, and programs. To install FLEXlm, you will create a directory for the kit, read the distribution media, then run the FLEXlm installation program.

Globetrotter Software ships FLEXlm VMS kits on CD and on tape in UNIX tar format.

Installation from UNIX media

FLEXlmVMS kits are generally shipped on UNIX media.These kits are VMS backup save sets which have been processed by a program (MFTU) which turns the backup save sets into compressed ascii files. In order to install a VMS kit, perform the following steps:

  1. Load the file onto your UNIX system, from either tape or CD.

    Instructions for tape:

    In the following instructions, substitute your tape device name for tape and the FLEXlm platform name for platform.) Typical VMS platform kit files would be “vax_v5” or “alpha_v1”.

    % cd lmgr
    % tar xf /dev/tape
    

    Instructions for CD:

    (mount the CD into directory cddir)
    % cd cddir
    % install.cd
    

    (Select the version of FLEXlm you want, then select either the vax_v5 or alpha_v1 kit).

    For example, if you are extracting a vax kit from tape on a sun4 running SunOS 4.x:

    % cd lmgr
    % tar xf /dev/rst0
    

  2. Copy the resultant ascii file, along with the file “mftu.com” to your VMS system, using your normal networking commands.

  3. On your VMS system, execute the following commands (substitute alpha_v1 for vax_v5 if you are extracting an alpha/openvms kit):

    $ create/dir [.mftu]
    $ copy mftu.com [.mftu]
    $ set def [.mftu]
    $ @mftu
    $ @mftumake
    $! In the next command, disk:[dir.mftu] refers to your default
    $ mftu :== $disk:[dir.mftu]mftu
    $ set def [-]
    $ rename vax_v5 vax_v5.mftu
    $ mftu
    MFTU> decode vax_v5.mftu
    $ backup vax_v5.bck/save [...]
    

Installation from VMS media

The CD distribution for FLEXlm can also be loaded on a VMS system if your system is running VMS v6.x. Proceed as follows:

$ mount/over=id/media=cdrom dka400:

The FLEXlm kits are in the directory [vms.v4_0] and are named alpha_v1.mft, vax_v5.mft, and vax_v6.mft. The directory [vms.mftu] contains the mftu program mftu.com which is used to decode the distribution kits. To extract the kit into the directory [xxx], perform the following steps (substitute the device name of your cdrom for dka400):

$ set def [xxx]
$ copy dka400:[vms.v_4]vax_v6.mft []
$ copy dka400:[vms.mftu]mftu.com []
$ set file mftu.com/attributes=(rfm:stmlf,rat:cr)
$ set file vax_v6.mft/attributes=(rfm:stmlf,rat:cr)
$ @mftu
$ @mftumake
$ mftu :== $disk:[xxx]mftu
$ mftu
MFTU> decode vax_v6.mft

This will leave you with a backup save set, which you can restore to the directory of your choice. Note that the two “set file” commands must be run on a VMS v6.x system.

Binary Installation for Windows Systems

On Windows systems, this version of FLEXlm supports only the client library. Both 16 bit and 32 bit Windows applications are supported. FLEXlm supports the 32 bit Windows applications through its NT offering, which contains the 32 bit client library as a WIN32s DLL. To install FLEXlm 16 bit client library for Windows on to your C: drive from A:, for example, follow the following steps: (Note: if the destination directory is not C:\lmgr, you will need to change some FLEXlm sample makefiles manually to reflect this difference).

  1. From Program Manager File Menu, run setup.exe program on FLEXlm Windows disk.

  2. Include C:\lmgr\h in your compiler include search path.

  3. Include C:\lmgr\lib in your link library search path.

  4. Include C:\lmgr\bin in your Windows DLL search Path. You may alternatively, copy all C:\lmgr\bin\*.dll files to a directory that is already in your DLL search path.

  5. Install FLEXlm vendor keys and private encryption seeds: Edit C:\LMGR\H\LM_CODE.H to reflect your chosen vendor daemon name, Globetrotter provided vendor keys, and your private encryption seeds.

  6. If your compiler is Microsoft Visual C/C++, you may then compile the sample programs with the following commands:

    C:> cd \lmgr\wintest
    C:> nmake /f wintest.mak
    C:> cd \lmgr\test
    C:> nmake /f lmclient.mak
    

A pre-compiled wintest.exe is also included in \lmgr\bin directory for your reference.

Binary Installation for Windows NT Systems

Both client and server are supported on Windows NT. The Microsoft C/C++ compiler is required to build your customized vendor daemon. Your client application can be written in any language that can interact with the FLEXlm client DLL lmgr32.dll, which is a standard Windows NT 32 bit mode DLL. To install FLEXlm for Windows NT systems, follow the procedure below:

  1. From Program Manager File Menu, run setup.exe program on FLEXlm Windows NT disk. Your default directory for FLEXlm is D:\lmgr32, which is assumed by all of FLEXlm makefiles. You may install FLEXlm to any other directory; however, you will need to change the dependency in the makefiles (*.mak files) via Microsoft Visual Workbench or manually.

  2. Install FLEXlm vendor keys and private encryption seeds:

    Edit C:\LMGR\H\LM_CODE.H to reflect your chosen vendor daemon name, Globetrotter provided vendor keys, and your private encryption seeds.


    Note: The rest of the build procedure may be repeated each time you modify FLEXlm source code or your vendor keys. BUILD.BAT is provided to automate the following procedure.


  3. Include D:\lmgr32\bin in your Windows NT DLL search Path. You may alternatively, copy all D:\lmgr32\bin\*.dll files to a directory that is already in your DLL search path.

  4. Set up Microsoft C/C++ compiler environment.

    For example, assuming Microsoft C/C++ compiler is installed in C:\MSVCNT, type the following commands:

    D:\> SET INCLUDE=%INCLUDE%;D:\LMGR32\H
    D:\> SET LIB=%LIB%;D:\LMGR32\LIB
    D:\> CALL C:\MSVCNT\BIN\VCVARS32.BAT
    

  5. Build the client library demo programs:

    For example:

    D:\> CD \LMGR32\TEST
    D:\LMGR32\TEST> NMAKE /F LMCLIENT.MAK
    D:\LMGR32\TEST> CD \LMGR32\WINTEST
    D:\LMGR32\WINTEST> NMAKE /F WINTEST.MAK
    

  6. Build the FLEXlm utility programs:

    For example:

    D:\> CD \LMGR32\UTILS
    D:\LMGR32\UTILS> NMAKE /F LMRANDOM.MAK
    D:\LMGR32\UTILS> NMAKE /F LMFEATSE.MAK
    D:\LMGR32\UTILS> NMAKE /F ISVALIDD.MAK
    D:\LMGR32\UTILS> NMAKE /F CREATE_L.MAK
    D:\LMGR32\UTILS> NMAKE /F CREATE_P.MAK
    D:\LMGR32\UTILS> NMAKE /F LMCRYPTE.MAK
    

    You may now use create_l.exe and create_p.exe to create license files.

  7. Build your vendor daemon. (If you plan to run the license server (lmgrd) on Windows NT systems.):

    Edit D:\LMGR32\VENDOR\LS_VENDO.C to customize your vendor daemon's behavior. You may also change the makefile VENDOR.MAK so that it generates the vendor daemon with your choice of file name instead of the default VENDOR.EXE. The details of vendor daemon customization are described in “Configuring Your Vendor Daemon”.

  8. To build your FLEXlm vendor daemon, do the following:

    D:\> CD \LMGR32\VENDOR
    D:\LMGR32\VENDOR> ..\UTILS\LMRANDOM < LS_VENDO.C > LSR_VEND.C
    D:\LMGR32\VENDOR> NMAKE /F VENDOR.MAK
    


    Note: A set of pre-compiled utility programs and vendor daemon using the demo keys are included in the D:\LMGR32\BIN directory for your reference.


  9. You are now ready to test out your vendor daemon with lmgrd.exe. You must name your vendor daemon consistently with your license file so that lmgrd.exe may start your vendor daemon successfully. For details on how to start lmgrd and vendor daemon, please see Chapter 10, “The License File” and Chapter 12, “End-User License Administration.”

Source Installation

A FLEXlm source distribution kit consists of a single directory which contains subdirectories for the client library, include files, and both license and vendor daemons. The BINARY_KIT script will produce a binary kit identical to the binary distribution in the subdirectory arch_os. arch is the machine architecture and os is the operating system version, as specified in the BINARY_KIT command. For example, arch could be one of sun4, hp700, vax, apollo, etc., and os could be u4 (for SunOS4). To install the source kit, you will create a directory to hold it, read the distribution media, then perform the build, which will result in a binary kit for the target platform.

  1. Create the directory

    % mkdir <directory to hold the kit>
    % cd <directory to hold the kit>
    

  2. Read the distribution media

    For SUN 1/4” tape:

    % tar xfb /dev/rst0 126 lmgr
    

    For 3 1/2” floppy:

    % tar xf /dev/rfd0
    % uncompress lmgr.Z
    

  3. Create the binary kit

    % lmgr/BINARY_KIT lmgr arch_os
    

    Example (SUN 1/4” tape):

    % mkdir /usr/license
    % cd /usr/license
    % tar xfb /dev/rst0 126 lmgr
    % lmgr/BINARY_KIT lmgr sun4_u4
    

It is important to use the correct arch_os value when running BINARY_KIT, since the BINARY_KIT script may change make parameters depending on the machine architecture.

The gplatargs script in the utils directory is used to determine architecture specific flags. gplatform in the utils directory is also used to determine arch_os. Both gplatform and gplatargs may require modification for new platforms.

Appendix A, “Distribution Kit Contents,” lists the contents of the source distribution kit.

Example INSTALL Session

This example illustrates the use of INSTALL to complete binary kit installation for a sun4, sunOS4 kit. Data you enter is typed in bold.

% cd lmgr/machind
%  INSTALL
Flexible License Manager binary kit installation
Copyright (C) 1988 - 1994 Globetrotter Software, Inc.
All rights reserved.
Your FLEXlm kits are in:
../sun4_u4
Which kit would you like to install? ../sun4_u4
Installing FLEXlm kit ../sun4_u4
ranlib-ing libraries
Do you want to continue and configure your daemon now [y/n]? n

Example CONFIG_DAEMON Session

The following example shows the configuration of a vendor daemon (demo) that uses the default values for all parameters. The meanings of the parameters are described in “Configuring Your Vendor Daemon”.


Note: You can manually edit ls_vendor.c in the /lmgr/machind directory, lm_code.h, and the makefile, if you do not want to run CONFIG_DAEMON. (This must be done manually on VMS and Windows NT, where CONFIG_DAEMON is not supported).

In FLEXlm v2.4 and later, the CONFIG_DAEMON script only prompts for the daemon name, one set of encryption seeds, and the vendor keys. This is done to simplify installation when all the defaults are desired. If you wish to specify all the daemon options, use the “-x” option to CONFIG_DAEMON, which will cause it to prompt for all options as in prior FLEXlm versions. This example does not use the option to illustrate all selections. All data that you type is in bold.

% cd lmgr/machind
% CONFIG_DAEMON

Flexible License Manager vendor daemon configuration.
Copyright (C) 1988, 1994 Globetrotter Software, Inc.

This script will configure and build your vendor daemon, and
leave the resulting configuration information in the file
daemon.dat.  To get the default value for any selection, simply
enter <CR>.

Your daemon must have a DAEMON name.  This name will appear in
the license file that you generate for your customers as the
name in the DAEMON line.  The name will also appear in the
executable for the daemon, in order for the Flexible License
Manager to do consistency checking.

The daemon name for an evaluation kit MUST BE "demo".

Please enter your daemon's DAEMON name: demo
Updating ../alpha_u1/makefile for daemon name "demo"

Your daemon (demo) will support some number of product features.
Your daemon will support only the features listed in the
license file that encrypt correctly with the codes you build
into your daemon.  Please enter your encryption code at the
following pair of prompts. 

DO NOT ENTER THE LEADING 0x in the encryption codes.

To get the default answer to any question, type a <CR>.

Encryption code first 32-bits (data[0]) [hexadecimal, <CR> to quit]: 12345678 
Encryption code second 32-bits (data[1]) [hexadecimal]: 87654321

If you want to leave the FLEXlm vendor keys unchanged in
lm_code.h, simply enter <CR> to the next prompt.

DO NOT ENTER THE LEADING 0x in the vendor keys.

FLEXlm vendor key #1 for demo [hexadecimal]: 12345678
FLEXlm vendor key #2 for demo [hexadecimal]: 87654321
FLEXlm vendor key #3 for demo [hexadecimal]: 12344321
FLEXlm vendor key #4 for demo [hexadecimal]: 43211234
FLEXlm vendor key #5 for demo [hexadecimal]: aabb33ee


The configuration information for your daemon is in daemon.dat
The data file used to build the daemon is ls_vendor.c

Do you want to continue and build the daemon now? [y/n, default: n]: y

You are running on an alpha-osf1 system

FLEXlm binary directories are:
../alpha_u1

Which daemon would you like to build? [default: ../alpha_u1, e to exit]: 

Building kit in directory ../alpha_u1
cc -c -g -I../machind  ../machind/create_lic.c
cc -o create_license create_lic.o liblmgr.a 
rm create_lic.o
cc -c -g -I../machind  ../machind/create_pkg.c
cc -o create_pkg create_pkg.o liblmgr.a 
rm create_pkg.o
cc -c -g -I../machind  ../machind/lmclient.c
cc -o lmclient lmclient.o liblmgr.a 
rm lmclient.o
cc -c -g -I../machind  ../machind/lmcrypter.c
cc -o lmcrypter lmcrypter.o liblmgr.a 
rm lmcrypter.o
cc -c -g -I../machind  ../machind/lmfeatset.c
cc -o lmfeatset lmfeatset.o liblmgr.a 
rm lmfeatset.o
cc -c -g -I../machind  ../machind/lmrandom.c
cc -o lmrandom lmrandom.o
rm lmrandom.o
rm -f lsr_vendor.c
lmrandom < ../machind/ls_vendor.c > lsr_vendor.c
cc -c -g -I../machind  lsr_vendor.c 
rm -f ls_vendor.o
mv lsr_vendor.o ls_vendor.o
cc  -o demo ls_vendor.o  liblmgr_as.a liblmgr_s.a liblmgr.a 
strip demo
strip create_license create_pkg lmclient isvaliddate lmcrypter lmfeatset lmrandom  
strip: Info: isvaliddate already stripped
ln -f lmutil lmhostid
ln -f lmutil lmver
ln -f lmutil lmcksum 
ln -f lmutil lmdown
ln -f lmutil lmhostid
ln -f lmutil lmremove 
ln -f lmutil lmremove 
ln -f lmutil lmreread 
ln -f lmutil lmswitchr 
ln -f lmutil lmstat 
ln -f lmutil lmdiag
ln -f lmutil lmver 
Done building kit ../alpha_u1

Installing Your FLEXlm Vendor Keys

All FLEXlm kits require a set of FLEXlm Vendor Keys in order to operate. Globetrotter Software will supply you with the FLEXlm Vendor Keys for the vendor name you select, or “demo” if it is a demo kit. The FLEXlm Vendor Keys consist of five hex numbers which are coded to the vendor name. CONFIG_DAEMON installs these keys in your vendor daemon via the include file lm_code.h.

The FLEXlm Vendor Keys are the fourth through eighth parameters to the LM_CODE macro, as in this example:

LM_CODE(vcode, ENCRYPTION_CODE_1, ENCRYPTION_CODE_2,
VENDOR_KEY1, VENDOR_KEY2, VENDOR_KEY3, 
VENDOR_KEY4, VENDOR_KEY5)

(The ENCRYPTION_CODE_x and VENDOR_KEYx values are defined in lm_code.h as a result of running CONFIG_DAEMON). The LM_CODE macro creates a static variable with the name of its first parameter. If you want a global variable, use the LM_CODE_GLOBAL macro, which takes the same parameters as LM_CODE.

Once you have coded this LM_CODE macro, call lc_init as follows:

lc_init((LM_HANDLE *)0, VENDOR_NAME, &vcode, &lm_job);

where:  

is the:

(char *) VENDOR_NAME 


Vendor name you have picked, from lm_code.h.

(VENDORCODE *) vcode 


First parameter to LM_CODE, above.

(LM_HANDLE **) job 


Returned job ID.

The first argument to lc_init() is the current job, and is used in cases where multiple jobs are used.

This call to lc_init() must be included in any program that uses the FLEXlm libraries, and it must be the first FLEXlm function you call (unless you are using the Software License Working Group or LSAPI calls).

Building Your Application

If you use any of the FLEXlm symbolic definitions, macros, or data structures, you must include lm_client.h and lm_code.h in your C module. lc_set_attr() calls require you to include lm_attr.h. Your encryption seeds, FLEXlm vendor keys and vendor name are in lm_code.h.

In order to build your application:

  1. Insert the calls that you require into your code.

  2. Link your code with the FLEXlm library liblmgr.a (or lmgr.lib on Windows systems, or lmgr32.lib on Win32s or Windows NT systems). If you have loaded the distribution kit into /usr/license/ as described in Chapter 2 then use a command of the following form:

    % cc -o program program.o $(OBJS) -L/usr/license/lmgr/arch_os -llmgr
    

    where $(OBJS) is the list of the objects for your program. You can put -llmgr anywhere after your objects, and before -lsocket and -lintl, if needed on your system. See how lmclient is linked in the makefile in the binary kit for your platform for a correct example.