Sunday, February 11, 2001 Dear MacPerl Users, this is the Bit-ShiftReg-2.0 module with shared libraries compiled for MacPerl. Shared libraries run only on PPC and CFM68K versions of MacPerl, not non-CFM 68K versions. This was compiled with MPW's MrC (PPC) and SC (68K). Passed all tests on both architectures (thanks to my old Mac LC :). However, let me know of any problems you might encounter. You can download the module and the readme from my website via http://usemacperl.webjump.com/index.html or from my CPAN directory $CPAN/authors/id/T/TW/TWEGNER/ INSTALLATION ============ The module is best installed using Chris Nandor's installme.plx droplet. Simply drop the packed archive or the unpacked folder on the droplet. Answer the upcoming question "Convert all text and MacBinary files?" with "Yes". This should install the module properly. The installer is part of the cpan-mac module, available from CPAN http://www.perl.com/CPAN-local/authors/id/CNANDOR/ or via Chris Nandor's MacPerl page http://pudge.net/macperl/ . CHANGES ======= In the 'Mac_changed' folder, you will find a back-up of all the *ORIGINAL* files, that have been changed: lib_defs.h MANIFEST README Actually, the only source (header) file I've changed is 'lib_defs.h'. All the changes I've made can be found by searching for the phrase '###TOM', if you are interested in. I've added two MPW worksheets (PPC and 68K) to the distribution. This way you can build the module yourself, if you like. However, you will need the MacPerl source distribution [1] and the FREE MPW development environment, available from Apple [2]. You may also want to take a look at the Macintosh Perl XS Tutorial [3]. It's best to open the worksheet and execute the commands step by step. Read and follow the instructions I've provided for each step of the build process. In the build process for CFM68K some extra preparation is required for the source file(s). To help you in this procedure, I've added the file 'ShiftReg_68K.xs'. This should be the input file for the XSUBpp compiler in the CFM68K build process. In that 68K XS file, the header declarations are bracketed with #import pragmas. This special pragma treatment is needed for the SC compiler and the ILink linker (see the Macintosh Perl XS tutorial for details). Follow the steps in the 68K MPW worksheet and everything should be fine. Have fun. -- Thomas Wegner toms_email@gmx.de References: [1] MacPerl 5.004 source [2] Apple's MPW [3] Macintosh Perl XS Tutorial ############################ ORIGINAL FOLLOWS #################################################################### ====================================== Module "Bit::ShiftReg" Version 2.0 ====================================== for Perl version 5.000 or higher Contents of this file: ---------------------- - Legal stuff - Requirements - What does it do - Preliminary steps for use with Perl prior to version 5.002 - How to install it - Version history - Credits - Final note Legal stuff: ------------ Copyright (c) 1997 by Steffen Beyer. All rights reserved. This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Requirements: ------------- Perl version 5.000 or higher, a C compiler capable of the ANSI C standard (!) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ What does it do: ---------------- This module implements rotate left, rotate right, arithmetic shift left and logical shift right operations with carry flag for all C integer types. The results depend on the number of bits that the integer types unsigned char, unsigned short, unsigned int and unsigned long have on your machine. The module automatically determines the number of bits of each integer type and adjusts its internal constants accordingly. Preliminary steps for use with Perl prior to version 5.002: ----------------------------------------------------------- Edit the file "Makefile.PL" in this distribution and change the line 'VERSION_FROM' => 'ShiftReg.pm', to 'VERSION' => '2.0', Then edit the file "ShiftReg.pm" and change the line bootstrap Bit::ShiftReg $VERSION; to bootstrap Bit::ShiftReg; Finally, edit the file "ShiftReg.xs" and delete the line PROTOTYPES: DISABLE How to install it: ------------------ Please unpack and build this package OUTSIDE the Perl source and distribution tree!! 1) Change directory to the directory that has been created by unpacking this package ("Bit-ShiftReg-2.0/"). 2) Type "perl Makefile.PL" (or whatever the name and path of your Perl 5 binary is). This will create a "Makefile" with the appropriate parameters for your system (for instance, where the install directories are, and so on). 3) Type "make". This will create a dynamically linkable library file that will be linked to Perl later, at runtime, provided your system supports dynamic linking. Please refer to the MakeMaker documentation for instructions on how to build a new Perl with statically linked libraries (invoke "perldoc ExtUtils::MakeMaker" for this), if your system does NOT support dynamic linking! Should you encounter any compiler warnings or errors (like the redefini- tion of certain types already defined by your system), please contact me by mail at , sending me your compiler output (both STDOUT and STDERR). Thank you! ====================================================================== Be aware that you need a C compiler which supports ANSI C in order to successfully compile this package! ====================================================================== Also note that problems may arise with the c89 compiler of HP, although it allegedly supports ANSI C! I recommend the GNU gcc compiler, which is available for free on the Internet. (HP users are strongly recommended to install the GNU assembler GAS first before installing GNU gcc) Should you get the error messages ShiftReg.c: 15: Unable to find include file 'EXTERN.h'. ShiftReg.c: 16: Unable to find include file 'perl.h'. ShiftReg.c: 17: Unable to find include file 'XSUB.h'. then edit the file Makefile.PL and change the line 'INC' => '', # e.g., '-I/opt/pkg/perl5.003/dist' in such a way that it points to your Perl 5 distribution tree, e.g., 'INC' => '-I/usr/ctr/dlt/private/perl/perl5.003', or the like, and start over with the generation of the Makefile at 2). 4) Now issue "make test". The output should look somewhat like this: PERL_DL_NONLAZY=1 /usr/bin/perl -I./blib/arch -I./blib/lib -I/e/www/sw/pkg/perl/lib/i386-freebsd/5.003 -I/e/www/sw/pkg/perl/lib -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/f000..............ok t/f001..............ok t/f002..............ok t/f003..............ok t/f004..............ok t/f005..............ok t/f006..............ok t/f007..............ok All tests successful. Files=8, Tests=234, 1 secs ( 1.40 cusr 0.23 csys = 1.63 cpu) 5) At last, type "make install". 6) Share and enjoy! Version history: ---------------- Version 1.0 was the initial release. Version 1.1 fixed a possible bug in the XS file where the number of bits of an unsigned char was assumed to be 8 bits (without even checking) in the previous version. Version 2.0 provides new "MSB" and "LSB" functions (for all types). This version also changed the module's name from "ROL_ROR" to "Bit::ShiftReg". It also provides testing routines so that "make test" now works. And last but not least this version changed the interfaces of the existing functions so that they can be chained to form ever larger shift registers. Credits: -------- Many thanks to Andreas Koenig (as always!) for his relentless support and efforts as upload manager of the CPAN! Also many thanks to Jon Orwant and Tim Bunce for their suggestions concerning this module's name and its implementation! Final note: ----------- If you need any assistance or have any comments, problems, suggestions, findings, complaints, questions, insights, compliments or donations to give ;-) then please don't hesitate to send me a mail: sb@sdm.de (Steffen Beyer) Yours sincerely, -- _____ _____ .__ _/ ____\____ _/ ____\____ |__|______ \ __\\__ \\ __\/ \| \_ __ \ Steffen Beyer | | / __ \| | | | \ || | \/ sb@sdm.de |__| (____ /__| |___| /__||__| sb@en.muc.de \/ \/ http://www.engelschall.com/u/sb/