TOC PREV NEXT INDEX

 


Creating and Distributing Dynamically-Linked Wrapped Applications


To create a dynamically-linked wrapped application, wrap your application with either the uses tclshdynamic option (to use the tclsh interpreter) or uses wishdynamic option (to use the wish interpreter).

For a Windows application, if your target system has the same version of TclPro installed and your application doesn't use any extensions other than those bundled with TclPro, you can simply copy your application to the target system. You can run the application from anywhere on the target system.

For a Unix application, if your target system has the same version of TclPro installed in exactly the same directory as on your development system and your application doesn't use any extensions other than those bundled with TclPro, you can simply copy your application to the target system. You can run the application from anywhere on the target system. Although the requirements in this case are restrictive, it is actually fairly common for a company to make the TclPro installation available on a shared directory of a file server. If all users mount the TclPro installation in the same location on their systems, they all effectively have the same TclPro configuration.

For all other cases, you must create a special distribution to install on your target system that contains your application and all binary libraries and library script files required by your system. (The rest of this section refers to this distribution directory as $DIST.) You must copy these files from the TclPro installation directory. (The rest of this section refers to this directory as $TclPro).

Your resulting distribution tree should have the following structure:


$DIST/
|
|---lib/
|   |
|   |---tcl8.3/
|   |---tk8.3/ (optional)
|   |---itcl3.2/ (optional)
|   |---itk3.2/ (optional)
|   |---iwidgets2.2.0/ (optional)
|   |---iwidgets3.0.0/ (optional)
|   |---tclX8.3/ (optional)
|   |---tkX8.3/ (optional)
|
|---$platform/
    |
    |---lib/ (Unix only)
    |   |
    |   |---*.so (or *.sl on HPUX)
    |
    |---bin/
        |
        |---wrapped application(s)
        |---*.dll (Windows only)

The following steps describe how to create this distribution directory:

  1. Create a dynamically-linked wrapped application with prowrap. The uses tclshdynamic and uses wishdynamic options automatically handle setting the appropriate values of the tcl_library and tk_library variables, as well as any similar library variables for the extensions bundled with TclPro, so that your application can find the script libraries. If you use any additional extensions with your application, you must include a code option to your prowrap command setting any similar library variables for those extensions. You can use the following example as a template:
-code "set tcl_library [file join [file dir [info nameofexec]] .. .. lib tcl8.3]"
You would need to replace "tcl_library" and "tcl8.3" with values appropriate for your extension.
  1. Create a distribution directory with whatever name you want.
  2. Create the directory $DIST/lib.
  3. Copy the entire contents of $TclPro/lib to $DIST/lib. Optionally, you can omit from $DIST/lib any extensions your application doesn't use (for example, don't copy $TclPro/lib/tclX8.3 and its contents if your application doesn't use TclX).
  4. If your application uses any additional extensions (beyond those bundled with TclPro) which have directories and files residing in the Tcl script library directory (the lib subdirectory of the Tcl installation directory), then copy those directories and files to $DIST/lib.
  5. Create the directory $DIST/$platform, where $platform is the platform-specific subdirectory as used by TclPro. Table 12 lists the appropriate subdirectory names (for example, win32ix86 for Windows systems).

    Table 12 Platform-Specific TclPro Subdirectories 
    Platform
    TclPro Platform Subdirectory
    HPUX
    hpux-parisc
    IRIX/Mips
    irix-mips
    Linux/x86
    linux-ix86
    Solaris/SPARC
    solaris-sparc
    Windows 95/NT(x86)
    win32-ix86
  6. Create the directory $DIST/$platform/bin.
  7. Copy or move your dynamically-linked wrapped application to $DIST/$platform/bin.
  8. For Unix distributions:
    1. Create the directory $DIST/$platform/lib.
    2. Copy all shared libraries from $TclPro/$platform/lib to $DIST/$platform/lib (for example, copy $TclPro/solarissparc/lib/*.so to $DIST/solarissparc/lib). Optionally, you can omit from $DIST/$platform/lib any extensions your application doesn't use (for example, don't copy $TclPro/$platform/lib/libtclX8.3.so if your application doesn't use TclX).
    3. If your application uses any additional extensions (beyond those bundled with TclPro) which have shared libraries, or if your application uses any other shared libraries, then copy those libraries to $DIST/$platform/lib.
  9. For Windows distributions:
    1. Copy all shared libraries from $TclPro\win32ix86\bin to $DIST\win32ix86\bin (for example, copy $TclPro\win32ix86\bin\*.dll to $DIST\win32ix86\bin). Optionally, you can omit from $DIST\win32ix86\bin any extensions your application doesn't use (for example, don't copy $TclPro\win32ix86\bin\tclx83.dll if your application doesn't use TclX).
    2. If your application uses any additional extensions (beyond those bundled with TclPro) which have shared libraries, or if your application uses any other shared libraries, then copy those libraries to $DIST\win32ix86\bin.
  10. Use whatever installation method you want to copy the entire $DIST distribution tree to your target systems. You can install the distribution anywhere you like on the target system; however, users can't move the wrapped application from the distribution tree's bin directory.

Note: If you want to distribute more than one dynamically-linked wrapped application, you can include all of those applications in $DIST/$platform/bin. If you do this, be sure to include all of the extensions and libraries needed by all of your applications.



http://www.ajubasolutions.com
Voice: (650) 210-0100
Fax: (650) 210-0101
support@ajubasolutions.com
TOC PREV NEXT INDEX