Cdk Perl5 Extension, Mike Glover, Copyright 1995, 1996, 1997 ------------------------------------------------------------------------------ This is the Perl5 extension to the Cdk library written by Mike Glover. All the copyright notices from the Cdk C distribution also apply to the extension. If you don't agree then remove this package. The file FILES contains a list of all of the example and demonstration files provided with the Perl5 Cdk extension. Preamble -------- ******* BEFORE YOU CAN COMPILE THIS EXTENSION YOU NEED THE CDK LIBRARY!!!!! *********** But don't worry, you can pick it up from my web page at: http://www.swi.com/~glover/cdk/cdk.html Then you must compile and install Cdk on your machine before you can compile this extension. Compiling and installing Cdk should not be a problem; it is supported on many platforms including Linx, FreeBSD, Solaris, AIX, SGI, HP, DEC, Sun, etc... Compiling procedure: --------------------- 1. To incorporate this extension into Perl you must modify the Makefile.PL file to tell the compiler where to find the Cdk library and header files. The following is an example Makefile.PL file: use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'Cdk', 'VERSION' => '4.6', 'LIBS' => ['-L/usr/local/lib -L/home/glover/cdk -lcdk -lncurses'], 'DEFINE' => '-DNCURSES', 'INC' => '-I/usr/local/include -I/usr/local/include/ncurses -I/home/glover/cdk', 'clean' => {FILES => 'Makefile.old'}, ); * LIBS tells the compiler where to find the Cdk and curses libraries. Just change the -L paths to reflect what is on your system. Leave the -lcdk and -lcurses. * DEFINE tells the compiler which extra flags to use when compiling the extension. Here are the flags currently supported. * If you are using Ncurses, set -DNCURSES, as above. If not then leave it blank. * If your header file defines COLOR_* values for color support then use -DCOLOR. * INC tells the compiler where to find the header files. Just change the -I paths to reflect what is on your system. 2. Change directories into the Perl5 home directory and rerun Configure. When it asks about Perl5 extensions, make sure that Cdk is in the list. If it's not then add it. Configure will ask about statically or dynamically loaded extensions, pick one for Cdk. Don't choose both. 3. Run make and let Perl rebuild itself. 4. If you have any problems compiling, read the NOTES file. If you are compiling on a Solaris box read the NOTES file. Testing the Cdk extension: -------------------------- 1. To test the extension, change directories into the ext/Cdk/fulldemo directory. This directory has a file named cdkdemo. It demonstrates all of the current Cdk widgets. There are two more directories: examples, which has a script which demonstrates each widget individually and demo which has a couple of simple application programs. 2. Before running the demo script set you PERL5LIB environment variable to the lib directory under the Perl5 source tree. On my machine Perl is under: /opt/perl5.001n so my PERL5LIB would be temporarily set to /opt/perl5.001n/lib 3. Run the cdkdemo script. If everything is OK, you should see the main screen to the cdkdemo script. 4. Install the new version of Perl. Change directories into the source tree and make install. 5. Revert your PERL5LIB environment variable to whatever it was before. Misc: ----- The cdkdemo script has a full complement of help on how to build Cdk Perl scripts. If you want some more examples, look under the examples directory in this distribution. There is an example for each widget. Have fun. If you have any questions I can be contacted at: mike@swi.com ttfn, Mike